@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #060d08;
    --bg-secondary: #0d1a10;
    --bg-card: rgba(13, 26, 16, 0.85);
    --bg-card-hover: rgba(20, 40, 24, 0.9);
    --border-subtle: rgba(34, 197, 94, 0.12);
    --border-hover: rgba(34, 197, 94, 0.3);
    --text-primary: #e8f5e9;
    --text-secondary: #81c784;
    --text-muted: #4a7c50;
    --gold: #fbbf24;
    --gold-glow: rgba(251, 191, 36, 0.3);
    --accent-blue: #3b82f6;
    --accent-red: #ef4444;
    --accent-green: #22c55e;
    --accent-purple: #8b5cf6;
    --jungle-dark: #0a1f0e;
    --jungle-mid: #143d1a;
    --jungle-light: #1e5a26;
    --jungle-glow: rgba(34, 197, 94, 0.15);
}

body {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-container {
    text-align: center;
    max-width: 480px;
    width: 100%;
}

.menu-logo {
    margin-bottom: 60px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--gold), #f59e0b);
    border-radius: 20px;
    position: relative;
    box-shadow: 0 0 40px var(--gold-glow), 0 8px 32px rgba(0,0,0,0.4);
    transform: rotate(45deg);
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 16px;
}

.game-title {
    font-size: 56px;
    font-weight: 900;
    letter-spacing: 8px;
    margin-bottom: 8px;
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 8px var(--gold-glow));
}

.subtitle {
    font-size: 16px;
    color: var(--text-muted);
    letter-spacing: 6px;
    text-transform: uppercase;
    font-weight: 500;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.version {
    margin-top: 48px;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 2px;
}

.btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-small {
    padding: 6px 16px;
    font-size: 13px;
    letter-spacing: 1px;
}

.btn-block {
    width: 100%;
    margin-bottom: 8px;
}

.hero-selection-container {
    max-width: 1100px;
    width: 100%;
}

.hero-selection-container h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--gold);
}

.player-count-selector {
    text-align: center;
    margin-bottom: 32px;
    font-size: 16px;
    color: var(--text-secondary);
}

.player-count-selector input[type="range"] {
    margin: 0 16px;
    width: 180px;
    height: 4px;
    -webkit-appearance: none;
    background: var(--border-subtle);
    border-radius: 2px;
    outline: none;
    vertical-align: middle;
}

.player-count-selector input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-green);
    cursor: pointer;
    border: 2px solid white;
}

#player-count-display {
    display: inline-block;
    min-width: 28px;
    font-weight: 700;
    color: var(--gold);
    font-size: 20px;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
    max-height: 58vh;
    overflow-y: auto;
    padding: 8px 4px;
}

.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 0;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    overflow: hidden;
    position: relative;
}

.hero-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.hero-card.selected {
    border-color: var(--gold);
    box-shadow: 0 0 24px var(--gold-glow);
}

