/* Apply Oswald font globally */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Oswald', sans-serif;
    background-color: #333;
    color: white;
    text-align: center;
    margin: 0;
    padding: 0;
}

h1 {
    font-size: 2.5rem;
    margin-top: 0px;
    margin-bottom: -6px;
    color: white;
    font-weight: 700;
}

#question {
    background-color: #222;
    color: #FFD700;
    font-size: 1rem;
    padding: 5px;
    border: 2px solid #FFD700;
    margin: 5px auto;
    width: 85%;
    max-width: 600px;
    border-radius: 10px;
}

/* Game grid */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 175px);
    grid-gap: 10px;
    justify-content: center;
    align-items: center;
    margin: 10px auto;
    width: max-content;
}

.box {
    width: 175px;
    height: 40px;
    background-color: #444;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid #FFD700;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 0.8rem;
}

.box.not-used {
    border: 1px solid #FFD700;
}

.box-number {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #FFD700;
    font-size: 1.25rem;
    font-weight: 400;
    pointer-events: none;
}

.box-number.visible {
    display: block;
}

.box-answer {
    flex: 3;
    text-align: center;
    text-transform: uppercase;
}

.box-count {
    flex: 1;
    text-align: center;
    margin-left: 10px;
}

.green {
    background-color: #a5d6a7;
    color: black;
    border: 2px solid #81c784;
}

.black {
    background-color: #191919;
    color: white;
    border: 2px solid rgba(0, 0, 0, 0.8);
}

.box.not-used.reveal-border {
    border: 2px solid #666;
}

/* Tagline */
#tagline {
    position: fixed;
    bottom: 0px;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: #FFD700;
    z-index: 9;
    height: 5vh;
    line-height: 5vh;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

#tagline a {
    color: #FFD700;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}
#tagline a:hover {
    color: #FFA500;
    text-decoration: underline;
}

/* -----------------------------
   Native keyboard (NO on-screen keyboard)
   ----------------------------- */
/* If you still have these elements in HTML, this ensures they don't show. */
#keyboardContainer,
#on-screen-keyboard {
    display: none !important;
}

/* Guess input */
#guess-section {
    width: 90%;
    max-width: 600px;
    margin: 10px auto 12px;
}

#guess-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

#guess-box {
    font-family: 'Oswald', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 90%;
    max-width: 500px;
    margin: 8px auto 6px;
}

/* IMPORTANT: native typing enabled */
#guess {
    pointer-events: auto;   /* ENABLE focus/click */
    user-select: text;      /* ENABLE selection */
    cursor: text;           /* text cursor */
    -webkit-user-select: text;
    -webkit-touch-callout: default;

    text-transform: uppercase;
    font-family: 'Oswald', sans-serif;

    /* 16px prevents iOS zoom-on-focus */
    font-size: 16px;

    padding: 5px;
    height: 40px;
    box-sizing: border-box;
    flex: 1;
    min-width: 0;
    margin-right: 10px;
}

#guess::placeholder {
    color: #aaa;
    line-height: normal;
    vertical-align: middle;
    font-size: 16px;
}

#guess:disabled {
    background-color: #e0e0e0;
    color: #999;
}

/* Submit button */
#submit-button {
    background-color: #FFD700;
    color: #333;
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    padding: 0 15px;
    height: 40px;
    width: 180px;
    border: 2px solid #333;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
    pointer-events: auto;
    user-select: none;
    touch-action: manipulation;
}

#submit-button:hover {
    background-color: #FFA500;
}

#submit-button:focus,
#submit-button:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

#submit-button:active {
    cursor: pointer;
    outline: none;
    box-shadow: none;
}

/* Blinking cursor (optional visual) */
@keyframes blink {
    50% {
        opacity: 0;
    }
}

#blinking-cursor {
    position: absolute;
    top: 0px;
    left: 5px;
    color: #000000;
    font-family: inherit;
    line-height: inherit;
    font-size: 1.5rem;
    animation: blink 1s step-start infinite;
    pointer-events: none;
}

/* Survey cursor */
#blinking-cursor-survey {
    position: absolute;
    top: 45%;
    left: 5px;
    transform: translateY(-50%);
    color: #000000;
    font-family: inherit;
    line-height: inherit;
    font-size: 1.5rem;
    animation: blink 1s step-start infinite;
    pointer-events: none;
    z-index: 1003;
}

/* Messages */
#already-found-message {
    height: 20px;
    line-height: 20px;
    text-align: center;
    overflow: hidden;
    color: red;
    font-size: 0.95rem;
    font-weight: bold;
    margin-top: 4px;
    margin-bottom: 2px;
      display: none;

}

