/* Money Clash interface styles */
@font-face { font-family: 'Troika'; src: url('../fonts/troika.woff') format('woff'); font-style: normal; font-weight: 400 1000; font-display: swap; }
:root {
  --bg: #376b70; --panel: #477b72; --panel-2: #568b7e; --line: #79aa9e;
  --ink: #f8fff9; --muted: #c4ddd5; --lime: #caff7d; --gold: #ffe083;
  --red: #ff8178; --blue: #8fc1ff; --purple: #d7adff; --shadow: #173d3b;
  --action-economy: #66d17a; --action-attack: #ff6d69; --action-defense: #67aef7;
  --action-movement: #b789f4; --action-politics: #f0c94d; --action-trap: #242725;
  --display-font: 'Troika', 'Arial Rounded MT Bold', ui-rounded, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 18% 18%, #fff7c855, transparent 30%), radial-gradient(circle at 82% 25%, #cceaff55, transparent 34%), linear-gradient(135deg, #628ba9, #74b89a 52%, #716bd1); font-family: Inter, ui-rounded, system-ui, sans-serif; }
button { font: inherit; }
[v-cloak] { display: none; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.app { width: min(1100px, 100%); height: 100vh; margin: auto; padding: 14px 18px; overflow: hidden; }
.layout { height: calc(100vh - 28px); display: grid; place-items: start center; }

.board-wrap { width: 100%; min-width: 0; min-height: 0; display: grid; place-items: start center; }
.board-stage { position: relative; width: min(calc(100% - 350px), calc(100vh - 28px)); }
.board { width: 100%; display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(6, 1fr); aspect-ratio: 1; overflow: hidden; border: 3px solid #8fc0b4; border-radius: 18px; background: #3f7169; box-shadow: 0 24px 70px #173d3b70; }
.space { position: relative; min-width: 0; display: grid; place-items: center; padding: 18px 6px 6px; border: 1px solid var(--line); background: #4b7d73; transition: filter .18s, opacity .18s, background .2s, box-shadow .2s; }
.space::before { content: ''; position: absolute; z-index: 0; inset: 0; pointer-events: none; background: linear-gradient(145deg, color-mix(in srgb, var(--district-color) 34%, transparent), transparent 65%); }
.space > * { z-index: 1; }
.space.owned { color: white; }
.space.owned .slot-name, .space.owned .slot-no { z-index: 3; padding: 3px 5px; border-radius: 5px; color: white; background: #06100db8; text-shadow: 0 1px 3px #000b; }
.space.shortcut { background: repeating-linear-gradient(135deg, #628f82, #628f82 8px, #4d786d 8px, #4d786d 16px); }
.space.current { z-index: 2; box-shadow: inset 0 0 0 2px var(--lime); }
.space.controlled { box-shadow: inset 0 0 0 3px var(--gold), 0 0 16px color-mix(in srgb, var(--district-color) 60%, transparent); }
.mood-pop { position: absolute; z-index: 9; top: 5px; right: 5px; font-size: clamp(1.1rem, 2.4vw, 1.7rem); filter: drop-shadow(0 3px 4px #000); animation: mood-pop .45s cubic-bezier(.2,1.5,.4,1); }
.board.tracking .space:not(.current) { filter: brightness(.34) saturate(.45); }
.board.tracking .center { filter: brightness(.65); }
.board.tracking .space.current { filter: brightness(1.3) saturate(1.2); box-shadow: inset 0 0 0 4px var(--lime), 0 0 28px var(--lime); }
.board.tracking .space.current::after { content: ''; position: absolute; z-index: 5; inset: 5px; border: 3px solid white; border-radius: 10px; pointer-events: none; animation: track-pulse .55s ease-out infinite; }
@keyframes track-pulse { from { transform: scale(.78); opacity: 1; } to { transform: scale(1.08); opacity: 0; } }
.slot-no { position: absolute; top: 5px; left: 7px; color: #6f847e; font-size: .65rem; font-weight: 900; }
.shortcut-mark { color: #dce8e3; font-size: clamp(1.2rem, 3vw, 2rem); font-weight: 1000; text-shadow: 0 3px 8px #000; }
.group-progress { position: absolute; right: 5px; bottom: 5px; left: 5px; display: flex; justify-content: center; gap: 3px; }
.group-progress i { width: 7px; height: 4px; border-radius: 99px; background: #ffffff35; }
.group-progress i.filled { background: var(--gold); box-shadow: 0 0 5px var(--gold); }
.owner-bar { position: absolute; inset: auto 0 0; height: 5px; }
.tokens { position: absolute; inset: 23% 8% 14%; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 3px; }
.token { position: relative; width: clamp(20px, 2.5vw, 31px); aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border: 2px solid #07100d; border-radius: 50%; color: #07100d; font-size: clamp(.65rem, 1.4vw, .9rem); font-weight: 1000; box-shadow: 0 3px 0 #0007; transform-origin: center bottom; transition: opacity .25s, filter .25s; will-change: transform; }
.token.active-token { z-index: 8; border-color: white; filter: brightness(1.35) drop-shadow(0 0 9px var(--lime)); animation: active-token-pulse .8s ease-in-out infinite alternate; }
@keyframes active-token-pulse { from { transform: scale(1); } to { transform: scale(1.24) translateY(-3px); } }

.corner-player { position: absolute; z-index: 8; width: 166px; display: grid; grid-template-columns: 44px 1fr; align-items: start; gap: 9px; min-width: 0; padding: 9px; overflow: visible; border: 1px solid #d9fff04a; border-left: 5px solid var(--player-color); border-radius: 9px; background-color: #173d39; background-position: center; background-size: cover; color: white; box-shadow: 0 7px 20px #173d3b80; }
.corner-player.corner-0 { top: 4px; right: calc(100% + 12px); }
.corner-player.corner-1 { top: 4px; left: calc(100% + 12px); }
.corner-player.corner-2 { right: calc(100% + 12px); bottom: 4px; }
.corner-player.corner-3 { left: calc(100% + 12px); bottom: 4px; }
.corner-player:not(.active):not(.broke):not(.leader) { opacity: .52; transform: scale(.95); }
.corner-player.leader { z-index: 13; opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 2px #f3c96940, 0 0 28px #f3c96955, 0 7px 20px #000b; }
.corner-avatar-wrap { position: relative; width: 44px; }
.leader-crown { position: absolute; z-index: 20; top: -17px; left: 50%; font-size: 1.65rem; line-height: 1; pointer-events: none; filter: drop-shadow(0 4px 3px #000b) drop-shadow(0 0 8px #f3c969); transform: translateX(-50%); animation: crown-arrive .7s cubic-bezier(.18,1.65,.35,1), crown-float 1s .7s ease-in-out infinite alternate; }
@keyframes crown-arrive { 0% { transform: translate(40px, -35px) rotate(25deg) scale(.2); opacity: 0; } 65% { transform: translate(-55%, 3px) rotate(-9deg) scale(1.25); opacity: 1; } 100% { transform: translateX(-50%); } }
@keyframes crown-float { to { transform: translate(-50%, -4px) rotate(4deg); filter: drop-shadow(0 7px 4px #000b) drop-shadow(0 0 13px #f3c969); } }
.corner-player.active { z-index: 12; outline: 3px solid white; border-color: var(--player-color); transform: scale(1.08); filter: brightness(1.25); box-shadow: 0 0 0 5px color-mix(in srgb, var(--player-color) 32%, transparent), 0 0 34px var(--player-color), 0 10px 24px #000d; animation: active-player-pulse 1s ease-in-out infinite alternate; }
.corner-player.active::before { content: ''; position: absolute; z-index: -1; inset: -4px; border: 4px solid var(--player-color); border-radius: 14px; pointer-events: none; animation: turn-ripple 1.05s ease-out 2; }
.corner-player.active::after { content: 'PLAYING'; position: absolute; top: -11px; right: 8px; padding: 3px 7px; border-radius: 99px; color: #07100d; background: var(--lime); font-size: .48rem; font-weight: 1000; letter-spacing: .1em; box-shadow: 0 2px 7px #0009; }
@keyframes active-player-pulse { from { box-shadow: 0 0 0 3px color-mix(in srgb, var(--player-color) 25%, transparent), 0 0 18px var(--player-color), 0 10px 24px #000d; } to { box-shadow: 0 0 0 7px color-mix(in srgb, var(--player-color) 35%, transparent), 0 0 42px var(--player-color), 0 10px 24px #000d; } }
@keyframes turn-ripple { 0% { inset: -2px; opacity: 1; } 100% { inset: -34px; border-width: 1px; opacity: 0; } }
.corner-player.active .corner-avatar { animation: turn-avatar-jump .82s cubic-bezier(.18,1.55,.35,1); }
@keyframes turn-avatar-jump { 0% { transform: none; } 32% { transform: translateY(-20px) scale(1.24) rotate(-5deg); filter: brightness(1.45); } 58% { transform: translateY(3px) scale(.94) rotate(3deg); } 78% { transform: translateY(-7px) scale(1.08); } 100% { transform: none; } }
.corner-player.earning { z-index: 15; opacity: 1 !important; filter: brightness(1.5) !important; animation: earning-profile .42s ease-in-out infinite alternate !important; }
@keyframes earning-profile { from { transform: scale(1.08); box-shadow: 0 0 22px var(--player-color); } to { transform: scale(1.18); box-shadow: 0 0 55px var(--player-color), 0 0 0 7px #f3c96966; } }
.corner-player.payment-due { z-index: 14; opacity: 1 !important; outline: 3px solid var(--red); animation: payment-due .55s ease-in-out infinite alternate !important; }
@keyframes payment-due { to { transform: scale(1.1); box-shadow: 0 0 38px var(--red); } }
.corner-player.waiting-receiver { opacity: 1 !important; outline: 2px dashed var(--gold); }
.corner-player.broke { filter: grayscale(1); opacity: .5; }
.reaction-bubble { position: absolute; z-index: 24; top: -68px; right: 7px; min-width: 62px; padding: 10px 13px; border: 3px solid #17201d; border-radius: 20px; color: #101816; background: white; font-size: 2.2rem; line-height: 1; text-align: center; filter: drop-shadow(0 8px 9px #000b); animation: reaction-pop .5s cubic-bezier(.18,1.6,.35,1), reaction-float .7s .5s ease-in-out infinite alternate; }
.reaction-bubble::after { content: ''; position: absolute; right: 15px; bottom: -10px; width: 16px; height: 16px; border-right: 3px solid #17201d; border-bottom: 3px solid #17201d; background: white; transform: rotate(45deg); }
.corner-player.corner-0 .reaction-bubble, .corner-player.corner-1 .reaction-bubble { top: calc(100% + 12px); bottom: auto; }
.corner-player.corner-0 .reaction-bubble::after, .corner-player.corner-1 .reaction-bubble::after { top: -10px; bottom: auto; border: 0; border-top: 3px solid #17201d; border-left: 3px solid #17201d; }
@keyframes reaction-pop { from { transform: translateY(18px) scale(.2) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes reaction-float { to { transform: translateY(-4px) rotate(3deg); } }
.corner-avatar { position: relative; width: 44px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--player-color); color: #08110e; font-size: 1.4rem; font-weight: 1000; }
.corner-avatar img, .token img, .transaction-avatar img, .story-icon img, .win-icon img, .slot-class-image { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: cover; }
.image-fallback { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; }
.corner-name, .corner-cash { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.corner-name { font-family: var(--display-font); font-size: clamp(.55rem, 1vw, .68rem); font-weight: 1000; text-shadow: 0 2px 4px #000, 0 0 7px #000; }
.corner-cash { margin-top: 1px; color: var(--gold); font-family: var(--display-font); font-size: clamp(.9rem, 1.5vw, 1.08rem); font-weight: 1000; line-height: 1; text-shadow: 0 2px 4px #000, 0 0 8px #000; }
.wealth-chart { width: 100%; height: 16px; display: block; margin-top: 4px; overflow: visible; color: var(--player-color); opacity: .9; }
.wealth-chart .wealth-guide { stroke: #ffffff1c; stroke-width: 1; }
.wealth-chart .wealth-line { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 3px currentColor); }
.wealth-chart .wealth-dot { fill: var(--gold); stroke: #07100d; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.reaction-dock { position: absolute; z-index: 30; top: 228px; right: calc(100% + 12px); width: 166px; padding: 8px; border: 1px solid #d9fff04a; border-radius: 12px; background: #376861f2; box-shadow: 0 8px 22px #173d3b80; }
.reaction-dock::before { content: 'REACT'; display: block; margin-bottom: 6px; color: #91a39d; font-size: .5rem; font-weight: 1000; letter-spacing: .16em; text-align: center; }
.reaction-buttons { display: flex; justify-content: center; gap: 6px; }
.reaction-btn { width: 38px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid #ffffff5c; border-radius: 9px; background: #ffffff20; font-size: 1.35rem; cursor: pointer; box-shadow: 0 3px 0 #214b4780; transition: transform .16s, border-color .16s, background .16s; }
.reaction-btn:hover { border-color: var(--gold); background: #f3c96924; transform: translateY(-2px); }
.cash-pile { grid-column: 1 / -1; min-height: 30px; display: flex; flex-wrap: wrap; align-content: center; align-items: center; gap: 0; margin-top: 1px; padding-left: 2px; line-height: 1; }
.cash-coin { position: relative; width: 32px; height: 32px; margin-right: -23px; margin-bottom: -4px; object-fit: contain; filter: drop-shadow(0 2px 2px #000); transform: none; }

.board.landing-impact { animation: board-impact .38s ease-out; }
@keyframes board-impact { 0%,100% { transform: none; } 20% { transform: translateX(-5px) rotate(-.25deg); } 45% { transform: translateX(5px) rotate(.25deg); } 70% { transform: translateX(-2px); } }
.space.impact { z-index: 10; filter: brightness(1.45); box-shadow: inset 0 0 0 4px var(--impact-color), 0 0 42px var(--impact-color); }
.space.impact .slot-icon { animation: impact-icon .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes impact-icon { from { transform: scale(.35) rotate(-18deg); } to { transform: scale(1.35) rotate(4deg); } }
.impact-wave, .build-wave { position: absolute; z-index: 11; inset: 50%; border: 4px solid var(--wave-color); border-radius: 50%; pointer-events: none; animation: wave-out 1.5s ease-out forwards; }
.impact-wave.second, .build-wave.second { animation-delay: .28s; }
.build-wave.third { animation-delay: .56s; }
@keyframes wave-out { from { inset: 48%; opacity: 1; } to { inset: -55%; opacity: 0; } }
.space.building { z-index: 10; box-shadow: inset 0 0 0 4px var(--wave-color), 0 0 48px var(--wave-color); animation: build-pop .7s cubic-bezier(.2,1.4,.4,1); }
@keyframes build-pop { from { transform: scale(.72); filter: brightness(2); } to { transform: none; } }
.build-label { position: absolute; z-index: 13; left: 50%; top: 50%; padding: 5px 8px; border-radius: 99px; color: #07100d; background: var(--wave-color); font-size: .58rem; font-weight: 1000; letter-spacing: .1em; transform: translate(-50%, -50%); animation: build-label 1.8s ease-out forwards; }
@keyframes build-label { 0% { transform: translate(-50%, -30%) scale(.4); opacity: 0; } 20%,65% { transform: translate(-50%, -70%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -130%) scale(.8); opacity: 0; } }

.center { position: relative; isolation: isolate; grid-column: 2/6; grid-row: 2/6; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; padding: clamp(13px, 2.2vw, 25px); background: radial-gradient(circle, #315f59, #173f44 74%); background-position: center; background-size: cover; transition: filter .2s, background .35s ease; box-shadow: inset 0 0 70px #071c2090; }
.center > * { position: relative; z-index: 1; }
.center.has-place { animation: center-place-reveal .65s ease-out; }
@keyframes center-place-reveal { from { filter: brightness(1.55); background-size: 118%; } to { filter: none; background-size: 100%; } }
.turn-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.turn-player { min-width: 0; display: flex; align-items: center; gap: 10px; }
.turn-avatar { position: relative; width: clamp(34px, 4.5vw, 48px); aspect-ratio: 1; display: grid; flex: 0 0 auto; place-items: center; overflow: hidden; border: 3px solid white; border-radius: 50%; background: var(--turn-color); font-size: 1.25rem; box-shadow: 0 0 18px var(--turn-color), 0 4px 10px #0009; }
.turn-avatar img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: cover; }
.turn-head h2 { margin: 0; font-family: var(--display-font); font-size: clamp(1.1rem, 2.5vw, 2rem); }
.turn-tools { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.turn-countdown { min-width: 58px; padding: 7px 9px; border: 1px solid #d9fff05c; border-radius: 8px; color: white; background: #092b2dc7; font-size: .78rem; font-weight: 1000; font-variant-numeric: tabular-nums; letter-spacing: .05em; box-shadow: inset 0 0 12px #0005; }
.leave-game { padding: 7px 10px; border: 1px solid #ffb4ae; border-radius: 8px; color: white; background: #a83f3b; font-size: .64rem; font-weight: 1000; cursor: pointer; box-shadow: 0 3px 0 #5c201e; transition: transform .16s, filter .16s; }
.leave-game:hover { filter: brightness(1.15); transform: translateY(-1px); }
.music-toggle { width: 32px; height: 30px; padding: 0; border: 1px solid #d9fff05c; border-radius: 8px; color: white; background: #092b2dc7; cursor: pointer; }
.round-tag { color: var(--gold); font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.timer { position: relative; height: 7px; margin: 9px 0 10px; overflow: hidden; border-radius: 10px; background: #214d4a70; }
.timer > i { position: absolute; inset: 0 auto 0 0; background: var(--lime); transition: width .25s linear; }
.action-legend { display: flex; justify-content: center; gap: 4px; margin: -4px 0 5px; }
.action-legend span { --action-color: #999; min-width: 28px; padding: 2px 5px; border: 1px solid var(--action-color); border-radius: 99px; color: white; background: color-mix(in srgb, var(--action-color) 30%, #102a28); font-size: .58rem; text-align: center; }
.action-legend b { font-weight: 400; }
.action-legend i { display: none; }
.action--economy { --action-color: var(--action-economy); }
.action--attack { --action-color: var(--action-attack); }
.action--defense { --action-color: var(--action-defense); }
.action--movement { --action-color: var(--action-movement); }
.action--politics { --action-color: var(--action-politics); }
.action--trap { --action-color: #111; }
.center-main { flex: 1; min-height: 0; display: grid; place-items: center; text-align: center; }
.center-main > div { width: 100%; min-height: 0; }
.dice { display: flex; justify-content: center; gap: 24px; margin: 12px 0 18px; perspective: 700px; }
.die-shell { --die-size: clamp(50px, 6vw, 68px); position: relative; width: var(--die-size); height: var(--die-size); filter: drop-shadow(0 12px 7px #0009); }
.die-shell::after { content: ''; position: absolute; z-index: -1; right: 4px; bottom: -15px; left: 4px; height: 12px; border-radius: 50%; background: #0009; filter: blur(5px); transform: scaleX(.9); }
.die-cube { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(var(--rest-x)) rotateY(var(--rest-y)); transition: transform .5s cubic-bezier(.18,1.35,.35,1); }
.die-cube.rolling { animation: cube-roll var(--roll-speed, .32s) linear infinite; }
.die-shell:nth-child(2) .die-cube.rolling { animation-name: cube-roll-reverse; }
.die-face { --half-die: calc(var(--die-size) / 2); --pip: #10201a; position: absolute; inset: 0; display: grid; place-items: center; border: 2px solid #b8c7c0; border-radius: 13px; color: #10201a; background: radial-gradient(circle at 30% 22%, #fff 0, #e7eee9 55%, #bdcbc5 100%); box-shadow: inset 0 0 12px #fff, inset -5px -6px 10px #53665f33; backface-visibility: hidden; }
.die-face::before { content: ''; position: absolute; inset: 12%; background-repeat: no-repeat; filter: drop-shadow(0 1px 0 #fff9); }
.face-front::before { background-image: radial-gradient(circle at 50% 50%, var(--pip) 0 11%, transparent 12%); }
.face-top::before { background-image: radial-gradient(circle at 25% 25%, var(--pip) 0 10%, transparent 11%), radial-gradient(circle at 75% 75%, var(--pip) 0 10%, transparent 11%); }
.face-right::before { background-image: radial-gradient(circle at 25% 25%, var(--pip) 0 10%, transparent 11%), radial-gradient(circle at 50% 50%, var(--pip) 0 10%, transparent 11%), radial-gradient(circle at 75% 75%, var(--pip) 0 10%, transparent 11%); }
.face-left::before { background-image: radial-gradient(circle at 25% 25%, var(--pip) 0 10%, transparent 11%), radial-gradient(circle at 75% 25%, var(--pip) 0 10%, transparent 11%), radial-gradient(circle at 25% 75%, var(--pip) 0 10%, transparent 11%), radial-gradient(circle at 75% 75%, var(--pip) 0 10%, transparent 11%); }
.face-bottom::before { background-image: radial-gradient(circle at 25% 25%, var(--pip) 0 10%, transparent 11%), radial-gradient(circle at 75% 25%, var(--pip) 0 10%, transparent 11%), radial-gradient(circle at 50% 50%, var(--pip) 0 10%, transparent 11%), radial-gradient(circle at 25% 75%, var(--pip) 0 10%, transparent 11%), radial-gradient(circle at 75% 75%, var(--pip) 0 10%, transparent 11%); }
.face-back::before { background-image: radial-gradient(circle at 25% 22%, var(--pip) 0 9%, transparent 10%), radial-gradient(circle at 75% 22%, var(--pip) 0 9%, transparent 10%), radial-gradient(circle at 25% 50%, var(--pip) 0 9%, transparent 10%), radial-gradient(circle at 75% 50%, var(--pip) 0 9%, transparent 10%), radial-gradient(circle at 25% 78%, var(--pip) 0 9%, transparent 10%), radial-gradient(circle at 75% 78%, var(--pip) 0 9%, transparent 10%); }
.face-front { transform: translateZ(var(--half-die)); }
.face-back { transform: rotateY(180deg) translateZ(var(--half-die)); }
.face-right { transform: rotateY(90deg) translateZ(var(--half-die)); }
.face-left { transform: rotateY(-90deg) translateZ(var(--half-die)); }
.face-top { transform: rotateX(90deg) translateZ(var(--half-die)); }
.face-bottom { transform: rotateX(-90deg) translateZ(var(--half-die)); }
@keyframes cube-roll { 0% { transform: rotateX(0) rotateY(0) rotateZ(0) translateY(0); } 45% { transform: rotateX(220deg) rotateY(150deg) rotateZ(45deg) translateY(-13px); } 100% { transform: rotateX(440deg) rotateY(360deg) rotateZ(90deg) translateY(0); } }
@keyframes cube-roll-reverse { 0% { transform: rotateX(0) rotateY(0) rotateZ(0) translateY(0); } 45% { transform: rotateX(-180deg) rotateY(230deg) rotateZ(-55deg) translateY(-16px); } 100% { transform: rotateX(-360deg) rotateY(460deg) rotateZ(-110deg) translateY(0); } }
.roll-equation { margin: 4px 0 10px; color: white; font-size: clamp(1rem, 2.2vw, 1.5rem); font-weight: 900; animation: equation-pop .4s cubic-bezier(.2,1.5,.4,1); }
.roll-equation b { color: var(--gold); font-size: 1.35em; }
@keyframes equation-pop { from { transform: scale(.55); opacity: 0; } }
.event { min-height: 46px; max-width: 500px; margin: 13px auto; color: #c5d2ce; line-height: 1.42; }
.place-offer { width: min(470px, 100%); margin: 0 auto 10px; padding: 13px; border: 1px solid var(--place-color); border-top: 5px solid var(--place-color); border-radius: 14px; background: #143b3bef; box-shadow: 0 10px 26px #071d20a8; animation: story-in .35s ease-out; }
.place-offer-name { color: var(--place-color); font-size: .7rem; font-weight: 1000; letter-spacing: .12em; text-transform: uppercase; }
.place-offer-price { margin: 2px 0 8px; color: white; font-family: var(--display-font); font-size: clamp(1.7rem, 4vw, 2.7rem); font-weight: 1000; line-height: 1; }
.value-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; align-items: end; height: 38px; margin: 7px 0 4px; }
.value-scale span { position: relative; min-width: 0; height: var(--value-height); border: 1px solid #ffffff35; border-radius: 5px 5px 2px 2px; background: var(--value-color); opacity: .38; }
.value-scale span.active { opacity: 1; box-shadow: 0 0 0 2px white, 0 0 14px var(--value-color); }
.value-scale span::after { content: attr(data-price); position: absolute; right: 0; bottom: calc(100% + 2px); left: 0; color: white; font-size: .46rem; font-weight: 1000; text-align: center; }
.value-range { display: flex; justify-content: space-between; color: #71877f; font-size: .5rem; font-weight: 900; }
.place-comparison { margin: 8px 0 3px; color: #c9d5d1; font-size: .7rem; line-height: 1.35; }
.place-effect-line { color: var(--gold); font-size: .68rem; font-weight: 1000; }
.story-card { width: min(450px, 96%); max-height: 100%; margin: 4px auto 9px; padding: clamp(10px, 1.6vw, 16px); overflow: hidden; border: 1px solid var(--story-color); border-top: 5px solid var(--story-color); border-radius: 14px; background: #123635f7; color: white; text-align: center; box-shadow: 0 12px 30px #061719b8; animation: story-in .3s ease-out; }
@keyframes story-in { from { transform: translateY(12px) scale(.95); opacity: 0; } }
.story-mood { font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1; animation: mood-pop .45s cubic-bezier(.2,1.5,.4,1); }
@keyframes mood-pop { from { transform: scale(.25) rotate(-15deg); opacity: 0; } }
.story-icon { position: relative; display: inline-grid; width: 24px; aspect-ratio: 1; place-items: center; overflow: hidden; border-radius: 50%; font-size: .9rem; vertical-align: middle; }
.story-kicker { color: var(--story-color); font-size: .62rem; font-weight: 1000; letter-spacing: .12em; text-transform: uppercase; }
.story-title { margin: 3px 0 7px; font: 900 clamp(1rem, 2vw, 1.35rem)/1.05 var(--display-font); }
.transaction-view { display: grid; grid-template-columns: minmax(0, 1fr) 82px minmax(0, 1fr); gap: 6px; align-items: center; margin: 6px 0; }
.transaction-person { min-width: 0; padding: 7px 5px; border: 1px solid #ffffff18; border-radius: 10px; background: #ffffff08; }
.transaction-person.payer { animation: payer-shake .5s ease-in-out 2; }
.transaction-person.receiver { border-color: color-mix(in srgb, var(--story-color) 55%, transparent); animation: receiver-bounce .65s cubic-bezier(.2,1.5,.4,1); }
@keyframes payer-shake { 25% { transform: translateX(-4px) rotate(-1deg); } 75% { transform: translateX(4px) rotate(1deg); } }
@keyframes receiver-bounce { from { transform: scale(.65); opacity: .3; } }
.transaction-avatar { position: relative; width: 42px; margin: -5px auto 2px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border: 2px solid white; border-radius: 50%; background: var(--person-color); font-size: 1.25rem; box-shadow: 0 3px 8px #0009; }
.transaction-name { overflow: hidden; color: white; font-size: clamp(.62rem, 1.1vw, .78rem); font-weight: 1000; text-overflow: ellipsis; white-space: nowrap; }
.transaction-role { color: #b5cec6; font-size: .48rem; font-weight: 1000; letter-spacing: .1em; }
.transaction-flow { display: grid; place-items: center; color: var(--gold); }
.flow-arrow { font-size: 2rem; line-height: .75; animation: arrow-flow .65s ease-in-out infinite alternate; }
@keyframes arrow-flow { from { transform: translateX(-6px); opacity: .5; } to { transform: translateX(6px); opacity: 1; filter: drop-shadow(0 0 7px var(--gold)); } }
.payment-wait { margin: 4px 0 8px; color: #aebdb8; font-size: .72rem; font-weight: 800; animation: waiting-pulse .8s ease-in-out infinite alternate; }
@keyframes waiting-pulse { to { color: white; opacity: .55; } }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 7px; }
.choice-card { position: relative; min-width: 0; min-height: 58px; overflow: hidden; padding: 9px 10px; border: 2px solid color-mix(in srgb, var(--story-color) 72%, white); border-radius: 9px; color: white; background: color-mix(in srgb, var(--story-color) 42%, #244e4b); text-align: center; box-shadow: 0 4px 0 #102d2c, 0 7px 17px #071b1d90, 0 0 13px color-mix(in srgb, var(--story-color) 38%, transparent); transition: transform .16s, filter .16s, box-shadow .16s; }
.choice-card[class*="action--"] { border-color: color-mix(in srgb, var(--action-color) 78%, white); background: color-mix(in srgb, var(--action-color) 45%, #173c38); box-shadow: 0 4px 0 color-mix(in srgb, var(--action-color) 30%, #07100d), 0 7px 17px #071b1d90, 0 0 16px color-mix(in srgb, var(--action-color) 45%, transparent); }
.choice-card.action--trap { border-color: #aab2ad; background: linear-gradient(145deg, #343936, #101311); }
button.choice-card { cursor: pointer; animation: action-breathe 1.15s ease-in-out infinite alternate; }
button.choice-card::after, .actions .btn::after, .start-play::after { content: ''; position: absolute; top: -55%; bottom: -55%; left: -55%; width: 32%; pointer-events: none; background: linear-gradient(90deg, transparent, #ffffffc4, transparent); transform: skewX(-18deg); animation: action-shine 1.8s ease-in-out infinite; }
button.choice-card:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.18); box-shadow: 0 6px 0 #050b09, 0 10px 18px #0009, 0 0 14px color-mix(in srgb, var(--story-color) 40%, transparent); }
.choice-card:disabled { cursor: wait; opacity: .62; }
.choice-title { display: block; color: white; font: 1000 .72rem/1.12 var(--display-font); }
.choice-description { display: block; margin-top: 4px; color: #d7e6e1; font-size: .56rem; line-height: 1.25; }
.choice-amount { display: block; margin-top: 5px; color: var(--gold); font-size: .82rem; font-weight: 1000; line-height: 1; }
.choice-outcome { margin: 10px auto 4px; padding: 14px; border: 2px solid var(--story-color); border-radius: 12px; color: white; background: #07100de8; font-size: clamp(.9rem, 2vw, 1.15rem); font-weight: 1000; animation: outcome-pop .45s cubic-bezier(.2,1.5,.4,1); }
@keyframes outcome-pop { from { transform: scale(.55) rotate(-2deg); opacity: 0; } }
.upgrade-panel { width: min(470px, 100%); margin: auto; padding: 14px; border: 1px solid var(--upgrade-color); border-top: 5px solid var(--upgrade-color); border-radius: 14px; background: #143b3bf5; box-shadow: 0 12px 30px #071d20a8; animation: story-in .35s ease-out; }
.upgrade-panel h3 { margin: 3px 0 5px; color: white; font: 900 clamp(1.05rem, 2.2vw, 1.45rem)/1 var(--display-font); }
.upgrade-place { color: var(--upgrade-color); font-size: .62rem; font-weight: 1000; letter-spacing: .1em; text-transform: uppercase; }
.upgrade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.upgrade-grid .choice-card { min-height: 58px; --story-color: var(--upgrade-color); }
.upgrade-owned { margin-top: 8px; color: var(--muted); font-size: .58rem; }
.story-body { margin: 5px 0 0; color: #c4d8d2; font-size: .65rem; }
.story-amount { margin-top: 4px; color: var(--gold); font-family: var(--display-font); font-size: clamp(1.2rem, 2.5vw, 1.7rem); font-weight: 1000; line-height: 1; }
.story-amount img { width: 38px; height: 38px; margin: -8px 3px -11px 0; object-fit: contain; filter: drop-shadow(0 3px 4px #000); }
.place-offer-name, .story-kicker, .upgrade-place, .round-tag, .build-label, .roll-equation, .earn-pop, .leave-game { font-family: var(--display-font); }
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; }
.btn { position: relative; overflow: hidden; padding: 11px 18px; border: 2px solid #b6e1d6; border-radius: 9px; color: white; background: #3f766d; font-family: var(--display-font); font-weight: 1000; cursor: pointer; box-shadow: 0 4px 0 #173e3a, 0 0 15px #a9e9d53d; }
.btn[class*="action--"] { border-color: color-mix(in srgb, var(--action-color) 76%, white); color: white; background: color-mix(in srgb, var(--action-color) 58%, #244e4b); box-shadow: 0 4px 0 color-mix(in srgb, var(--action-color) 35%, #07100d), 0 0 17px color-mix(in srgb, var(--action-color) 40%, transparent); }
.btn.action--politics { color: #211b05; }
.btn.action--trap { border-color: #949b97; background: #181b19; }
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.15); }
.btn:disabled { cursor: not-allowed; opacity: .45; }
.btn.primary { border-color: var(--lime); color: #0c160f; background: var(--lime); }
.btn.income { border-color: var(--gold); color: #181307; background: var(--gold); }
.btn.danger { border-color: var(--red); color: #1d0b09; background: var(--red); }
.btn.primary[class*="action--"], .btn.income[class*="action--"] { border-color: color-mix(in srgb, var(--action-color) 76%, white); color: white; background: color-mix(in srgb, var(--action-color) 58%, #244e4b); }
.btn.primary.action--economy, .btn.income.action--economy { color: #07150b; }
.actions .btn:not(:disabled) { animation: action-breathe 1.15s ease-in-out infinite alternate; }
@keyframes action-breathe { from { transform: scale(.975); filter: brightness(.98); } to { transform: scale(1.035); filter: brightness(1.13); } }
@keyframes action-shine { 0%, 22% { left: -55%; } 62%, 100% { left: 125%; } }
.roll-btn { position: relative; min-width: 230px; min-height: 60px; overflow: hidden; padding: 15px 34px; border-radius: 14px; font-size: 1.08rem; letter-spacing: .07em; box-shadow: 0 7px 0 #557829, 0 0 24px #b9f46e5c; animation: roll-ready 1.05s ease-in-out infinite alternate; }
.roll-btn::after { content: ''; position: absolute; top: -45%; bottom: -45%; left: -45%; width: 34%; pointer-events: none; background: linear-gradient(90deg, transparent, #ffffffb8, transparent); transform: skewX(-18deg); animation: roll-shine 1.8s ease-in-out infinite; }
@keyframes roll-ready { from { transform: translateY(0) scale(1); box-shadow: 0 7px 0 #557829, 0 0 18px #b9f46e4f; } to { transform: translateY(-2px) scale(1.035); box-shadow: 0 9px 0 #557829, 0 0 42px #b9f46e9c; } }
@keyframes roll-shine { 0%,28% { left: -45%; opacity: 0; } 42% { opacity: 1; } 72%,100% { left: 118%; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .token, .token.active-token, button.choice-card, .actions .btn:not(:disabled) { animation: none; } button.choice-card::after, .actions .btn::after, .start-play::after { animation: none; } }

.cash-layer { position: fixed; z-index: 30; inset: 0; pointer-events: none; overflow: hidden; }
.cash-flight { position: absolute; display: grid; place-items: center; min-width: 52px; padding: 7px 10px; border: 2px solid #132019; border-radius: 99px; background: var(--gold); color: #172017; font-size: .78rem; font-weight: 1000; box-shadow: 0 5px 14px #0009; transform: translate(-50%, -50%); animation: cash-fly 2.15s cubic-bezier(.18,.72,.16,1) forwards; animation-delay: var(--delay, 0ms); }
.cash-flight.coin { min-width: 0; padding: 0; border: 0; background: transparent; font-size: 1.15rem; box-shadow: none; filter: drop-shadow(0 3px 3px #000); }
.cash-flight img { width: 36px; height: 36px; object-fit: contain; }
.cash-flight:not(.coin) { grid-template-columns: 38px auto; gap: 4px; }
.cash-flight.coin img { width: 46px; height: 46px; }
@keyframes cash-fly { 0% { transform: translate(-50%, -50%) scale(.45); opacity: 0; } 12% { opacity: 1; } 62% { transform: translate(calc(-50% + var(--dx) * .64), calc(-50% + var(--dy) * .64 + var(--arc, -35px))) scale(1.18); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.35); opacity: 0; } }
.money-celebration { position: fixed; z-index: 24; inset: 0; pointer-events: none; box-shadow: inset 0 0 95px var(--earn-color), inset 0 0 0 8px var(--earn-color); animation: screen-earn 3.2s ease-out forwards; }
.money-celebration::before, .money-celebration::after { content: '✦  ✧  ✦  ✧  ✦'; position: absolute; left: 50%; color: var(--gold); font-size: clamp(1rem, 3vw, 2rem); letter-spacing: .6em; transform: translateX(-50%); animation: sparkle-drift 2.6s ease-out forwards; }
.money-celebration::before { top: 8%; }
.money-celebration::after { bottom: 8%; animation-direction: reverse; }
@keyframes screen-earn { 0% { opacity: 0; } 12%,72% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sparkle-drift { from { transform: translateX(-50%) scale(.55); opacity: 0; } 35% { opacity: 1; } to { transform: translateX(-50%) scale(1.35); opacity: 0; } }
.earn-pop { position: absolute; left: 50%; top: 18%; padding: 9px 18px; border: 2px solid var(--earn-color); border-radius: 99px; color: var(--gold); background: #08100ee8; font-size: clamp(1.1rem, 3vw, 1.8rem); font-weight: 1000; transform: translateX(-50%); box-shadow: 0 0 35px var(--earn-color); animation: earn-pop 3s cubic-bezier(.2,1.3,.4,1) forwards; }
.earn-pop img { width: 52px; height: 52px; margin: -15px 7px -15px -10px; object-fit: contain; vertical-align: middle; }
@keyframes earn-pop { 0% { transform: translate(-50%, 25px) scale(.35); opacity: 0; } 16%,72% { transform: translate(-50%, 0) scale(1); opacity: 1; } 100% { transform: translate(-50%, -35px) scale(.8); opacity: 0; } }

.overlay { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 18px; background: #050908e8; backdrop-filter: blur(8px); }
.overlay.home-overlay { padding: 0; overflow: auto; background: radial-gradient(circle at 18% 42%, #fff7c8 0, transparent 28%), radial-gradient(circle at 78% 30%, #cceaff 0, transparent 33%), linear-gradient(135deg, #8aaf4c, #cbffb6 52%, #5a54fb); backdrop-filter: none; }
.modal { width: min(820px, 100%); max-height: 94vh; overflow: auto; padding: clamp(18px, 4vw, 34px); border: 1px solid #92c4b7; border-radius: 19px; background: linear-gradient(145deg, #568b7e, #376b70); box-shadow: 0 30px 80px #173d3b80; }
.modal h2 { margin: 5px 0 6px; color: var(--lime); font: 900 clamp(2rem, 6vw, 4rem)/1 var(--display-font); letter-spacing: .01em; }
.modal-intro { max-width: 620px; color: var(--muted); line-height: 1.5; }
.home-overlay .start-modal { position: relative; width: 100%; height: 100vh; min-height: 650px; max-height: none; padding: 0; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-align: center; }
.home-hero { width: 100%; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, .9fr); gap: clamp(36px, 7vw, 110px); align-items: center; padding: clamp(28px, 6vw, 92px); }
.home-brand { justify-self: end; width: min(560px, 100%); text-align: center; }
.home-actions { justify-self: start; width: min(470px, 100%); }
.home-logo { width: min(330px, 78%); max-height: 190px; display: block; margin: -8px auto 0; object-fit: contain; filter: drop-shadow(0 15px 18px #000a) drop-shadow(0 0 22px #f3c96933); }
.home-brand h2 { margin: 4px auto 12px; color: #173a31; font-family: var(--display-font); font-size: clamp(1.7rem, 3.5vw, 3rem); letter-spacing: .01em; }
.start-modal .modal-intro { max-width: 470px; margin: 0 auto; color: #355a50; font-size: .91rem; font-weight: 700; line-height: 1.5; }
.home-overlay .player-name-field label, .home-overlay .roulette-status { color: #49655d; }
.home-overlay .player-name-field input { border-color: #75a89a; color: #173a31; background: #fffffff0; box-shadow: 0 4px 14px #38695a20, inset 0 2px 5px #6b9b8c18; }
.home-overlay .player-name-field input:focus { border-color: #4e8c7b; box-shadow: 0 0 0 4px #4e8c7b24; }
.home-actions .player-name-field { margin-top: 15px; }
.home-actions .roulette-status { margin: 8px 0 8px; }
.home-actions .start-play { min-height: 62px; font-size: 1.2rem; animation: play-now-breathe 1.35s ease-in-out infinite alternate; }
@keyframes play-now-breathe { from { transform: scale(.97); box-shadow: 0 7px 0 #557829, 0 0 18px #b9f46e3d; } to { transform: scale(1.035); box-shadow: 0 9px 0 #557829, 0 0 38px #b9f46e9c; } }
@media (prefers-reduced-motion: reduce) { .home-actions .start-play { animation: none; } }
.hero-class-label { margin-bottom: -6px; color: #345a4f; font-size: .58rem; font-weight: 1000; letter-spacing: .14em; text-transform: uppercase; }
.hero-class-row { display: flex; justify-content: center; gap: 14px; margin: 16px auto 29px; }
.hero-profile { position: relative; width: 80px; aspect-ratio: 1; padding: 0; border: 4px solid #ffffffd9; border-radius: 50%; background: white; cursor: help; box-shadow: 0 8px 18px #335b4f55; transition: transform .18s, border-color .18s, filter .18s; }
.hero-profile > img { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: cover; }
.profile-name { position: absolute; top: calc(100% + 7px); left: 50%; width: 100px; overflow: hidden; color: #23493f; font-size: .57rem; font-weight: 1000; text-overflow: ellipsis; white-space: nowrap; transform: translateX(-50%); }
.hero-profile:hover, .hero-profile:focus-visible { z-index: 9; border-color: var(--profile-color); outline: none; transform: translateY(-7px) scale(1.09); filter: brightness(1.15); box-shadow: 0 0 24px var(--profile-color), 0 8px 16px #000b; }
.hero-profile.selected { border-color: var(--lime); transform: translateY(-7px) scale(1.1); box-shadow: 0 0 28px var(--lime); }
.profile-detail { position: absolute; z-index: 20; left: 50%; bottom: calc(100% + 12px); width: 190px; padding: 10px 11px; border: 1px solid var(--profile-color); border-radius: 10px; color: #dbe5e1; background: #07100df7; font-size: .65rem; line-height: 1.35; text-align: left; box-shadow: 0 12px 30px #000d; opacity: 0; pointer-events: none; transform: translate(-50%, 8px) scale(.95); transition: .18s; }
.profile-detail::after { content: ''; position: absolute; top: 100%; left: 50%; width: 10px; height: 10px; border-right: 1px solid var(--profile-color); border-bottom: 1px solid var(--profile-color); background: #07100d; transform: translate(-50%, -5px) rotate(45deg); }
.profile-detail b { display: block; margin-bottom: 3px; color: var(--profile-color); font-size: .72rem; }
.hero-profile:hover .profile-detail, .hero-profile:focus-visible .profile-detail { opacity: 1; transform: translate(-50%, 0) scale(1); }
.hero-class-row.spinning .hero-profile.selected::after { content: '▼'; position: absolute; left: 50%; top: -29px; color: var(--gold); font-size: 1.2rem; transform: translateX(-50%); animation: roulette-pointer .25s ease-in-out infinite alternate; }
.hero-class-row.settled .hero-profile.selected { animation: faction-winner .75s cubic-bezier(.2,1.5,.4,1) infinite alternate; }
.home-divider { width: min(390px, 88%); height: 1px; margin: 7px auto 13px; background: linear-gradient(90deg, transparent, #173a3126, transparent); }
.money-demo { position: relative; min-height: 455px; display: grid; align-content: center; padding: clamp(22px, 4vw, 38px); overflow: hidden; background: radial-gradient(circle at 50% 46%, #ffffffb8, transparent 55%); }
.money-demo::before { content: '$  $  $'; position: absolute; inset: -30px; color: #39725e0c; font-size: 7rem; font-weight: 1000; letter-spacing: .2em; transform: rotate(-18deg); }
.demo-kicker { position: relative; color: var(--gold); font-size: .62rem; font-weight: 1000; letter-spacing: .16em; text-transform: uppercase; }
.money-demo h3 { position: relative; max-width: 430px; margin: 5px auto 23px; color: #173a31; font: 1000 clamp(1.55rem, 3vw, 2.55rem)/1.02 var(--display-font); }
.demo-transfer { position: relative; display: grid; grid-template-columns: 88px minmax(100px, 1fr) 88px; gap: 12px; align-items: center; }
.demo-person { min-width: 0; color: #23493f; font-size: .64rem; font-weight: 1000; }
.demo-avatar { width: 74px; margin: 0 auto 7px; aspect-ratio: 1; overflow: hidden; border: 4px solid var(--demo-color); border-radius: 50%; box-shadow: 0 0 24px color-mix(in srgb, var(--demo-color) 55%, transparent); }
.demo-avatar img { width: 100%; height: 100%; object-fit: cover; }
.demo-mood { position: absolute; margin: -18px 0 0 58px; font-size: 1.65rem; filter: drop-shadow(0 3px 3px #000); }
.demo-flow { position: relative; min-height: 110px; display: grid; place-items: center; }
.demo-arrow { color: var(--gold); font-size: 2.5rem; animation: arrow-flow .65s ease-in-out infinite alternate; }
.demo-cash { display: flex; align-items: center; color: var(--gold); font-size: 1.45rem; font-weight: 1000; }
.demo-cash img { width: 48px; height: 48px; object-fit: contain; }
.demo-flying-money { position: absolute; top: 13px; left: -9px; width: 42px; height: 42px; object-fit: contain; animation: demo-money-fly 2.1s ease-in-out infinite; }
.demo-flying-money.second { animation-delay: .7s; }
.demo-flying-money.third { animation-delay: 1.4s; }
@keyframes demo-money-fly { 0% { transform: translateX(0) translateY(12px) scale(.5); opacity: 0; } 18%,76% { opacity: 1; } 48% { transform: translateX(55px) translateY(-18px) scale(1.2); } 100% { transform: translateX(116px) translateY(8px) scale(.55); opacity: 0; } }
.demo-events { position: relative; display: flex; justify-content: center; gap: 8px; margin-top: 25px; }
.demo-event { padding: 8px 11px; border: 1px solid #6eaa9838; border-radius: 9px; color: #31594e; background: #ffffff9e; font-size: .61rem; font-weight: 850; box-shadow: 0 5px 13px #46756618; }
.demo-event b, .demo-cash { color: #9a6100; }
.home-footer { position: absolute; z-index: 5; right: 28px; bottom: 22px; left: 28px; display: flex; justify-content: space-between; align-items: center; color: #173a31; font-size: .68rem; font-weight: 900; }
.home-footer-links { display: flex; gap: 8px; }
.home-footer-link { padding: 7px 10px; border: 1px solid #173a3133; border-radius: 8px; color: #173a31; background: #ffffff7d; font: inherit; cursor: pointer; box-shadow: 0 3px 8px #264d4020; }
.home-footer-link:hover { background: white; transform: translateY(-1px); }
.home-version { padding: 7px 10px; border-radius: 8px; background: #ffffff5e; letter-spacing: .08em; }
.player-name-field { display: grid; gap: 7px; max-width: 420px; margin: 16px auto 6px; }
.player-name-field label { color: var(--gold); font-size: .66rem; font-weight: 1000; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
.player-name-field input { width: 100%; padding: 13px 16px; border: 1px solid #526d65; border-radius: 10px; outline: none; color: white; background: #09110f; font: 900 1rem/1 Inter, system-ui, sans-serif; text-align: center; box-shadow: inset 0 2px 8px #0007; }
.player-name-field input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px #b9f46e22, inset 0 2px 8px #0007; }
.class-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px auto; }
.class-card { position: relative; min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: #111a18; transition: .16s; }
.class-card.selected { z-index: 2; border-color: var(--lime); background: #20322c; transform: translateY(-6px) scale(1.04); box-shadow: 0 0 28px #b9f46e88; }
.class-grid.spinning .class-card.selected::after { content: '▼'; position: absolute; left: 50%; top: -25px; color: var(--gold); font-size: 1.25rem; transform: translateX(-50%); animation: roulette-pointer .25s ease-in-out infinite alternate; }
@keyframes roulette-pointer { to { transform: translate(-50%, 5px); } }
.class-grid.settled .class-card.selected { animation: faction-winner .75s cubic-bezier(.2,1.5,.4,1) infinite alternate; }
@keyframes faction-winner { from { box-shadow: 0 0 18px var(--lime); } to { transform: translateY(-9px) scale(1.1); box-shadow: 0 0 55px var(--lime), 0 0 0 7px #b9f46e33; } }
.class-art { position: relative; width: 100%; aspect-ratio: 1.45; display: grid; place-items: center; overflow: hidden; border-radius: 7px; background: #09110f; font-size: 1.7rem; }
.class-art img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: cover; }
.class-card h3 { margin: 6px 2px 2px; overflow: hidden; font-size: clamp(.62rem, 1.2vw, .78rem); text-overflow: ellipsis; white-space: nowrap; }
.class-card p { display: none; }
.roulette-status { min-height: 24px; margin: -8px 0 12px; color: var(--gold); font-size: .78rem; font-weight: 1000; letter-spacing: .1em; text-align: center; text-transform: uppercase; }
.start-play { width: min(420px, 100%); min-height: 66px; display: block; margin: 0 auto; border-radius: 14px; font-size: 1.25rem; letter-spacing: .08em; box-shadow: 0 8px 0 #557829, 0 0 32px #b9f46e33; }
.lobby-modal { max-width: 620px; text-align: center; }
.lobby-modal h2 { margin-bottom: 10px; color: white; font-size: clamp(2rem, 5vw, 3.4rem); }
.lobby-status { min-height: 22px; margin: 0 0 16px; color: var(--gold); font-size: .72rem; font-weight: 1000; letter-spacing: .12em; text-transform: uppercase; }
.lobby-grid { display: grid; gap: 8px; }
.lobby-player { min-height: 70px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 13px; overflow: hidden; border: 1px solid #ffffff1c; border-left: 5px solid var(--lobby-color, #52635e); border-radius: 12px; background: #08100ed9; text-align: left; transition: border-color .25s, filter .25s, transform .35s, opacity .25s; }
.lobby-player.pending { opacity: .46; }
.lobby-player.searching { opacity: 1; border-color: var(--gold); transform: scale(1.025); box-shadow: 0 0 24px #f3c96925; }
.lobby-player.ready { animation: lobby-join .55s cubic-bezier(.2,1.5,.4,1); }
@keyframes lobby-join { from { transform: translateX(-22px) scale(.94); opacity: .35; filter: brightness(2); } to { transform: none; opacity: 1; filter: none; } }
.lobby-avatar { position: relative; width: 48px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--lobby-color, #263531); font-size: 1.45rem; }
.lobby-avatar img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: cover; }
.match-spinner { width: 30px; aspect-ratio: 1; border: 4px solid #ffffff1f; border-top-color: var(--gold); border-right-color: var(--gold); border-radius: 50%; animation: matchmaking-spin .65s linear infinite; }
@keyframes matchmaking-spin { to { transform: rotate(360deg); } }
.lobby-name { overflow: hidden; font-size: 1rem; font-weight: 1000; text-overflow: ellipsis; white-space: nowrap; }
.lobby-class { margin-top: 3px; color: var(--muted); font-size: .66rem; font-weight: 800; }
.lobby-state { color: var(--lime); font-size: .62rem; font-weight: 1000; letter-spacing: .1em; }
.lobby-player.searching .lobby-state { color: var(--gold); }
.win-modal { max-width: 570px; max-height: calc(100vh - 24px); overflow: hidden; text-align: center; }
.final-crown { margin: -18px auto -9px; font-size: 3.5rem; line-height: 1; filter: drop-shadow(0 6px 5px #000b) drop-shadow(0 0 14px var(--gold)); animation: final-crown .8s cubic-bezier(.18,1.65,.35,1), final-crown-float 1s .8s ease-in-out infinite alternate; }
@keyframes final-crown { from { transform: translateY(-65px) rotate(-18deg) scale(.25); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes final-crown-float { to { transform: translateY(-4px) rotate(4deg); filter: drop-shadow(0 7px 4px #000b) drop-shadow(0 0 13px #f3c969); } }
.win-icon { position: relative; width: 92px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; margin: auto; border-radius: 50%; font-size: 5rem; }
.win-modal h2 { color: var(--gold); }
.win-modal > p { margin: 6px auto; color: var(--muted); line-height: 1.35; }
.win-modal.loss { border-color: var(--red); }
.win-modal.loss h2 { color: var(--red); }
.win-stat { margin: 20px 0; font-size: 1.4rem; font-weight: 900; }
.game-duration { width: fit-content; display: flex; align-items: baseline; gap: 9px; margin: 11px auto 3px; padding: 7px 13px; border: 1px solid #f3c96955; border-radius: 99px; background: #f3c9690d; }
.game-duration span { color: var(--muted); font-size: .6rem; font-weight: 1000; letter-spacing: .11em; text-transform: uppercase; }
.game-duration b { color: var(--gold); font-size: 1rem; }
.standings { display: grid; gap: 7px; margin: 12px 0; text-align: left; }
.result-row { display: grid; grid-template-columns: 28px 44px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid #ffffff1c; border-left: 4px solid var(--result-color); border-radius: 10px; background: #08100eaa; }
.result-row.champion { border-color: var(--gold); background: #f3c96912; box-shadow: 0 0 22px #f3c96922; }
.result-rank { color: var(--gold); font-size: 1rem; font-weight: 1000; text-align: center; }
.result-avatar { width: 44px; aspect-ratio: 1; overflow: hidden; border-radius: 50%; background: var(--result-color); }
.result-avatar img { width: 100%; height: 100%; object-fit: cover; }
.result-name { overflow: hidden; font-weight: 1000; text-overflow: ellipsis; white-space: nowrap; }
.result-class { color: var(--muted); font-size: .62rem; }
.result-money { color: var(--gold); font-size: 1rem; font-weight: 1000; letter-spacing: .07em; }
.result-money.bankrupt { color: #f06a60; }

@media (max-height: 700px) {
  .win-modal { padding: 14px 18px; }
  .win-icon { width: 62px; font-size: 3rem; }
  .win-modal h2 { font-size: clamp(1.7rem, 5vh, 2.5rem); }
  .win-modal > p { max-width: 470px; font-size: .75rem; }
  .game-duration { margin-top: 7px; padding: 5px 11px; }
  .standings { gap: 5px; margin: 8px 0; }
  .result-row { grid-template-columns: 24px 36px minmax(0, 1fr) auto; gap: 7px; padding: 5px 8px; }
  .result-avatar { width: 36px; }
  .result-name { font-size: .82rem; }
  .result-money { font-size: .78rem; }
}

@media (max-width: 900px) { .app { height: auto; min-height: 100vh; overflow: visible; } .layout { height: auto; } .board-stage { width: min(100%, calc(100vh - 228px)); padding: 100px 0; } .corner-player { width: 166px; } .corner-player.corner-0 { top: 0; left: 0; right: auto; } .corner-player.corner-1 { top: 0; right: 0; left: auto; } .corner-player.corner-2 { bottom: 0; left: 0; right: auto; } .corner-player.corner-3 { right: 0; bottom: 0; left: auto; } .reaction-dock { top: 184px; right: auto; left: 0; } }
@media (max-width: 690px) {
  .app { padding: 8px; }
  .layout { display: block; }
  .board-stage { padding-top: 118px; }
  .board { border-radius: 10px; }
  .space { padding: 13px 2px 3px; }
  .slot-name { display: none; }
  .center { padding: 6px; overflow: hidden; }
  .turn-player { gap: 5px; }
  .turn-avatar { width: 28px; border-width: 2px; font-size: .8rem; }
  .turn-head h2 { max-width: 150px; overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
  .turn-tools { gap: 3px; }
  .turn-countdown { min-width: 43px; padding: 4px 5px; border-radius: 5px; font-size: .54rem; }
  .leave-game { padding: 4px 5px; border-radius: 5px; font-size: .46rem; box-shadow: 0 2px 0 #5c201e; }
  .timer { height: 4px; margin: 4px 0 5px; }
  .center-main { display: block; overflow-x: hidden; overflow-y: auto; padding: 1px 2px 5px; scrollbar-color: var(--gold) #17231f; scrollbar-width: thin; }
  .center-main > div { min-height: 100%; }
  .event { min-height: 24px; margin: 5px auto 7px; font-size: .58rem; line-height: 1.25; }
  .dice { gap: 17px; margin: 8px 0 13px; }
  .die-shell { --die-size: 42px; }
  .die-face { border-radius: 8px; }
  .roll-equation { margin: 3px 0 5px; font-size: .8rem; }
  .story-card, .upgrade-panel, .place-offer { width: 100%; max-height: none; margin: 0 auto 5px; padding: 6px; overflow: visible; border-top-width: 3px; border-radius: 8px; }
  .story-kicker { font-size: .5rem; }
  .story-icon { width: 17px; }
  .story-title { margin: 2px 0 4px; font-size: .86rem; }
  .transaction-view { grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr); gap: 3px; margin: 3px 0; }
  .transaction-person { padding: 3px 2px; border-radius: 6px; }
  .story-mood { font-size: 1rem; }
  .transaction-avatar { width: 27px; margin: -2px auto 1px; border-width: 1px; font-size: .75rem; }
  .transaction-name { font-size: .55rem; }
  .transaction-role { display: none; }
  .flow-arrow { font-size: 1.25rem; }
  .story-amount { margin-top: 2px; font-size: .8rem; }
  .story-amount img { display: none; }
  .payment-wait { margin: 2px 0 4px; font-size: .55rem; }
  .story-body, .upgrade-owned, .place-comparison, .value-scale, .value-range { display: none; }
  .choice-grid, .upgrade-grid { grid-template-columns: 1fr; gap: 5px; margin-top: 5px; }
  .choice-card, .upgrade-grid .choice-card { min-height: 46px; padding: 7px 6px; border-radius: 7px; text-align: center; }
  .choice-title { font-size: .58rem; }
  .choice-amount { margin-top: 4px; font-size: .68rem; }
  .choice-amount { margin-top: 2px; font-size: .6rem; }
  .high-roller-card { grid-column: auto; display: block; }
  .choice-outcome { margin: 4px 0; padding: 8px; font-size: .72rem; }
  .upgrade-panel h3 { margin: 2px 0 4px; font-size: .82rem; }
  .upgrade-place, .place-offer-name { font-size: .52rem; }
  .place-offer-price { margin: 2px 0 4px; font-size: 1.45rem; }
  .place-effect-line { font-size: .56rem; line-height: 1.2; }
  .actions { position: sticky; z-index: 5; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding-top: 5px; background: linear-gradient(transparent, #101816 30%); }
  .build-action { grid-column: 1 / -1; }
  .btn { padding: 8px 8px; font-size: .62rem; }
  .roll-btn { grid-column: 1 / -1; width: 100%; min-width: 0; min-height: 42px; padding: 9px 16px; font-size: .78rem; }
  .class-grid { grid-template-columns: 1fr 1fr; }
  .home-overlay .start-modal { height: auto; min-height: 100dvh; overflow: visible; }
  .home-hero { height: auto; min-height: 100dvh; grid-template-columns: 1fr; gap: 20px; padding: 24px 18px 76px; }
  .home-brand, .home-actions { justify-self: center; width: min(470px, 100%); }
  .home-logo { width: min(235px, 66vw); max-height: 135px; }
  .home-copy h2 { font-size: 1.45rem; }
  .hero-class-row { margin: 12px auto 8px; }
  .hero-class-row { margin-bottom: 26px; gap: 9px; }
  .hero-profile { width: 62px; }
  .profile-name { width: 78px; font-size: .5rem; }
  .profile-detail { position: fixed; right: 12px; bottom: 72px; left: 12px; width: auto; transform: translateY(8px); }
  .hero-profile:hover .profile-detail, .hero-profile:focus-visible .profile-detail { transform: none; }
  .profile-detail::after { display: none; }
  .demo-transfer { grid-template-columns: 70px minmax(85px, 1fr) 70px; gap: 5px; }
  .demo-avatar { width: 58px; }
  .demo-mood { margin-left: 45px; font-size: 1.25rem; }
  .money-demo h3 { margin-bottom: 15px; font-size: 1.3rem; }
  .demo-events { margin-top: 15px; }
  .home-footer { right: 12px; bottom: 10px; left: 12px; }
  .home-footer-link, .home-version { padding: 6px 8px; font-size: .6rem; }
  .lobby-player { min-height: 60px; grid-template-columns: 40px minmax(0, 1fr) auto; padding: 8px 10px; }
  .lobby-avatar { width: 40px; }
  .corner-player { grid-template-columns: 32px 1fr; gap: 5px; padding: 6px; border-left-width: 3px; }
  .corner-avatar-wrap, .corner-avatar { width: 32px; }
  .corner-avatar { font-size: 1rem; }
  .leader-crown { top: -3px; font-size: 1.35rem; }
  .wealth-chart { height: 12px; margin-top: 2px; }
  .reaction-dock { position: fixed; z-index: 80; inset: auto 8px 8px; width: auto; padding: 7px 10px calc(7px + env(safe-area-inset-bottom)); border-color: #ffffff66; background: #376861ed; backdrop-filter: blur(12px); }
  .reaction-dock::before { display: none; }
  .reaction-buttons { gap: 10px; }
  .reaction-btn { width: 42px; height: 38px; font-size: 1.35rem; }
  .reaction-bubble { top: -54px; min-width: 52px; padding: 8px 10px; font-size: 1.8rem; }
  .cash-coin { width: 27px; height: 27px; margin-right: -20px; margin-bottom: -3px; }
}
