:root {
  color-scheme: dark;
  --ink: #171118;
  --wine: #3a1d2e;
  --purple: #4d355a;
  --gold: #d4a653;
  --cream: #f0dfba;
  --green: #63ba88;
  --font-poster: "Copperplate Gothic Bold", "Copperplate Gothic", Georgia, serif;
  --font-story: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: #120e13;
  color: var(--cream);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; overflow-x: hidden; background: radial-gradient(circle at 50% -15%, #51344f 0, #241922 38%, #0d0a0e 100%); }
button { font: inherit; }
.loading { display: grid; min-height: 100vh; place-items: center; letter-spacing: .12em; text-transform: uppercase; }
#game { min-height: 100vh; padding: 14px clamp(10px, 2vw, 30px) 38px; }

.table-header { max-width: 1400px; margin: 0 auto 7px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.table-header small, .event-strip small, .proof-copy small, .last-log small, .player-head small, .opponent-chip small { color: #bda978; letter-spacing: .14em; font-size: 11px; font-weight: 800; }
.table-header h1 { margin: 0; font-family: Impact, Haettenschweiler, sans-serif; font-size: 28px; letter-spacing: .055em; text-transform: uppercase; color: #f4d48f; font-weight: 500; white-space: nowrap; }
.match-facts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: end; }
.match-facts span { border: 1px solid #6f5943; border-radius: 999px; padding: 8px 12px; background: #211820cc; color: #b9aa95; font-size: 11px; letter-spacing: .06em; }
.match-facts b { color: #f4dcaa; margin-left: 4px; }
.recap-button { position: relative; width: 40px; height: 34px; display: grid; place-items: center; border: 1px solid #8f7147; border-radius: 10px; background: #342437; color: #f3d69a; cursor: pointer; box-shadow: 0 4px 9px #0007; }
.recap-button > b { margin: 0; font-size: 22px; line-height: 1; }
.recap-button > i { position: absolute; right: -5px; top: -6px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; border: 1px solid #f0d7a3; border-radius: 999px; background: #24744e; color: white; font-size: 9px; font-style: normal; font-weight: 900; }

.opponent-rail { max-width: 1400px; margin: 0 auto 7px; display: flex; justify-content: flex-end; gap: 8px; }
.opponent-chip { width: 280px; display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; align-items: center; text-align: left; padding: 7px 11px; border: 1px solid color-mix(in srgb, var(--agency-color) 72%, #8a6b4c); border-radius: 10px; color: var(--cream); background: linear-gradient(145deg, color-mix(in srgb, var(--agency-color) 28%, #322136), color-mix(in srgb, var(--agency-color) 8%, #1d171e)); cursor: pointer; box-shadow: 0 6px 13px #0006, inset 0 0 18px color-mix(in srgb, var(--agency-color) 11%, transparent); }
.opponent-chip:hover { border-color: color-mix(in srgb, var(--agency-color) 78%, #f1dda7); transform: translateY(-1px); }
.opponent-chip b { display: block; margin-top: 3px; text-transform: uppercase; }
.opponent-chip > span:last-of-type { color: #c7b694; font-size: 12px; }
.opponent-chip em { grid-column: 2; color: #e6bd70; font-style: normal; font-size: 11px; }

.table-layout { max-width: 1700px; margin: auto; display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.board-column { min-width: 0; }
.event-strip { max-width: 1400px; display: grid; grid-template-columns: 48px 68px minmax(280px, 1fr) 28px minmax(260px, .9fr); gap: 11px; align-items: center; min-height: 74px; margin: 0 auto 9px; padding: 7px 12px; border: 1px solid #80663e; border-radius: 13px; background: linear-gradient(90deg, #21151d, #332337); box-shadow: inset 0 0 30px #0006; }
.event-card-thumb { width: 42px; aspect-ratio: 1500/2100; object-fit: contain; border-radius: 4px; cursor: zoom-in; box-shadow: 0 4px 8px #0009; }
.event-year { color: #f0d6a3; font-family: Georgia, serif; font-size: 13px; }
.event-hot-block, .event-effect-block { display: grid; gap: 4px; min-width: 0; }
.event-hot-block > small, .event-effect-block > small { font-size: 8px; }
.event-hot-zones, .event-effect { display: flex; align-items: center; gap: 8px; min-width: 0; }
.event-zone-chip { min-width: 0; height: 43px; display: flex; align-items: center; gap: 7px; padding: 3px 10px 3px 4px; border: 2px solid #87683f; border-radius: 999px; background: #181218; box-shadow: 0 4px 8px #0008; }
.event-zone-chip img { width: 34px; height: 34px; flex: 0 0 34px; object-fit: contain; }
.event-zone-chip b { overflow: hidden; color: #ead19e; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.event-arrow { color: #dfad58; font-size: 28px; text-align: center; }
.event-effect { justify-content: flex-start; }
.event-effect-icon { width: 43px; height: 43px; flex: 0 0 43px; display: grid; place-items: center; border: 2px solid #87683f; border-radius: 50%; background: #efe0b9; box-shadow: 0 4px 8px #0008; }
.event-effect-icon img { width: 34px; height: 34px; object-fit: contain; }
.event-effect b { color: #f0d6a3; font-family: Georgia, serif; font-size: 12px; line-height: 1.25; }

.common-board { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 9px; border: 3px solid #a8753c; border-radius: 18px; background: radial-gradient(circle, #523d4f 0, #2e222e 58%, #181219 100%); box-shadow: inset 0 0 0 3px #161017, 0 16px 28px #0009; }
.zone-tile { position: relative; min-width: 0; overflow: hidden; border: 2px solid #19131a; border-radius: 10px; background: #261d27; box-shadow: 0 7px 14px #0007; }
.zone-board-art { display: block; width: 100%; aspect-ratio: 1522/1242; object-fit: contain; }
.zone-symbol-overlay { position: absolute; z-index: 10; left: 82.260184%; top: .805153%; width: 17.082786%; aspect-ratio: 1; object-fit: contain; pointer-events: none; filter: drop-shadow(-1px 0 0 #090709) drop-shadow(1px 0 0 #090709) drop-shadow(0 -1px 0 #090709) drop-shadow(0 1px 0 #090709) drop-shadow(0 4px 3px #000b); }
.zone-rule-hotspot { position: absolute; z-index: 12; left: 56.242%; top: 21.659%; width: 43.167%; height: 34.783%; cursor: zoom-in; }
.zone-tile.hot { outline: 3px solid #dd9a3b; box-shadow: 0 0 22px #f2a63d99; }
.hot-ribbon { position: absolute; top: 8px; left: -31px; width: 134px; padding: 4px 0; transform: rotate(-34deg); background: #b14a3e; color: #fff1c9; text-align: center; font-size: 9px; font-weight: 900; letter-spacing: .07em; box-shadow: 0 2px 5px #0008; }
.zone-spaces, .production-slots { position: absolute; z-index: 4; inset: 0; }
.zone-space { position: absolute; display: block; margin: 0; padding: 0; border: 0; border-radius: 5px; background: transparent; color: inherit; opacity: 1; appearance: none; }
.zone-space:disabled { opacity: 1; }
.zone-space.legal { cursor: pointer; z-index: 6; box-shadow: inset 0 0 0 3px #53d28c, 0 0 16px #42dd89; background: #2eb87220; }
.zone-space.legal:hover { background: #3be39036; box-shadow: inset 0 0 0 4px #83efad, 0 0 22px #51e69a; }
.zone-space.legal::after { content: "+"; position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #18764d; border: 2px solid #baf7cf; color: white; font-size: 19px; font-weight: 900; box-shadow: 0 3px 7px #0009; }
.zone-space.recruitment-blocked { z-index: 6; cursor: pointer; background: #a84c2b20; box-shadow: inset 0 0 0 3px #d16d45, 0 0 13px #b84736aa; }
.zone-space.recruitment-blocked::after { content: "!"; position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 25px; height: 25px; display: grid; place-items: center; border: 2px solid #ffe0aa; border-radius: 50%; background: #913d31; color: white; font-size: 17px; font-weight: 950; box-shadow: 0 3px 7px #0009; }
.zone-space.occupied { z-index: 7; background: #18101820; }
.zone-cast-card { position: absolute; inset: 3%; width: 94%; height: 94%; object-fit: contain; border: 0; border-radius: 4px; box-shadow: 0 0 8px var(--agency-color, #fff); filter: drop-shadow(0 4px 4px #000a); }
.owner-pip { position: absolute; left: 3px; right: 3px; bottom: 3px; padding: 2px; overflow: hidden; border-radius: 3px; background: #191219e6; color: #f0d59b; font-size: 6px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.reward-tokens { position: absolute; z-index: 9; left: 50%; top: 4%; min-width: 24px; min-height: 24px; display: flex; align-items: center; gap: 3px; translate: -50% 0; pointer-events: none; }
.physical-token { --token-size: clamp(18px, 1.65vw, 27px); position: relative; isolation: isolate; display: inline-grid; flex: 0 0 var(--token-size); width: var(--token-size); height: var(--token-size); place-items: center; }
.physical-token::before { content: ""; position: absolute; z-index: 0; inset: 3px 1px -2px; background: #2a1b13; opacity: .86; }
.physical-token.money-token::before { border-radius: 50%; }
.physical-token.hype-token::before { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); border-radius: 5px; background: #4b2a10; }
.physical-token img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(-1px 0 0 #161116) drop-shadow(1px 0 0 #161116) drop-shadow(0 -1px 0 #161116) drop-shadow(0 1px 0 #161116) drop-shadow(0 3px 2px #0009); }
.reward-tokens .physical-token:nth-child(1) { rotate: -4deg; }
.reward-tokens .physical-token:nth-child(2) { rotate: 4deg; }

.market-slot { position: absolute; z-index: 7; display: grid; place-items: center; border-radius: 5px; pointer-events: none; }
.market-deck { isolation: isolate; color: #f0d59a; text-align: center; }
.market-deck .deck-layer { position: absolute; left: 50%; top: 50%; display: block; width: 82%; height: 94%; object-fit: contain; translate: -50% -50%; }
.market-deck .deck-layer-back { z-index: 0; transform: translate(2px, 2px); filter: brightness(.42); opacity: .72; }
.market-deck .deck-layer-middle { z-index: 1; transform: translate(1px, 1px); filter: brightness(.68); opacity: .9; }
.market-deck .deck-face { z-index: 2; filter: drop-shadow(0 2px 2px #0008); }
.market-deck span { position: absolute; z-index: 3; right: 8%; bottom: 3%; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border: 1px solid #3c2817; border-radius: 999px; background: #d4a653; color: #21161c; font-size: 8px; font-weight: 950; box-shadow: 0 2px 2px #0008; }
.market-discard { overflow: visible; background: transparent; box-shadow: none; }
.market-discard img { display: block; width: 82%; height: 94%; object-fit: contain; filter: drop-shadow(0 2px 2px #0008); pointer-events: auto; cursor: zoom-in; }

.production-card-slot { position: absolute; margin: 0; padding: 0; overflow: visible; border: 0; aspect-ratio: 2100/1500; background: transparent; }
.production-card-art { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 3px #0009); }
.production-scene-slot { position: absolute; z-index: 3; top: 17.5%; width: 41.3%; height: 79%; margin: 0; padding: 0; overflow: visible; border: 0; border-radius: 4px 4px 6px 6px; appearance: none; background: transparent; opacity: 1; }
.production-scene-slot:disabled { opacity: 1; }
.production-scene-1 { left: 7.6%; }
.production-scene-2 { left: 51.1%; }
.production-scene-slot.legal { cursor: pointer; z-index: 8; outline: 3px solid #54dd91; outline-offset: -2px; background: #2eb87218; box-shadow: 0 0 16px #52e99b; }
.production-scene-slot.legal:hover { outline-width: 4px; background: #52e99b28; filter: brightness(1.08); }
.production-hype { --token-size: clamp(19px, 1.75vw, 28px); position: absolute; z-index: 9; left: 7%; top: 24%; rotate: -5deg; pointer-events: none; }
.production-cast-card { position: absolute; z-index: 6; left: 4%; top: 3%; width: 92%; height: 94%; object-fit: contain; border: 0; border-radius: 4px; box-shadow: 0 0 7px var(--agency-color, #fff); filter: drop-shadow(0 3px 3px #000b); }
.production-owner { position: absolute; z-index: 7; left: 6%; right: 6%; bottom: 5%; overflow: hidden; padding: 2px; border-radius: 3px; background: #191219e6; color: #f0d59b; font-size: 5px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.scene-label { position: absolute; z-index: 8; right: 4px; top: 4px; padding: 2px 5px; border-radius: 999px; background: #171118e8; color: #f1d394; font-size: 6px; font-weight: 900; opacity: 0; }
.production-scene-slot.legal .scene-label, .production-scene-slot.completed .scene-label { opacity: 1; }

.local-label { max-width: 760px; display: flex; align-items: center; gap: 12px; margin: 9px auto 4px; color: #cfac68; font-size: 8px; font-weight: 900; letter-spacing: .18em; }
.local-label i { height: 1px; flex: 1; background: linear-gradient(90deg, #9e7440, transparent); }
.turn-instruction { max-width: 760px; min-height: 39px; display: flex; align-items: center; gap: 9px; margin: 0 auto 4px; padding: 3px 9px; border: 1px solid #4e9369; border-radius: 9px; background: linear-gradient(90deg, #173123, #171218); color: #f0d7a5; box-shadow: inset 0 0 16px #55c78412; }
.turn-instruction > img { width: 31px; height: 34px; flex: 0 0 31px; object-fit: contain; filter: drop-shadow(-1px 0 0 #090709) drop-shadow(1px 0 0 #090709) drop-shadow(0 -1px 0 #090709) drop-shadow(0 1px 0 #090709) drop-shadow(0 3px 2px #0009); }
.turn-instruction.selected > img { object-fit: contain; }
.turn-instruction span { display: grid; gap: 1px; }
.turn-instruction small { color: #69ce93; font-size: 7px; font-weight: 950; letter-spacing: .13em; }
.turn-instruction b { font-size: 11px; }
.turn-instruction.waiting { border-color: #765e46; background: linear-gradient(90deg, #32232d, #171218); }
.turn-instruction.waiting small { color: #d0a964; }
.player-board { border: 3px solid color-mix(in srgb, var(--agency-color) 74%, #d6aa67); border-radius: 18px; padding: 13px; background: radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--agency-color) 38%, #4b374c), color-mix(in srgb, var(--agency-color) 15%, #281d29) 58%, color-mix(in srgb, var(--agency-color) 5%, #171218)); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--agency-color) 18%, #171218), inset 0 0 34px color-mix(in srgb, var(--agency-color) 13%, transparent), 0 16px 30px #0008; overflow: hidden; }
.board-column > .player-board { max-width: 760px; margin: 0 auto; padding: 7px; border-width: 2px; border-radius: 13px; }
.board-column > .player-board .player-head { gap: 10px; padding: 2px 5px 6px; }
.board-column > .player-board .player-head h2 { font-size: 20px; }
.board-column > .player-board .chaos-box { min-width: 135px; grid-template-columns: 34px auto; padding: 3px 7px; }
.board-column > .player-board .chaos-box img { width: 34px; height: 34px; }
.board-column > .player-board .chaos-box strong { font-size: 17px; }
.board-column > .player-board .cast-row { gap: 6px; padding: 7px 0; }
.board-column > .player-board .cast-state { padding: 2px; font-size: 6px; }
.board-column > .player-board .stats { gap: 6px; padding-top: 6px; }
.board-column > .player-board .stat { min-height: 36px; grid-template-columns: 31px 1fr; padding: 2px 7px; }
.board-column > .player-board .stat img { width: 31px; height: 31px; }
.board-column > .player-board .stat span { font-size: 23px; }
.player-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 4px 7px 10px; border-bottom: 1px solid color-mix(in srgb, var(--agency-color) 58%, #8f7148); }
.player-head h2 { margin: 2px 0 0; font-family: Impact, sans-serif; color: color-mix(in srgb, var(--agency-color) 46%, #f0d396); letter-spacing: .055em; font-size: 27px; font-weight: 500; text-transform: uppercase; }
.chaos-box { display: grid; grid-template-columns: 44px auto; gap: 7px; align-items: center; min-width: 165px; padding: 6px 10px; border: 2px solid #a7753e; border-radius: 10px; background: #efe0bd; color: #281e25; }
.chaos-box img { width: 44px; height: 44px; object-fit: contain; }
.chaos-box small { color: #5c4c42; }
.chaos-box strong { float: right; color: #a83937; font-size: 21px; }
.chaos-pips { clear: both; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding-top: 3px; }
.chaos-pips i { height: 5px; border-radius: 3px; background: #c9b994; }
.chaos-pips i.on { background: #b93f38; }
.cast-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; padding: 12px 0; }
.cast-slot { position: relative; width: 100%; aspect-ratio: 1000/1590; overflow: hidden; display: grid; place-items: center; margin: 0; padding: 0; border: 2px solid #171218; border-radius: 8px; appearance: none; background: #e5d4af; color: inherit; box-shadow: 0 5px 11px #0008; }
.cast-slot.available { outline: 0; }
.cast-slot.available[type="button"] { cursor: pointer; }
.cast-slot.available[type="button"]:hover { translate: 0 -3px; box-shadow: 0 0 0 3px #58ce8d, 0 8px 15px #000a; }
.cast-slot.strike-manageable[type="button"] { cursor: pointer; }
.cast-slot.strike-manageable[type="button"]:hover { translate: 0 -3px; box-shadow: 0 0 0 3px #c98055, 0 8px 15px #000a; }
.cast-slot.selected { outline: 4px solid #f0b94f; box-shadow: 0 0 24px #f2ad45, 0 8px 16px #000c; translate: 0 -4px; }
.cast-card { width: 100%; height: 100%; object-fit: contain; display: block; }
.cast-slot.exhausted .cast-card, .cast-slot.production .cast-card { filter: grayscale(.45) brightness(.6); }
.cast-state { position: absolute; left: 4px; right: 4px; bottom: 4px; padding: 3px; border-radius: 4px; background: #181219dc; color: #d9c195; font-size: 8px; font-weight: 900; letter-spacing: .08em; text-align: center; }
.cast-slot.available .cast-state { background: #17623fdd; color: white; }
.strike-token { position: absolute; right: 5px; top: 5px; width: 42px; filter: drop-shadow(0 2px 3px #000); }
.strike-count { position: absolute; right: 2px; top: 2px; color: white; background: #9b2727; border-radius: 50%; width: 19px; height: 19px; text-align: center; }
.added-token-badge { position: absolute; z-index: 8; top: 4px; left: 4px; right: auto; width: 30px; height: 30px; display: grid; place-items: center; pointer-events: none; filter: drop-shadow(0 2px 3px #000c); }
.added-token-badge img { width: 100%; height: 100%; object-fit: contain; }
.zone-added-token { top: 2px; left: 2px; right: auto; width: 20px; height: 20px; }
.production-added-token { top: 2px; left: 2px; right: auto; width: 18px; height: 18px; }
.cast-slot.away { border-style: dashed; background: repeating-linear-gradient(135deg, #2d222f 0 12px, #211a24 12px 24px); }
.away-marker { display: grid; gap: 6px; padding: 8px; text-align: center; color: #d3b97f; }
.away-marker small { color: #79c99a; font-weight: 900; letter-spacing: .1em; }
.away-marker b { font-family: Impact, sans-serif; font-size: clamp(11px, 1vw, 16px); letter-spacing: .04em; }
.away-marker span { color: #ae9c7e; font-size: 9px; }
.cast-slot.locked, .cast-slot.empty { align-content: center; gap: 7px; text-align: center; background: repeating-linear-gradient(135deg, #392b3c 0 12px, #29212e 12px 24px); color: #d6b773; }
.cast-slot.empty { background: #d8c69f1c; color: #a6916d; border-style: dashed; }
.cast-slot.locked small, .cast-slot.empty small { color: #9f927d; font-size: 8px; text-transform: uppercase; }
.padlock { font-size: 24px; color: #c89143; }
.padlock img { width: 24px; height: 24px; object-fit: contain; filter: var(--icon-outline); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--agency-color) 58%, #8f7148); }
.stat { min-height: 50px; display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 8px; padding: 5px 11px; border: 2px solid #1d171d; border-radius: 9px; background: #efe0bd; color: #261d25; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--agency-color) 64%, #c89143); }
.stat img { width: 46px; height: 46px; object-fit: contain; }
.stat span { font-family: Impact, sans-serif; font-size: 30px; text-align: center; }

.action-panel { position: sticky; top: 15px; padding: 15px; border: 1px solid #8d6c45; border-radius: 16px; background: linear-gradient(150deg, #36253a, #1c161d); box-shadow: 0 16px 30px #0008; }
.proof-copy strong { display: block; margin: 6px 0; color: #f0d59c; font-family: Georgia, serif; font-size: 18px; }
.proof-copy span { color: #c3b49a; font-size: 12px; line-height: 1.45; }
.action-panel button { width: 100%; margin-top: 13px; padding: 13px 10px; border: 0; border-radius: 9px; background: linear-gradient(#d09b42, #9d6628); color: #20151b; font-weight: 950; letter-spacing: .06em; cursor: pointer; box-shadow: 0 5px 12px #0007; }
.action-panel button:disabled { cursor: default; filter: grayscale(.8); opacity: .55; }
.action-panel button.quiet { margin-top: 7px; padding: 9px; background: #211921; color: #c9b28d; border: 1px solid #6e5841; box-shadow: none; font-size: 11px; }
.flow-steps { display: flex; align-items: center; gap: 4px; margin-top: 14px; padding: 8px 2px; color: #756b60; font-size: 7px; letter-spacing: .06em; }
.flow-steps b { padding: 4px 5px; border: 1px solid #51463d; border-radius: 999px; }
.flow-steps b.done { color: #7fc397; border-color: #407d59; }
.flow-steps b.current { color: #f0c16c; border-color: #be8c40; box-shadow: 0 0 8px #c89045; }
.flow-steps i { height: 1px; flex: 1; background: #53463e; }
.last-log { margin-top: 16px; border-top: 1px solid #66523e; padding-top: 13px; }
.last-recap { margin-top: 8px; padding: 8px; border: 1px solid #554636; border-radius: 10px; background: #100d11; }
.last-recap.idle { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; color: #7fc497; }
.ready-mark { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #4b8d67; border-radius: 50%; background: #183c2a; font-weight: 950; }
.last-route { display: grid; grid-template-columns: 31px 18px minmax(0, 1fr); align-items: center; gap: 5px; color: #d9c092; }
.last-route img { width: 31px; height: 43px; object-fit: contain; filter: drop-shadow(0 2px 2px #000); }
.last-route span { color: #73c793; font-size: 17px; text-align: center; }
.last-route b { margin: 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.server-seal { margin-top: 12px; padding: 9px; border: 1px solid #3d7558; border-radius: 8px; color: #7fc497; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-align: center; }
.server-seal span { color: #9caa9f; font-weight: 500; letter-spacing: 0; }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 30px; background: #09070ad9; backdrop-filter: blur(8px); }
.modal-card { position: relative; width: min(1180px, 92vw); padding: 42px 18px 18px; border: 2px solid #c99b50; border-radius: 18px; background: #1a141a; box-shadow: 0 30px 80px #000; }
.modal-card.agency-modal { border-color: color-mix(in srgb, var(--agency-color) 76%, #c99b50); background: linear-gradient(145deg, color-mix(in srgb, var(--agency-color) 14%, #211821), #151116); box-shadow: 0 30px 80px #000, 0 0 34px color-mix(in srgb, var(--agency-color) 18%, transparent); }
.modal-card .close { position: absolute; top: 8px; right: 12px; border: 1px solid #8a6d48; border-radius: 50%; width: 30px; height: 30px; color: #f3d7a1; background: #2f232e; font-size: 20px; cursor: pointer; }
.orientation-note { position: absolute; top: 15px; left: 20px; color: #bda775; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.compact-board { width: 100%; transform: none; }

.recap-backdrop { z-index: 28; }
.recap-modal { width: min(760px, 90vw); padding: 42px 22px 22px; }
.recap-modal > small { color: #d9b873; font-weight: 950; letter-spacing: .14em; }
.recent-moves { display: grid; gap: 10px; margin-top: 13px; }
.recent-moves .last-recap { display: grid; grid-template-columns: minmax(190px, .7fr) 1fr; align-items: center; gap: 12px; margin: 0; padding: 12px; }
.recent-moves .recap-flow.compact { margin: 0; }

.choice-backdrop { z-index: 40; }
.choice-card { width: min(820px, 92vw); max-height: 92vh; overflow: auto; padding: 25px; border: 2px solid #c99a4e; border-radius: 18px; background: linear-gradient(145deg, #38263b, #181319 70%); text-align: center; box-shadow: 0 28px 90px #000, 0 0 35px #d49b4438; }
.choice-card > small { color: #caaa6c; font-size: 10px; font-weight: 950; letter-spacing: .16em; }
.choice-card h2 { margin: 8px 0 16px; color: #f0d59d; font-family: Georgia, serif; font-size: 20px; }
.choice-grid { display: grid; gap: 14px; justify-content: center; }
.source-grid, .bag-choice-grid { grid-template-columns: repeat(2, minmax(190px, 260px)); }
.cast-choice-grid { grid-template-columns: repeat(3, minmax(150px, 205px)); }
.discard-choice-grid, .target-grid { grid-template-columns: repeat(auto-fit, minmax(125px, 170px)); }
.source-choice, .bag-choice-grid button { min-height: 230px; display: grid; align-content: center; justify-items: center; gap: 12px; border: 2px solid #725b43; border-radius: 14px; background: #201920; color: #eed49d; cursor: pointer; box-shadow: 0 8px 17px #0009; }
.source-choice:hover, .bag-choice-grid button:hover { border-color: #e1b15d; translate: 0 -2px; }
.source-choice:disabled, .bag-choice-grid button:disabled { opacity: .38; cursor: default; }
.mini-deck { position: relative; width: 104px; height: 150px; display: grid; place-items: center; }
.mini-deck img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(3px 4px 0 #362b2e) drop-shadow(0 7px 5px #000b); }
.mini-deck i { position: absolute; right: -5px; bottom: -4px; min-width: 27px; height: 27px; display: grid; place-items: center; border: 2px solid #21161b; border-radius: 50%; background: #d4a653; color: #21161b; font-style: normal; font-weight: 950; }
.choice-cast { min-width: 0; display: grid; justify-items: center; gap: 7px; padding: 8px; border: 2px solid #604d3d; border-radius: 12px; background: #181318; color: #ebd19b; cursor: pointer; box-shadow: 0 7px 13px #0008; }
.choice-cast:hover, .choice-cast.selected { border-color: #e2b45f; translate: 0 -2px; box-shadow: 0 0 18px #e5aa4b66, 0 9px 16px #0009; }
.choice-cast:disabled { opacity: 1; cursor: default; }
.choice-cast img { width: min(132px, 100%); aspect-ratio: 1000/1590; object-fit: contain; border-radius: 5px; }
.choice-cast b { max-width: 100%; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.acquire-choice-card { width: min(900px, 94vw); }
.acquire-current-cast { margin: -3px 0 15px; padding: 9px 11px 10px; border: 1px solid #735b42; border-radius: 11px; background: #120f13b8; text-align: left; }
.acquire-current-cast > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: #d6b878; font: 850 9px var(--font-poster); letter-spacing: .08em; }
.acquire-current-cast > header span { color: #9f927d; font-size: 8px; }
.acquire-current-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.acquire-current-member { min-width: 0; display: grid; justify-items: center; gap: 3px; color: #d8c190; text-align: center; }
.acquire-current-member > b { width: 100%; overflow: hidden; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.acquire-current-member > small { color: #7fc397; font-size: 6px; font-weight: 900; letter-spacing: .04em; }
.acquire-current-member.on-strike > small { color: #e38b78; }
.acquire-current-card { position: relative; width: min(72px, 100%); aspect-ratio: 1000/1590; }
.acquire-current-art { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 4px #000b); }
.choice-added-token { top: 1px; left: 1px; width: 21px; height: 21px; }
.acquire-current-strike { position: absolute; z-index: 9; top: 1px; right: 1px; width: 24px; height: 24px; object-fit: contain; filter: drop-shadow(0 2px 2px #000); }
.acquire-current-strike-count { position: absolute; z-index: 10; top: 0; right: -1px; width: 13px; height: 13px; display: grid; place-items: center; border-radius: 50%; background: #9b2727; color: white; font-size: 7px; }
.chosen-cast { width: 170px; margin: 0 auto 13px; }
.primary-choice, .quiet-choice { min-height: 43px; margin-top: 14px; padding: 8px 20px; border: 0; border-radius: 9px; background: linear-gradient(#d7a44c, #9b6429); color: #21161c; font-weight: 950; cursor: pointer; }
.quiet-choice { margin-left: 9px; border: 1px solid #6c5843; background: #211a21; color: #cbb58d; }
.bag-icons { width: 145px; min-height: 100px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 3px; }
.bag-icons img { width: 52px; height: 52px; object-fit: contain; }
.bag-choice-grid button i { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #d5a653; color: #22171c; font-style: normal; font-weight: 950; }
.token-candidates { display: flex; justify-content: center; gap: 18px; }
.choice-token { width: 125px; min-height: 145px; display: grid; align-content: center; justify-items: center; gap: 9px; border: 2px solid #725d46; border-radius: 15px; background: #171218; color: #f1d8a4; cursor: pointer; box-shadow: 0 8px 16px #0009; }
.choice-token:hover, .choice-token.selected { border-color: #67d496; box-shadow: 0 0 21px #4ee18b88, 0 9px 16px #0009; translate: 0 -2px; }
.choice-token img { width: 88px; height: 88px; object-fit: contain; }
.choice-token b { font-size: 10px; text-transform: uppercase; }
.choice-arrow { display: block; margin: 14px 0 0; color: #66cf92; font-size: 27px; }
.target-grid .choice-cast img { width: 92px; }
.waiting-choice { width: 390px; display: flex; align-items: center; justify-content: center; gap: 13px; color: #e8ce99; }
.choice-spinner { font-size: 31px; color: #64ca90; animation: choice-spin 1s linear infinite; }
@keyframes choice-spin { to { rotate: 360deg; } }

.confirmation-backdrop { z-index: 30; }
.confirmation-card { width: min(680px, 90vw); padding: 22px 24px 24px; border: 2px solid #d1a052; border-radius: 17px; background: linear-gradient(150deg, #3c2940, #1b151c); box-shadow: 0 30px 90px #000; }
.confirmation-card > small { color: #bd9d66; font-weight: 900; letter-spacing: .15em; }
.confirmation-route { display: grid; grid-template-columns: 118px 54px minmax(0, 1fr); align-items: center; justify-content: center; gap: 14px; margin: 10px 0 12px; }
.confirmation-route figure { position: relative; display: grid; place-items: center; gap: 5px; margin: 0; min-width: 0; }
.confirmation-route figcaption { max-width: 100%; overflow: hidden; color: #efd49c; font-size: 11px; font-weight: 900; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.destination-figure figcaption { display: grid; gap: 2px; }
.destination-figure figcaption small { color: #71c994; font-size: 8px; letter-spacing: .12em; }
.destination-figure figcaption span { overflow: hidden; text-overflow: ellipsis; }
.confirmation-cast { width: 82px; height: 126px; object-fit: contain; filter: drop-shadow(0 7px 5px #000a); }
.confirmation-token { top: 2px; left: 17px; width: 29px; height: 29px; }
.confirmation-destination { width: 100%; height: 126px; object-fit: contain; filter: drop-shadow(0 7px 5px #000a); }
.destination-figure b { position: absolute; right: 6px; top: 7px; width: 31px; height: 31px; display: grid; place-items: center; border: 2px solid #f4db9c; border-radius: 50%; background: #246d49; color: white; font-size: 18px; box-shadow: 0 3px 7px #000b; }
.route-arrow { color: #6bd194; font-size: 40px; font-weight: 300; text-align: center; filter: drop-shadow(0 0 7px #50d58a88); }
.chaos-equation { display: flex; min-height: 91px; align-items: center; justify-content: center; gap: 10px; padding: 9px 12px; border: 1px solid #744943; border-radius: 12px 12px 0 0; background: #160e12; }
.chaos-term { min-width: 68px; display: grid; justify-items: center; gap: 6px; }
.chaos-term small { color: #9f8970; font-size: 7px; font-weight: 950; letter-spacing: .1em; text-align: center; }
.chaos-term.total { padding-left: 4px; }
.chaos-term.total small { color: #e1b36e; }
.chaos-term.total .recap-icon { box-shadow: 0 0 0 3px #c68b4088, 0 5px 8px #0008; }
.math-sign { color: #9f775b; font-family: Georgia, serif; font-size: 27px; font-weight: 900; }
.math-sign.equals { color: #e1b36e; }
.gains-panel { display: grid; grid-template-columns: 94px minmax(0, 1fr); align-items: center; min-height: 79px; padding: 9px 14px; border: 1px solid #496b55; border-top: 0; border-radius: 0 0 12px 12px; background: linear-gradient(90deg, #14241b, #100d11); }
.gains-panel > small { color: #71c994; font-size: 9px; font-weight: 950; letter-spacing: .13em; }
.gains-panel > div { display: flex; align-items: center; justify-content: center; gap: 11px; }
.confirmation-warning { min-height: 66px; display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 11px; margin-top: 10px; padding: 9px 13px; border: 2px solid #cb604b; border-radius: 10px; background: linear-gradient(90deg, #4b211f, #1a1114); }
.confirmation-warning img { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(-1px 0 0 #090709) drop-shadow(1px 0 0 #090709) drop-shadow(0 -1px 0 #090709) drop-shadow(0 1px 0 #090709); }
.confirmation-warning span { display: grid; gap: 4px; }
.confirmation-warning b { color: #ffb49b; font-size: 12px; letter-spacing: .08em; }
.confirmation-warning small { color: #f0d4c3; font-size: 10px; line-height: 1.3; }
.recap-flow { display: flex; align-items: stretch; justify-content: center; gap: 8px; min-height: 92px; padding: 11px; border: 1px solid #6e5943; border-radius: 12px; background: #120e13; }
.recap-flow.compact { min-height: 0; justify-content: flex-start; gap: 4px; margin-top: 8px; padding: 5px; border: 0; background: transparent; overflow: hidden; }
.recap-group { min-width: 76px; display: grid; align-content: center; justify-items: center; gap: 7px; }
.recap-group small { color: #8f8069; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.recap-group > div { display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; }
.recap-arrow { align-self: center; color: #6a5948; font-size: 29px; font-style: normal; }
.recap-icon { position: relative; width: 58px; height: 58px; display: grid; place-items: center; border: 2px solid #6b5a49; border-radius: 50%; background: radial-gradient(circle, #f1e0b9 0 58%, #9d7c48 61% 67%, #241a21 70%); box-shadow: 0 5px 8px #0008; }
.recap-icon img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 2px #0008); }
.recap-icon b { position: absolute; right: -5px; bottom: -5px; min-width: 27px; height: 27px; display: grid; place-items: center; padding: 0 5px; border: 2px solid #e7d4a8; border-radius: 999px; background: #2d242b; color: #f6e4bd; font-size: 14px; box-shadow: 0 3px 5px #000a; }
.recap-icon.good b { background: #236444; color: #fff; }
.recap-icon.bad b { background: #a13b36; color: #fff; }
.recap-flow.compact .recap-group { min-width: 0; gap: 3px; }
.recap-flow.compact .recap-group small { font-size: 6px; }
.recap-flow.compact .recap-arrow { font-size: 15px; }
.recap-flow.compact .recap-icon { width: 34px; height: 34px; border-width: 1px; }
.recap-flow.compact .recap-icon img { width: 27px; height: 27px; }
.recap-flow.compact .recap-icon b { right: -3px; bottom: -3px; min-width: 18px; height: 18px; padding: 0 3px; border-width: 1px; font-size: 9px; }
.confirmation-actions { display: grid; grid-template-columns: 1fr 1.7fr; gap: 10px; }
.confirmation-actions button { min-height: 44px; margin-top: 15px; border: 1px solid #785f45; border-radius: 9px; background: #211921; color: #ccb48c; font-weight: 900; cursor: pointer; }
.confirmation-actions #confirm-action { border: 0; background: linear-gradient(#d5a34d, #9b6429); color: #22171c; letter-spacing: .06em; }
.confirmation-actions #confirm-action:disabled { cursor: not-allowed; background: #57464a; color: #aa9999; opacity: .8; }

.card-hover-preview { --preview-color: #d4a653; position: fixed; z-index: 90; left: 0; top: 0; display: none; place-items: center; overflow: hidden; border: 3px solid var(--preview-color); border-radius: 10px; background: #171118; pointer-events: none; box-shadow: 0 0 0 2px #140f15, 0 18px 48px #000e, 0 0 18px var(--preview-color); }
.card-hover-preview.visible { display: grid; }
.card-hover-preview[data-kind="cast"] { width: min(230px, 62vw); aspect-ratio: 1000/1590; }
.card-hover-preview[data-kind="event"] { width: min(240px, 62vw); aspect-ratio: 1500/2100; }
.card-hover-preview[data-kind="production"] { width: min(470px, 78vw); aspect-ratio: 2100/1500; }
.card-hover-preview[data-kind="zone-rule"] { width: min(657px, 92vw); aspect-ratio: 657/432; border: 0; border-radius: 31px; background: transparent; }
.card-hover-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.card-hover-preview[data-kind="zone-rule"] img { object-fit: fill; }
[data-card-preview] { -webkit-user-drag: none; }

.event-zone-chip img, .event-effect-icon img, .recap-icon img, .stat img, .chaos-box img, .strike-token, .bag-icons img, .choice-token img {
  filter: drop-shadow(0 2px 2px #0009);
}

@media (max-width: 1300px) {
  #game { padding-left: 10px; padding-right: 10px; }
  .table-layout { grid-template-columns: minmax(0, 1fr); }
  .player-head h2 { font-size: 22px; }
  .cast-row { gap: 5px; }
  .stat { grid-template-columns: 36px 1fr; padding: 4px 7px; }
  .stat img { width: 36px; height: 36px; }
}

@media (max-width: 760px) {
  .table-header { align-items: start; }
  .table-header h1 { font-size: 25px; }
  .event-strip { grid-template-columns: 40px 58px 1fr; }
  .event-hot-block { grid-column: 3; }
  .event-arrow { display: none; }
  .event-effect-block { grid-column: 1 / -1; }
  .event-zone-chip b { font-size: 8px; }
}

/* Regia asimmetrica: rapporti derivati dagli asset reali, non da altezze arbitrarie. */
:root {
  --cast-ratio: 1000 / 1590;
  --zone-ratio: 1522 / 1242;
  --event-ratio: 1500 / 2100;
  --production-ratio: 2100 / 1500;
  --icon-outline: drop-shadow(-1px 0 0 #0a080a) drop-shadow(1px 0 0 #0a080a) drop-shadow(0 -1px 0 #0a080a) drop-shadow(0 1px 0 #0a080a) drop-shadow(0 3px 2px #000a);
}

#game { padding: 10px 10px 28px; }
.studio-shell {
  width: min(1480px, calc(100vw - 20px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1160px) minmax(290px, 310px);
  gap: 10px;
  align-items: start;
}
.studio-main { min-width: 0; display: grid; gap: 9px; }
.studio-main .common-board { width: 100%; max-width: none; }
.studio-main > .player-board { width: 100%; max-width: none; margin: 0; }
.studio-rail { min-width: 0; display: grid; gap: 9px; align-content: start; }

.rail-panel {
  position: relative;
  overflow: hidden;
  border: 2px solid #9c703c;
  border-radius: 13px;
  background:
    linear-gradient(90deg, transparent 0 49%, #ffffff05 50%, transparent 51%),
    radial-gradient(circle at 50% 0, #4d374a 0, #2c202c 47%, #171218 100%);
  box-shadow: inset 0 0 0 2px #160f15, inset 0 0 28px #0008, 0 10px 20px #0009;
}
.rail-panel::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid #d2a05635;
  border-radius: 8px;
  pointer-events: none;
}
.rail-title {
  position: relative;
  z-index: 2;
  min-height: 36px;
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  padding: 5px 10px;
  border-bottom: 1px solid #a57741;
  background: linear-gradient(#443044, #2a1d2b);
  color: #efd39b;
  font-family: Georgia, serif;
  font-size: 13px;
  letter-spacing: .11em;
  text-align: center;
  text-shadow: 0 2px 2px #000;
}
.rail-title > span { color: #b68a4d; font-size: 10px; }
.rail-title button {
  position: relative;
  z-index: 3;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid #bf8c48;
  border-radius: 50%;
  background: #1d161d;
  color: #e5bd76;
  cursor: pointer;
  font-size: 16px;
}
.event-panel .rail-title { grid-template-columns: 58px minmax(0, 1fr) 20px; }
.rail-title .event-title-button { width: auto; height: auto; min-width: 0; padding: 0 4px; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; line-height: 1; white-space: nowrap; cursor: pointer; }
.event-title-button b { font: inherit; }
.event-title-button:hover { color: #f2d58e; }
.rail-title .home-return-button { position: relative; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 3px; min-height: 24px; padding: 2px 5px; border: 1px solid #8f6c42; border-radius: 5px; background: #1a1419; color: #d8b977; font: 800 8px var(--font-poster); letter-spacing: .06em; text-decoration: none; }
.rail-title .home-return-button span { color: #e3c98d; font-size: 13px; }
.rail-title .home-return-button:hover { border-color: #d0a055; color: #f1d597; filter: brightness(1.12); }
.moves-trigger {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #c49350;
  border-radius: 0;
  cursor: pointer;
}
.moves-trigger:hover { filter: brightness(1.12); }
.moves-trigger:focus-visible { outline: 2px solid #e5bd76; outline-offset: -4px; }

.event-rail-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 11px;
  padding: 13px 13px 15px;
}
.event-card-column { display: grid; justify-items: center; align-content: start; gap: 5px; }
.rail-event-card {
  display: block;
  width: 112px;
  aspect-ratio: var(--event-ratio);
  object-fit: contain;
  border-radius: 5px;
  cursor: zoom-in;
  filter: drop-shadow(0 7px 5px #000c);
}
.rail-event-card.missing { place-items: center; border: 1px dashed #a6814e; background: #211820; color: #b9a27b; font-size: 9px; }
.event-card-column > b { color: #f0d49a; font-family: Georgia, serif; font-size: 11px; letter-spacing: .09em; }
.event-card-column > small, .event-rule-copy > small { color: #ba9b68; font-size: 7px; font-weight: 950; letter-spacing: .13em; }
.rail-hot-zones { display: flex; justify-content: center; gap: 6px; }
.rail-hot-zones span {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid #bd8d48;
  border-radius: 9px;
  background: #ece0c1;
  box-shadow: inset 0 0 0 2px #32232c, 0 4px 7px #0009;
}
.rail-hot-zones img { width: 31px; height: 31px; object-fit: contain; filter: var(--icon-outline); }
.event-rule-copy {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 11px 10px;
  border: 1px solid #6e5338;
  border-radius: 9px;
  background: linear-gradient(145deg, #211920e8, #100d11e8);
  box-shadow: inset 0 0 18px #0008;
}
.event-rule-copy > div { display: grid; gap: 10px; }
.event-rule-copy .event-effect { display: grid; justify-items: start; gap: 9px; }
.event-rule-copy .event-effect-icon { width: 43px; height: 43px; }
.event-rule-copy .event-effect b { color: #efd9aa; font-size: 12px; line-height: 1.4; }

.agencies-panel { padding-bottom: 8px; }
.agency-list { position: relative; z-index: 1; display: grid; gap: 7px; padding: 10px 11px; }
.agency-plaque {
  position: relative;
  min-height: 71px;
  width: 100%;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  grid-template-rows: 1fr auto;
  gap: 2px 9px;
  align-items: center;
  margin: 0;
  padding: 8px 10px 7px 7px;
  border: 2px solid color-mix(in srgb, var(--agency-color) 78%, #c69a57);
  border-radius: 9px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--agency-color) 42%, #261b26), color-mix(in srgb, var(--agency-color) 13%, #171218) 68%),
    #211820;
  color: #f1d9a9;
  text-align: left;
  box-shadow: inset 0 0 17px color-mix(in srgb, var(--agency-color) 16%, transparent), 0 5px 11px #0009;
}
button.agency-plaque { cursor: pointer; }
button.agency-plaque:hover { border-color: color-mix(in srgb, var(--agency-color) 66%, #ffe2a6); filter: brightness(1.08); }
.agency-plaque.active { box-shadow: inset 0 0 0 2px #f0d69b, inset 0 0 20px color-mix(in srgb, var(--agency-color) 22%, transparent), 0 0 14px color-mix(in srgb, var(--agency-color) 48%, transparent), 0 5px 11px #0009; }
.agency-color-chip { grid-row: 1 / 3; width: 7px; height: 100%; border-radius: 5px; background: var(--agency-color); box-shadow: 0 0 9px var(--agency-color); }
.agency-copy { min-width: 0; display: grid; gap: 2px; }
.agency-copy small { color: color-mix(in srgb, var(--agency-color) 52%, #efd8a6); font-size: 7px; font-weight: 950; letter-spacing: .12em; }
.agency-copy b { overflow: hidden; color: color-mix(in srgb, var(--agency-color) 34%, #f5dfa9); font-family: Impact, sans-serif; font-size: 19px; font-weight: 500; letter-spacing: .055em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.agency-public { display: flex; align-items: center; justify-content: end; gap: 6px; color: #cbb58b; font-size: 8px; font-weight: 900; }
.agency-public i { display: flex; align-items: center; gap: 3px; font-style: normal; }
.agency-public img { width: 18px; height: 18px; object-fit: contain; filter: var(--icon-outline); }
.agency-plaque em { grid-column: 3; justify-self: end; color: color-mix(in srgb, var(--agency-color) 55%, #f4d89f); font-size: 8px; font-style: normal; font-weight: 950; letter-spacing: .13em; }

.moves-panel { padding-bottom: 8px; }
.rail-panel.collapsed { padding-bottom: 0; }
.rail-moves { position: relative; z-index: 1; display: grid; gap: 6px; padding: 9px 10px 11px; }
.rail-move {
  min-height: 84px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 6px 7px;
  border: 1px solid color-mix(in srgb, var(--agency-color) 53%, #604b39);
  border-radius: 8px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--agency-color) 13%, #171218), #0d0b0e);
  box-shadow: inset 4px 0 0 var(--agency-color), 0 4px 8px #0008;
}
.rail-move-route { min-width: 0; display: grid; grid-template-columns: 42px 14px minmax(0, 1fr); align-items: center; gap: 4px; }
.rail-move-cast { width: 38px; aspect-ratio: var(--cast-ratio); object-fit: contain; filter: drop-shadow(0 4px 3px #000a); }
.rail-move-route > span { color: #d4a653; text-align: center; }
.rail-destination { min-width: 0; display: grid; justify-items: center; gap: 2px; }
.rail-destination img { width: 39px; height: 39px; object-fit: contain; filter: var(--icon-outline); }
.rail-destination.production img { width: 58px; height: 41px; filter: drop-shadow(0 3px 2px #000a); }
.rail-destination b { max-width: 72px; overflow: hidden; color: #d9c196; font-size: 7px; text-align: center; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.rail-move-gains { display: flex; align-items: center; justify-content: end; gap: 3px; }
.rail-move-gains > small { max-width: 58px; color: #8d7d68; font-size: 6px; text-align: center; }
.rail-move-gains .recap-icon { width: 31px; height: 31px; border-width: 1px; }
.rail-move-gains .recap-icon img { width: 24px; height: 24px; }
.rail-move-gains .recap-icon b { right: -3px; bottom: -3px; min-width: 17px; height: 17px; padding: 0 3px; border-width: 1px; font-size: 8px; }
.rail-empty { min-height: 70px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #79c99a; }
.rail-empty span { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid #438460; border-radius: 50%; background: #173b29; }

/* Plancia personale: sei slot veri, tutti con il rapporto delle carte Cast. */
.studio-main > .player-board {
  padding: 8px;
  border-width: 2px;
  border-radius: 13px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--agency-color) 27%, transparent), transparent 42%),
    radial-gradient(circle at 12% 0, color-mix(in srgb, var(--agency-color) 34%, #493649), color-mix(in srgb, var(--agency-color) 9%, #171218) 66%);
}
.studio-main .player-head {
  min-height: 55px;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto;
  gap: 10px;
  padding: 2px 5px 7px;
}
.agency-nameplate { min-width: 0; display: grid; grid-template-columns: minmax(0, auto) auto; grid-template-rows: auto auto; align-items: center; justify-content: start; column-gap: 10px; }
.agency-nameplate small { grid-column: 1 / 3; color: color-mix(in srgb, var(--agency-color) 48%, #e1c58f); font-size: 7px; }
.agency-nameplate h2 { margin: 0; overflow: hidden; color: color-mix(in srgb, var(--agency-color) 43%, #f2d99e); font-size: 23px; text-overflow: ellipsis; white-space: nowrap; }
.board-turn { display: inline-flex; align-items: center; gap: 4px; color: #9e8b72; font-size: 7px; font-weight: 950; letter-spacing: .11em; }
.board-turn.active { color: color-mix(in srgb, var(--agency-color) 66%, white); }
.board-turn i { width: 7px; height: 7px; border-radius: 50%; background: var(--agency-color); box-shadow: 0 0 8px var(--agency-color); }
.player-resources { display: flex; align-items: center; gap: 6px; }
.studio-main .stats { display: grid; grid-template-columns: repeat(4, 55px); gap: 4px; padding: 0; border: 0; }
.studio-main .stat { min-height: 39px; display: grid; grid-template-columns: 29px 1fr; gap: 1px; padding: 3px 4px; border-width: 1px; border-radius: 7px; }
.studio-main .stat img { width: 29px; height: 29px; filter: var(--icon-outline); }
.studio-main .stat span { font-size: 20px; }
.studio-main .chaos-box { min-width: 112px; grid-template-columns: 32px auto; gap: 4px; padding: 3px 6px; border-width: 1px; border-radius: 7px; }
.studio-main .chaos-box img { width: 31px; height: 31px; filter: var(--icon-outline); }
.studio-main .chaos-box strong { font-size: 15px; }
.studio-main .chaos-pips { gap: 1px; }
.studio-main .chaos-pips i { height: 4px; }
.studio-main .cast-row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; padding: 7px 0 0; }
.studio-main .cast-slot { min-width: 0; width: 100%; aspect-ratio: var(--cast-ratio); border-radius: 6px; }
.studio-main .cast-card { width: 100%; height: 100%; object-fit: contain; }
.studio-main .cast-state { padding: 2px; font-size: 6px; }
.studio-main .cast-slot.locked, .studio-main .cast-slot.empty { gap: 4px; }
.studio-main .cast-slot.locked b, .studio-main .cast-slot.empty > span { font-size: 11px; }
.studio-main .cast-slot.locked > span { font-size: 9px; }
.studio-main .cast-slot.locked small, .studio-main .cast-slot.empty small { font-size: 6px; }
.studio-main .padlock { font-size: 18px; }

.zone-board-art { aspect-ratio: var(--zone-ratio); }
.production-card-slot { aspect-ratio: var(--production-ratio); }
.rail-event-card { aspect-ratio: var(--event-ratio); }
.common-board { gap: 6px; padding: 7px; border-width: 2px; border-radius: 14px; }
.zone-tile { border-width: 1px; border-radius: 7px; }

@media (max-width: 1220px) {
  .studio-shell { grid-template-columns: minmax(0, 1fr) 285px; }
  .studio-main .stats { grid-template-columns: repeat(4, 46px); }
  .studio-main .stat { grid-template-columns: 24px 1fr; }
  .studio-main .stat img { width: 24px; height: 24px; }
  .studio-main .stat span { font-size: 17px; }
  .studio-main .chaos-box { min-width: 102px; }
}

@media (max-width: 980px) {
  .studio-shell { grid-template-columns: minmax(0, 1fr) 250px; }
  .studio-rail { gap: 2px; }
  .rail-title { min-height: 32px; padding-top: 3px; padding-bottom: 3px; font-size: 12px; }
  .event-rail-layout { grid-template-columns: 82px minmax(0, 1fr); gap: 6px; padding: 8px 8px 9px; }
  .rail-event-card { width: 74px; }
  .event-rule-copy { gap: 6px; padding: 7px 6px; }
  .event-rule-copy > div { gap: 6px; }
  .event-rule-copy .event-effect { gap: 6px; }
  .event-rule-copy .event-effect-icon { width: 37px; height: 37px; }
  .event-rule-copy .event-effect-icon img { width: 29px; height: 29px; }
  .event-rule-copy .event-effect b { font-size: 10px; line-height: 1.3; }
  .rail-hot-zones span { width: 34px; height: 34px; }
  .rail-hot-zones img { width: 27px; height: 27px; }
  .agencies-panel { padding-bottom: 4px; }
  .agency-list { gap: 4px; padding: 6px 9px; }
  .agency-plaque { min-height: 48px; height: 48px; padding: 4px 8px 3px 7px; }
  .agency-copy b { font-size: 15px; }
  .agency-public img { width: 15px; height: 15px; }
  .agency-badges { gap: 1px; }
  .agency-plaque em { font-size: 7px; }
  .agency-public i:last-child { display: none; }
  .rail-moves { gap: 3px; padding: 4px 7px 5px; }
  .rail-move { min-height: 48px; height: 48px; gap: 4px; padding: 3px 5px; }
  .rail-move-route { grid-template-columns: 25px 9px minmax(0, 1fr); gap: 2px; }
  .rail-move-cast { width: 24px; }
  .rail-move-route > span { font-size: 10px; }
  .rail-destination { grid-template-columns: 29px minmax(0, 1fr); justify-items: start; gap: 3px; }
  .rail-destination img { width: 28px; height: 28px; }
  .rail-destination.production img { width: 37px; height: 28px; }
  .rail-destination b { max-width: 66px; font-size: 6px; }
  .rail-move-gains { gap: 2px; }
  .rail-move-gains > small { display: none; }
  .rail-move-gains .recap-icon { width: 22px; height: 22px; }
  .rail-move-gains .recap-icon img { width: 17px; height: 17px; }
  .rail-move-gains .recap-icon b { min-width: 14px; height: 14px; font-size: 6px; }
  .moves-panel { min-height: 0; padding-bottom: 3px; }
}

@media (max-width: 760px) {
  .studio-shell { grid-template-columns: minmax(0, 1fr); }
  .common-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-main .player-head { grid-template-columns: minmax(0, 1fr); }
  .player-resources { justify-content: space-between; }
  .studio-main .cast-row { overflow-x: auto; grid-template-columns: repeat(6, 112px); }
  .studio-rail { grid-template-columns: minmax(0, 1fr); }
  .moves-panel { grid-column: auto; }
}

/* Livello ornamentale: usa esclusivamente illustrazioni già approvate e non occupa spazio. */
.rail-panel {
  isolation: isolate;
  border-color: #b1844b;
  box-shadow:
    inset 0 0 0 2px #100c10,
    inset 0 0 0 4px #c2934a24,
    inset 0 0 28px #0009,
    0 9px 17px #000b;
}
.rail-panel::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 34px 2px 2px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: .17;
  filter: saturate(.65) contrast(1.15);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 17%, #000 78%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 17%, #000 78%, transparent 100%);
}
.rail-panel::after {
  z-index: 4;
  border-color: #d1a15a54;
  background:
    linear-gradient(90deg, #d2a25c, #d2a25c) left top / 24px 2px no-repeat,
    linear-gradient(#d2a25c, #d2a25c) left top / 2px 24px no-repeat,
    linear-gradient(90deg, #d2a25c, #d2a25c) right top / 24px 2px no-repeat,
    linear-gradient(#d2a25c, #d2a25c) right top / 2px 24px no-repeat,
    linear-gradient(90deg, #d2a25c, #d2a25c) left bottom / 24px 2px no-repeat,
    linear-gradient(#d2a25c, #d2a25c) left bottom / 2px 24px no-repeat,
    linear-gradient(90deg, #d2a25c, #d2a25c) right bottom / 24px 2px no-repeat,
    linear-gradient(#d2a25c, #d2a25c) right bottom / 2px 24px no-repeat;
  box-shadow: inset 0 0 18px #d5a6530d;
}
.event-panel {
  background:
    radial-gradient(circle at 84% 76%, #28514745, transparent 42%),
    linear-gradient(145deg, #172522, #171218 72%);
}
.event-panel::before {
  background-image: url("/assets/zones/monster-lounge__board-v01.png");
  background-position: 60% 62%;
  background-size: 470px auto;
  opacity: .13;
}
.agencies-panel {
  background:
    radial-gradient(circle at 7% 70%, #32564655, transparent 42%),
    linear-gradient(145deg, #1a2824, #171218 75%);
}
.agencies-panel::before {
  background-image: url("/assets/zones/troupe-agency__board-v02.png");
  background-position: 18% 55%;
  background-size: 430px auto;
  opacity: .18;
}
.moves-panel {
  background:
    radial-gradient(circle at 86% 82%, #50372b4d, transparent 44%),
    linear-gradient(145deg, #261d1a, #151116 76%);
}
.moves-panel::before {
  background-image: url("/assets/zones/produzioni-attive__board-v01.png");
  background-position: 52% 58%;
  background-size: 420px auto;
  opacity: .15;
}
.rail-title {
  border-bottom-color: #c49350;
  background:
    radial-gradient(circle at 13px 50%, #d4a653 0 2px, transparent 3px),
    radial-gradient(circle at calc(100% - 13px) 50%, #d4a653 0 2px, transparent 3px),
    linear-gradient(90deg, #2c202d, #51364b 50%, #2c202d);
  box-shadow: inset 0 -1px #0e0b0e, inset 0 1px #e0b36129;
}
.rail-title > b { text-shadow: 0 2px 2px #000, 0 0 12px #d4a65333; }

.event-card-column {
  position: relative;
  padding: 4px 3px 6px;
  border: 1px solid #9e733f;
  border-radius: 8px 8px 12px 12px;
  background: linear-gradient(#251a21d9, #100d11e6);
  box-shadow: inset 0 0 0 2px #d4a65317, 0 5px 10px #0008;
}
.event-card-column::before,
.event-card-column::after {
  content: "✦";
  position: absolute;
  top: -6px;
  color: #d2a157;
  font-size: 8px;
  text-shadow: 0 2px 2px #000;
}
.event-card-column::before { left: -3px; }
.event-card-column::after { right: -3px; }
.event-rule-copy {
  border-color: #aa7f48;
  background:
    linear-gradient(135deg, #ffffff08, transparent 34%),
    linear-gradient(#181218eb, #0c0a0dec);
  box-shadow: inset 0 0 0 2px #d1a25612, inset 0 0 20px #0008, 0 5px 10px #0007;
}

.agency-plaque { isolation: isolate; overflow: hidden; }
.agency-plaque::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 46%, #0008 100%),
    url("/assets/zones/troupe-agency__board-v02.png") center 45% / 520px auto no-repeat;
  opacity: .17;
  filter: grayscale(.2) saturate(.8);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 66%);
  mask-image: linear-gradient(90deg, #000, transparent 66%);
}
.agency-plaque > * { position: relative; z-index: 1; }
.agency-plaque::after {
  content: "";
  position: absolute;
  z-index: 1;
  right: 6px;
  top: 6px;
  width: 13px;
  height: 13px;
  border: 1px solid color-mix(in srgb, var(--agency-color) 55%, #d2a25a);
  border-radius: 50%;
  background: radial-gradient(circle, #ead29a 0 18%, #735331 23% 42%, #171218 47%);
  box-shadow: 0 1px 3px #000;
  opacity: .72;
}

.rail-move {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--agency-color) 46%, #a57842);
  background:
    radial-gradient(circle at 4px 7px, #c79a561f 0 2px, transparent 2.5px) 0 0 / 8px 14px,
    linear-gradient(100deg, color-mix(in srgb, var(--agency-color) 14%, #171218), #0c0a0d);
  box-shadow: inset 4px 0 0 var(--agency-color), inset -1px 0 #d2a25a33, 0 4px 8px #0009;
}
.rail-move::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid #d1a15a1f;
  border-radius: 5px;
  pointer-events: none;
}

.studio-main > .player-board {
  position: relative;
  isolation: isolate;
  border-color: color-mix(in srgb, var(--agency-color) 70%, #d1a25c);
  box-shadow:
    inset 0 0 0 2px #0c0a0c,
    inset 0 0 0 4px color-mix(in srgb, var(--agency-color) 18%, #d1a25c),
    inset 0 0 30px #0007,
    0 10px 18px #000a;
}
.studio-main > .player-board::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 34%, #000a 77%),
    url("/assets/zones/troupe-agency__board-v02.png") left 46% / 720px auto no-repeat;
  opacity: .13;
  filter: saturate(.75) contrast(1.12);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 68%);
  mask-image: linear-gradient(90deg, #000, transparent 68%);
}
.studio-main > .player-board::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 5px;
  border: 1px solid color-mix(in srgb, var(--agency-color) 38%, #d2a15b);
  border-radius: 8px;
  background:
    radial-gradient(circle at 5px 5px, #d6ab65 0 2px, #34261d 2.5px 4px, transparent 4.5px),
    radial-gradient(circle at calc(100% - 5px) 5px, #d6ab65 0 2px, #34261d 2.5px 4px, transparent 4.5px),
    radial-gradient(circle at 5px calc(100% - 5px), #d6ab65 0 2px, #34261d 2.5px 4px, transparent 4.5px),
    radial-gradient(circle at calc(100% - 5px) calc(100% - 5px), #d6ab65 0 2px, #34261d 2.5px 4px, transparent 4.5px);
  pointer-events: none;
}
.studio-main > .player-board > * { position: relative; z-index: 1; }
.studio-main .player-head {
  border-bottom-color: color-mix(in srgb, var(--agency-color) 45%, #c99a54);
  background: linear-gradient(90deg, color-mix(in srgb, var(--agency-color) 18%, transparent), transparent 58%);
  box-shadow: inset 0 -1px #090709;
}
.studio-main .cast-slot.locked {
  background:
    linear-gradient(135deg, transparent 0 45%, #d1a05712 46% 48%, transparent 49%),
    repeating-linear-gradient(135deg, #392b3c 0 12px, #29212e 12px 24px);
  box-shadow: inset 0 0 0 1px #c794483d, inset 0 0 18px #0009, 0 5px 11px #0008;
}
.studio-main .cast-slot.empty {
  background:
    radial-gradient(circle at 50% 44%, color-mix(in srgb, var(--agency-color) 12%, transparent), transparent 35%),
    #d8c69f12;
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--agency-color) 8%, transparent), 0 5px 11px #0007;
}

/* Plancia Agenzia orizzontale: proporzioni della reference, sei slot canonici. */
.studio-main > .player-board {
  padding: 6px 8px 8px;
  border-radius: 10px;
}
.studio-main .player-head {
  min-height: 37px;
  grid-template-columns: minmax(210px, 1fr) auto;
  gap: 7px;
  padding: 0 6px 4px;
}
.studio-main .agency-nameplate {
  grid-template-columns: minmax(0, auto) auto;
  column-gap: 8px;
}
.studio-main .agency-nameplate small { font-size: 6px; }
.studio-main .agency-nameplate h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(16px, 2vw, 21px);
  font-weight: 800;
  letter-spacing: .035em;
  text-shadow: 0 2px 2px #000, 0 0 10px color-mix(in srgb, var(--agency-color) 32%, transparent);
}
.studio-main .board-turn { font-size: 6px; }
.studio-main .player-resources { gap: 4px; }
.studio-main .chaos-box {
  min-width: 92px;
  height: 31px;
  grid-template-columns: 25px auto;
  gap: 3px;
  padding: 2px 5px;
  border-radius: 5px;
  background: linear-gradient(#e8dbb8, #cdbc91);
}
.studio-main .chaos-box img { width: 24px; height: 24px; }
.studio-main .chaos-box small { font-size: 6px; }
.studio-main .chaos-box strong { font-size: 11px; }
.studio-main .chaos-pips { padding-top: 1px; }
.studio-main .chaos-pips i { height: 3px; }
.studio-main .stats { grid-template-columns: repeat(4, 39px); gap: 3px; }
.studio-main .stat {
  min-height: 31px;
  grid-template-columns: 23px 1fr;
  padding: 2px 3px;
  border-radius: 5px;
  background: linear-gradient(#eee1bf, #cfbc8e);
}
.studio-main .stat img { width: 23px; height: 23px; }
.studio-main .stat span { font-size: 15px; }
.studio-main .cast-row {
  grid-template-columns: repeat(6, clamp(74px, 8vw, 105px));
  justify-content: space-between;
  gap: 0;
  padding: 6px 0 0;
}
.studio-main .cast-slot {
  width: 100%;
  aspect-ratio: var(--cast-ratio);
  border-radius: 5px;
}
.studio-main .cast-state { left: 3px; right: 3px; bottom: 3px; padding: 1px; font-size: 5px; }
.studio-main .away-marker { gap: 4px; padding: 5px; }
.studio-main .away-marker small { font-size: 7px; }
.studio-main .away-marker b { font-size: clamp(9px, .9vw, 13px); }
.studio-main .away-marker span { font-size: 7px; }
.studio-main .cast-slot.locked,
.studio-main .cast-slot.empty { gap: 3px; }
.studio-main .cast-slot.locked b,
.studio-main .cast-slot.empty > span { font-size: 9px; }
.studio-main .cast-slot.locked > span { font-size: 8px; }
.studio-main .cast-slot.locked small,
.studio-main .cast-slot.empty small { font-size: 5px; }
.studio-main .padlock {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 1px solid #c89143;
  border-radius: 4px;
  background: #241a22;
  box-shadow: inset 0 0 0 1px #e1b55b24, 0 2px 4px #0008;
}
.studio-main .padlock img { width: 17px; height: 17px; object-fit: contain; filter: var(--icon-outline); }

@media (max-width: 760px) {
  .studio-main .cast-row { grid-template-columns: repeat(6, 74px); }
}

/* Ornamenti illustrati veri e palette Agenzia smaltata, non neon. */
.ui-ornament {
  position: absolute;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 5px 5px #000b);
}
.rail-panel > .ui-ornament { z-index: 2; }
.event-spotlight {
  width: 82px;
  right: -11px;
  bottom: -8px;
  rotate: -8deg;
  opacity: .68;
  filter: brightness(1.16) drop-shadow(0 5px 5px #000c);
}
.event-curtain {
  width: 76px;
  left: -10px;
  top: 23px;
  rotate: -3deg;
  opacity: .88;
  filter: brightness(1.1) saturate(.88) drop-shadow(0 5px 5px #000c);
}
.agencies-camera {
  width: 58px;
  left: -4px;
  top: 43px;
  rotate: -5deg;
  opacity: .7;
  filter: brightness(1.32) saturate(.82) drop-shadow(0 5px 5px #000c);
}
.agencies-castle {
  width: 52px;
  right: 4px;
  top: -7px;
  opacity: .72;
  filter: brightness(1.26) saturate(.78) drop-shadow(0 5px 5px #000c);
}
.moves-film {
  width: 92px;
  right: -18px;
  bottom: -51px;
  rotate: -9deg;
  opacity: .76;
  filter: brightness(1.22) saturate(.82) drop-shadow(0 5px 5px #000c);
}
.studio-main > .player-board > .ui-ornament {
  position: absolute;
  z-index: 0;
}
.board-castle {
  width: 126px;
  left: -10px;
  top: -34px;
  opacity: .62;
  filter: brightness(1.42) saturate(.74) drop-shadow(0 4px 5px #000d);
}
.board-film {
  width: 105px;
  left: 32%;
  top: -37px;
  rotate: -5deg;
  opacity: .35;
  filter: brightness(1.28) saturate(.76) drop-shadow(0 4px 5px #000d);
}
.board-corner {
  z-index: 3 !important;
  width: 56px;
  bottom: -5px;
  opacity: .96;
}
.board-corner-left { left: -4px; }
.board-corner-right { right: -4px; transform: scaleX(-1); }

.event-panel::before,
.agencies-panel::before,
.moves-panel::before,
.studio-main > .player-board::before { opacity: 0; }

.agency-plaque {
  border-color: color-mix(in srgb, var(--agency-color) 30%, #9a7348);
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--agency-color) 13%, #30252d), #181318 72%),
    #181318;
  box-shadow:
    inset 0 0 0 1px #d1a15a1f,
    inset 0 0 14px color-mix(in srgb, var(--agency-color) 6%, transparent),
    0 4px 9px #0009;
}
.agencies-panel .agency-list { padding-left: 30px; }
.agency-plaque::before { opacity: .035; }
.agency-plaque.active {
  border-color: color-mix(in srgb, var(--agency-color) 28%, #d2a35e);
  box-shadow:
    inset 0 0 0 2px #d7ae6766,
    inset 0 0 17px color-mix(in srgb, var(--agency-color) 8%, transparent),
    0 5px 10px #0009;
}
.agency-color-chip {
  background: color-mix(in srgb, var(--agency-color) 52%, #5a6157);
  box-shadow: inset 0 0 0 1px #efe0b944, 0 1px 3px #000b;
}
.agency-copy small { color: color-mix(in srgb, var(--agency-color) 24%, #c8b486); }
.agency-copy b { color: color-mix(in srgb, var(--agency-color) 20%, #e5c992); }
.agency-plaque em { color: color-mix(in srgb, var(--agency-color) 22%, #d6b36e); }

.studio-main > .player-board {
  border-color: color-mix(in srgb, var(--agency-color) 32%, #967148);
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--agency-color) 10%, #28302b), #171419 66%),
    #171419;
  box-shadow:
    inset 0 0 0 2px #0c0a0c,
    inset 0 0 0 4px #c8954c20,
    inset 0 0 26px #0008,
    0 9px 16px #000a;
}
.studio-main > .player-board::after {
  border-color: color-mix(in srgb, var(--agency-color) 18%, #a9804b);
}
.studio-main .player-head {
  border-bottom-color: color-mix(in srgb, var(--agency-color) 19%, #b4884f);
  background: linear-gradient(90deg, color-mix(in srgb, var(--agency-color) 7%, #33272f), transparent 62%);
}
.studio-main .agency-nameplate h2 {
  color: color-mix(in srgb, var(--agency-color) 26%, #e2c58f);
  text-shadow: 0 2px 2px #000, 0 0 8px #0007;
}
.studio-main .board-turn.active { color: color-mix(in srgb, var(--agency-color) 25%, #e1c58e); }
.studio-main .board-turn i {
  background: color-mix(in srgb, var(--agency-color) 48%, #6f745f);
  box-shadow: 0 1px 2px #000a;
}
.studio-main .stat {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--agency-color) 18%, #9c7547), 0 2px 4px #0008;
}

/* Colori Agenzia come smalto scuro, non come luce al neon. */
.agency-plaque {
  border-color: color-mix(in srgb, var(--agency-color) 10%, #806344);
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--agency-color) 6%, #282127), #151216 74%),
    #151216;
  box-shadow: inset 0 0 0 1px #d0a45a18, inset 0 0 13px #0006, 0 4px 9px #0009;
}
.agency-plaque.active {
  border-color: color-mix(in srgb, var(--agency-color) 12%, #b18a50);
  box-shadow: inset 0 0 0 2px #caa25b42, inset 5px 0 0 color-mix(in srgb, var(--agency-color) 28%, #625a4b), 0 5px 10px #0009;
}
.agency-color-chip {
  background: color-mix(in srgb, var(--agency-color) 28%, #55564f);
  box-shadow: inset 0 0 0 1px #efe0b932, 0 1px 3px #000b;
}
.agency-copy small,
.agency-copy b,
.agency-plaque em { color: #d8bf8d; }

.studio-main > .player-board {
  border-color: color-mix(in srgb, var(--agency-color) 9%, #8a6944);
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--agency-color) 5%, #242422), #151316 68%),
    #151316;
  box-shadow: inset 0 0 0 2px #0c0a0c, inset 0 0 0 4px #b98c4920, inset 0 0 26px #0009, 0 9px 16px #000a;
}
.studio-main > .player-board::after { border-color: #9a764848; }
.studio-main .player-head {
  border-bottom-color: #98734566;
  background: linear-gradient(90deg, color-mix(in srgb, var(--agency-color) 4%, #2c252a), transparent 62%);
}
.studio-main .agency-nameplate small { color: #bca77e; }
.studio-main .agency-nameplate h2 {
  color: color-mix(in srgb, var(--agency-color) 10%, #dfc58f);
  text-shadow: 0 2px 2px #000;
}
.studio-main .board-turn.active { color: #d4ba85; }
.studio-main .board-turn i {
  background: color-mix(in srgb, var(--agency-color) 25%, #686a5e);
  box-shadow: 0 1px 2px #000a;
}
.studio-main .stat { box-shadow: inset 0 0 0 1px #98704466, 0 2px 4px #0008; }
.rail-move {
  border-color: color-mix(in srgb, var(--agency-color) 8%, #806244);
  background: radial-gradient(circle at 4px 7px, #c79a5617 0 2px, transparent 2.5px) 0 0 / 8px 14px, linear-gradient(100deg, color-mix(in srgb, var(--agency-color) 5%, #171218), #0c0a0d);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--agency-color) 24%, #695d49), inset -1px 0 #d2a25a24, 0 4px 8px #0009;
}

/* Correzione UI: nessun ornamento sopra elementi di gioco. Restano solo gli angolari inferiori. */
.ui-ornament:not(.board-corner) { display: none; }
.agencies-panel .agency-list { padding-left: 11px; }
.agency-plaque::before { display: none; }

/* Fascia diagonale fisicamente sopra la prima coppia di premi. */
.hot-ribbon {
  z-index: 12;
  top: 21px;
  left: -18px;
  width: 100px;
  box-sizing: border-box;
  padding: 3px 0;
  transform: rotate(-40deg);
  border: 0;
  border-radius: 0;
  background: #a9443cf5;
  color: #fff0ca;
  font-size: 8px;
  line-height: 1;
  letter-spacing: .09em;
  box-shadow: 0 2px 4px #000b;
  pointer-events: none;
}

/* Le risorse sfruttano lo spazio libero dell'intestazione senza cambiare i sei slot Cast. */
.studio-main .player-resources { gap: 4px; }
.studio-main .chaos-box {
  min-width: 104px;
  height: 36px;
  grid-template-columns: 29px auto;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 6px;
}
.studio-main .chaos-box img { width: 27px; height: 27px; }
.studio-main .chaos-box small { font-size: 7px; }
.studio-main .chaos-box strong { font-size: 13px; }
.studio-main .chaos-pips { gap: 2px; padding-top: 2px; }
.studio-main .chaos-pips i { height: 3px; }
.studio-main .stats { grid-template-columns: repeat(4, 50px); gap: 4px; }
.studio-main .stat {
  min-height: 36px;
  grid-template-columns: 27px minmax(18px, 1fr);
  gap: 1px;
  padding: 3px 2px;
  border-radius: 6px;
}
.studio-main .stat img { width: 27px; height: 27px; }
.studio-main .stat span { min-width: 18px; font-size: 16px; text-align: center; }

/* Alloggi Cast più sobri: stessa misura e stesso rapporto delle carte, niente mattonelle viola. */
.studio-main .cast-slot.away,
.studio-main .cast-slot.locked,
.studio-main .cast-slot.empty {
  border: 1px solid #6f573c;
  border-radius: 5px;
  background: linear-gradient(180deg, #242027, #151318 78%);
  box-shadow: inset 0 0 0 2px #0c0a0d, inset 0 0 16px #0008, 0 4px 8px #0008;
}
.studio-main .cast-slot.empty {
  border-style: dashed;
  background: radial-gradient(circle at 50% 42%, #b89a6520, transparent 34%), #17151a;
}
.studio-main .cast-slot.locked b,
.studio-main .cast-slot.locked > span,
.studio-main .cast-slot.empty > span { color: #d6b777; }
.studio-main .cast-slot.locked small,
.studio-main .cast-slot.empty small { color: #887b68; }
.studio-main .padlock {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.studio-main .padlock img { width: 20px; height: 20px; }

/* Tipografia da locandina: titoli incisi e regole più editoriali. */
.rail-title,
.agency-copy b,
.agency-nameplate h2,
.event-card-column > b,
.away-marker b,
.studio-main .cast-slot.locked b,
.studio-main .cast-slot.empty > span {
  font-family: var(--font-poster);
}
.rail-title {
  font-weight: 700;
  letter-spacing: .085em;
}
.agency-copy b {
  font-size: clamp(14px, 1.4vw, 17px);
  font-weight: 700;
  letter-spacing: .035em;
}
.event-rule-copy .event-effect b,
.event-rule-copy > div > b {
  font-family: var(--font-story);
  color: #efd9aa;
  font-size: clamp(12px, 1.25vw, 14px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .01em;
}
.event-card-column > small,
.event-rule-copy > small,
.agency-copy small,
.agency-plaque em,
.rail-destination small,
.studio-main .cast-slot small {
  font-family: var(--font-poster);
  font-variant: small-caps;
  letter-spacing: .1em;
}

/* Innesti funzionali local-4p: stessi materiali e gerarchie del checkpoint. */
.seed-control { width: auto; min-width: 0; padding: 2px 6px; border: 1px solid #80623f; border-radius: 5px; background: #171419; color: #d8bd86; font: 800 7px var(--font-poster); white-space: nowrap; cursor: pointer; }
.seed-control:hover { border-color: #c89a55; }
.agency-badges { grid-column: 3; display: grid; justify-items: end; gap: 3px; }
.agency-badges em { grid-column: auto; }
.agency-badges .first { color: #e0be78; }
.first-player-mark { display: inline-block; margin-left: 7px; color: #d2ad66; font: 850 6px var(--font-poster); letter-spacing: .08em; }
.remove-strike-button { position: absolute; z-index: 6; left: 4px; right: 4px; bottom: 19px; min-height: 21px; display: flex; align-items: center; justify-content: center; gap: 3px; border: 1px solid #bf9654; border-radius: 4px; background: #21191ee8; color: #e2c589; font: 850 6px var(--font-poster); cursor: pointer; }
.remove-strike-button img { width: 15px; height: 15px; object-fit: contain; }
.token-target span { min-height: 16px; padding: 3px 5px; border-radius: 4px; color: #a9c997; font: 850 7px var(--font-poster); letter-spacing: .03em; }
.token-target.unavailable { opacity: .48; filter: saturate(.45); }
.token-target.unavailable span { background: #3a2226; color: #e5ad9d; }
.strike-recovery-backdrop { z-index: 80; }
.strike-recovery-card { width: min(650px, 92vw); }
.strike-recovery-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.strike-recovery-options > button { min-width: 0; display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 12px; padding: 9px; border: 2px solid #8c633f; border-radius: 11px; background: #171318; color: #efd59e; text-align: left; cursor: pointer; }
.strike-recovery-options > button:hover { border-color: #d7a64f; box-shadow: 0 0 18px #d7a64f55; }
.strike-recovery-options > button > img { width: 72px; aspect-ratio: 1000/1590; object-fit: contain; }
.strike-recovery-options span { display: grid; gap: 8px; }
.strike-recovery-options small { display: flex; align-items: center; gap: 5px; color: #d9bd83; font: 850 8px var(--font-poster); }
.strike-recovery-options small img { width: 21px; height: 21px; object-fit: contain; }
.strike-skip { margin-left: 0; }
.strike-no-hype { padding: 12px; border: 1px solid #745044; border-radius: 8px; background: #26181b; color: #e0b5a3; font: 800 10px var(--font-poster); }
.skip-strike-button { margin-left: 8px; padding: 3px 7px; border: 1px solid #765c40; border-radius: 4px; background: #1a1519; color: #cdb27e; font: 800 6px var(--font-poster); cursor: pointer; }

.pass-device-backdrop { z-index: 55; }
.pass-device-card { border-color: color-mix(in srgb, var(--agency-color) 45%, #c99a4e); }
.sync-notice {
  position: fixed;
  z-index: 120;
  top: 12px;
  left: 50%;
  width: max-content;
  max-width: min(620px, calc(100vw - 24px));
  padding: 9px 14px;
  border: 1px solid #5ba477;
  border-radius: 8px;
  background: #15251def;
  box-shadow: 0 6px 24px #000b, inset 0 0 0 1px #9fd3ac22;
  color: #d8edda;
  font: 800 10px var(--font-poster);
  letter-spacing: .035em;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.bot-turn-notice, .remote-turn-notice {
  position: fixed;
  z-index: 25;
  left: 50%;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #c99748;
  border-radius: 999px;
  background: #171116e8;
  color: #ead09b;
  box-shadow: 0 8px 24px #000a;
  translate: -50% 0;
  pointer-events: none;
}
.bot-turn-notice i, .remote-turn-notice i { width: 8px; height: 8px; border-radius: 50%; background: #62cf8e; box-shadow: 0 0 8px #62cf8e; animation: bot-turn-pulse .85s ease-in-out infinite alternate; }
.bot-turn-notice b, .remote-turn-notice b { font: 900 11px var(--font-poster); }
.bot-turn-notice span, .remote-turn-notice span { color: #9b896c; font: 800 8px var(--font-poster); letter-spacing: .12em; }
.remote-turn-notice { border-color: #6b87bd; }
.remote-turn-notice i { background: #6ca2ef; box-shadow: 0 0 8px #6ca2ef; }
@keyframes bot-turn-pulse { to { opacity: .35; scale: .75; } }
.choice-card p { margin: 0 auto 14px; max-width: 620px; color: #bcae96; font-size: 12px; line-height: 1.4; }
.bet-progress { display: flex; justify-content: center; gap: 8px; margin: 12px 0; }
.bet-progress i { width: 14px; height: 14px; border: 1px solid #6b5844; border-radius: 50%; background: #171318; }
.bet-progress i.committed { background: #a57d42; box-shadow: inset 0 0 0 3px #21191d; }
.bet-progress i.current { border-color: var(--agency-color); box-shadow: inset 0 0 0 3px #21191d; background: color-mix(in srgb, var(--agency-color) 55%, #9a7441); }
.hype-bet-input { width: min(300px, 90%); display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 8px; margin: 8px auto; padding: 8px 12px; border: 1px solid #745c42; border-radius: 10px; background: #171318; color: #d8bd89; }
.hype-bet-input img { width: 48px; height: 48px; object-fit: contain; }
.hype-bet-input input { min-width: 0; padding: 7px; border: 1px solid #8d6d44; border-radius: 6px; background: #eee0be; color: #21171b; font: 900 24px var(--font-poster); text-align: center; }
.event-bet-formula { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px auto 2px; }
.event-bet-formula > span { min-width: 78px; display: grid; gap: 2px; padding: 7px 10px; border: 1px solid #705a42; border-radius: 8px; background: #171318; }
.event-bet-formula > span.total { border-color: #4f936b; background: #173023; }
.event-bet-formula small { color: #9f907a; font: 750 7px var(--font-poster); letter-spacing: .09em; }
.event-bet-formula b { color: #efd39b; font: 800 21px var(--font-poster); }
.event-bet-formula > i { color: #b6955e; font: normal 800 18px var(--font-poster); }
.salary-grid { grid-template-columns: repeat(auto-fit, minmax(135px, 175px)); }
.salary-cast span { display: flex; align-items: center; justify-content: center; gap: 4px; color: #e0bd72; font-weight: 900; }
.salary-cast span img { width: 22px; height: 22px; object-fit: contain; }

.setup-backdrop { z-index: 80; }
.entry-choice-backdrop { z-index: 85; }
.entry-choice-card { width: min(510px, 92vw); }
.entry-choice-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.entry-choice-actions button { min-height: 52px; }
.setup-card { position: relative; width: min(620px, 92vw); }
.setup-card .close { top: 10px; right: 12px; }
.setup-names input { min-width: 0; padding: 8px 10px; border: 1px solid #725a40; border-radius: 6px; background: #eee0be; color: #21171b; font: 800 13px Georgia, serif; }
.setup-names { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.setup-names label { display: grid; grid-template-columns: 7px 76px 1fr; align-items: center; gap: 7px; color: #cdb990; font-size: 10px; text-align: left; }
.setup-names label i { width: 7px; height: 100%; min-height: 34px; border-radius: 5px; background: var(--agency-color); }
.setup-names .bot-seat span { min-height: 34px; display: flex; align-items: center; padding: 8px 10px; border: 1px solid #55483c; border-radius: 6px; background: #1b151a; color: #a99d8b; font-weight: 850; }

.year-summary-backdrop { z-index: 50; }
.year-summary-card { width: min(720px, 92vw); }
.event-ranking-mini { display: grid; gap: 5px; margin: 8px 0 14px; }
.event-ranking-mini div { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 6px 9px; border: 1px solid #614d38; border-radius: 6px; background: #181419; text-align: left; }
.event-ranking-mini b { color: #ddb869; }
.event-ranking-mini span { color: #ead4a6; }
.event-ranking-mini em { color: #aebc9c; font-size: 10px; font-style: normal; }
.new-year-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.new-year-facts span { display: grid; gap: 3px; padding: 8px; border: 1px solid #69523a; border-radius: 6px; background: #211920; color: #e1c690; font-size: 11px; }
.new-year-facts b { color: #9d8968; font-size: 7px; letter-spacing: .1em; }

.final-backdrop { z-index: 65; background: #080609ee; }
.final-card { width: min(780px, 94vw); }
.final-ranking { display: grid; gap: 7px; }
.final-ranking article { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid color-mix(in srgb, var(--agency-color) 24%, #765a3d); border-radius: 8px; background: linear-gradient(90deg, color-mix(in srgb, var(--agency-color) 8%, #211920), #171318); text-align: left; }
.final-ranking article.winner { border-color: color-mix(in srgb, var(--agency-color) 35%, #d0a45c); box-shadow: inset 5px 0 0 color-mix(in srgb, var(--agency-color) 45%, #8b764f); }
.final-ranking article > b { color: #d8b56d; font: 500 24px var(--font-poster); }
.final-ranking article span { display: grid; gap: 2px; }
.final-ranking strong { color: #ead09b; font-family: var(--font-poster); letter-spacing: .04em; }
.final-ranking small { color: #a99c87; }
.final-ranking em { color: #e3c174; font: 500 18px var(--font-poster); font-style: normal; }
.final-room-return { display:flex; align-items:center; justify-content:center; text-decoration:none; }


@media (max-width: 980px) {
  /* Il checkpoint di riferimento e' 946x698: niente barra verticale. */
  #game { min-height: 0; padding: 4px 10px 0; }
  .choice-card { max-height: 94vh; padding: 18px; }
  .final-ranking article { padding: 7px 9px; }
}