#game-x-display {
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2px;
    margin-bottom: 8px;
    font-weight: bold;
    color: #FF0000;
    text-align: center;
    letter-spacing: 2px;
}

#game-x-display .x {
    font-size: 22px;
    color: #FF0000;
    margin: 0 5px;
}

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

body.processing {
    cursor: progress !important;
}

body.processing #submit-button:hover {
    background-color: #FFD700;
    cursor: progress;
}

/* Top-left overlay (arrows + game id) */
.top-right-overlay {
    position: fixed;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #222;
    border: 2px solid #FFD700;
    border-radius: 10px;
    padding: 5px;
    z-index: 10;
    display: none;
}

.overlay-arrow {
    font-size: 24px;
    color: white;
    cursor: pointer;
    margin: 0 5px;
    user-select: none;
}

.overlay-number {
    font-size: 16px;
    color: #FFD700;
    text-align: center;
    width: 50px;
    font-family: 'Oswald', sans-serif;
}

/* Hide info icon */
#info-icon {
    display: none;
}

/* Share icon hidden (per your note) */
#share-icon {
    display: none !important;
}

/* Stats icon */
#stats-icon {
    position: absolute;
    top: 20px;
    right: 45px;
    font-size: 1.1rem;
    color: #FFD700;
    cursor: pointer;
    background: #333;
    border: 2px solid #FFD700;
    border-radius: 10px;
    width: 2rem;
    height: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}
#stats-icon:hover {
    background-color: #FFD700;
    color: #333;
}

/* Instructions overlay */
.instructions-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    z-index: 1006;
}

.instructions-content {
    background: #333;
    color: white;
    padding: 15px;
    width: 85%;
    max-width: 450px;
    max-height: calc(100vh - 40px);
    border-radius: 10px;
    text-align: left;
    position: relative;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.5);
    line-height: 1.8;
    animation: fadeIn 0.5s ease-in-out;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #888 #555;
}

.instructions-content::-webkit-scrollbar {
    width: 8px;
}
.instructions-content::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 5px;
    border: 2px solid #333;
}
.instructions-content::-webkit-scrollbar-track {
    background-color: #555;
    border-radius: 5px;
}
.instructions-content::-webkit-scrollbar-thumb:hover {
    background-color: #666;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.instructions-content h2 {
    font-size: 1.2rem;
    margin-top: 0px;
    margin-bottom: 5px;
    margin-right: 50px;
    text-align: left;
    font-weight: normal;
}

.instructions-content p {
    font-size: 1rem;
    margin-top: 5px;
    margin-bottom: 5px;
    text-align: left;
}

.how-to-play {
    border: 1px solid #FFD700;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}
.how-to-play p {
    margin: 0;
    font-size: 1rem;
}
.how-to-play ul {
    list-style-type: disc;
    margin-top: 10px;
    border-radius: 8px;
    padding-left: 20px;
}
.how-to-play ul li {
    margin-bottom: 10px;
    font-size: 1rem;
}

.instructions-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #FFD700;
    background-color: rgba(255, 215, 0, 0.2);
    padding: 5px;
    border: 2px solid transparent;
    border-radius: 8px;
    width: 2em;
    height: 2em;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    transition: transform 0.2s ease, background-color 0.3s ease;
    z-index: 1002;
}
.instructions-close:hover {
    transform: scale(1.1);
    background-color: #FFD700;
    color: #333;
    border: 2px solid #FFD700;
}

@media (max-width: 428px) {
    .instructions-content {
        width: 95%;
        font-size: 0.9rem;
        max-height: calc(100vh - 40px);
    }
    .instructions-close {
        font-size: 1.2rem;
    }
}

/* Results overlay */
.results-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-height: 610px;
    justify-content: center;
    padding: 10px;
    z-index: 1004;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    margin: 0;
}

.results-content {
    position: relative;
    width: 95%;
    max-width: 600px;
    min-width: 350px;
    background: #15272f;
    color: white;
    padding: 5px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 90vh;
    margin: 0 auto;
    border: 1px solid #666;
    overflow: visible;
}

.results-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1rem;
    cursor: pointer;
    color: #FFD700;
    padding: 5px;
    border: 2px solid #FFD700;
    border-radius: 8px;
    width: 1.8em;
    height: 1.8em;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

#answer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    justify-content: center;
    margin: 1px auto;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Share button */