.hero-portrait {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: linear-gradient(180deg, #1a2e1c, #0d1a0f);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.3s ease;
}

.hero-card:hover .hero-portrait img {
    transform: scale(1.05);
}

.hero-fallback {
    font-size: 36px;
    font-weight: 900;
    color: var(--gold);
}

.hero-name { font-size: 16px; font-weight: 700; padding: 12px 12px 2px; color: var(--text-primary); }
.hero-name-en { font-size: 11px; color: var(--text-muted); padding: 0 12px 6px; letter-spacing: 0.5px; }
.hero-ability-name { font-size: 12px; color: var(--gold); font-weight: 600; padding: 0 12px 4px; }
.hero-ability { font-size: 11px; color: var(--text-secondary); line-height: 1.5; padding: 0 12px 8px; }
.hero-meta { display: flex; justify-content: space-between; padding: 0 12px 4px; font-size: 10px; }
.hero-stars { color: var(--gold); letter-spacing: 1px; }
.hero-diff { color: var(--text-muted); }
.hero-cd { font-size: 10px; color: var(--text-muted); padding: 6px 12px 12px; border-top: 1px solid var(--border-subtle); margin-top: 4px; }
.hero-cd.passive { color: var(--accent-green); }

.player-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.selection-info { text-align: center; margin-bottom: 20px; font-size: 15px; color: var(--text-secondary); }
#heroes-needed { color: var(--gold); font-weight: 700; }
.hero-selection-buttons { display: flex; justify-content: center; gap: 16px; }
.hero-selection-buttons .btn { min-width: 140px; }

.game-layout {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

.top-bar {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    padding: 12px 24px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-subtle);
}

.turn-info { font-size: 15px; color: var(--text-secondary); }
.turn-info strong { color: var(--text-primary); }
.separator { margin: 0 12px; color: var(--text-muted); }

.game-content {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 16px;
    align-items: start;
}

.board-container {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    position: relative;
    background: var(--jungle-dark);
}

.jungle-bg {
    position: relative;
    width: 100%;
    padding-bottom: 77.78%;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(34, 80, 34, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(20, 60, 20, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(10, 40, 15, 0.8) 0%, transparent 70%),
        linear-gradient(160deg, #050e07 0%, #0a1f0e 30%, #0d2812 50%, #0a1f0e 70%, #050e07 100%);
    overflow: hidden;
}

.fog-layer {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 70%, rgba(80, 120, 80, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(80, 120, 80, 0.06) 0%, transparent 50%);
    animation: fogDrift 15s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 1;
}

@keyframes fogDrift {
    0% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    50% { transform: translate(20px, -10px) scale(1.05); opacity: 1; }
    100% { transform: translate(-15px, 5px) scale(0.98); opacity: 0.7; }
}

#particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.path-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.board-spaces {
    position: absolute;
    inset: 0;
    z-index: 5;
}

.board-space {
    position: absolute;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%);
    border-radius: 12px;
    background: rgba(10, 31, 14, 0.85);
    border: 2px solid rgba(34, 197, 94, 0.25);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

.board-space:hover {
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 10;
    border-color: rgba(34, 197, 94, 0.6);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3), 0 4px 16px rgba(0,0,0,0.5);
}

.board-space.has-color-set {
    border-top: 3px solid var(--set-color);
}

.board-space.space-owned {
    box-shadow: 0 0 12px rgba(var(--player-color-rgb, 255,255,255), 0.3);
}

.space-corner-start {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(10, 31, 14, 0.9));
    border-color: rgba(59, 130, 246, 0.5);
    width: 68px;
    height: 68px;
}

.space-corner-jail {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(10, 31, 14, 0.9));
    border-color: rgba(139, 92, 246, 0.5);
    width: 68px;
    height: 68px;
}

.space-corner-free {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(10, 31, 14, 0.9));
    border-color: rgba(245, 158, 11, 0.5);
    width: 68px;
    height: 68px;
    animation: roshanPulse 3s ease-in-out infinite;
}

@keyframes roshanPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.5); }
}

.space-corner-go_to_jail {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(10, 31, 14, 0.9));
    border-color: rgba(239, 68, 68, 0.5);
    width: 68px;
    height: 68px;
}

.space-property {
    background: rgba(15, 35, 20, 0.85);
}

.space-outpost {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(10, 31, 14, 0.9));
    border-color: rgba(99, 102, 241, 0.4);
}

.space-utility {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(10, 31, 14, 0.9));
    border-color: rgba(20, 184, 166, 0.4);
}

.space-chance {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(10, 31, 14, 0.9));
    border-color: rgba(245, 158, 11, 0.4);
    animation: chanceGlow 2s ease-in-out infinite;
}

@keyframes chanceGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.15); }
    50% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.35); }
}

.space-community {
    background: linear-gradient(135deg, rgba(168, 162, 158, 0.2), rgba(10, 31, 14, 0.9));
    border-color: rgba(168, 162, 158, 0.3);
}

.space-tax {
    background: linear-gradient(135deg, rgba(192, 38, 211, 0.2), rgba(10, 31, 14, 0.9));
    border-color: rgba(192, 38, 211, 0.4);
}

.space-icon {
    font-size: 16px;
    line-height: 1;
    margin-bottom: 1px;
}

.space-name {
    font-size: 8px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 54px;
    line-height: 1.2;
}

.space-price {
    font-size: 7px;
    color: var(--gold);
    font-weight: 600;
}

.space-buildings {
    display: flex;
    gap: 2px;
    margin-top: 1px;
}

.building-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.building-dot.house {
    background: #22c55e;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.5);
}

.building-dot.hotel {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
    width: 16px;
    font-size: 7px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.space-owner-ring {
    position: absolute;
    inset: -3px;
    border: 3px solid transparent;
    border-radius: 14px;
    pointer-events: none;
    transition: border-color 0.3s;
}

.space-owner-ring.owned {
    animation: ownerPulse 2s ease-in-out infinite;
}

@keyframes ownerPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.player-tokens {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
}

.player-token {
    position: absolute;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -50%);
    z-index: 8;
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1), top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.token-inner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--player-color);
    overflow: hidden;
    background: var(--jungle-dark);
    box-shadow: 0 0 10px var(--player-color), 0 2px 8px rgba(0,0,0,0.5);
}

