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

.heading-font {
    font-family: "Londrina Solid", system-ui;
    font-weight: 400;
    font-style: normal;
    letter-spacing: 2px;
      font-size: 5rem;
      text-transform: lowercase;
      text-shadow: 3px 3px #CCCCCC;
  }

.inivisible {
    display: none;
    opacity: 0;
}

.londrina-solid-thin {
    font-family: "Londrina Solid", sans-serif;
    font-weight: 100;
    font-style: normal;
  }
  
  .londrina-solid-light {
    font-family: "Londrina Solid", sans-serif;
    font-weight: 300;
    font-style: normal;
  }
  
  .londrina-solid-regular {
    font-family: "Londrina Solid", sans-serif;
    font-weight: 400;
    font-style: normal;
  }
  
  .londrina-solid-black {
    font-family: "Londrina Solid", sans-serif;
    font-weight: 900;
    font-style: normal;
  }


:root {
    /* Light mode */
    --bg-color: #ffffff;
    --text-color: #000000;
    --accent-color: #1a1a1a;
    --border-color: #d0d0d0;
    --paper-color: #ede7d9;
    --paper-texture-dark: #d4cfc0;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --shadow-color: rgba(0, 0, 0, 0.15);
    --bleep-color: #000;
    --punct-color: #e50914;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark mode */
        --bg-color: #121212;
        --text-color: #ffffff;
        --accent-color: #e0e0e0;
        --border-color: #404040;
        --paper-color: #262626;
        --paper-texture-dark: #1a1a1a;
        --shadow-color: rgba(255, 255, 255, 0.1);
        --bleep-color: #fff;
        --punct-color: #ff4444;
    }

    .heading-font {
        text-shadow: 0px 0px #CCCCCC;
    }

}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    min-height: 100vh;
    color: var(--text-color);
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 32px;
}

.about-link {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.8;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease;
    text-decoration: underline;
    padding: 0;
    margin-top: 8px;
    display: inline-block;
}

.about-link:hover {
    opacity: 1;
}

.about-link:active {
    opacity: 0.9;
}

.censor {
    position: relative;
    display: inline-block;
    font-family: 'Londrina Solid', system-ui;
    font-size: 5rem;
    font-weight: 400;
    letter-spacing: 2px;
    animation: popPulse 3s ease-in-out 1 both;
    /* padding: 0.8em 0.6em 0.8em; /* extra right + left space */
    overflow: visible; /* allow shadows + transforms to show */
    transform-origin: center center;
    box-sizing: content-box; /* ensures padding adds true space */
    text-shadow: 3px 3px #CCCCCC;

  }
  
  
    /* TEXT CONTENT */
    .censor::after {
      content: "bleep";
      position: relative;
      z-index: 2;
      color: var(--bleep-color);
      animation: swapText 3s ease-in-out 1 both;
    }
  
    /* SPIKY BURST BEHIND THE TEXT */
    .censor::before {
      content: "";
      position: absolute;
      top: 50%;
      left: 50%;
      width: 240%;
      height: 240%;
      background: #000;
      clip-path: polygon(
        50% 0%, 60% 25%, 80% 10%, 65% 40%,
        100% 45%, 70% 55%, 100% 65%, 65% 60%,
        80% 90%, 60% 75%, 50% 100%, 40% 75%,
        20% 90%, 35% 60%, 0% 65%, 30% 55%,
        0% 45%, 35% 40%, 20% 10%, 40% 25%
      );
      transform: translate(-50%, -50%) scale(0);
      opacity: 0;
      z-index: 1;
      animation: burst 3s ease-in-out 1 both;
    }
  
    /* TEXT CHANGE ANIMATION */
    @keyframes swapText {
      0%, 40%, 100% {
        content: "bleep";
        color: var(--bleep-color);
        text-shadow: 3px 3px 0 rgba(0,0,0,0.2);
      }
      45%, 70% {
        content: "@#$%!";
        color: var(--punct-color);
        text-shadow: 4px 4px 0 rgba(0,0,0,0.5);
      }
    }
  
    /* SPIKE BURST SYNCED WITH PUNCTUATION */
    @keyframes burst {
      0%, 40%, 100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
      }
      45% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3) rotate(2deg);
        background: #ffcc00;
      }
      50% {
        transform: translate(-50%, -50%) scale(1.6) rotate(-2deg);
        background: #ffeb3b;
      }
      60% {
        transform: translate(-50%, -50%) scale(1.4);
        background: #fff176;
      }
      70% {
        transform: translate(-50%, -50%) scale(1.7);
        opacity: 0.9;
        background: #ffee58;
      }
      80% {
        transform: translate(-50%, -50%) scale(1.9);
        opacity: 0.4;
        background: #ffda44;
      }
      90%, 100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
      }
    }
  
    /* POP & PULSE */
    @keyframes popPulse {
      0%, 40%, 100% { transform: scale(1); }
      45% { transform: scale(1.4) rotate(-4deg); }
      50% { transform: scale(0.8) rotate(3deg); }
      60% { transform: scale(1.2); }
      70% { transform: scale(0.95); }
      80% { transform: scale(1.05); }
      90% { transform: scale(1); }
    }

