/*
 * Genome Arcade - standalone/client-only HTML5 game styles.
 */
:root {
    --ga-ink: #17212b;
    --ga-muted: #5b6877;
    --ga-paper: #f7faf9;
    --ga-panel: #ffffff;
    --ga-line: #d8e2df;
    --ga-teal: #17796b;
    --ga-teal-dark: #105a50;
    --ga-gold: #b8860b;
    --ga-coral: #c84f4f;
    --ga-blue: #2563a8;
    --ga-violet: #6b5aa6;
    --ga-shadow: 0 14px 38px rgba(23, 33, 43, 0.12);
}

.genome-arcade-host {
    color: var(--ga-ink);
    background: var(--ga-paper);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.genome-arcade-host *,
.genome-arcade-host *::before,
.genome-arcade-host *::after {
    box-sizing: border-box;
}

.ga-app {
    min-height: 720px;
    background: var(--ga-paper);
}

.ga-wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0;
}

.ga-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 22px;
}

.ga-hero-main,
.ga-panel,
.ga-game-shell,
.ga-game-card,
.ga-privacy-panel {
    border: 1px solid var(--ga-line);
    border-radius: 8px;
    background: var(--ga-panel);
    box-shadow: var(--ga-shadow);
}

.ga-hero-main {
    padding: 28px;
}

.ga-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--ga-teal-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ga-mark {
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.ga-title {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.1rem, 4vw, 4.2rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.ga-lead {
    max-width: 720px;
    margin: 18px 0 0;
    color: var(--ga-muted);
    font-size: 1.05rem;
    line-height: 1.65;
}

.ga-feature-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.ga-feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--ga-line);
    border-radius: 8px;
    background: #eef7f4;
    color: var(--ga-teal-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.ga-privacy-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.ga-privacy-panel h2,
.ga-panel h2,
.ga-game-title {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.25;
}

.ga-privacy-panel p,
.ga-panel p {
    margin: 0;
    color: var(--ga-muted);
    line-height: 1.55;
}

.ga-privacy-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ga-privacy-list li {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 10px;
    color: var(--ga-muted);
    font-size: 0.94rem;
}

.ga-check {
    color: var(--ga-teal);
    font-weight: 900;
}

.ga-panel {
    padding: 24px;
}

.ga-upload-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 22px;
}

.ga-dropzone {
    position: relative;
    min-height: 260px;
    border: 2px dashed #9eb8b1;
    border-radius: 8px;
    background: #f2f8f6;
    display: grid;
    place-items: center;
    padding: 24px;
    text-align: center;
}

.ga-dropzone.is-dragover,
.ga-dropzone:focus-within {
    border-color: var(--ga-teal);
    outline: 3px solid rgba(23, 121, 107, 0.16);
}

.ga-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0;
    cursor: pointer;
}

.ga-drop-icon {
    display: inline-grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin-bottom: 18px;
    border-radius: 8px;
    background: var(--ga-teal);
    color: white;
    font-size: 2rem;
}

.ga-drop-title {
    margin: 0;
    font-size: 1.3rem;
}

.ga-drop-copy {
    margin: 10px 0 0;
    color: var(--ga-muted);
}

.ga-file-status {
    min-height: 24px;
    margin-top: 14px;
    color: var(--ga-teal-dark);
    font-weight: 700;
}

.ga-consent {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 12px;
    align-items: start;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--ga-line);
    border-radius: 8px;
    background: #ffffff;
}

.ga-consent input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--ga-teal);
}

.ga-consent span {
    color: var(--ga-muted);
    line-height: 1.45;
}

.ga-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.ga-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--ga-teal);
    color: #ffffff;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.ga-button:hover,
.ga-button:focus {
    background: var(--ga-teal-dark);
    color: #ffffff;
    text-decoration: none;
}

.ga-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.ga-button--ghost {
    background: #ffffff;
    border-color: var(--ga-line);
    color: var(--ga-ink);
}

.ga-button--ghost:hover,
.ga-button--ghost:focus {
    background: #edf3f1;
    color: var(--ga-ink);
}

.ga-button--danger {
    background: var(--ga-coral);
}

.ga-button--danger:hover,
.ga-button--danger:focus {
    background: #a63e3e;
}