.token-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.token-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 900;
    color: white;
    background: var(--player-color);
}

.token-label {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: 700;
    color: var(--player-color);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    white-space: nowrap;
}

.token-bounce {
    animation: tokenBounce 0.12s ease;
}

@keyframes tokenBounce {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -70%) scale(1.15); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.board-space.current-player-here {
    animation: spacePing 1.5s ease-out;
}

@keyframes spacePing {
    0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.6); }
    50% { box-shadow: 0 0 20px 8px rgba(251, 191, 36, 0.3); }
    100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

.board-center-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 4;
    pointer-events: none;
}

.center-title {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 6px;
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.6) 0%, rgba(245, 158, 11, 0.4) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(251, 191, 36, 0.2));
}

.center-sub {
    font-size: 12px;
    color: rgba(129, 199, 132, 0.4);
    letter-spacing: 8px;
    font-weight: 500;
}

.center-turn {
    font-size: 11px;
    color: rgba(129, 199, 132, 0.3);
    margin-top: 4px;
}

.space-tooltip {
    position: fixed;
    background: rgba(13, 26, 16, 0.95);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-primary);
    pointer-events: none;
    z-index: 100;
    transform: translate(-50%, -100%);
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    display: none;
    line-height: 1.6;
}

.dice-container {
    display: none;
    justify-content: center;
    gap: 24px;
    margin-bottom: 12px;
    perspective: 300px;
}

.dice-3d {
    width: 50px;
    height: 50px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
}

.dice-face-3d {
    position: absolute;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1a3a1e, #0d2812);
    border: 2px solid rgba(34, 197, 94, 0.4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    color: white;
    backface-visibility: hidden;
}

.dice-front  { transform: translateZ(25px); }
.dice-back   { transform: rotateY(180deg) translateZ(25px); }
.dice-right  { transform: rotateY(90deg) translateZ(25px); }
.dice-left   { transform: rotateY(-90deg) translateZ(25px); }
.dice-top    { transform: rotateX(90deg) translateZ(25px); }
.dice-bottom { transform: rotateX(-90deg) translateZ(25px); }

.dice-dots {
    position: relative;
    width: 36px;
    height: 36px;
}

.dice-dots .dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255,255,255,0.5);
}

.dot.tl { top: 2px; left: 2px; }
.dot.tr { top: 2px; right: 2px; }
.dot.ml { top: 14px; left: 2px; }
.dot.mr { top: 14px; right: 2px; }
.dot.bl { bottom: 2px; left: 2px; }
.dot.br { bottom: 2px; right: 2px; }
.dot.c  { top: 14px; left: 14px; }

.dice-rolling {
    animation: diceRoll 0.15s linear infinite;
}

@keyframes diceRoll {
    0%   { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    25%  { transform: rotateX(90deg) rotateY(45deg) rotateZ(30deg); }
    50%  { transform: rotateX(180deg) rotateY(90deg) rotateZ(60deg); }
    75%  { transform: rotateX(270deg) rotateY(135deg) rotateZ(90deg); }
    100% { transform: rotateX(360deg) rotateY(180deg) rotateZ(120deg); }
}

.dice-settled {
    animation: diceSettle 0.4s ease-out;
}

@keyframes diceSettle {
    0% { transform: rotateX(20deg) scale(1.1); }
    50% { transform: rotateX(-5deg) scale(0.95); }
    100% { transform: rotateX(0deg) scale(1); }
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--border-subtle);
}

.panel-section h3 {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-card {
    background: rgba(10, 31, 14, 0.6);
    border-radius: 10px;
    padding: 10px 12px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.player-card.active {
    background: rgba(34, 197, 94, 0.08);
    border-left-color: var(--accent-green);
}

.player-card.bankrupt { opacity: 0.4; }

.player-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-hero-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-subtle);
}

.player-card-info { flex: 1; }
.player-card-name { font-size: 13px; font-weight: 600; }
.player-card-hero { font-size: 11px; color: var(--text-muted); }
.player-card-gold { font-size: 16px; font-weight: 700; color: var(--gold); }

.health-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.health-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease, background 0.3s ease;
}