.title {
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--accent-color);
    opacity: 0.7;
    font-weight: 500;
}

.game-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 600px; /* Reserve space for entire game layout before content loads */
}

/* Torn Book Page - Sentence Display */
.book-page {
    background: linear-gradient(135deg, var(--paper-color) 0%, var(--paper-texture-dark) 100%);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    padding: 24px 20px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow-color);
    
    /* Torn paper effect */
    clip-path: polygon(
        0% 0%, 100% 0%, 100% 3%, 99.5% 5%, 100% 7%, 99.8% 9%, 100% 11%, 99.6% 13%, 100% 15%,
        99.7% 20%, 100% 25%, 99.5% 30%, 100% 35%, 99.8% 40%, 100% 45%, 99.9% 50%, 100% 55%,
        99.6% 60%, 100% 65%, 99.7% 70%, 100% 75%, 99.5% 80%, 100% 85%, 99.8% 90%, 100% 95%,
        100% 100%, 0% 100%, 0.2% 95%, 0% 90%, 0.4% 85%, 0% 80%, 0.3% 75%, 0% 70%, 0.5% 65%,
        0% 60%, 0.4% 55%, 0% 50%, 0.1% 45%, 0% 40%, 0.2% 35%, 0% 30%, 0.5% 25%, 0% 20%,
        0.3% 15%, 0% 11%, 0.4% 9%, 0% 7%, 0.5% 5%, 0% 3%
    );
}

.book-page.easy {
    background: linear-gradient(135deg, #d4e8d4 0%, #c1dfc1 100%);
}

@media (prefers-color-scheme: dark) {
    .book-page.easy {
        background: linear-gradient(135deg, #2a4a2a 0%, #1f3a1f 100%);
    }
}

.book-page.medium {
    background: linear-gradient(135deg, #f5e6d3 0%, #ede7d9 100%);
}

@media (prefers-color-scheme: dark) {
    .book-page.medium {
        background: linear-gradient(135deg, #3a3424 0%, #2a2a1a 100%);
    }
}

.book-page.hard {
    background: linear-gradient(135deg, #f0d8d8 0%, #e8cac7 100%);
}

@media (prefers-color-scheme: dark) {
    .book-page.hard {
        background: linear-gradient(135deg, #4a3232 0%, #342424 100%);
    }
}

.book-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 1px,
            rgba(0, 0, 0, 0.02) 1px,
            rgba(0, 0, 0, 0.02) 2px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 1px,
            rgba(0, 0, 0, 0.01) 1px,
            rgba(0, 0, 0, 0.01) 2px
        );
    pointer-events: none;
    border-radius: 4px;
}

.book-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(
            2px at 20% 30%,
            rgba(139, 125, 107, 0.08) 0%,
            transparent 50%
        ),
        radial-gradient(
            3px at 60% 70%,
            rgba(139, 125, 107, 0.06) 0%,
            transparent 50%
        ),
        radial-gradient(
            2px at 50% 50%,
            rgba(139, 125, 107, 0.04) 0%,
            transparent 50%
        );
    pointer-events: none;
}

.page-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.sentence {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 1.6rem;
    line-height: 1.8;
    color: var(--text-color);
    text-align: center;
    font-style: italic;
    font-weight: normal;
    min-height: 72px; /* Reserve space for sentence before content loads */
}

/* Game Controls */
.game-controls {
    background-color: var(--bg-color);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
    min-height: 130px; /* Label (24px) + gap (12px) + input (46px) + gap (12px) + button (36px) = ~130px */
}

label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#guessInput {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.2s;
    min-height: 46px; /* Ensure consistent input height */
}

#guessInput::placeholder {
    color: var(--accent-color);
    opacity: 0.5;
}

#guessInput:focus {
    outline: none;
    border-color: var(--text-color);
}