.btn-share-results {
    background-color: #1f4a5a;
    color: white;
    padding: 10px 20px;
    border: 1px solid #666;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 350px;
    margin: 10px auto;
}
.btn-share-results:hover {
    background-color: #236b83;
    transform: scale(1.05);
    box-shadow: 0px 4px 10px rgba(35, 107, 131, 0.8);
}

#results {
    display: none;
}

#score {
    font-size: 1rem;
    font-weight: bold;
    color: #FFD700;
    margin-top: 0px;
    margin-bottom: 0px;
    text-align: center;
}

/* Survey */
#survey {
    display: none;
    margin-bottom: 10px;
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid #FFD700;
    padding: 5px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    
}

#survey h3 {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    text-align: center;
    margin-top: 1px;
    text-transform: uppercase;
}

#survey-question {
    padding: 2px;
}

#thank-you-message {
    margin-top: 20px;
    color: #FFD700;
    padding: 20px;
    display: none;
}

#survey, #thank-you-message {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    text-align: center;
}

#response-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}

#survey-response {
    flex: 1;
    min-width: 200px;
    height: 40px;
    padding: 5px 5px;
    font-family: 'Oswald', sans-serif;
    font-size: 16px; /* prevent iOS zoom */
    text-transform: uppercase;
    box-sizing: border-box;
    border: 2px solid #666;
    border-radius: 5px;
    background-color: #fff;
    color: black;
    z-index: 1002;
}

#survey-response:focus {
    outline: none;
}

.btn-submit-survey {
    background-color: #FFD700;
    color: #333;
    padding: 8px 16px;
    border: 2px solid #333;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Oswald', sans-serif;
    white-space: nowrap;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30%;
    max-width: 350px;
    margin: 10px auto;
    transition: background-color 0.3s ease;
}
.btn-submit-survey:hover {
    background-color: #FFA500;
}

/* Copy confirmation */
#copy-confirmation {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #FFD700;
    color: #333;
    padding: 8px 16px;
    border-radius: 5px;
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    z-index: 1100;
    text-align: center;
    display: none;
}

/* Results grid boxes */
.grid-boxa {
    width: 150px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid #666;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 0.7rem;
}

.grid-boxa .grid-answera:empty + .grid-counta:empty,
.grid-boxa .grid-counta:empty + .grid-answera:empty {
    background-color: transparent;
}

/* NOTE: :has() not supported everywhere; keep, but don’t rely on it for core behavior */
.grid-boxa:has(:empty) {
    background-color: transparent;
    border: none;
    pointer-events: none;
}

.grid-answera {
    flex: 3;
    text-align: center;
    text-transform: uppercase;
    font-size: 12px;
}

.grid-counta {
    flex: 1;
    text-align: center;
    margin-left: 10px;
    font-size: 14px;
}

/* Overlay background behind results */
#overlay-background {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1004;
}



/* Suggest Survey Button */
.btn-suggest-survey {
    position: relative;
    background-color: #FFD700;
    color: #333;
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    padding: 10px 30px;
    border: 2px solid #333;
    border-radius: 8px;
    cursor: pointer;
    animation: pulseGlow 2s infinite;
    transition: transform 0.2s ease-in-out, background-color 0.3s ease;
    text-align: center;
    display: none;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 350px;
    margin: 10px auto;
}

@keyframes pulseGlow {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 215, 0, 0.7); }
    50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(255, 215, 0, 0.7); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 215, 0, 0.7); }
}

.btn-suggest-survey:hover {
    background-color: #FFA500;
    transform: scale(1.12);
}

/* Average score */
#average-score {
    padding-bottom: 8px;
}

#survey-note {
    font-size: 0.8rem;
    color: white;
    text-align: center;
    margin-top: 0px;
    opacity: 0.98;
}

/* Hide recaptcha badge */
.grecaptcha-badge {
    display: none !important;
}

/* Share popup overlay */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    pointer-events: auto;
}

.popup-content {
    background: #333;
    color: white;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: fadeIn 0.3s ease-in-out;
    pointer-events: auto;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1rem;
    cursor: pointer;
    color: #FFD700;
    transition: transform 0.2s ease;
    z-index: 10;
}
.close-popup:hover { transform: scale(1.1); }

