:root {
    --bg: #001B3A;
    --blue: #4DB8FF;
    --orange: #FFA347;
    --grey: #7A7A7A;
    --outline: #2f5c8d;
    --keyboard: #19385f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: white;
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
}

.container {
    width: min(95vw, 600px);
    margin: auto;
    padding: 15px;
}

/* ---------- Logo ---------- */

.logo {
    margin-bottom: 15px;
}

.logo-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 5px;
}

.logo-tile {
    width: 50px;
    height: 50px;

    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 8px;

    font-size: 30px;
    font-weight: bold;

    box-shadow: 0 3px 8px rgba(0,0,0,.3);
}

.logo-tile.blue {
    background: var(--blue);
}

.logo-tile.orange {
    background: var(--orange);
}

/* Make HOBDLE larger */

.logo-tile.title {
    width: 60px;
    height: 60px;
    font-size: 36px;
}

/* ---------- Subtitle ---------- */

.subtitle {
    margin: 0 0 15px;
    font-size: 20px;
}

/* ---------- Message ---------- */

#message {
    min-height: 0;
    margin-top: 15px;
    margin-bottom: 15px;
    font-size: 20px;
}

/* ---------- Board ---------- */

#board {
    display: grid;
    grid-template-columns: repeat(var(--columns), min(13vw, 65px));
    gap: min(2vw, 8px);
    justify-content: center;
    margin-bottom: 30px;
}

.tile {
    width: min(13vw, 65px);
    height: min(13vw, 65px);

    border: 2px solid var(--outline);
    border-radius: 8px;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: min(7vw, 34px);
    font-weight: bold;
    text-transform: uppercase;

    transition:
        background-color .2s,
        border-color .2s,
        transform .2s;
}

.tile.correct {
    background: var(--blue);
    border-color: var(--blue);
}

.tile.present {
    background: var(--orange);
    border-color: var(--orange);
}

.tile.absent {
    background: var(--grey);
    border-color: var(--grey);
}

.tile.pop {
    transform: scale(1.1);
}

.tile.flip {
    animation: flip .5s ease;
}

@keyframes flip {
    0% {
        transform: rotateX(0);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0);
    }
}

/* ---------- Shake ---------- */

.board-shake {
    animation: shake .4s;
}

@keyframes shake {
    20%,60% {
        transform: translateX(-8px);
    }

    40%,80% {
        transform: translateX(8px);
    }
}

/* ---------- Keyboard ---------- */

#keyboard {
    margin-top: 10px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.key {
    width: min(9vw, 42px);
    height: min(12vw, 55px);

    margin: 2px;

    border: none;
    border-radius: 6px;

    background: var(--keyboard);
    color: white;

    font-size: min(4vw, 18px);
    font-weight: bold;

    cursor: pointer;
    transition: .15s;
}

.key:hover {
    transform: translateY(-2px);
}

.key:active {
    transform: translateY(1px);
}

.key.large {
    width: min(18vw, 90px);
}

.key.correct {
    background: var(--blue);
}

.key.present {
    background: var(--orange);
}

.key.absent {
    background: var(--grey);
}

/* ---------- Mobile ---------- */

@media (max-width: 500px) {

    .logo-tile {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .logo-tile.title {
        width: 44px;
        height: 44px;
        font-size: 26px;
    }

    .logo {
        margin-bottom: 10px;
    }

    .subtitle {
        margin: 8px 0 10px;
        font-size: 18px;
    }

    #message {
        min-height: 0;
        margin-bottom: 6px;
    }

    #board {
        margin-top: 5px;
        margin-bottom: 20px;
    }
}
#sync-top-button {

    position: absolute;

    top: 20px;
    right: 120px;

    width: 40px;
    height: 40px;

    border: none;
    border-radius: 50%;

    background: #19385f;
    color: white;

    font-size: 18px;

    cursor: pointer;

}
#stats-button {
    position: absolute;
    top: 20px;
    right: 70px;

    width: 40px;
    height: 40px;

    border: none;
    border-radius: 50%;

    background: #19385f;
    color: white;

    font-size: 18px;

    cursor: pointer;
}
#help-button {
    position: absolute;
    top: 20px;
    right: 20px;

    width: 40px;
    height: 40px;

    border: none;
    border-radius: 50%;

    background: #19385f;
    color: white;

    font-size: 18px;

    cursor: pointer;
}
#menu-button {

    display: none;

    position: absolute;

    top: 20px;
    right: 20px;

    width: 40px;
    height: 40px;

    border: none;
    border-radius: 50%;

    background: #19385f;
    color: white;

    font-size: 18px;

    cursor: pointer;

}
.modal {
    display: none;

    position: fixed;
    inset: 0;

    background:
        rgba(0,0,0,.8);

    z-index: 999;
}