.health-safe { background: linear-gradient(90deg, #22c55e, #16a34a); }
.health-warning { background: linear-gradient(90deg, #eab308, #f59e0b); }
.health-danger { background: linear-gradient(90deg, #ef4444, #dc2626); }
.health-critical {
    background: linear-gradient(90deg, #ef4444, #b91c1c);
    animation: pulse-critical 1s infinite;
}

@keyframes pulse-critical {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.player-card-details {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.cd-text { color: var(--accent-red); }
.ready-text { color: var(--accent-green); }

.dice-result {
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(10, 31, 14, 0.6);
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dice-face {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #1a3a1e, #0d2812);
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    border: 1px solid var(--border-hover);
}

.dice-plus, .dice-equals { color: var(--text-muted); font-size: 14px; }
.dice-total { font-size: 22px; color: var(--gold); font-weight: 900; }
.dice-doubles {
    display: inline-block;
    background: var(--accent-purple);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.event-log-section { flex: 1; display: flex; flex-direction: column; }

.event-log {
    background: rgba(10, 31, 14, 0.6);
    border-radius: 10px;
    padding: 12px;
    max-height: 260px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.6;
    flex: 1;
}

.log-entry {
    margin-bottom: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    color: var(--text-secondary);
    border-left: 2px solid var(--border-subtle);
}

.log-entry:first-child {
    background: rgba(34, 197, 94, 0.06);
    border-left-color: var(--accent-green);
    color: var(--text-primary);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 20px;
    max-width: 560px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    0% { transform: translateY(20px) scale(0.95); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-content h2 { color: var(--gold); margin-bottom: 20px; font-size: 24px; }

.close {
    position: absolute;
    right: 20px;
    top: 16px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    line-height: 1;
}

.close:hover { color: var(--text-primary); }

.purchase-modal-box { text-align: center; }
.purchase-modal-box h3 { font-size: 22px; color: var(--gold); margin-bottom: 16px; }
.modal-price { font-size: 28px; font-weight: 900; color: var(--gold); margin-bottom: 4px; }
.modal-balance { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

.modal-rent-table {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
    text-align: left;
}

.rent-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.rent-row:last-child { border-bottom: none; }
.rent-row.highlight { color: var(--accent-red); font-weight: 700; background: rgba(239, 68, 68, 0.08); border-radius: 6px; }

.modal-color-set { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.modal-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.6; }
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }
.modal-actions .btn { min-width: 120px; }

.card-modal-box { text-align: center; max-width: 400px; }
.card-type-label { font-size: 11px; color: var(--text-muted); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 8px; }
.card-name { font-size: 24px; font-weight: 900; color: var(--gold); margin-bottom: 12px; }

.card-rarity {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.card-rarity.common, .card-rarity.positive { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.card-rarity.rare, .card-rarity.neutral { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.card-rarity.epic, .card-rarity.negative { background: rgba(168, 85, 247, 0.15); color: #a855f7; }

.card-effect { font-size: 15px; color: var(--text-primary); line-height: 1.6; margin-bottom: 12px; }
.card-desc { font-size: 12px; color: var(--text-muted); font-style: italic; margin-bottom: 20px; }

.build-modal-box { max-width: 520px; }
.build-modal-box h3 { color: var(--gold); font-size: 20px; margin-bottom: 16px; }
.build-list { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; }

.build-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 12px;
    border-left: 3px solid var(--border-subtle);
}

.build-item.buildable { border-left-color: var(--accent-green); }
.build-item.locked { opacity: 0.6; }

.build-item-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.build-color-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.build-name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.build-level { margin-left: auto; font-size: 12px; }
.build-item-info { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.build-action { display: flex; justify-content: space-between; align-items: center; }
.build-cost { font-size: 12px; color: var(--gold); font-weight: 600; }
.build-locked-reason { font-size: 11px; color: var(--accent-red); font-style: italic; }
.build-no-options { color: var(--text-muted); font-size: 13px; text-align: center; padding: 16px; }

.instructions h3 { margin-top: 20px; margin-bottom: 8px; color: var(--accent-green); font-size: 15px; }
.instructions p { color: var(--text-secondary); line-height: 1.8; }
.instructions ul { margin-left: 20px; line-height: 2; color: var(--text-secondary); }
.instructions ul strong { color: var(--text-primary); }
.mt-20 { margin-top: 20px; }

@media (max-width: 1200px) {
    .game-content { grid-template-columns: 1fr; }
    .side-panel { order: -1; }
}

@media (max-width: 768px) {
    .game-title { font-size: 36px; letter-spacing: 4px; }
    .hero-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
    .modal-content { padding: 24px; }
    .board-space { width: 48px; height: 48px; }
    .space-name { font-size: 7px; }
    .space-icon { font-size: 14px; }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(34, 197, 94, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(34, 197, 94, 0.25); }
