/* ===== css/v24.css (V31 consolidated) ===== */
/* ============================================================
   V24 — DEFENDER + DELUXE GALAGA + MEMORY-MATCH + MUTANT LAB
   + arcade sound. Three new arcade games, one invention
   machine, and the speaker toggle. Green-on-black, same as
   the rest of the site.
   ============================================================ */

/* --- Memory-match grid: 4x4 face-down tubes --- */
.mm-memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 460px;
    margin: 14px auto 0;
}
.mm-memory-card {
    position: relative;
    height: 120px;
    padding: 0;
    border: 2px solid var(--accent, #00FF66);
    border-radius: 0 0 22px 22px;
    background: linear-gradient(#001a08, #000);
    overflow: hidden;
    cursor: pointer;
    box-shadow: inset 0 0 12px rgba(0, 255, 102, 0.2);
    font-family: monospace;
}
.mm-memory-card::after {
    /* The potion at the bottom of the tube */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 26px;
    background: rgba(0, 255, 102, 0.18);
    border-top: 1px solid rgba(0, 255, 102, 0.5);
    z-index: 1;
}
.mm-memory-mutant {
    position: absolute;
    left: 50%;
    bottom: 6px;
    width: 76px;
    height: 76px;
    margin-left: -38px;
    transform: translateY(105px);
    transition: transform 0.28s cubic-bezier(0.2, 1.3, 0.4, 1);
    z-index: 2;
    filter: drop-shadow(0 0 8px rgba(0, 255, 102, 0.45));
}
.mm-memory-mutant svg {
    width: 76px;
    height: 76px;
}
.mm-memory-card.flipped .mm-memory-mutant,
.mm-memory-card.matched .mm-memory-mutant {
    transform: translateY(0);
}
.mm-memory-cover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2em;
    font-weight: bold;
    color: var(--text, #00FF66);
    text-shadow: 0 0 10px rgba(0, 255, 102, 0.6);
    z-index: 3;
    transition: opacity 0.2s ease;
}
.mm-memory-card.flipped .mm-memory-cover,
.mm-memory-card.matched .mm-memory-cover {
    opacity: 0;
}
.mm-memory-card.matched {
    border-color: #FFD23F;
    box-shadow: inset 0 0 12px rgba(255, 210, 63, 0.35), 0 0 10px rgba(255, 210, 63, 0.35);
}
.mm-memory-card:focus-visible {
    outline: 3px solid #FFD23F;
    outline-offset: 2px;
}

/* --- Defender touch pad: four directions + fire --- */
.mm-touch-defender {
    flex-wrap: wrap;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
}
.mm-touch-defender .term-btn {
    flex: 1 1 28%;
}

/* --- Mutant Lab generator --- */
.mm-lab-machine {
    max-width: 460px;
    margin: 16px auto 0;
    padding: 18px 14px;
    border: 2px solid var(--accent, #00FF66);
    background: #001a08;
    box-shadow: 0 0 14px rgba(0, 255, 102, 0.3);
    text-align: center;
}
.mm-lab-machine canvas {
    display: block;
    margin: 0 auto;
    background: #000;
    border: 2px solid var(--accent, #00FF66);
    box-shadow: 0 0 14px rgba(0, 255, 102, 0.3);
}
.mm-lab-machine h2 {
    margin: 14px 0 4px;
    color: var(--text, #00FF66);
    font-family: monospace;
    letter-spacing: 1px;
}
.mm-lab-machine p {
    line-height: 1.6;
}
.mm-lab-stats {
    font-size: 0.85em;
    opacity: 0.85;
}

/* --- Sound toggle: muted state reads clearly --- */
#gameSound {
    min-width: 132px;
}

@media (max-width: 600px) {
    .mm-memory-card { height: 96px; }
    .mm-memory-mutant, .mm-memory-mutant svg { width: 60px; height: 60px; }
    .mm-memory-mutant { margin-left: -30px; }
}

@media (prefers-reduced-motion: reduce) {
    .mm-memory-mutant, .mm-memory-cover { transition: none; }
}

/* ===== css/v26.css (V31 consolidated) ===== */
/* ============================================================
   V26 — LAB LEADERBOARD (high scores for the whole arcade).
   Test-tube charts: each score is a tube filling up with
   green liquid, the champion's tube gets a mutant face on
   top, and the average is a gold tube at the end of the row.
   Green-on-black, same as the rest of the site. The fills
   sit at their final height from the server; js/highscores.js
   only animates them rising on load.
   ============================================================ */

/* --- The save box on a game-over screen --- */
.mm-hs-save {
    max-width: 560px;
    margin: 14px auto 0;
    padding: 14px 16px;
    border: 2px solid var(--accent, #00FF66);
    border-radius: 10px;
    background: #001a08;
    box-shadow: 0 0 14px rgba(0, 255, 102, 0.3);
    text-align: center;
}
.mm-hs-save-title {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0 0 6px;
}
.mm-hs-save form {
    margin: 10px 0 4px;
}
.mm-hs-save label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.95em;
}
.mm-hs-save input[type="text"] {
    display: block;
    width: 120px;
    margin: 0 auto 10px;
    padding: 8px 10px;
    text-align: center;
    font-family: monospace;
    font-size: 1.3em;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--text, #00FF66);
    background: #000;
    border: 2px solid var(--accent, #00FF66);
    border-radius: 6px;
}
.mm-hs-save input[type="text"]:focus {
    outline: 3px solid #FFD23F;
    outline-offset: 2px;
}
.mm-hs-save .term-btn {
    font-size: 1.05em;
    padding: 10px 20px;
}

/* --- Notices and empty states --- */
.mm-hs-notice {
    max-width: 760px;
    margin: 14px auto;
    padding: 12px 16px;
    border: 2px solid #00FF66;
    border-radius: 10px;
    background: #001a08;
    box-shadow: 0 0 14px rgba(0, 255, 102, 0.3);
    text-align: center;
    font-weight: bold;
}
.mm-hs-empty {
    text-align: center;
    font-size: 1.05em;
    padding: 10px 0;
}
.mm-hs-stats {
    text-align: center;
    line-height: 1.9;
}

/* --- The tube charts --- */
.mm-hs-chart {
    max-width: 860px;
    margin: 18px auto 6px;
}
.mm-hs-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
}
.mm-hs-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}
.mm-hs-champ {
    width: 44px;
    height: 44px;
    margin-bottom: 2px;
    filter: drop-shadow(0 0 8px rgba(0, 255, 102, 0.5));
}
.mm-hs-avg-star {
    height: 44px;
    line-height: 44px;
    font-size: 1.8em;
    color: #FFD23F;
    text-shadow: 0 0 10px rgba(255, 210, 63, 0.6);
}
.mm-hs-tube {
    position: relative;
    width: 100%;
    max-width: 64px;
    height: 150px;
    border: 2px solid var(--accent, #00FF66);
    border-bottom-width: 3px;
    border-radius: 0 0 22px 22px;
    background: linear-gradient(#001a08, #000);
    box-shadow: inset 0 0 12px rgba(0, 255, 102, 0.2);
    overflow: hidden;
}
.mm-hs-fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--h, 4%);
    background: linear-gradient(rgba(0, 255, 102, 0.85), rgba(0, 255, 102, 0.45));
    border-top: 1px solid rgba(0, 255, 102, 0.9);
    transition: height 0.9s ease;
}
.mm-hs-avg-tube {
    border-color: #FFD23F;
    box-shadow: inset 0 0 12px rgba(255, 210, 63, 0.25);
}
.mm-hs-avg-tube .mm-hs-fill {
    background: linear-gradient(rgba(255, 210, 63, 0.9), rgba(255, 210, 63, 0.5));
    border-top-color: rgba(255, 210, 63, 0.95);
}
.mm-hs-champ-col .mm-hs-tube {
    border-color: #FFD23F;
    box-shadow: inset 0 0 12px rgba(255, 210, 63, 0.25), 0 0 10px rgba(255, 210, 63, 0.35);
}
.mm-hs-lab {
    margin-top: 6px;
    font-size: 0.8em;
    line-height: 1.4;
    text-align: center;
    word-break: break-word;
}
.mm-hs-overview .mm-hs-tube {
    height: 120px;
}

/* --- The top-10 table --- */
.mm-hs-table {
    width: 100%;
    max-width: 640px;
    margin: 16px auto 4px;
    border-collapse: collapse;
    font-family: monospace;
}
.mm-hs-table th,
.mm-hs-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(0, 255, 102, 0.3);
    text-align: left;
}
.mm-hs-table th {
    color: var(--text, #00FF66);
    letter-spacing: 1px;
    border-bottom-width: 2px;
}
.mm-hs-table tr.mm-hs-first td {
    color: #FFD23F;
    font-weight: bold;
}

/* --- Lobby: the lab best under each game's own best --- */
.mm-lab-best {
    display: block;
    margin-top: 6px;
    font-size: 0.85em;
    opacity: 0.9;
}

@media (max-width: 600px) {
    .mm-hs-tube { height: 110px; }
    .mm-hs-overview .mm-hs-tube { height: 90px; }
    .mm-hs-champ { width: 34px; height: 34px; }
    .mm-hs-avg-star { height: 34px; line-height: 34px; font-size: 1.4em; }
    .mm-hs-lab { font-size: 0.7em; }
    .mm-hs-chart { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    .mm-hs-fill { transition: none; }
}
