@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=Barlow:wght@400;500;600;700&display=swap');

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
    --bg:           #0d1b2a;   /* Deep stadium navy */
    --surface:      #111f30;   /* Page surface */
    --card:         #172336;   /* Card */
    --card-bg:      #172336;   /* alias kept for game CSS compat */
    --border:       #243548;   /* Subtle border */
    --border-mid:   #2e4560;   /* Mid border */

    --green:        #16a34a;   /* Forest green */
    --green-dim:    #0f6430;   /* Darker green */
    --green-glow:   rgba(22,163,74,0.15);

    --gold:         #d97706;   /* Amber/saffron – GAA colours */
    --gold-light:   #f59e0b;
    --accent-yellow: #d97706;  /* alias kept for game CSS compat */
    --accent-green:  #16a34a;  /* alias kept for game CSS compat */

    --red:          #dc2626;

    --text:         #e2eaf4;   /* Primary text */
    --text-main:    #e2eaf4;   /* alias */
    --text-secondary: #5c7999; /* Muted */
    --text-dim:     #334e6a;   /* Very muted */

    --glass-bg:     rgba(23,35,54,0.9); /* used by some game CSS */

    --radius-sm:    4px;
    --radius:       8px;
    --radius-lg:    12px;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── BASE ───────────────────────────────────────────────────── */
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Barlow', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    margin: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 620px;
    padding: 0 0 60px;
    position: relative;
}

/* ── HEADER ─────────────────────────────────────────────────── */
.game-header {
    text-align: center;
    padding: 28px 20px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#brandName {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 3.4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    color: var(--text);
    line-height: 1;
}

/* Green dot accent in the brand */
#brandName::after {
    content: '·';
    color: var(--green);
    margin-left: 2px;
}

#gameSubtitle {
    margin-top: 8px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--gold);
    display: inline-block;
}

/* ── GAME TAB NAV ───────────────────────────────────────────── */
.game-switcher {
    position: static;
    width: 100%;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.game-switcher::-webkit-scrollbar { display: none; }

.menu-toggle { display: none; }

.game-menu {
    display: flex !important;
    flex-direction: row !important;
    position: static !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    min-width: max-content;
    box-shadow: none !important;
    backdrop-filter: none !important;
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

.menu-item {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    padding: 14px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
    background: none;
    border-radius: 0;
}

.menu-item:hover {
    color: var(--text);
    background: none;
}

.menu-item.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
    background: none;
}

/* ── QUESTION CARD ──────────────────────────────────────────── */
.question.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--green);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin: 20px 20px 0;
    width: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 72px;
}

#question {
    font-family: 'Barlow', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text);
}

/* ── INPUT SECTION ──────────────────────────────────────────── */
.input-section.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin: 16px 20px 0;
}

.input-area {
    display: flex;
    gap: 10px;
    position: relative;
}

input[type="text"] {
    flex: 1;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-mid);
    background: var(--bg);
    color: var(--text);
    font-family: 'Barlow', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.15s;
}

input[type="text"]::placeholder {
    color: var(--text-dim);
}

input[type="text"]:focus {
    border-color: var(--green);
}

input[type="text"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button#submitGuess {
    background: var(--green);
    color: #fff;
    padding: 0 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

button#submitGuess:hover { background: #15803d; }
button#submitGuess:active { background: var(--green-dim); }
button#submitGuess:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── LIVES & FEEDBACK ───────────────────────────────────────── */
.lives {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 16px 0 8px;
}

.feedback {
    text-align: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    height: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s, transform 0.2s;
}

.feedback.show {
    opacity: 1;
    transform: translateY(0);
}

.feedback.success { color: var(--green); }
.feedback.error   { color: var(--red);   animation: shakeX 0.4s ease; }
.feedback.info    { color: var(--gold);  }

@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-8px); }
    75%       { transform: translateX(8px); }
}

/* ── SUGGESTIONS ────────────────────────────────────────────── */
.suggestions {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius);
    z-index: 1000;
    display: none;
    overflow: hidden;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.5);
    margin-bottom: 6px;
}

.suggestion {
    padding: 11px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    font-family: 'Barlow', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.15s;
}

.suggestion:hover {
    background: var(--border);
    color: var(--gold);
}

.suggestion:last-child { border-bottom: none; }

/* ── LOADING OVERLAY ────────────────────────────────────────── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-mid);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-overlay p {
    margin-top: 18px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── MOBILE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .game-header { padding: 20px 16px 16px; }
    #brandName   { font-size: 2.6rem; }

    .question.card,
    .input-section.card { margin-left: 16px; margin-right: 16px; }
}

@media (max-width: 480px) {
    #brandName   { font-size: 2.2rem; letter-spacing: 1px; }
    #gameSubtitle { font-size: 0.85rem; }

    .question.card { padding: 18px 20px; }

    input[type="text"] { font-size: 16px; } /* prevent iOS zoom */

    .input-area { flex-direction: column; }
    button#submitGuess { width: 100%; padding: 13px; }
}