.modal-content {
    width: min(90vw, 600px);

    background: #001B3A;
    color: white;

    padding: 30px;
    border-radius: 12px;

    margin: 40px auto;

    text-align: left;

    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.modal-content h2 {
    margin-top: 0;
}

#close-help,
#close-stats,
#close-sync,
#close-account {

    float: right;

    font-size: 30px;

    font-weight: bold;

    color: white;

    cursor: pointer;

    transition: .2s;

}

#close-help:hover,
#close-stats:hover,
#close-sync:hover {

    color: #4DB8FF;

}

.example-row {
    display: flex;
    gap: 5px;
    margin: 15px 0;
}

.example {
    width: 45px;
    height: 45px;

    border: 2px solid #2f5c8d;
    border-radius: 6px;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 24px;
    font-weight: bold;
}

.example.blue {
    background: #4DB8FF;
    border-color: #4DB8FF;
}

.example.orange {
    background: #FFA347;
    border-color: #FFA347;
}

.example.grey {
    background: #7A7A7A;
    border-color: #7A7A7A;
}

@media (max-width: 500px) {

    .modal-content {
        margin: 20px;
        padding: 20px;
    }

    .example {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
}
.back-link {
    position: absolute;
    top: 20px;
    left: 20px;

    display: flex;
    align-items: center;

    width: 40px;
    height: 40px;
    overflow: hidden;

    background: rgba(25, 56, 95, 0.9);
    border-radius: 20px;

    color: #4DB8FF;
    text-decoration: none;

    transition: width 0.3s ease;

    z-index: 1000;
}

.back-link:hover {
    width: 190px;
}

.back-arrow {
    width: 40px;

    display: flex;
    justify-content: center;
    align-items: center;

    flex-shrink: 0;

    color: white;
    font-size: 22px;
}

.back-text {
    white-space: nowrap;
    opacity: 0;

    font-weight: bold;

    transition: opacity 0.2s ease;
}

.back-link:hover .back-text {
    opacity: 1;
}
.back-text {
    color: white;
    white-space: nowrap;
    opacity: 0;

    font-weight: bold;

    transition: opacity 0.2s ease;
}
/* ---------- Mobile Header ---------- */

@media (max-width: 768px) {

    .back-link {
        display: none;
    }

    #stats-button,
    #help-button {
        display: none;
    }

    #menu-button {
        display: block;
        right: 20px;
    }

    #sync-top-button {
        left: 20px;
        right: auto;
    }

}
/* ----- Streak ----- */
#streak-container {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
    color: white;
}
#share-button,
#view-stats-button {

    width: 180px;

    margin: 20px 0 0;
    padding: 12px 24px;

    background: #F28C28;
    color: white;

    border: none;
    border-radius: 8px;

    font-size: 16px;
    font-weight: bold;

    cursor: pointer;

    transition: .2s;

}

#share-button:hover,
#view-stats-button:hover {

    background: #d9781d;

}

#result-buttons {

    justify-content: center;
    align-items: center;

    gap: 12px;

    margin-top: 20px;

}
/* ---------- Banner ---------- */
#event-banner {
    max-width: 420px;
    margin: 0 auto 20px;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
}

.hidden {
    display: none;
}

.super-banner {
    background: #dbeafe;
    color: #1e3a8a;
    border: 2px solid #60a5fa;
}

