@import url('https://fonts.googleapis.com/css2?family=Playwrite+US+Trad&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&display=swap');

/* Reset any browser default margins */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    border: 0;
}


/* Loading Text Blink Animation */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.stats-loading-text {
    animation: blink 1.5s ease-in-out infinite;
}

/* Image Placeholder/Skeleton */
.image-placeholder {
    width: 100%;
    max-width: 400px;
    height: 250px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 8px;
    margin-top: 8px;
    margin-bottom: 4px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.daily-image.loading {
    display: none;
}

.container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    background-color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    padding: 24px 0;
    margin: 8px 8px 0 8px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #DDEEF2 0%, #C8E6F0 50%, #B8DEE8 100%);
    height: 110px;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

h1 {
    font-family: 'Playwrite US Trad', 'Dancing Script', sans-serif;
    font-size: 2.6rem;
    margin: 0;
    color: #2c3e50;
    font-weight: normal;
    text-decoration: none;
    position: relative;
    z-index: 1;
}

h1 a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
    position: relative;
    z-index: 1;
}

h1 a:hover {
    /* Hover effects removed for mobile optimization */
}

/* Main Game Area */
#game-container,
.tomorrow-content {
    padding: 20px 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.success-content {
    padding: 20px 16px !important;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: auto !important;
    min-height: auto !important;
}

/* Word Display */
#word-display {
    font-family: 'Inter', sans-serif;
    /* Match body font */
    font-size: 2rem;
    /* Larger letters */
    font-weight: 700;
    /* Bold */
    text-align: center;
    margin: 12px 0;
    letter-spacing: 0.5em;
    /* Wide spacing */
    color: #343A40;
    text-transform: uppercase;
    /* UPPERCASE LETTERS */
    /* border-bottom: 2px solid #CED4DA; Underline */
    padding-bottom: 10px;
    /* Space below letters */
    /* Remove margin if using padding for spacing */
    line-height: 1.2;
}

#word-display::before {
    display: none;
}


/* Game Status */
#game-status {
    display: flex;
    justify-content: space-between;
    padding: 8px 20px;
    background-color: transparent;
    font-family: 'Inter', sans-serif;
}

.status-item {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #adb5bd;
    font-weight: 400;
    margin-bottom: 7.5px;
}

.status-item:first-child {
    text-align: left;
}

.status-item:last-child {
    text-align: right;
}

.status-item span {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: #adb5bd;
    font-size: 0.85rem;
}

/* Guess Input */
#guess-container {
    display: flex;
    margin: 0;
    padding: 0;
    width: 100%;
}

#guess-input {
    flex-grow: 1;
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid #CED4DA;
    /* border-radius: 4px; */
    margin-right: 10px;
    font-family: 'Inter', sans-serif;
}

#guess-button {
    margin: -1px 0 0 0;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 12px 16px !important;
    width: 372px !important;
    box-sizing: border-box;
    display: block;
    background: linear-gradient(135deg, #c8e6a3 0%, #b8d99a 50%, #a8cc8f 100%) !important;
    color: #2c3e50 !important;
    border: none !important;
    box-shadow: 0 3px 8px rgba(184, 217, 154, 0.4), 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#guess-button:hover {
    /* Hover effects removed for mobile optimization */
}

#guess-button:active {
    transform: translateY(0px);
    box-shadow: 0 2px 4px rgba(199, 217, 183, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
}

#guess-button:disabled {
    cursor: not-allowed;
}

/* Game Results Feedback */
#game-results {
    margin: 3px 0 9px 0;
    /* Closer to hint box, further from guess button */
    text-align: center;
    color: #adb5bd;
    /* Light grey to match instruction text */
    font-weight: normal;
    font-style: normal;
    height: 19px;
    /* Fixed height to maintain consistent spacing */
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Game status margins - JavaScript controlled */
#game-status {
    margin: 0 12px 4px 8px !important;
}

/* Hints Section Styling */
#hints-container {
    display: flex;
    flex-direction: column;
    gap: 2.16px;
    margin: -3px 0 0 0;
    padding: 0;
    width: 100%;
}

/* Hint box container for 3D flip effect */
.hint-box-container {
    perspective: 1000px;
    margin: 0 0 4.8px 0;
    margin-left: auto;
    margin-right: auto;
    width: calc(100% - 16px);
    max-width: 372px;
}