.btn {
    padding: 12px 24px;
    border: 2px solid var(--text-color);
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.btn:hover:not(:disabled) {
    background-color: var(--text-color);
    color: var(--bg-color);
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

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

.btn-primary {
    background-color: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.btn-secondary {
    background-color: var(--bg-color);
    color: var(--text-color);
    border-color: var(--text-color);
}

/* Feedback */
.feedback {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s;
    border: 1px solid;
    min-height: 40px; /* Reserve space for feedback message */
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback.success {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    border-color: var(--success-color);
}

.feedback.error {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    border-color: var(--error-color);
}

.feedback.warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
    border-color: var(--warning-color);
}

.feedback.hidden {
    min-height: 0;
    display: none;
}

.hidden {
    display: none !important;
}

/* Attempts Counter */
.attempts-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 16px;
}

.attempts-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.attempts-display {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 700;
}

.attempts-count {
    color: var(--error-color);
    font-size: 1.3rem;
}

/* Previous Guesses */
.previous-guesses {
    padding: 16px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-top: 16px;
    min-height: 0;
}

.previous-guesses:not(.hidden) {
    min-height: 80px; /* Reserve minimum space when visible */
}

.guesses-label {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.guesses-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.guess-tag {
    background-color: transparent;
    color: var(--text-color);
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.guess-tag.incorrect {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    border-color: var(--error-color);
}

/* Hints Container */
.hints-container {
    padding: 12px 0;
    margin-top: 12px;
    min-height: 0; /* Initially no height */
}

.hints-container:not(.hidden) {
    min-height: 60px; /* Reserve minimum space when visible */
}

.hints-label {
    color: var(--text-color);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.hints-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hint-tag {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
    padding: 6px 12px;
    border: 1px solid #3498db;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    font-style: italic;
}

/* Result Screen */
.result-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;     /* Allow vertical scrolling when content exceeds viewport */
    overflow-x: hidden;   /* Prevent horizontal scrolling */
    padding: 20px 0;      /* Add vertical spacing for better mobile UX */
}

.result-content {
    padding: 40px 24px;
    text-align: center;
    max-width: 400px;
    animation: slideUp 0.3s ease;
    margin: auto;
    min-height: fit-content;
    width: 100%;
}

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

.result-content h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: var(--text-color);
    font-weight: 700;
    font-family: "Londrina Solid", system-ui;
    letter-spacing: 1px;
    text-transform: lowercase;
}

.result-content h1 {
    margin-bottom: 8px;
    text-align: center;
}

.result-content p {
    font-size: 1rem;
    margin-bottom: 32px;
    color: var(--accent-color);
    line-height: 1.6;
}

.result-book-page {
    margin-bottom: 32px;
    min-height: 140px;
    padding: 28px 24px;
}

.result-book-page .sentence {
    font-size: 1.8rem;
    line-height: 1.9;
}

.result-message {
    font-size: 1rem;
    margin-bottom: 24px;
    color: var(--accent-color);
    font-weight: 500;
    line-height: 1.6;
}

.score-display {
    font-size: 2.5rem;
    margin: 20px 0 24px 0;
    text-align: center;
    letter-spacing: 4px;
    min-height: 3rem;
}

.result-actions {
    display: flex;
    gap: 12px;
    flex-direction: row; /* Change from column to row */
    justify-content: center;
    align-items: stretch;
}

.result-actions .btn {
    flex: 1;
}

.result-book-page strong {
    font-weight: 900;
    font-size: 1.1em;
    color: var(--text-color);
}

/* Definition Link Styles */
.definition-link {
    text-decoration: none;
    color: inherit;
    cursor: help;
    border-bottom: 2px dotted var(--text-color);
    transition: all 0.2s ease;
}

.definition-link:hover {
    opacity: 0.7;
    border-bottom-style: solid;
}

.definition-link strong {
    font-weight: 900;
    font-size: 1.1em;
    color: var(--text-color);
}

/* Stats */
.stats {
    display: none;
}

footer {
    text-align: center;
    margin-top: 32px;
    color: var(--accent-color);
    font-size: 0.9rem;
    opacity: 0.7;
}

footer p {
    margin: 0 0 8px 0;
}

footer p:last-child {
    margin-bottom: 0;
}

.footer-main {
    font-size: 0.9rem;
}

.footer-credit {
    font-size: 0.8rem;
    opacity: 0.8;
}

footer a {
    color: inherit;
    opacity: 1;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

footer a:hover {
    opacity: 0.8;
}

/* Modal */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: var(--paper-color);
    padding: 32px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--accent-color);
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    color: var(--text-color);
}

.about-body {
    line-height: 1.8;
    font-size: 0.95rem;
}

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

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

/* Calendar */
.calendar {
    display: grid;
    gap: 12px;
}

.calendar-header {
    text-align: center;
    margin-bottom: 16px;
}

.calendar-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-color);
}

.calendar-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.calendar-month-year {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-color);
    flex: 1;
    text-align: center;
    min-width: 150px;
}

.calendar-nav-btn {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.calendar-nav-btn:hover {
    background-color: var(--text-color);
    border-color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.calendar-nav-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px var(--shadow-color);
}

.calendar-nav-btn:disabled,
.calendar-nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--border-color);
    color: var(--accent-color);
}