.yellow-btn {
    background-color: #FFD700;
    color: #333;
    font-size: 1.2rem;
    font-family: "Oswald", sans-serif;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
    transition: background-color 0.3s ease;
}
.yellow-btn:hover { background-color: #FFA500; }

.outline-btn {
    background: transparent;
    border: 2px solid #FFD700;
    color: #FFD700;
    font-size: 1rem;
    font-family: "Oswald", sans-serif;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.outline-btn:hover {
    background-color: rgba(255, 215, 0, 0.2);
    color: white;
}

.popup-small-text {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 20px;
    text-align: center;
}

/* Hamburger menu */
.hamburger-menu {
    position: fixed;
    top: 20px;
    right: 8px;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #333;
    border: 2px solid #FFD700;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 1003;
}

.bar {
    width: 20px;
    height: 2px;
    background-color: #FFD700;
    margin: 2px auto;
    transition: 0.3s;
}

.hamburger-menu.open .bar:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
.hamburger-menu.open .bar:nth-child(2) {
    opacity: 0;
}
.hamburger-menu.open .bar:nth-child(3) {
    transform: rotate(-45deg) translate(4.5px, -4.5px);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: -250px;
    width: 250px;
    height: 100%;
    background-color: #222;
    color: white;
    padding-top: 60px;
    transition: 0.3s;
    z-index: 1002;
}
.sidebar.active { right: 0; }

.menu-links {
    list-style: none;
    padding: 0;
}

.menu-links li {
    padding: 15px;
    text-align: center;
}

.menu-links li a {
    color: #FFD700;
    text-decoration: none;
    font-size: 18px;
    cursor: pointer;
}

/* Menu overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 1001;
}
.menu-overlay.active { display: block; }

/* Social section */
#social-links {
    text-align: center;
    padding: 15px 0;
    margin-top: 30px;
}

#social-links p {
    font-size: 1rem;
    color: white;
    margin-bottom: 8px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-icons a img {
    width: 25px;
    height: 25px;
    filter: brightness(0) invert(1);
    transition: filter 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.social-icons a img:hover {
    filter: brightness(0) invert(0.7);
    transform: scale(1.1);
}

#todaygame {
    background-color: #FFD700;
    color: black !important;
    border-radius: 12px;
    padding: 10px 15px;
    display: inline-block;
}

/* Guesses popup */
#guesses-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1006;
}

.guesses-content {
    position: relative;
    width: 80%;
    max-width: 600px;
    min-width: 350px;
    background: #15272f;
    color: white;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 80vh;
    border: 1px solid #666;
}

.guesses-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1rem;
    cursor: pointer;
    color: #FFD700;
    padding: 5px;
    border: 2px solid #FFD700;
    border-radius: 8px;
    width: 1.8em;
    height: 1.8em;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.guesses-close:hover {
    transform: scale(1.1);
    background-color: #FFD700;
    color: #333;
    border: 2px solid #FFD700;
}

#guess-count {
    font-size: 1rem;
    color: #BBB;
    margin-top: 8px;
    margin-bottom: 15px;
}

#guess-list {
    list-style-type: none;
    padding: 0;
    margin-top: 15px;
    max-height: 250px;
    overflow-y: auto;
    width: 100%;
    text-align: left;
}

#guess-list li {
    font-size: 1rem;
    padding: 5px;
}

/* Email popup */
.email-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: hidden;
    box-sizing: border-box;
}

.email-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: #15272f;
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
    overflow-x: hidden;
    margin: 0;
    border: 1px solid #666;
}

.email-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1rem;
    cursor: pointer;
    color: #FFD700;
    padding: 5px;
    border: 2px solid #FFD700;
    border-radius: 8px;
    width: 1.8em;
    height: 1.8em;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.email-content input[type="email"] {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    margin: 10px auto;
    border: 2px solid #FFD700;
    border-radius: 8px;
    background-color: #1d2f36;
    color: white;
    font-family: 'Oswald', sans-serif;
    font-size: 16px; /* prevent iOS zoom */
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.email-content input[type="email"]:focus {
    border-color: #FFA500;
    background-color: #223a43;
    box-shadow: 0 0 8px #FFA500;
}

.email-content input[type="email"]::placeholder {
    color: #aaa;
    font-style: italic;
}

.email-content button {
    width: 60%;
    margin: 10px auto;
    height: 40px;
    background-color: #FFD700;
    color: #333;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 5px;
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.email-content button:hover {
    background-color: #FFA500;
}

#email-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#email-header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
}

#email-header h3 {
    max-width: 70%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: white;
    font-size: 1.2rem;
    font-family: 'Oswald', sans-serif;
    margin: 0 auto;
}

.hidden {
    display: none;
    visibility: hidden;
}

.feedback-message {
    margin-top: 5px;
    padding: 5px;
    font-size: 14px;
    text-align: center;
    color: white;
    background-color: transparent;
}
.feedback-message a {
    color: white;
    text-decoration: underline;
    font-weight: bold;
}
.feedback-message a:hover {
    opacity: 0.8;
}