.hint-box {
    margin: 0;
    padding: 12px 16px; /* Consistent padding in both states */
    width: 100%;
    height: 70px;
    box-sizing: border-box;
    display: block;
    transition: background 0.8s ease-out, border-color 0.8s ease-out, box-shadow 0.8s ease-out;
    background: linear-gradient(135deg, #fcfcfd 0%, #fafbfc 50%, #f8f9fa 100%);
    border: 2px solid #f1f3f4;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.025), 0 2px 4px rgba(0, 0, 0, 0.015);
    position: relative;
    overflow: hidden;
}

/* Revealed state */
.hint-box.hint-revealed {
    /* Base revealed styles - colors set by nth-of-type rules */
}

.hint-box:hover:not(.hint-revealed) {
    /* Hover effects removed for mobile optimization */
}

/* Keep title at top for consistent positioning */
.hint-box:not(.hint-revealed) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.hint-box:not(.hint-revealed) .hint-category {
    margin: 0 0 0 0;
    font-weight: 300;
}

.hint-box:not(.hint-revealed) .hint-preview {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.hint-category {
    font-size: 1.1rem;
    font-weight: 300;
    color: #2c3e50;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
    text-align: center;
}

.hint-preview {
    font-size: 0.8em;
    font-weight: 500;
    color: #adb5bd;
    font-family: 'Inter', sans-serif;
    text-align: center;
    margin-top: 3px;
    font-style: italic;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 1em;
}

/* Fix spacing for boxes 2-4 in Instagram browser - ensure they match box 1's spacing */
.hint-box-container:nth-of-type(n+2) .hint-box:not(.hint-revealed) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

.hint-box-container:nth-of-type(n+2) .hint-box:not(.hint-revealed) .hint-category {
    margin: 0 auto 0 auto !important;
    line-height: 1.2 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

.hint-box-container:nth-of-type(n+2) .hint-box:not(.hint-revealed) .hint-preview {
    margin-top: 3px !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    line-height: 1.2 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hide preview when hint is revealed */
.hint-box.hint-revealed .hint-preview {
    display: none !important;
    visibility: hidden !important;
}

.hint-content {
    display: none;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 6px;
    color: #000000;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
    text-align: center;
    transition: opacity 0.3s ease-in-out;
}

/* Revealed hint styling */
.hint-box.hint-revealed {
    background-color: #D6F0F4;
    /* Lightest blue (almost pastel) base color */
    cursor: default;
    padding: 12px 16px;
    /* Same padding as unrevealed state - prevents title jump */
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Auto height for all revealed hints - adapts to content */
.hint-box.hint-revealed.short-content,
.hint-box.hint-revealed.medium-content,
.hint-box.hint-revealed.long-content {
    height: auto;
    min-height: 70px;
}

/* Create increasingly darker shades for subsequent hints */
.hint-box-container:nth-of-type(1) .hint-box.hint-revealed {
    background: linear-gradient(135deg, #D6F0F4 0%, #C8E8F0 50%, #B8E0EC 100%);
    border: 2px solid #B8E0EC;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.hint-box-container:nth-of-type(2) .hint-box.hint-revealed {
    background: linear-gradient(135deg, #A6D7E8 0%, #96CFE0 50%, #86C7D8 100%);
    border: 2px solid #86C7D8;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.hint-box-container:nth-of-type(3) .hint-box.hint-revealed {
    background: linear-gradient(135deg, #7CBFD4 0%, #6CB3C8 50%, #5CA7BC 100%);
    border: 2px solid #5CA7BC;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.hint-box-container:nth-of-type(4) .hint-box.hint-revealed {
    background: linear-gradient(135deg, #5CA7C0 0%, #4C97B0 50%, #3C87A0 100%);
    border: 2px solid #3C87A0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Sparkle effect for hint boxes */
.hint-box:not(.hint-revealed):before {
    content: '✨';
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hint-box:not(.hint-revealed):hover:before {
    /* Hover effects removed for mobile optimization */
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
}

.hint-box.hint-revealed .hint-category {
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.8;
    margin: 0 0 2px 0;
}

.hint-box.hint-revealed .hint-content {
    display: block !important;
    /* Show content when revealed */
    margin-top: 0;
    font-weight: 700;
    font-size: 1.1rem;
    animation: hintReveal 0.8s ease-out forwards;
    opacity: 0;
}

/* Writeup content styling */
.hint-content.writeup-content {
    font-size: 0.8em !important;
    font-weight: 500 !important;
    font-family: 'Inter', sans-serif !important;
    font-style: italic !important;
    line-height: 1.2 !important;
    text-align: center !important;
    color: #2c3e50 !important;
    opacity: 0.8 !important;
    margin-top: 3px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Ensure hint box centers writeup content vertically and horizontally */
.hint-box[data-showing="writeup"],
.hint-box.hint-revealed[data-showing="writeup"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    min-height: 70px !important;
    flex-direction: column !important;
}

@keyframes hintReveal {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Loading state */
.hint-box.hint-loading .hint-content {
    display: block;
    font-style: italic;
    font-weight: normal;
    color: #6C757D;
}

/* SPA-specific animations and transitions */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* SPA view transitions */
.spa-view {
    /* Animation removed to prevent flash */
    visibility: hidden;
    opacity: 0;
}

.spa-view[style*="display: block"] {
    visibility: visible;
    opacity: 1;
}

.spa-view.transitioning-out {
    animation: fadeOut 0.2s ease-in-out forwards;
}

#game-playing.transitioning-out {
    animation: fadeOutPure 0.5s ease-out forwards;
}

@keyframes fadeOutPure {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.spa-view.transitioning-in {
    animation: slideInFromBottom 0.4s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success screen specific animations */
#game-success.spa-view {
    /* Animation removed */
}

#game-success.spa-view.fade-transition {
    animation: successFadeIn 0.5s ease-out forwards;
}

@keyframes successSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    60% {
        opacity: 1;
        transform: translateY(-5px) scale(1.02);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes successFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Failure screen specific animations */
#game-failure.spa-view {
    /* Animation removed - will use fade transition like success page */
}

#game-failure.spa-view.fade-transition {
    animation: successFadeIn 0.5s ease-out forwards;
}

/* Share button pulse animation */
.share-button {
    position: relative;
    overflow: hidden;
}

.share-button:hover {
    background-color: #9ca3af !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(156, 163, 175, 0.3);
    transition: all 0.2s ease;
}

@keyframes buttonPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Share feedback animation */
#share-feedback {
    animation: feedbackSlideDown 0.3s ease-out;
}

@keyframes feedbackSlideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Result screen content animations */
.success-header,
.tomorrow-header {
    /* Animation removed */
}

@keyframes headerBounceIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
    }

    60% {
        opacity: 1;
        transform: translateY(5px) scale(1.1);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.success-message,
.tomorrow-message {
    /* Animation removed */
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.answer-line {
    /* Animation removed */
}

@keyframes answerRevealFromTop {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.share-summary-display {
    /* Animation removed */
}

@keyframes summaryFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button stagger animations - disabled for cleaner look */
.share-button {
    /* No animation */
}

.explanation-button {
    /* No animation */
}

/* Game message styling */
.game-message {
    animation: slideIn 0.3s ease-out;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 500;
}

/* OTP input enhancements for SPA */
.otp-input:focus {
    outline: none;
    border-color: #007BFF;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.otp-input.error {
    border-color: #DC3545;
    animation: shake 0.5s ease-in-out;
}

/* Button hover effects */
.verify-button:hover:not(:disabled) {
    /* Hover effects removed for mobile optimization */
}

.verify-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

/* Hint box interaction improvements */
.hint-box:not(.hint-revealed):not(.hint-loading):hover {
    /* Hover effects removed for mobile optimization */
}

.hint-box:not(.hint-revealed):not(.hint-loading):active {
    transform: scale(0.98);
}

/* Loading state - no visual indicator */
.hint-box.hint-loading::after {
    display: none;
}

/* Status counter animations */
.status-item span {
    transition: all 0.2s ease;
}

.status-item span.updating {
    animation: pulse 0.4s ease-in-out;
}

/* OTP Container Styling */
/* OTP Container - JavaScript controlled margins */
.otp-container {
    margin: 16px 0 4px 0 !important;
}

.otp-input {
    width: 45px;
    height: 45px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    font-size: 1.5rem;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    background-color: #fff;
    transition: all 0.2s ease;
}

.otp-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.otp-input:focus {
    outline: none;
    border-color: #007BFF;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Responsive design for smaller screens */
@media (max-width: 480px) {
    .otp-container {
        gap: 6px;
    }

    .otp-input {
        width: 35px;
        height: 35px;
        min-width: 35px;
        max-width: 35px;
        font-size: 1.3rem;
    }
}

/* Success Screen Specific Styles */
.success-content {
    background: linear-gradient(135deg, #fff5e6 0%, #ffd4a3 25%, #ffb366 50%, #ff8c42 75%, #ff8c42 100%);
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 20px 16px !important;
    margin: 0 !important;
    border-radius: 0;
    height: auto !important;
    min-height: auto !important;
    flex-grow: 1;
}

/* Header styling for success page - orange with bubbles */
header.success-header {
    background: linear-gradient(135deg, #fff5e6 0%, #ffd4a3 25%, #ffb366 50%, #ff8c42 75%, #ff8c42 100%);
    padding: 24px 0 !important;
    margin: 8px 8px 0 8px !important;
    margin-bottom: 0 !important;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
    min-height: 110px;
    box-sizing: border-box;
}

header.success-header h1 {
    /* Inherit all properties from base h1, only override color */
    color: #495057;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

header.success-header h1 a {
    color: #495057;
    position: relative;
    z-index: 1;
    text-decoration: none;
}

/* Bubbles inside the header */
header.success-header .header-bubble-1,
header.success-header .header-bubble-2,
header.success-header .header-bubble-3,
header.success-header .header-bubble-4,
header.success-header .header-bubble-5,
header.success-header .header-bubble-6 {
    position: absolute;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

header.success-header .header-bubble-1 {
    top: -20px;
    left: -20px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.7) 0%, rgba(255, 165, 0, 0.4) 40%, rgba(255, 165, 0, 0.2) 70%, transparent 90%);
    animation: float 12s ease-in-out infinite;
}

header.success-header .header-bubble-2 {
    top: -15px;
    right: -25px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.6) 0%, rgba(255, 165, 0, 0.4) 40%, rgba(255, 165, 0, 0.2) 70%, transparent 90%);
    animation: float2 14s ease-in-out infinite;
}

header.success-header .header-bubble-3 {
    top: 10px;
    left: 25%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.5) 0%, rgba(255, 165, 0, 0.3) 40%, transparent 70%);
    animation: float4 10s ease-in-out infinite;
}

header.success-header .header-bubble-4 {
    top: -10px;
    left: 60%;
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, rgba(255, 140, 66, 0.6) 0%, rgba(255, 140, 66, 0.3) 50%, transparent 80%);
    animation: float3 11s ease-in-out infinite;
}

header.success-header .header-bubble-5 {
    top: 5px;
    right: 15%;
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, rgba(255, 179, 102, 0.7) 0%, rgba(255, 179, 102, 0.4) 40%, transparent 80%);
    animation: float 13s ease-in-out infinite reverse;
}

header.success-header .header-bubble-6 {
    top: -5px;
    left: 10%;
    width: 85px;
    height: 85px;
    background: radial-gradient(circle, rgba(255, 212, 163, 0.6) 0%, rgba(255, 212, 163, 0.3) 50%, transparent 80%);
    animation: float2 15s ease-in-out infinite reverse;
}

/* Failure header with blue gradient */
header.failure-header {
    background: linear-gradient(135deg, #DDEEF2 0%, #C8E6F0 50%, #B8DEE8 100%);
    padding: 24px 0 !important;
    margin: 8px 8px 0 8px !important;
    margin-bottom: 0 !important;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
    height: 110px;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

header.failure-header h1 {
    color: #495057;
    font-size: 2.2rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

header.failure-header h1 a {
    color: #495057;
    position: relative;
    z-index: 1;
    text-decoration: none;
}

/* Blue bubbles inside the failure header */
header.failure-header .header-bubble-1,
header.failure-header .header-bubble-2,
header.failure-header .header-bubble-3 {
    position: absolute;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

header.failure-header .header-bubble-1 {
    top: 10px;
    left: -20px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.4) 40%, rgba(255, 255, 255, 0.2) 70%, transparent 90%);
    animation: float 24s ease-in-out infinite;
}

header.failure-header .header-bubble-2 {
    top: 60px;
    right: -25px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.3) 30%, rgba(255, 255, 255, 0.2) 60%, transparent 100%);
    animation: float2 28s ease-in-out infinite;
}

header.failure-header .header-bubble-3 {
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.3) 40%, transparent 70%);
    animation: float4 20s ease-in-out infinite;
}

/* Blue bubbles inside the default header (home page) - same as failure header */
header:not(.success-header):not(.failure-header) .header-bubble-1,
header:not(.success-header):not(.failure-header) .header-bubble-2,
header:not(.success-header):not(.failure-header) .header-bubble-3 {
    position: absolute;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

header:not(.success-header):not(.failure-header) .header-bubble-1 {
    top: 10px;
    left: -20px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.4) 40%, rgba(255, 255, 255, 0.2) 70%, transparent 90%);
    animation: float 24s ease-in-out infinite;
}

header:not(.success-header):not(.failure-header) .header-bubble-2 {
    top: 60px;
    right: -25px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.4) 40%, rgba(255, 255, 255, 0.2) 70%, transparent 90%);
    animation: float2 28s ease-in-out infinite;
}

header:not(.success-header):not(.failure-header) .header-bubble-3 {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.4) 40%, rgba(255, 255, 255, 0.2) 70%, transparent 90%);
    animation: float4 20s ease-in-out infinite;
}

/* Container styling for success page */
.container.success-container {
    /* Inherits base container styling for consistent appearance */
}

/* Success content - white background like game page */
.success-content.success-seamless {
    background: #FFFFFF;
    position: relative;
    padding: 10px 8px !important;
}

/* Remove bubbles from success-seamless content */
.success-content.success-seamless::before,
.success-content.success-seamless::after {
    display: none !important;
}

/* Remove bubbles from failure page content */
#game-failure .success-content::before,
#game-failure .success-content::after {
    display: none !important;
}

#game-failure .success-content .green-bubble-3,
#game-failure .success-content .green-bubble-4,
#game-failure .success-content .green-bubble-5,
#game-failure .success-content .green-bubble-6 {
    display: none !important;
}

