/* Shared high-score screens (see arcade-scores.js). Layout from Missile
   Command; each game sets its own colours through the --as-* variables. */

:root {
    --as-accent: #00a0ff;
    --as-dim: #0080cc;
    --as-font: 'Courier New', monospace;
}

.as-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
    font-family: var(--as-font);
    color: var(--as-accent);
}

.as-overlay.as-hidden {
    display: none;
}

.as-panel {
    box-sizing: border-box;
    width: min(480px, 100%);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.95);
    border: 3px solid var(--as-accent);
    box-shadow: 0 0 30px var(--as-accent);
    padding: 28px 24px;
    text-align: center;
}

.as-panel h2 {
    font-size: 32px;
    margin: 0 0 16px;
    text-shadow: 0 0 15px var(--as-accent);
}

.as-line {
    font-size: 18px;
    margin: 0 0 8px;
}

.as-big {
    font-size: 26px;
    font-weight: bold;
}

.as-strong {
    font-weight: bold;
}

.as-enter {
    font-size: 18px;
    margin: 18px 0 8px;
    color: var(--as-dim);
}

.as-picker {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 18px 0;
}

.as-letter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.as-box {
    font-size: 44px;
    font-weight: bold;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--as-accent);
    background: #000;
    color: var(--as-accent);
    text-shadow: 0 0 10px var(--as-accent);
    cursor: pointer;
    user-select: none;
}

/* A blank shows as a faint underscore, so it reads as a chosen blank. */
.as-box.as-blank::after {
    content: '_';
    opacity: 0.7;
}

.as-letter.as-active .as-box {
    background: var(--as-accent);
    color: #000;
    box-shadow: 0 0 20px var(--as-accent);
}

.as-overlay button {
    font-family: var(--as-font);
    background: #000;
    color: var(--as-accent);
    border: 2px solid var(--as-accent);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.as-overlay button:hover {
    background: var(--as-accent);
    color: #000;
    box-shadow: 0 0 10px var(--as-accent);
}

.as-overlay button:active {
    transform: scale(0.94);
}

.as-overlay button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    background: #000;
    color: var(--as-accent);
}

.as-arrow {
    padding: 8px 0;
    width: 60px;
    font-size: 20px;
}

.as-btn {
    padding: 14px 28px;
    font-size: 18px;
    text-shadow: 0 0 5px var(--as-accent);
}

/* PLAY AGAIN or SUBMIT SCORE, with BACK HOME beside it (stacks on phones) */
.as-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

/* BACK HOME is a link styled like the buttons */
.as-overlay a.as-btn {
    display: inline-block;
    font-family: var(--as-font);
    font-weight: normal;
    line-height: normal;
    background: #000;
    color: var(--as-accent);
    border: 2px solid var(--as-accent);
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.as-overlay a.as-btn:hover,
.as-overlay a.as-btn:focus-visible {
    background: var(--as-accent);
    color: #000;
    box-shadow: 0 0 10px var(--as-accent);
}

.as-overlay a.as-btn:focus-visible,
.as-overlay button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.as-hint {
    font-size: 12px;
    color: var(--as-dim);
    margin: 10px 0;
}

.as-touch-hint {
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    .as-touch-hint {
        display: block;
    }
}

/* High-score board */
.as-board {
    margin: 18px 0;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--as-dim);
}

.as-board h3 {
    font-size: 20px;
    margin: 0 0 12px;
    text-shadow: 0 0 10px var(--as-accent);
}

.as-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--as-font);
}

.as-row {
    display: grid;
    grid-template-columns: 2.4em 3.6em 1fr 4.6em 6.6em;
    align-items: baseline;
    gap: 6px;
    padding: 6px 12px;
    background: #000;
    border: 1px solid var(--as-dim);
    font-size: 16px;
    color: var(--as-accent);
    text-align: left;
}

.as-row.as-new {
    border-color: var(--as-accent);
    box-shadow: 0 0 10px var(--as-accent);
}

.as-rank {
    color: var(--as-dim);
    font-weight: bold;
}

/* pre keeps a middle blank ("B P") visible and lined up. */
.as-row .as-initials {
    white-space: pre;
    font-weight: bold;
    letter-spacing: 3px;
}

.as-score {
    font-weight: bold;
    text-align: right;
}

.as-level,
.as-date {
    color: var(--as-dim);
    font-size: 12px;
    text-align: right;
}

.as-empty {
    color: var(--as-dim);
    padding: 8px;
    text-align: center;
}

@media (max-width: 420px) {
    .as-panel {
        padding: 20px 12px;
    }

    .as-panel h2 {
        font-size: 26px;
    }

    .as-picker {
        gap: 14px;
    }

    .as-row {
        grid-template-columns: 2em 3.2em 1fr 4em 6em;
        gap: 4px;
        padding: 5px 6px;
        font-size: 14px;
    }

    .as-level,
    .as-date {
        font-size: 11px;
    }
}