.ga-error {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #efb5b5;
    border-radius: 8px;
    background: #fff3f3;
    color: #8f2f2f;
}

.ga-progress {
    display: grid;
    gap: 16px;
    place-items: center;
    min-height: 360px;
    text-align: center;
}

.ga-orbit {
    position: relative;
    width: 92px;
    height: 92px;
    border: 3px solid #b9d5cf;
    border-radius: 50%;
}

.ga-orbit::before,
.ga-orbit::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ga-gold);
}

.ga-orbit::before {
    top: 7px;
    left: 12px;
}

.ga-orbit::after {
    right: 9px;
    bottom: 12px;
    background: var(--ga-blue);
}

.ga-hub-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    margin-bottom: 20px;
}

.ga-seed-badge {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #fff5dc;
    color: #714f00;
    font-weight: 900;
}

.ga-games-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.ga-game-card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    padding: 16px;
    min-height: 250px;
    text-align: left;
    border-color: var(--ga-line);
    cursor: pointer;
}

.ga-game-card:hover,
.ga-game-card:focus {
    border-color: var(--ga-teal);
    outline: 3px solid rgba(23, 121, 107, 0.14);
}

.ga-game-card .ga-game-title,
.ga-game-card .ga-card-copy {
    display: block;
}

.ga-game-art {
    position: relative;
    height: 96px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--ga-line);
    background: #17212b;
}

.ga-game-art svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ga-card-copy {
    color: var(--ga-muted);
    line-height: 1.45;
}

.ga-card-meta {
    color: var(--ga-teal-dark);
    font-size: 0.84rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ga-game-shell {
    overflow: hidden;
}

.ga-game-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid var(--ga-line);
    background: #ffffff;
}

.ga-game-heading {
    min-width: 0;
}

.ga-game-heading p {
    margin: 4px 0 0;
    color: var(--ga-muted);
    font-size: 0.92rem;
}

.ga-game-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 0;
    background: #111820;
}

.ga-canvas-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    min-height: 340px;
}

.ga-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #111820;
}

.ga-side-panel {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 16px;
    background: #f4f7f6;
    border-left: 1px solid var(--ga-line);
}

.ga-stat {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--ga-line);
    border-radius: 8px;
    background: white;
}

.ga-stat-label {
    color: var(--ga-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ga-stat-value {
    color: var(--ga-ink);
    font-weight: 900;
}

.ga-controls-help {
    color: var(--ga-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.ga-touch-controls {
    display: none;
    grid-template-columns: 144px 76px;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    padding: 14px;
    background: #101820;
}

.ga-pad {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(3, 44px);
    gap: 6px;
}

.ga-touch {
    border: 1px solid #50606c;
    border-radius: 8px;
    background: #26333f;
    color: #ffffff;
    font-weight: 900;
    touch-action: none;
}

.ga-touch[data-control="up"] { grid-column: 2; grid-row: 1; }
.ga-touch[data-control="left"] { grid-column: 1; grid-row: 2; }
.ga-touch[data-control="right"] { grid-column: 3; grid-row: 2; }
.ga-touch[data-control="down"] { grid-column: 2; grid-row: 3; }
.ga-touch[data-control="action"] {
    width: 76px;
    height: 76px;
    background: var(--ga-gold);
    color: #1d1604;
}

.ga-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 980px) {
    .ga-hero,
    .ga-upload-grid,
    .ga-game-stage {
        grid-template-columns: 1fr;
    }

    .ga-games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ga-side-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-left: 0;
        border-top: 1px solid var(--ga-line);
    }
}

@media (max-width: 680px) {
    .ga-wrap {
        width: min(100% - 20px, 1180px);
        padding: 20px 0;
    }

    .ga-hero-main,
    .ga-panel,
    .ga-privacy-panel {
        padding: 18px;
    }

    .ga-hub-header,
    .ga-game-toolbar {
        grid-template-columns: 1fr;
    }

    .ga-games-grid,
    .ga-side-panel {
        grid-template-columns: 1fr;
    }

    .ga-canvas-wrap {
        min-height: 230px;
    }

    .ga-touch-controls {
        display: grid;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ga-button,
    .ga-game-card {
        transition: none;
    }
}