/* Success guess container - same as game page */
#success-guess-container {
    display: flex;
    margin: 0;
    padding: 0;
    width: 100%;
    flex-direction: column;
    align-items: center;
}

/* Game results message for success page */
#success-game-results {
    margin: 3px 0 11px 0;
    text-align: center;
    color: #adb5bd;
    font-weight: normal;
    font-style: normal;
    height: 19px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

#failure-game-results {
    margin: 3px 0 11px 0;
    text-align: center;
    color: #adb5bd;
    font-weight: normal;
    font-style: normal;
    height: 19px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Green share button (styled like guess button) - base styles, overridden by JS */
.share-button-green {
    box-sizing: border-box;
    cursor: pointer;
}

.share-button-green:active {
    transform: translateY(0px);
    box-shadow: 0 2px 4px rgba(199, 217, 183, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.success-content::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.7) 0%, rgba(255, 165, 0, 0.4) 40%, rgba(255, 165, 0, 0.2) 70%, transparent 90%);
    border-radius: 50%;
    animation: float 16s ease-in-out infinite;
    z-index: 0;
}

.success-content::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -75px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.7) 0%, rgba(255, 165, 0, 0.4) 40%, rgba(255, 165, 0, 0.2) 70%, transparent 90%);
    border-radius: 50%;
    animation: float2 18s ease-in-out infinite;
    z-index: 0;
}

