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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: white;
    margin: 0;
    padding: 0;
    /* Prevent zoom on Safari */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    /* Safe area support for iPhone notch/Dynamic Island */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.main-content {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0 20px 20px 20px;
}

@media (max-width: 767px) {
    .main-content {
        padding: 0; /* Remove main content padding on mobile */
    }
}

.game-container {
    background: white;
    border: 1px solid white;
    border-radius: 4px;
    padding: 0;
    max-width: 600px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Mobile-style appearance for all screens */
body {
    background: #eeeeee; /* Light gray background outside mobile container */
}

.game-container {
    border: 1px solid #ddd;
    max-width: 375px; /* iPhone width to simulate mobile screen */
    border-radius: 20px; /* More rounded corners for mobile-like appearance */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Subtle drop shadow */
}

.loading {
    font-size: 18px;
    color: #666;
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: #4ac22e;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.word-seed {
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
    font-size: 24px;
    color: #333;
    margin: 11px 0 16px 0; /* Reduced top margin by 13px total: 24px→11px */
    height: 34px; /* Fixed height - Reserve space even when hidden */
    opacity: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.undo-count-text {
    font-size: 14px;
    color: #666;
    font-weight: normal;
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.word-seed h1 {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
    display: inline;
}

.word-seed.hidden {
    opacity: 0 !important;
    transition: opacity 0.3s ease-out;
    /* Keep the height so layout doesn't shift */
}

.current-word {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: bold;
    color: #444444;
    margin: 15px 0 20px 0; /* Reduced top and bottom by 5px each */
    letter-spacing: 0;
    height: 100px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out 0.5s forwards;
    /* Font size will be set dynamically by JavaScript */
}

.available-letters {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0 25px 0; /* Reduced bottom margin by 50% from 50px to 25px */
    flex-wrap: wrap;
}

.letter-button {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #4ac22e;
    color: white;
    border: none;
    border-radius: 7.5px;
    font-size: 2rem;
    font-weight: bold;
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.letter-button:hover {
    /* No shadow on hover for cleaner look */
}

.letter-button:active {
    /* No transform animation for mobile compatibility */
}

.stats {
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
    margin: 40px auto 30px auto; /* Move down 10px and center the stats box */
    font-size: 16px;
    color: #444;
    width: fit-content; /* Auto-fit width to content */
}

.stat-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    display: grid;
    grid-template-columns: auto auto auto;
    gap: 10px;
    align-items: center;
    row-gap: 8px;
}

.stat-row-with-bar {
    display: contents;
}

.stat-label-col {
    text-align: left;
}

.stat-number-col {
    text-align: left;
}

.stat-bar-col {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.stat-bar-with-max {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-bar-container {
    display: flex;
    flex-direction: row;
    height: 10px;
    width: 60px;
    overflow: hidden;
    border-radius: 5px;
    background: #ccc;
}

.stat-bar-max {
    font-size: 10px;
    color: #888;
    min-width: 20px;
    text-align: left;
}

.stat-bar-green {
    height: 10px;
    background: #4ac22e;
    transition: width 0.1s linear;
    border-radius: 5px;
}

.stat-bar-green.amber {
    background: #f59e0b;
}

.stat-bar-grey {
    height: 10px;
    background: transparent;
    transition: width 0.1s linear;
    flex-grow: 1;
}

.game-over {
    background: #e8f5e8;
    border: 2px solid #4ac22e;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-over h2 {
    color: #2e7d32;
    margin-bottom: 15px;
}

.new-game-btn {
    background: #4ac22e;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    padding: 15px 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 20px;
}

.new-game-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.longest-words {
    margin: 0px auto 15px auto;
    width: 270px;
}

#longestWordsList {
    max-height: 150px; /* Increased height to show more content */
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 4px 8px; /* Reduced top/bottom padding from 8px/12px to 4px */
    box-sizing: border-box;
}

.longest-words h3 {
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
    color: black !important;
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 7.5px; /* Halved from 15px to 7.5px */
    text-decoration: none !important;
}

.longest-words div[onclick] {
    color: black !important;
    text-decoration: none !important;
}

.word-item {
    text-align: left;
    padding: 3.5px 0; /* Reduced by 30% from 5px */
    font-size: 15px; /* 1px smaller than header (16px) */
}

.word-item:last-child {
    margin-bottom: 4px; /* Reduced extra space at bottom */
}

.word-prefix {
    font-weight: bold;
    color: #4ac22e;
}

.word-suffix {
    color: #666;
}

.performance-info {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.6);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    backdrop-filter: blur(10px);
    z-index: 1000;
    max-width: 300px;
    text-align: right;
}

.compression-info {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
}

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

@keyframes scaleIn {
    from { transform: scale(0.9); }
    to { transform: scale(1); }
}

@keyframes letterCelebration {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

@keyframes ordinalPulse {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

@keyframes perfectCelebration {
    0% { transform: translateY(0); color: inherit; }
    25% { transform: translateY(-10px); color: #FFD700; }
    50% { transform: translateY(-5px); color: #FF6B6B; }
    75% { transform: translateY(-10px); color: #4ECDC4; }
    100% { transform: translateY(0); color: #FF69B4; }
}

@keyframes firework {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(1);
        opacity: 0;
    }
}

.celebration-letter {
    display: inline-block;
    margin: 0;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
}

.ordinal-number {
    display: inline;
    color: #4ac22e;
    font-weight: bold;
}

.ordinal-char {
    display: inline-block;
    animation: ordinalPulse 0.3s ease-in-out;
}

#currentWordText {
    display: flex;
    justify-content: center;
    white-space: nowrap; /* Force no wrapping */
}

.letter-ripple {
    display: inline-block;
    animation: letterCelebration 0.28s ease-in-out; /* 30% faster: 0.4s -> 0.28s */
}

.letter-perfect {
    display: inline-block;
    animation: perfectCelebration 0.42s ease-in-out; /* 30% faster: 0.6s -> 0.42s */
    position: relative;
}

.firework-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    animation: firework 0.56s ease-out forwards; /* 30% faster: 0.8s -> 0.56s */
}

.share-button {
    background: #4ac22e;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    padding: 12px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 15px;
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
    letter-spacing: 1.3px;
}

.share-button:hover {
    background: #45a049;
    transform: translateY(-1px);
}

#finishDefinitionLink {
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#longestWordInfo {
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
}

.copied-popup {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 16px 34px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    line-height: 1.4;
    z-index: 1000;
    opacity: 0;
    pointer-events: none; /* Prevent blocking clicks when hidden */
    transition: opacity 0.3s ease;
}

.copied-popup.show {
    opacity: 1;
    pointer-events: auto; /* Allow events when visible */
}

@media (max-width: 767px) {
    .copied-popup {
        top: 25%;
    }
}

@media (max-width: 767px) {
    .letter-button {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .undo-button {
        width: 37.5px;
        height: 37.5px;
        font-size: 1.125rem;
    }

    .undo-icon {
        font-size: 1.3rem;
        top: 2px;
    }

    .stats {
        grid-template-columns: 1fr;
    }
}

/* Welcome Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 52px;
    z-index: 1000;
}

@media (min-width: 768px) {
    .modal-overlay {
        /* Center over the game container area on desktop */
        justify-content: center;
        padding-left: calc((100vw - 375px) / 2);
        padding-right: calc((100vw - 375px) / 2);
        align-items: flex-start;
        padding-top: 52px;
    }
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 15px;
    max-width: 320px;
    max-height: 85vh;
    width: 90%;
    text-align: left;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
}

.modal-header {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.modal-instruction {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10.8px;
    font-size: 14px;
    line-height: 1.4;
}

.modal-instruction:last-of-type {
    margin-bottom: 0;
}

.modal-emoji {
    font-size: 16px;
    margin-right: 8px;
    flex-shrink: 0;
    margin-top: 1px;
}

.modal-close-btn {
    background: #4ac22e;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    padding: 12px 24px;
    cursor: pointer;
    transition: background 0.2s ease;
    align-self: center;
}

.modal-close-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.modal-close-x {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.modal-close-x:hover {
    color: #333;
}

/* Stats Icon Styles */
.stats-icon {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: absolute;
    top: 10px;
    right: calc((100% - 375px) / 2 + 52px);
    filter: grayscale(100%);
    z-index: 10;
}

.stats-icon:hover {
    border-color: #999;
}

/* Help Icon Styles */
.help-icon {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: absolute;
    top: 10px;
    right: calc((100% - 375px) / 2 + 10px);
    z-index: 10;
}

.help-icon:hover {
    border-color: #999;
}

/* Menu Button Styles */
.menu-button {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    user-select: none;
    position: absolute;
    top: 10px;
    left: calc((100% - 375px) / 2 + 10px);
    transition: all 0.2s ease;
    z-index: 10;
}

.menu-button span {
    position: relative;
    top: -3px;
}

.menu-button:hover {
    border-color: #999;
}

.menu-button:active {
    transform: scale(0.95);
}

.menu-dropdown {
    display: none;
    position: absolute;
    top: 46px;
    left: calc((100% - 375px) / 2 + 10px);
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 180px;
}

.menu-dropdown.show {
    display: block;
}

.menu-option {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 1px solid #eee;
}

.menu-option:last-child {
    border-bottom: none;
}

.menu-option:hover {
    background: #f5f5f5;
}

/* Language Selector Styles */
.language-button {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    user-select: none;
    position: absolute;
    top: 10px;
    left: calc((100% - 375px) / 2 + 52px);
    transition: all 0.2s ease;
    z-index: 10;
}

.language-button:hover {
    border-color: #999;
}

.language-button:active {
    transform: scale(0.95);
}

.language-dropdown {
    display: none;
    position: absolute;
    top: 46px;
    left: calc((100% - 375px) / 2 + 52px);
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 180px;
}

.language-dropdown.show {
    display: block;
}

.language-option {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    border-bottom: 1px solid #eee;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: #f5f5f5;
}

.language-option.active {
    background: #e8f5e9;
}

.language-option .flag {
    font-size: 24px;
}

.language-option .name {
    flex: 1;
}

.game-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 375px;
    margin: 0 auto;
    padding: 0 5px;
    margin-bottom: 10px;
}

/* Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    z-index: 10000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.cookie-banner.hidden {
    display: none;
}

.cookie-banner-text {
    flex: 1;
    font-family: sans-serif;
}

.cookie-banner-buttons {
    display: flex;
    gap: 10px;
}

.cookie-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    font-family: sans-serif;
    white-space: nowrap;
}

.cookie-btn-accept {
    background-color: #4ac22e;
    color: white;
}

.cookie-btn-decline {
    background-color: #666;
    color: white;
}

.cookie-btn:hover {
    opacity: 0.9;
}

/* Ad Banner */
.ad-banner {
    width: 320px;
    height: 50px;
    min-height: 50px;
    background-color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
    margin: 0 auto;
    position: relative;
}

.ad-banner > div {
    width: 100%;
    height: 100%;
    min-height: 50px;
}

/* Ad banner - unified behavior for all screen sizes */
.ad-banner-wrapper {
    position: sticky;
    bottom: 0;
    width: 100%;
    padding: 15px 0 0 0;
}


.game-number {
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 7px 0 0 0;
    min-height: 21px; /* Reserve space for text (14px font + line height) */
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
}

.game-number.daily {
    color: #4ac22e; /* Official WordSeed green for daily games */
    font-weight: 600; /* Semibold for daily games */
}

/* Copyright footer */
#copyright {
    font-size: 12px !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
}

#copyright a {
    font-size: 12px !important;
}

/* Stats Modal List */
.stats-list {
    margin-top: 0px;
    display: flex;
    flex-direction: column;
    gap: 8.625px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5.06px 12.8px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.stat-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #4ac22e;
    white-space: nowrap;
}

.hidden {
    display: none !important;
}

/* Mock Ad Modal */
.mock-ad-container {
    background: #666;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    margin: 0 auto;
}

.mock-ad-content {
    padding: 30px;
    text-align: center;
}

.mock-ad-header {
    font-size: 20px;
    font-weight: bold;
    color: white;
    margin-bottom: 20px;
}

.mock-ad-body {
    font-size: 16px;
    color: #ddd;
    margin-bottom: 30px;
    line-height: 1.5;
}

.mock-ad-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.mock-ad-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mock-ad-cancel {
    background: #999;
    color: white;
}

.mock-ad-cancel:hover {
    background: #888;
}

.mock-ad-complete {
    background: #4ac22e;
    color: white;
}

.mock-ad-complete:hover {
    background: #3da925;
}

/* Undo Button */
.undo-button {
    position: relative;
    background: #4ac22e;
    /* 75% size of regular letter buttons */
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
}

.ad-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 9px;
    font-weight: bold;
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
}

.undo-count {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 9px;
    font-weight: bold;
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
}

.undo-icon {
    font-size: 0.9rem;
    font-weight: bold;
    position: relative;
    top: 1px;
}

/* About Section */
.about-container {
    position: absolute;
    top: calc(100vh + 10px); /* Fallback - dynamically updated by JS to max(100vh + 10px, adBottom + 10px) */
    left: 50%;
    transform: translateX(-50%);
    max-width: 375px;
    width: 100%;
    padding: 30px 20px;
    text-align: left;
    opacity: 1;
}

.about-subheading {
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.about-subheading-sub {
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

.about-body {
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
    font-size: 16px;
    color: #444;
    line-height: 1.6;
}

.about-body p {
    margin: 0 0 16px 0;
}

.about-body p:last-child {
    margin-bottom: 0;
}

.about-body ul {
    margin: 0 0 16px 0;
    padding-left: 30px;
}

.about-body h3 {
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 30px 0 15px 0;
}

/* About WordSeed Button */
.about-button {
    position: fixed;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: #999;
    color: #eeeeee;
    border: none;
    border-radius: 14px;
    padding: 6px 11px;
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 999;
    opacity: 1;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.about-button.faded {
    opacity: 0.5;
}

.about-button.invisible {
    opacity: 0;
    pointer-events: none;
}

.about-button:hover:not(.invisible) {
    opacity: 1;
}

.about-arrow {
    color: #eeeeee;
    font-size: 11px;
    line-height: 1;
}

.about-button.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Streak Celebration Modal */
.streak-celebration-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 10000;
    pointer-events: all;
    background: rgba(0, 0, 0, 0.5);
}

.streak-celebration-modal.hidden {
    display: none;
}

.streak-celebration-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    width: 50%;
    max-width: 300px;
    min-width: 200px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: absolute;
    z-index: 10001;
    cursor: pointer;
}

.streak-celebration-text {
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
    font-size: 18px;
    line-height: 1.4;
    color: #333;
    text-align: center;
}

.streak-days-number {
    font-size: 32px;
    font-weight: bold;
    color: #4ac22e;
    display: inline;
}

.streak-confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10000;
}

.streak-confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    pointer-events: none;
}

/* FAQ Styles */
.faq-item {
    margin-bottom: 4.8px;
}

.about-body .faq-question {
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
    cursor: pointer;
    user-select: none;
    padding: 10px 0;
    position: relative;
    transition: color 0.2s ease;
}

.about-body .faq-question:hover {
    color: #4ac22e;
}

.about-body .faq-question::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.2s ease;
}

.about-body .faq-question.open::before {
    transform: rotate(90deg);
}

.faq-answer {
    font-family: 'Avenir Next', 'Avenir', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif;
    font-size: 16px;
    color: #444;
    line-height: 1.6;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 24px;
}

/* Scroll to top button */
.scroll-to-top-btn {
    position: fixed;
    bottom: 20px;
    background: #4ac22e;
    color: white;
    border: none;
    border-radius: 3.75px;
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    /* Position relative to center, accounting for game container width (375px max) */
    left: calc(50% + 187.5px + 10px);
}

.scroll-to-top-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-to-top-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.scroll-to-top-btn:active {
    transform: translateY(0);
}

/* On mobile (narrower than game container), position inside right edge */
@media (max-width: 600px) {
    .scroll-to-top-btn {
        width: 25px;
        height: 25px;
        font-size: 0.625rem;
        bottom: 15px;
        left: auto;
        right: 15px;
    }
}
