/* gzjson — Common Screen (Scale-to-Fit) */

html, body {
    overflow: hidden; /* Prevent all scrolling */
    width: 100%;
    height: 100%;
    background-color: #111;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
    color: #fff;
}

#scaling-viewport {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    background: #000;
}

#scaling-container {
    transform-origin: center center;
    display: flex;
    flex-direction: column;
    background: #000;
    position: relative;
    /* Dimensions set by JS via style attribute, but defaults here */
    width: 1920px;
    height: 1080px;
}

/* Base landscape layout */
.orientation-landscape #scaling-container {
    width: 1920px;
    height: 1080px;
}

/* Base portrait layout */
.orientation-portrait #scaling-container {
    width: 1080px;
    height: 1920px;
}

/* --- Common screen elements --- */
.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 32px;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.screen h1 {
    font-size: 48px;
    margin-bottom: 16px;
}

.screen .game-code {
    font-size: 64px;
    font-weight: bold;
    letter-spacing: 0.1em;
    color: #4fc3f7;
    margin: 16px 0;
}

/* --- Simplified Lobby Grid --- */
.lobby-grid-simple {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1fr;
    gap: 32px;
    width: 100%;
    height: 100%;
    align-items: stretch;
}

/* Portrait adaptation */
.orientation-portrait .lobby-grid-simple {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 32px;
}

.lobby-box {
    background: #111;
    border: 2px solid #333;
    border-radius: 24px;
    padding: 48px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.lobby-box h2 {
    font-size: 40px;
    margin-bottom: 32px;
    color: #00ff7f;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Box 1: Join */
.box-join .qr-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.qr-code {
    border-radius: 12px;
    background: #fff;
    padding: 16px;
    box-shadow: 0 0 30px rgba(0,255,127,0.2);
    width: 400px;
    height: 400px;
}

.qr-url-simple {
    margin-top: 32px;
    font-size: 22px;
    font-family: monospace;
}

.qr-url-simple a {
    color: #888;
    text-decoration: none;
}

/* Box 2: Challenge */
.timer-label-simple {
    font-size: 19px;
    color: #aaa;
    margin-bottom: 16px;
}

.timer-digits-simple {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 32px;
}

.timer-value-simple {
    font-size: 96px;
    font-weight: 900;
    color: #00ff7f;
    font-variant-numeric: tabular-nums;
}

.timer-unit-simple {
    font-size: 19px;
    color: #666;
    margin-right: 8px;
    text-transform: uppercase;
}

.timer-sep-simple {
    font-size: 80px;
    font-weight: 300;
    color: #333;
}

/* Instructions Carousel */
.instructions-carousel {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border-radius: 16px;
    margin-bottom: 16px;
    min-height: 250px;
}

.instruction-slide {
    width: 100%;
    transition: opacity 0.6s ease-in-out;
}

.instruction-number {
    font-size: 48px;
    font-weight: 900;
    color: #4fc3f7;
    margin-bottom: 8px;
    opacity: 0.5;
}

.instruction-title {
    font-size: 29px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}

.instruction-text {
    font-size: 19px;
    color: #aaa;
    max-width: 400px;
}

.fade-in { opacity: 1; }
.fade-out { opacity: 0; }

/* Lobby Marquee */
.lobby-marquee {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #111;
    border-top: 1px solid #333;
    padding: 16px 0;
    overflow: hidden;
    z-index: 100;
}

.marquee-track {
    display: inline-block;
    white-space: nowrap;
    animation: marquee-scroll 40s linear infinite;
    padding-left: 100%;
}

.marquee-content {
    font-size: 24px;
    color: #00ff7f;
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 2px;
}

@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.player-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.player-chip {
    background: #222;
    color: #00ff7f;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    border: 1px solid #333;
    font-size: 16px;
}

/* --- Question display --- */
.screen .question-text {
    font-size: 32px;
    margin: 16px 0;
}

.screen .countdown-number {
    font-size: 80px;
    font-weight: bold;
    color: #4fc3f7;
}

/* --- Results table --- */
.results-table {
    width: 100%;
    max-width: 800px;
    margin: 24px auto;
    border-collapse: collapse;
    font-size: 29px;
}

.results-table td {
    padding: 8px 16px;
    border-bottom: 1px solid #333;
}

.results-table .winner td {
    color: #00ff7f;
    font-weight: bold;
}

/* --- Post-Game Insight Hub (Review) --- */
.review-dashboard { margin-bottom: 32px; }
.personal-hub {
    display: flex;
    background: #111;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    gap: 32px;
    align-items: center;
    border: 1px solid #333;
    color: #fff;
}
.hub-identity { display: flex; align-items: center; gap: 24px; flex: 1; }
.archetype-badge {
    background: linear-gradient(135deg, #00ff7f, #00b8ff);
    padding: 16px;
    border-radius: 12px;
    color: #000;
    text-align: center;
    min-width: 150px;
}
.archetype-name { font-size: 19px; font-weight: 900; display: block; }
.radar-chart { width: 150px; height: 150px; }

/* --- Ticker (Plain) --- */
.lobby-ticker {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    border-top: 2px solid #333;
    padding: 16px 0;
    overflow: hidden;
    z-index: 1000;
}

.ticker-track {
    display: flex;
    white-space: nowrap;
    animation: tickerScroll 60s linear infinite;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    padding: 0 64px;
    font-size: 24px;
    font-family: 'Orbitron', sans-serif;
    color: #4fc3f7;
    text-transform: uppercase;
}

.ticker-icon {
    margin-right: 16px;
    color: #00ff7f;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Build & State tags --- */
/* These are absolute so they pin to the 1920x1080 logical canvas 
   of the #scaling-container (which is their relative ancestor). */
.build-tag, .state-tag {
    position: absolute;
    left: 8px;
    font-size: 12px;
    font-family: monospace;
    pointer-events: none;
    z-index: 9999;
    padding: 2px 4px;
    opacity: 0.4;
}

.build-tag {
    bottom: 80px;
    color: #888;
}

.state-tag {
    bottom: 95px;
    color: #4caf50;
    font-weight: 500;
    text-transform: uppercase;
}