.success-content .bubble-3 {
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.7) 0%, rgba(255, 165, 0, 0.4) 40%, rgba(255, 165, 0, 0.2) 70%, transparent 90%);
    border-radius: 50%;
    animation: float3 17s ease-in-out infinite;
    z-index: 0;
}

.success-content .bubble-4 {
    position: absolute;
    top: 20%;
    right: 20%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.7) 0%, rgba(255, 165, 0, 0.4) 40%, rgba(255, 165, 0, 0.2) 70%, transparent 90%);
    border-radius: 50%;
    animation: float4 16.5s ease-in-out infinite;
    z-index: 0;
}

.success-content .bubble-5 {
    position: absolute;
    bottom: 20%;
    right: -40px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.7) 0%, rgba(255, 165, 0, 0.4) 40%, rgba(255, 165, 0, 0.2) 70%, transparent 90%);
    border-radius: 50%;
    animation: float2 17.5s ease-in-out infinite reverse;
    z-index: 0;
}

.success-content .bubble-6 {
    position: absolute;
    bottom: -30px;
    right: 30%;
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.7) 0%, rgba(255, 165, 0, 0.4) 40%, rgba(255, 165, 0, 0.2) 70%, transparent 90%);
    border-radius: 50%;
    animation: float3 18s ease-in-out infinite reverse;
    z-index: 0;
}

/* Green bubble background alternative */
.green-bubble-background {
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 25%, #c3e6cb 50%, #b8dfc7 75%, #a8d5b8 100%);
    position: relative;
    overflow: hidden;
}

.green-bubble-background::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(76, 175, 80, 0.3) 0%, rgba(76, 175, 80, 0.1) 50%, transparent 70%);
    border-radius: 50%;
    animation: float 3s ease-in-out infinite;
}

