/* Main game screen layout and scoped overrides. */

#game-screen {
    --game-ui-inset: clamp(10px, 2vmin, 20px);
    --game-right-rail-top: clamp(68px, 8vh, 86px);
    --game-panel-gap: 12px;
    --game-log-width: clamp(220px, 24vw, 300px);
    --game-log-height: clamp(170px, 38vh, 460px);
    --game-effect-queue-width: clamp(300px, 28vw, 390px);
    --game-description-width: clamp(260px, 25vw, 400px);
}

#game-screen.screen-scale-screen {
    place-items: start center;
}

#game-screen .game-container {
    position: relative;
    max-height: calc(100vh - 60px);
    padding: clamp(12px, 1.6vmin, 18px);
}

#game-screen .game-container.screen-scale-target {
    width: 1200px;
    max-width: none;
    max-height: none;
    transform-origin: top center;
}

#game-screen > .menu-button-container {
    top: var(--game-ui-inset);
    left: var(--game-ui-inset);
}

#game-screen > .game-log {
    right: var(--game-ui-inset);
    bottom: var(--game-ui-inset);
    width: var(--game-log-width);
    height: var(--game-log-height);
    max-height: var(--game-log-height);
}

#game-screen > .effect-queue-panel {
    right: var(--game-ui-inset);
    top: var(--game-right-rail-top);
    bottom: auto;
    width: var(--game-effect-queue-width);
    max-width: var(--game-effect-queue-width);
    max-height: min(44vh, calc(100vh - var(--game-right-rail-top) - var(--game-log-height) - var(--game-panel-gap) - var(--game-ui-inset)));
}

body[data-current-screen="game"] > .card-description,
body[data-current-screen="mulligan"] > .card-description {
    left: clamp(10px, 2vmin, 20px);
    top: 50%;
    bottom: auto;
    width: clamp(260px, 25vw, 400px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    transform: translateY(-50%);
}

#game-screen .place-count-display {
    min-height: 42px;
    margin-top: 0;
    padding: 7px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 0 1 auto;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 8px;
}

#game-screen .place-count-display h4 {
    margin: 0;
    color: inherit;
    font-size: 0.9em;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

#game-screen .place-count-matrix {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 0;
}

#game-screen .place-count-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    min-width: 22px;
    height: 24px;
    padding: 2px 7px;
    background: #3498db;
    color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
}

#game-screen .place-count-item.empty {
    background: #bdc3c7;
    color: #7f8c8d;
    font-style: italic;
}

.theme-glass #game-screen .place-count-display {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid var(--glass-stroke);
}

.theme-glass #game-screen .place-count-item {
    background: rgba(255, 255, 255, 0.16);
    color: var(--text);
    border: 1px solid var(--glass-stroke);
}

@media (max-height: 760px) {
    #game-screen {
        --game-right-rail-top: 64px;
        --game-log-height: clamp(180px, 34vh, 300px);
    }
}

@media (max-width: 900px) {
    #game-screen {
        --game-log-width: min(300px, calc(100vw - 24px));
        --game-effect-queue-width: min(300px, calc(100vw - 24px));
    }

    #game-screen > .effect-queue-panel {
        right: 12px;
        min-width: 0;
    }
}