.calendar-nav-btn:disabled:hover,
.calendar-nav-btn.disabled:hover {
    background-color: var(--border-color);
    color: var(--accent-color);
    transform: none;
    box-shadow: none;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent-color);
    padding: 8px 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 500;
    cursor: default;
    user-select: none;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
}

.calendar-day-cell.empty {
    background-color: transparent;
    border: none;
    cursor: default;
}

.calendar-day-cell.not-played {
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

.calendar-day-cell.not-played:hover {
    border-color: var(--accent-color);
    transform: scale(1.05);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.calendar-day-cell.completed {
    background-color: #C8E6C9;
    color: #1b5e20;
    border-color: #81c784;
    font-weight: 600;
}

.calendar-day-cell.failed {
    background-color: #FFCDD2;
    color: #b71c1c;
    border-color: #ef5350;
    font-weight: 600;
}

.calendar-day-cell.future-date {
    background-color: var(--border-color);
    color: var(--accent-color);
    opacity: 0.5;
    cursor: not-allowed;
    border-color: transparent;
}

/* Audio Player */
.audio-player-container {
    text-align: center;
    margin: 16px 0;
    min-height: 48px; /* Reserve space to prevent layout shift */
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-player-container.hidden {
    display: none;
    min-height: 0; /* Don't reserve space when hidden */
}

.hear-it-btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--accent-color);
    color: var(--bg-color);
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hear-it-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.hear-it-btn:active {
    transform: translateY(0);
}

.hear-it-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    body {
        padding: 16px;
    }

    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    header {
        margin-bottom: 24px;
    }

    .game-container {
        gap: 20px;
        min-height: 550px; /* Slightly smaller for mobile screens */
    }

    .book-page {
        padding: 20px 16px;
        min-height: 100px;
    }

    .sentence {
        font-size: 1rem;
        line-height: 1.5;
        min-height: 60px; /* Slightly smaller for mobile */
    }

    .game-controls {
        gap: 0;
    }

    .input-group {
        margin-bottom: 12px;
        min-height: 120px; /* Slightly smaller for mobile but still stable */
    }

    #guessInput {
        padding: 10px 14px;
        font-size: 1rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .stats {
        gap: 24px;
        padding: 12px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .result-content {
        padding: 32px 20px;
    }

    .result-content h2 {
        font-size: 2rem;
    }

    .result-content p {
        font-size: 0.95rem;
    }

    .attempts-counter {
        padding: 10px 14px;
        gap: 10px;
    }

    .attempts-label {
        font-size: 0.9rem;
    }

    .previous-guesses {
        padding: 12px 14px;
        min-height: 0;
    }

    .previous-guesses:not(.hidden) {
        min-height: 70px;
    }

    .guesses-label {
        font-size: 0.85rem;
    }

    .guess-tag {
        font-size: 0.85rem;
        padding: 5px 10px;
    }

    .audio-player-container {
        min-height: 44px;
    }

    .hints-container:not(.hidden) {
        min-height: 50px;
    }

    footer {
        margin-top: 24px;
        font-size: 0.85rem;
    }

    .footer-credit {
        font-size: 0.75rem;
    }

    .modal-content {
        padding: 24px;
        width: 95%;
        max-height: 90vh;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .calendar-header h3 {
        font-size: 1.1rem;
    }

    .calendar-header-container {
        gap: 8px;
    }

    .calendar-month-year {
        font-size: 1.1rem;
        min-width: 120px;
    }

    .calendar-nav-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .calendar-nav-btn:disabled,
    .calendar-nav-btn.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .calendar-weekday {
        font-size: 0.75rem;
        padding: 6px 0;
    }

    .calendar-day-cell {
        font-size: 0.85rem;
    }

    .calendar-day-cell.future-date {
        opacity: 0.5;
    }
}

/* Settings Modal Styles */
.settings-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.mode-options {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.mode-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    border-color: var(--accent-color);
    opacity: 0.9;
}

.mode-btn-active {
    background: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

.mode-description {
    font-size: 0.9rem;
    color: var(--accent-color);
    text-align: center;
    margin: 0;
    opacity: 0.8;
}

/* Letter Input Boxes for Regular Mode */
.letter-input-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
    min-height: 50px; /* Reserve space for letter boxes */
}

.letter-input-box {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    background: var(--bg-color);
    padding: 0;
    cursor: text;
    transition: all 0.2s ease;
}

.letter-input-box:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.letter-input-box:hover {
    border-color: var(--accent-color);
}

.letter-input-box.filled {
    background: var(--paper-color);
    border-color: var(--accent-color);
}

@media (max-width: 600px) {
    .letter-input-box {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}