.green-bubble-background::after {
    content: '';
    position: absolute;
    top: 100px;
    right: -80px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(102, 187, 106, 0.25) 0%, rgba(102, 187, 106, 0.08) 50%, transparent 70%);
    border-radius: 50%;
    animation: float 4s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translate(0px, 0px) rotate(0deg);
    }
    25% {
        transform: translate(80px, -60px) rotate(90deg);
    }
    50% {
        transform: translate(30px, -100px) rotate(180deg);
    }
    75% {
        transform: translate(-70px, -50px) rotate(270deg);
    }
}

@keyframes float2 {
    0%, 100% {
        transform: translate(0px, 0px) rotate(0deg);
    }
    25% {
        transform: translate(-90px, -40px) rotate(-90deg);
    }
    50% {
        transform: translate(-50px, -90px) rotate(-180deg);
    }
    75% {
        transform: translate(60px, -70px) rotate(-270deg);
    }
}

@keyframes float3 {
    0%, 100% {
        transform: translate(0px, 0px) rotate(0deg);
    }
    33% {
        transform: translate(100px, -70px) rotate(120deg);
    }
    66% {
        transform: translate(-60px, -120px) rotate(240deg);
    }
}

@keyframes float4 {
    0%, 100% {
        transform: translate(0px, 0px) rotate(0deg);
    }
    20% {
        transform: translate(-50px, -60px) rotate(72deg);
    }
    40% {
        transform: translate(70px, -110px) rotate(144deg);
    }
    60% {
        transform: translate(50px, -40px) rotate(216deg);
    }
    80% {
        transform: translate(-80px, -80px) rotate(288deg);
    }
}

/* Additional bubble elements for more dynamic effect */
.green-bubble-background .bubble-1 {
    position: absolute;
    top: 20%;
    left: 10%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(129, 199, 132, 0.2) 0%, rgba(129, 199, 132, 0.05) 50%, transparent 70%);
    border-radius: 50%;
    animation: float 3.5s ease-in-out infinite;
}

.green-bubble-background .bubble-2 {
    position: absolute;
    top: 60%;
    right: 15%;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(165, 214, 167, 0.25) 0%, rgba(165, 214, 167, 0.08) 50%, transparent 70%);
    border-radius: 50%;
    animation: float 4.5s ease-in-out infinite reverse;
}

.green-bubble-background .bubble-3 {
    position: absolute;
    bottom: 20%;
    left: 20%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(76, 175, 80, 0.15) 0%, rgba(76, 175, 80, 0.05) 50%, transparent 70%);
    border-radius: 50%;
    animation: float 2.5s ease-in-out infinite;
}

/* Ensure uniform spacing for all success page elements */
.success-content > *:not(.daily-image):not(.success-header):not(.tomorrow-header):not(.bubble-3):not(.bubble-4):not(.bubble-5):not(.bubble-6):not(.green-bubble-3):not(.green-bubble-4):not(.green-bubble-5):not(.green-bubble-6) {
    margin: 0 0 8px 0 !important;
    position: relative;
    z-index: 2;
}

/* Temporary class to hide text and see only background */
.success-content.hide-text > *:not(.bubble-3):not(.bubble-4):not(.bubble-5):not(.bubble-6):not(.green-bubble-3):not(.green-bubble-4):not(.green-bubble-5):not(.green-bubble-6) {
    opacity: 0 !important;
    visibility: hidden !important;
}

.success-content > *:last-child {
    margin-bottom: 0 !important;
}

/* Maybe-tomorrow page specific styling */
#game-failure .success-content {
    background: #FFFFFF;
    position: relative;
}

/* Blue bubbles for maybe-tomorrow page - same positioning and movements as success page */
#game-failure .success-content::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, #DDEEF2 0%, #C8E6F0 30%, #B8DEE8 60%, #C8E6F0 100%);
    animation: float 16s ease-in-out infinite;
    z-index: 1;
}

#game-failure .success-content::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -75px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, #DDEEF2 0%, #C8E6F0 30%, #B8DEE8 60%, #C8E6F0 100%);
    animation: float2 18s ease-in-out infinite;
    z-index: 1;
}

#game-failure .success-content .green-bubble-3 {
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #B8DEE8 0%, #C8E6F0 30%, #DDEEF2 60%, #C8E6F0 100%);
    border-radius: 50%;
    animation: float3 17s ease-in-out infinite;
    z-index: 1;
}

#game-failure .success-content .green-bubble-4 {
    position: absolute;
    top: 20%;
    right: 20%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #B8DEE8 0%, #C8E6F0 30%, #DDEEF2 60%, #C8E6F0 100%);
    border-radius: 50%;
    animation: float4 16.5s ease-in-out infinite;
    z-index: 1;
}

#game-failure .success-content .green-bubble-5 {
    position: absolute;
    bottom: 20%;
    right: -40px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, #C8E6F0 0%, #B8DEE8 30%, #C8E6F0 60%, #DDEEF2 100%);
    border-radius: 50%;
    animation: float2 17.5s ease-in-out infinite reverse;
    z-index: 1;
}

#game-failure .success-content .green-bubble-6 {
    position: absolute;
    bottom: -30px;
    right: 30%;
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, #DDEEF2 0%, #C8E6F0 30%, #B8DEE8 60%, #C8E6F0 100%);
    border-radius: 50%;
    animation: float3 18s ease-in-out infinite reverse;
    z-index: 1;
}