/* Login button */
#login-btn {
    position: fixed;
    top: 20px;
    left: 10px;
    background-color: #FFD700;
    color: #333;
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    padding: 4px 4px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease, border-radius 0.2s ease;
    z-index: 1000;
}
#login-btn:hover { background-color: #FFA500; }

/* Logout dropdown */
#logout-dropdown {
    position: absolute;
    background-color: #FFD700;
    color: #333;
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    display: none;
    text-align: center;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1101;
    opacity: 0;
    transform: translateY(-0px);
    transition: opacity 0.2s ease, transform 0.2s ease, border-radius 0.2s ease;
    min-width: fit-content;
    width: auto;
}
#logout-dropdown.visible {
    display: block;
    opacity: 1;
    transform: translateY(-1px);
}

#logout-btn {
    background: transparent;
    border: none;
    color: #333;
    font-size: 1rem;
    font-family: 'Oswald', sans-serif;
    cursor: pointer;
    padding: 4px 4px;
    width: 100%;
    text-align: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#logout-btn:hover,
#logout-dropdown:hover {
    background-color: #FFA500;
    border-radius: 5px !important;
}

/* Stats popup overlay */
#overlay-background-stats {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
}

#stats-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: auto;
    z-index: 2000;
}

.stats-content {
    position: relative;
    width: 95%;
    max-width: 600px;
    min-width: 350px;
    background: #15272f;
    color: white;
    padding: 10px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 90vh;
    margin: 0 auto;
    border: 1px solid #666;
    overflow: visible;
    z-index: 2001;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 10px;
    width: 100%;
    max-width: 350px;
    margin: 20px auto;
}

.stats-grid div {
    padding: 8px;
    background-color: #444;
    border-radius: 5px;
    text-align: center;
    font-size: 1rem;
    color: white;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Stats login prompt */
#stats-login-prompt {
    display: none;
    text-align: center;
    padding: 15px;
    width: 100%;
    max-width: 350px;
    margin: 20px auto;
}

#stats-login-prompt p {
    font-size: 1rem;
    color: white;
    margin-bottom: 10px;
}

#stats-login-button {
    background-color: #FFD700;
    color: #333;
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    padding: 10px 15px;
    border: 2px solid #333;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s;
    width: 100%;
    max-width: 250px;
}
#stats-login-button:hover {
    background-color: #FFA500;
    transform: scale(1.05);
    box-shadow: 0px 4px 10px rgba(255, 215, 0, 0.8);
}

#stats-login-disclaimer p {
    font-size: 0.75rem;
    color: #808080;
    margin-top: 5px;
    font-style: italic;
    padding: 10px 10px;
}

/* Desktop share wrapper */
#desktop-share-wrapper {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    margin-top: 20px;
    text-align: center;
}

#desktop-share-wrapper h3 {
    margin-bottom: 10px;
}

#desktop-share-wrapper .a2a_kit {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.a2a_kit.a2a_kit_size_32 a {
    transform: scale(1.1);
}

.game-id-display {
    font-size: 0.75rem;
    color: white;
    margin-bottom: 5px;
    opacity: 0.7;
}

/* Small screen height adjustments (kept from your original) */
@media (max-height: 600px) {
    .grid {
        grid-template-columns: repeat(2, 120px);
        grid-gap: 4px;
    }
    .box {
        width: 120px;
        height: 35px;
    }
    .boxa {
        width: 120px;
        height: 35px;
    }
    #guess-box {
        width: 80%;
        max-width: 250px;
    }
    #guess, #submit-button {
        font-size: 0.8rem;
        height: 25px;
    }
    #already-found-message {
        height: 30px;
        line-height: 10px;
        font-size: 0.8rem;
        margin-top: 2px;
        margin-bottom: 7px;
    }
    #game-x-display {
        height: 20px;
        font-size: 0.8rem;
        margin-top: 2px;
    }
    #game-x-display .x {
        font-size: 20px;
    }
    #blinking-cursor {
        top: 0px;
        left: 5px;
        font-size: 1rem;
    }
}

@media (max-height: 705px) {
    #results {
        transform: scale(0.9);
        transform-origin: top center;
    }
}
@media (max-height: 645px) {
    #results {
        transform: scale(0.8);
        transform-origin: top center;
    }
}
@media (max-height: 580px) {
    #results {
        transform: scale(0.75);
        transform-origin: top center;
    }
}

/* Improve mobile native keyboard layout safety */
@supports (padding: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}