.chef-banner {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #fbbf24;
}
/* ==========================
   Statistics
========================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.stat-card {
    background: #19385f;
    border: 2px solid #2b5a93;
    border-radius: 12px;

    padding: 18px;

    text-align: center;

    transition: .2s;
}

.stat-card.full {
    grid-column: 1 / -1;
}

.stat-value {
    display: block;

    font-size: 34px;
    font-weight: bold;

    color: white;
}

.stat-label {
    display: block;

    margin-top: 8px;

    font-size: 14px;

    color: #d5dce6;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin: 12px 0;
}

.stats-row strong {
    font-size: 20px;
}

#guess-distribution {
    margin-top: 15px;
}
/* ==========================
   Guess Distribution
========================== */

.guess-row {
    display: flex;
    align-items: center;

    gap: 12px;

    margin: 8px 0;
}

.guess-number {
    width: 20px;

    font-weight: bold;
}
.guess-bar-container {
    flex: 1;
}
.guess-bar {

    height: 28px;

    background: #2b5a93;

    border-radius: 6px;

    color: white;

    display: flex;
    align-items: center;

    padding-left: 10px;

    font-weight: bold;

    transition: width .3s;

    min-width: 0;
}

.guess-count {

    width: 20px;

    text-align: right;

    font-weight: bold;
}
.key i {
    font-size: 18px;
}
/* ==========================
   Achievements
========================== */

#achievements {

    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;

}

.achievement {

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px;

    border-radius: 8px;

    background: #f5f5f5;

}

.achievement.locked {

    opacity: .4;

}

.achievement-icon {

    font-size: 26px;

}

.achievement-info {

    flex: 1;

}

.achievement-title {

    font-weight: bold;

}
/* ==========================
   Achievement Popup
========================== */

#achievement-popup {

    position: fixed;

    top: -120px;
    left: 50%;

    transform: translateX(-50%);

    display: flex;
    align-items: center;

    gap: 15px;

    padding: 18px 25px;

    background: #19385f;

    border: 3px solid #F28C28;

    border-radius: 12px;

    color: white;

    box-shadow: 0 8px 20px rgba(0,0,0,.4);

    transition: top .5s ease;

    z-index: 5000;

}

#achievement-popup.show {

    top: 20px;

}

#achievement-icon {

    font-size: 42px;

}

#achievement-title {

    font-weight: bold;

    color: #F28C28;

    margin-bottom: 5px;

}
/* ==========================
   Countdown
========================== */

#countdown-container {

    text-align: center;

    margin-bottom: 18px;

}

#countdown-label {

    font-size: 15px;

    color: #d5dce6;

}

#countdown {

    font-size: 30px;

    font-weight: bold;

    color: #F28C28;

    margin-top: 4px;

}
/* ==========================
   Login Buttons
========================== */

.login-button {

    width: 100%;

    margin-top: 12px;

    padding: 14px;

    border: none;
    border-radius: 10px;

    font-size: 16px;
    font-weight: bold;

    cursor: pointer;

    display: flex;
    justify-content: center;
    align-items: center;

    gap: 10px;

    transition: .2s;

}

.login-button i {

    font-size: 20px;

}

.google-login {

    background: white;
    color: #444;

}

.google-login:hover {

    background: #f3f3f3;

}

.apple-login {

    background: black;
    color: white;

}
.apple-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.apple-login small {
    display: block;
    font-size: 12px;
    margin-top: 2px;
    opacity: 0.8;
}
.apple-login:not(:disabled):hover {

    background: #222;

}
.sync-note {

    margin-top: 20px;

    text-align: center;

    font-size: 13px;

    line-height: 1.5;

    color: #c7d3e6;

}
/* ==========================
   Mobile Menu
========================== */

.mobile-menu {

    display: none;

    position: absolute;

    top: 70px;
    right: 20px;

    width: 230px;

    background: #19385f;

    border: 2px solid #2b5a93;
    border-radius: 12px;

    overflow: hidden;

    z-index: 1000;

}

.mobile-menu button {

    width: 100%;

    padding: 15px;

    border: none;

    background: transparent;
    color: white;

    text-align: left;

    font-size: 16px;

    cursor: pointer;

}

.mobile-menu button:hover {

    background: #2b5a93;

}

.mobile-menu a {

    display: block;

    padding: 15px;

    color: white;

    text-decoration: none;

}

.mobile-menu a:hover {

    background: #2b5a93;

}

.mobile-menu hr {

    margin: 0;

    border: none;

    border-top: 1px solid #2b5a93;

}