/* Ensure text appears above bubbles */
#game-failure .success-content > * {
    position: relative;
    z-index: 2;
}

/* Failure page button colors - matching hint boxes */
#game-failure .share-button {
    background: linear-gradient(135deg, #A6D7E8 0%, #96CFE0 50%, #86C7D8 100%);
    color: white;
    border: 2px solid #86C7D8;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

#game-failure .explanation-button {
    background: linear-gradient(135deg, #7CBFD4 0%, #6CB3C8 50%, #5CA7BC 100%);
    color: white;
    border: 2px solid #5CA7BC;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-top: 6px !important;
}

#game-failure .exp-text {
    color: white;
}

#game-failure .results-box {
    margin-top: 7px !important;
}

#game-failure .today-answer {
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.success-header {
    font-family: 'Playwrite US Trad', cursive;
    font-size: 2.8rem;
    /* Larger script */
    color: #495057;
    /* Orange/brown color */
    margin: 5px 0 3px 0 !important;
    font-weight: normal;
    position: relative;
    z-index: 2;
    /* Decorative fonts often don't need bold */
}

.success-message {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: #5C3C00;
    margin-bottom: 8px;
}

.success-word {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #5C3C00;
    margin-bottom: 8px;
}

/* New success page layout elements */
.today-answer {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: #495057;
    margin: 0;
    padding: 10px 0 11px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.solve-rate {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: #495057;
    margin: 0 0 8px 0;
    text-align: center;
}

.solid-finish {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: #2c3e50;
    margin: 0 0 8px 0;
    text-align: center;
}

.results-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.7) 50%, rgba(240, 248, 252, 0.6) 100%);
    border-radius: 8px;
    padding: 16px 20px 16px 20px;
    margin: 0 0 8px 0 !important;
    border: none;
    box-shadow: 0 4px 12px rgba(166, 215, 232, 0.2), 0 2px 4px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.box-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.5);
    width: 100%;
}

#game-success .box-divider {
    margin: 4px 0 8px 0 !important;
}

#game-failure .box-divider {
    margin: 4px 0 8px 0 !important;
}

.daily-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 8px !important;
    margin-bottom: 4px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(166, 215, 232, 0.2), 0 2px 4px rgba(0, 0, 0, 0.05);
}

.instagram-link {
    font-family: 'Inter', sans-serif;
    font-style: italic;
    color: white;
    text-decoration: none;
    display: block;
    max-width: 400px;
    margin: 0 5px 8px auto;
    text-align: right;
    position: relative;
    z-index: 2;
    font-size: 0.7rem;
    transform: translateX(-5px);
}

.instagram-link:hover {
    text-decoration: underline;
}

.instagram-box {
    margin-top: 0 !important;
    padding-top: 20px !important;
}

.results-content {
    text-align: center;
}

.game-info {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #495057;
    margin-bottom: 8px;
    font-weight: 600;
}

.finish-stats {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #495057;
    margin-bottom: 8px;
    line-height: 1.4;
}

.hints-used {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #495057;
    line-height: 1.4;
}

/* Tomorrow Screen Specific Styles */
/* Now using .success-content for consistent layout */

.word-reveal {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    color: #6C757D;
    /* Grey color */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    border-bottom: 2px solid #ADB5BD;
    /* Grey underline */
    padding-bottom: 8px;
    margin-bottom: 25px;
    display: inline-block;
    /* Allow underline to fit content */
}

.tomorrow-header {
    font-family: 'Playwrite US Trad', cursive;
    font-size: 1.9rem;
    color: #495057;
    font-weight: normal;
}

.tomorrow-message {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #495057;
    margin: 0 0 23px 0;
    padding: 0 10px;
    /* Prevent text touching edges, adds 15px padding below */
}

/* Shared Styles for Summary/Buttons on End Screens */
.summary-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #495057;
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    /* text-transform: uppercase; */
}

.game-id-display {
    font-family: 'Inter', sans-serif;
    margin: 0 0 8px 0;
    color: #6C757D;
    font-size: 0.9rem;
}

.share-summary-display {
    font-family: 'Inter', sans-serif;
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    /* Larger emojis/checks */
    line-height: 1;
    min-height: 30px;
    /* Ensure space even if empty */
}

.share-button {
    width: 100%;
    padding: 12px 16px;
    margin: 4px 0 0 0;
    background: linear-gradient(135deg, #ffb366 0%, #ff9f4a 50%, #ff8c42 100%);
    color: white;
    border: 2px solid #ff8c42;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-button:hover {
    /* Hover effects removed for mobile optimization */
}

.share-button:active, .explanation-button:active {
    transform: translateY(0px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.08);
}





.result-inner-container {
    background: transparent;
    border-radius: 0;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* .explanation-button:disabled {
    background-color: #ADB5BD;
    cursor: not-allowed;
}
 */

/* Responsive Adjustments */
@media (max-width: 480px) {
    .container {
        max-width: 100%;
        box-shadow: none;
    }
    
    header {
        padding: 20px 16px;
    }
    
    header.success-header {
        margin: 8px 8px 0 8px !important;
    }
    
    h1 {
        font-size: 2.2rem;
    }

    #game-container,
    .success-content {
        padding: 20px 16px;
    }

    #word-display {
        font-size: 1.6rem;
        letter-spacing: 0.4em;
    }

    .success-header,
    .tomorrow-header {
        font-size: 1.9rem;
    }
    
    header.failure-header h1 {
        font-size: 2.2rem;
    }

    .hint-box-container {
        margin-bottom: 2.7px;
        margin-left: auto;
        margin-right: auto;
        width: calc(100% - 32px);
        max-width: 372px;
    }
    
    .hint-box {
        padding: 15px 16px; /* Increased top/bottom padding for more text spacing */
        width: 100%;
    }

    #guess-button {
        margin-left: auto !important;
        margin-right: auto !important;
        width: calc(100% - 32px) !important;
        max-width: 372px !important;
    }

    .hint-category {
        font-size: 1.1rem;
    }

    .hint-content {
        font-size: 1.1rem;
    }

    .hint-box.hint-revealed .hint-category {
        font-size: 1rem;
    }

    .hint-box.hint-revealed .hint-content {
        font-size: 1.1rem;
    }

    .share-button,
    .explanation-button {
        padding: 14px;
        margin: 0 0 0 0;
    }
    
    /* Modal styles handled by main modal rules below */
    
    .modal-body h2 {
        font-size: 1.6rem;
        margin-bottom: 16px;
    }
    
    .modal-body h3 {
        font-size: 1rem;
        margin: 20px 0 10px 0;
    }
    
    .modal-body p {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .modal-content .close {
        top: 16px;
        right: 16px;
        font-size: 20px;
    }
}

/* Ensure consistent text width on smaller devices by reducing padding and font size */
@media (max-width: 390px) {
    header.failure-header h1 {
        font-size: 1.9rem;
    }
    header.failure-header {
        height: 110px !important;
        min-height: 110px !important;
    }
}

@media (max-width: 375px) {
    .hint-box {
        padding: 15px 5px !important; /* Reduced horizontal padding to give more width for text */
    }
    
    .hint-category {
        font-size: 1.1rem !important;
    }
    
    .hint-content {
        font-size: 1.1rem !important;
    }
    
    .hint-box.hint-revealed .hint-category {
        font-size: 0.95rem !important;
    }
    
    .hint-box.hint-revealed .hint-content {
        font-size: 1.05rem !important;
    }
    
    .hint-box.hint-revealed .hint-content.writeup-content {
        font-size: 0.75rem !important;
    }
}

.otp-container {
    display: flex;
    flex-direction: row;
    /* Ensure horizontal layout */
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.otp-input {
    width: 40px;
    /* Fixed width */
    height: 40px;
    /* Fixed height */
    min-width: 40px;
    /* Prevent stretching */
    max-width: 28px;
    /* Prevent stretching */
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    border-radius: 6px;
    text-align: center;
    font-size: 1.5rem;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
    padding: 0;
    /* Remove padding */
    box-sizing: border-box;
    /* Include border in width calculation */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    display: inline-block;
    /* Ensure inline display */
    flex: 0 0 auto;
    /* Prevent flex stretching */
}

.otp-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: scale(1.05);
}

.otp-input:focus {
    border-color: #A6D7E8 !important;
    box-shadow: 0 3px 8px rgba(166, 215, 232, 0.3), 0 0 0 2px rgba(166, 215, 232, 0.2);
    outline: none;
}

.verify-button {
    padding: 16px 25px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 16px;
}

.verify-button:hover:not(:disabled) {
    /* Hover effects removed for mobile optimization */
}

.verify-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.7;
}

@media (max-width: 480px) {
    .otp-container {
        flex-wrap: wrap;
        gap: 6px;
    }

    .otp-input {
        width: 40px;
        height: 40px;
        min-width: 40px;
        max-width: 40px;
        font-size: 1.3rem;
    }
}

.explanation-button {
    width: 100%;
    padding: 16px 8px;
    margin: 6px 0 0 0 !important;
    background: linear-gradient(135deg, #f5a055 0%, #ed8a3d 50%, #e67530 100%);
    color: white;
    border: 2px solid #e67530;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: block;
}

.explanation-button:hover {
    /* Hover effects removed for mobile optimization */
}

.exp-text {
    font-family: 'Inter', sans-serif;
    color: white;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.explanation-button:hover {
    /* Hover effects removed for mobile optimization */
}

/* More specific rules for button IDs and active states */
#success-share-button:hover,
#failure-share-button:hover,
#success-share-button:active,
#failure-share-button:active {
    /* Hover effects removed for mobile optimization */
}

/* Reset button state after click */
#success-share-button:focus:not(:hover),
#failure-share-button:focus:not(:hover) {
    background-color: #7CBFD4 !important;
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.explanation-button:active {
    background-color: #9ca3af !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(156, 163, 175, 0.3);
    text-decoration: none;
    color: white;
}

/* Reset explanation button state after click */
.explanation-button:focus:not(:hover) {
    background-color: #5CA7C0 !important;
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: white;
}

.player-stats {
    font-family: 'Inter', sans-serif;
    text-align: center;
    margin: 4px 0 2px 0 !important;
    font-weight: 400;
    color: #495057;
    font-size: 1rem;
}

/* Inline instructions */
.instructions {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #adb5bd;
    font-style: normal;
    text-align: center;
    line-height: 1.5;
    margin: 16px 0 8px;
    position: relative;
    z-index: 1001;
    overflow: visible;
}

#how-to-play-link {
    color: #adb5bd;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    font-weight: 400;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline;
}

#how-to-play-link:hover {
    /* Hover effects removed for mobile optimization */
}

/* Curved arrow from "your guess goes above" to input boxes */
.curved-arrow-guess {
    position: absolute;
    top: -36px;
    left: calc(10% - 17px);
    width: 120px;
    height: 60px;
    pointer-events: none;
    z-index: 1002;
    opacity: 0.7;
    overflow: visible;
}

.curved-arrow-guess svg {
    width: 100%;
    height: 100%;
}

/* Curved Arrow Pointer for How to Play */
.curved-arrow {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    opacity: 0.85;
}

.curved-arrow svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 1px 2px rgba(108, 117, 125, 0.2));
}

/* Arrow pointing from top to How to Play link */
.curved-arrow-top-left {
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 90px;
}

/* Arrow pointing from "How to Play" up and left to input boxes */
.curved-arrow-bottom-up {
    left: -120px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 110px;
}

/* Arrow pointing from top-right to How to Play link */
.curved-arrow-top-right {
    top: -60px;
    right: 20px;
    width: 100px;
    height: 70px;
}

/* Arrow pointing from left side */
.curved-arrow-left {
    top: 50%;
    left: -80px;
    transform: translateY(-50%);
    width: 80px;
    height: 100px;
}

/* Arrow pointing from right side */
.curved-arrow-right {
    top: 50%;
    right: -80px;
    transform: translateY(-50%) scaleX(-1);
    width: 80px;
    height: 100px;
}

/* Custom arrow position - modify these values to your preference */
.curved-arrow-custom {
    top: -50px;        /* Distance from top (negative = above) */
    left: 30%;         /* Horizontal position (0% = left, 100% = right) */
    transform: translateX(-50%);
    width: 120px;      /* Arrow width */
    height: 80px;      /* Arrow height */
}

/* Animation for arrow (optional - makes it more noticeable) */
@keyframes arrowPulse {
    0%, 100% {
        opacity: 0.85;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.08);
    }
}

@keyframes arrowPulseUp {
    0%, 100% {
        opacity: 0.7;
        transform: translateY(-50%) translateX(0);
    }
    50% {
        opacity: 0.9;
        transform: translateY(-50%) translateX(-3px);
    }
}

.curved-arrow-top-left.animated {
    animation: arrowPulse 2.5s ease-in-out infinite;
}

.curved-arrow-bottom-up.animated {
    animation: arrowPulseUp 2.5s ease-in-out infinite;
}

/* Hide arrow on very small screens to avoid clutter */
@media (max-width: 375px) {
    .curved-arrow {
        display: none;
    }
}

/* Small "?" icon-button */
.help-button {
    display: inline-block;
    margin-left: .4rem;
    width: 20px;
    height: 20px;
    font-size: .9rem;
    line-height: 18px;
    border: 1px solid #ADB5BD;
    border-radius: 50%;
    background: #fff;
    color: #495057;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.help-button:hover {
    /* Hover effects removed for mobile optimization */
}

.help-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(166, 215, 232, .6);
}

/* ----------  Modal ---------- */
/* Removed conflicting modal styles - using main modal styles below */

.modal-content h2 {
    font-family: 'Playwrite US Trad', cursive;
    font-size: 1.6rem;
    margin-top: 0;
    margin-bottom: .5rem;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6C757D;
    cursor: pointer;
}

.modal-close:hover {
    /* Hover effects removed for mobile optimization */
}

.answer-line {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    text-align: center;
    margin: 0px 0 11px 0 !important;
    /* consistent spacing above / below, adds 0px padding above and 11px below */
    /* letter-spacing: 0.03em; */
}

/* .answer-text {
    text-transform: uppercase; */
/* } */

/* Tighter “Maybe tomorrow?” headline */
.tomorrow-header {
    line-height: 1.2;
    margin: 5px 0 20px 0 !important;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

    .modal-content {
        background-color: #fff;
        padding: 12px 16px;
        border-radius: 12px;
        width: 100%;
        max-width: 400px;
        max-height: 66vh;
        overflow-y: auto;
        position: relative;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
        border: 2px solid #A6D7E8;
        box-sizing: border-box;
        margin: 0 auto;
        transform: translateY(-7vh);
    }
    
    @media (max-width: 480px) {
        .modal-content {
            max-width: 350px;
            padding: 9px 12px;
            width: 100%;
            max-height: 62vh;
            transform: translateY(-6vh);
        }
    }

.modal-content .close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 24px;
    font-weight: 400;
    cursor: pointer;
    color: #6c757d;
    background: none;
    border: none;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-content .close:hover,
.modal-content .close:focus {
    /* Hover effects removed for mobile optimization */
}

.modal-body h2 {
    font-family: 'Playwrite US Trad', cursive;
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.6rem;
    text-align: center;
    font-weight: normal;
    background: linear-gradient(135deg, #DDEEF2 0%, #C8E6F0 50%, #B8DEE8 100%);
    padding: 13px 20px;
    border-radius: 8px;
    margin: -12px -16px 20px -16px;
}

.modal-body h3 {
    font-family: 'Inter', sans-serif;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    margin: 6px 0 8px 0;
    text-align: center;
}

.modal-body p {
    font-family: 'Inter', sans-serif;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.modal-body {
    text-align: center;
}

.modal-body div[style*="text-align: left"] {
    text-align: center !important;
}

#how-to-play-modal .modal-body {
    text-align: center !important;
}

#how-to-play-modal .modal-body div {
    text-align: center !important;
}

#how-to-play-modal .modal-body p {
    text-align: center !important;
}

/* Game Results Message Styling */
#game-results {
    text-align: center;
    margin: 3px 0 9px 0;
    font-weight: normal;
    font-style: normal;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    min-height: 0;
    color: #adb5bd;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Guess Container Improvements */
#guess-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0;
}

.otp-container {
    margin-bottom: 0;
}

/* Input focus states */
.otp-input:focus {
    outline: none;
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Button disabled state */
#guess-button:disabled {
    background-color: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}