* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background: linear-gradient(135deg, #D4C4A8 0%, #C4B498 50%, #D4C4A8 100%);
    color: #2C2C2C;
    min-height: 100vh;
    padding: 20px 20px 0 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    flex: 1;
}

h1 {
    text-align: center;
    font-size: 3.2em;
    margin-bottom: 15px;
    color: #3B4CCA;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 3px 3px 0 #FFCB05;
}

.subtitle {
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #4A4A4A;
    font-weight: 600;
}

.search-container {
    position: relative;
    margin-bottom: 25px;
}

#characterSearch {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 3px solid #3B4CCA;
    border-radius: 12px;
    background: #E8DCC4;
    color: #2C2C2C;
    outline: none;
    transition: all 0.3s;
    font-weight: 600;
}

#characterSearch::placeholder {
    color: rgba(44, 44, 44, 0.4);
}

#characterSearch:focus {
    background: #F5EDD6;
    box-shadow: 0 0 20px rgba(59, 76, 202, 0.3);
    border-color: #FF4444;
    transform: translateY(-2px);
}

.search-results {
    position: absolute;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: #E8DCC4;
    border: 3px solid #3B4CCA;
    border-radius: 12px;
    margin-top: 5px;
    z-index: 100;
    display: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 2px solid rgba(59, 76, 202, 0.1);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-result-item:hover {
    background: rgba(59, 76, 202, 0.1);
    transform: translateX(5px);
}

.search-result-item strong {
    color: #FF4444;
    font-weight: bold;
}

.search-result-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid #3B4CCA;
    background: #F5EDD6;
}

.guesses-count {
    text-align: center;
    font-size: 1.4em;
    margin-bottom: 30px;
    color: #3B4CCA;
    font-weight: 700;
}

.hints-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.hint-btn {
    padding: 15px 25px;
    font-size: 0.9em;
    border: 3px solid #A89878;
    border-radius: 10px;
    background: #D4C4A8;
    color: rgba(44, 44, 44, 0.4);
    cursor: not-allowed;
    transition: all 0.3s;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.hint-btn:not(:disabled) {
    background: linear-gradient(135deg, #FFCB05, #FFA500);
    color: #2C2C2C;
    cursor: pointer;
    border-color: #3B4CCA;
    box-shadow: 0 6px 15px rgba(59, 76, 202, 0.3);
}

.hint-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 76, 202, 0.5);
}

.hint-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.hint-btn:disabled {
    opacity: 0.5;
}

.hint-btn::after {
    content: attr(data-attempts);
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75em;
    color: #888;
    white-space: nowrap;
}

.hint-display {
    background: rgba(255, 203, 5, 0.2);
    border: 3px solid #FFCB05;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 35px;
    min-height: 60px;
    font-size: 1.2em;
    text-align: center;
    display: none;
    font-weight: 600;
    color: #2C2C2C;
}

.hint-display.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guesses-grid {
    margin-top: 40px;
}

.guess-row {
    display: grid;
    grid-template-columns: 100px repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.guess-row .guess-cell {
    justify-self: stretch;
}

.header-row {
    margin-bottom: 20px;
    border-bottom: 4px solid #3B4CCA;
    padding-bottom: 15px;
}

.header-row .header-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-cell {
    padding: 10px;
    text-align: center;
    font-weight: 900;
    font-size: 0.9em;
    color: #3B4CCA;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.guess-image-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.guess-character-img {
    width: 95px;
    height: 95px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid #3B4CCA;
    transition: transform 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    background: #F5EDD6;
}

.guess-character-img:hover {
    transform: scale(1.1);
    border-color: #FF4444;
}

.guess-cell {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    border: 3px solid rgba(59, 76, 202, 0.2);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    opacity: 0;
    transform: scale(0.7);
    background: #E8DCC4;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow: hidden;
    font-size: 0.95em;
}

.guess-cell.reveal {
    animation: revealCell 0.6s ease forwards;
}

@keyframes revealCell {
    0% {
        opacity: 0;
        transform: scale(0.7) rotate(-5deg);
    }
    50% {
        transform: scale(1.1) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.guess-cell.correct {
    background: linear-gradient(135deg, #4CAF50 0%, #45A049 100%);
    border-color: #2E7D32;
    color: white;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.guess-cell.close {
    background: linear-gradient(135deg, #FFCB05 0%, #FFA500 100%);
    border-color: #FF8C00;
    color: #2C2C2C;
    box-shadow: 0 0 20px rgba(255, 203, 5, 0.5);
}

.guess-cell.wrong {
    background: linear-gradient(135deg, #FF4444 0%, #E53935 100%);
    border-color: #C62828;
    color: white;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.4);
}

.guess-row.winning {
    animation: winningRowPulse 1s ease infinite;
}

@keyframes winningRowPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 203, 5, 0);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 30px rgba(255, 203, 5, 0.6);
    }
}

.win-message {
    display: none !important;
}

.hidden {
    display: none;
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #FFCB05;
    pointer-events: none;
    z-index: 9999;
    animation: confettiFall 4s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    20% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.index-btn {
    display: block;
    margin: 0 auto 25px;
    padding: 12px 25px;
    font-size: 1em;
    border: 3px solid #3B4CCA;
    border-radius: 10px;
    background: #E8DCC4;
    color: #3B4CCA;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.index-btn:hover {
    background: #3B4CCA;
    color: #F5EDD6;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(59, 76, 202, 0.3);
}

.character-index-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.character-index-modal.show {
    display: flex;
}

.character-index-content {
    background: linear-gradient(135deg, #E8DCC4, #D4C4A8);
    border: 4px solid #3B4CCA;
    border-radius: 15px;
    padding: 30px;
    max-width: 95vw;
    width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
}

.character-index-content h2 {
    text-align: center;
    color: #3B4CCA;
    margin-bottom: 15px;
    font-size: 2em;
    letter-spacing: 2px;
    font-weight: 900;
}

.character-count {
    text-align: center;
    color: #2C2C2C;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-weight: 600;
}

.easy-mode-toggle {
    display: block;
    margin: 0 auto 20px;
    padding: 12px 30px;
    font-size: 1em;
    border: 3px solid rgba(59, 76, 202, 0.3);
    border-radius: 10px;
    background: #E8DCC4;
    color: rgba(44, 44, 44, 0.6);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.easy-mode-toggle:hover {
    background: #F5EDD6;
    border-color: #3B4CCA;
    transform: translateY(-2px);
}

.easy-mode-toggle.active {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
    color: #2E7D32;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

.easy-mode-toggle.active:hover {
    background: rgba(76, 175, 80, 0.3);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
}

.character-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.character-index-item {
    padding: 12px;
    background: #E8DCC4;
    border: 3px solid rgba(59, 76, 202, 0.3);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.character-index-item:hover {
    background: #F5EDD6;
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(59, 76, 202, 0.3);
    border-color: #FF4444;
}

.character-index-item span {
    font-size: 0.85em;
    text-align: center;
    line-height: 1.2;
    font-weight: 600;
    color: #2C2C2C;
}

.character-index-img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid #3B4CCA;
    background: #F5EDD6;
}

.character-index-item.crossed-out::before,
.character-index-item.crossed-out::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 68, 68, 0.15);
    pointer-events: none;
    border-radius: 10px;
}

.character-index-item.crossed-out::before {
    background: linear-gradient(
        to bottom right,
        transparent calc(50% - 4px),
        rgba(255, 68, 68, 0.9) calc(50% - 4px),
        rgba(255, 68, 68, 0.9) calc(50% + 4px),
        transparent calc(50% + 4px)
    );
}

.character-index-item.crossed-out::after {
    background: linear-gradient(
        to top right,
        transparent calc(50% - 4px),
        rgba(255, 68, 68, 0.9) calc(50% - 4px),
        rgba(255, 68, 68, 0.9) calc(50% + 4px),
        transparent calc(50% + 4px)
    );
}

.character-index-item.crossed-out {
    opacity: 0.5;
}

.character-index-item.crossed-out:hover {
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
}

.character-index-item::before,
.character-index-item::after {
    transition: opacity 0.2s ease;
    opacity: 0;
}

.character-index-item.crossed-out::before,
.character-index-item.crossed-out::after {
    opacity: 1;
}

.close-btn {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 1em;
    border: 3px solid #3B4CCA;
    border-radius: 10px;
    background: #E8DCC4;
    color: #3B4CCA;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.close-btn:hover {
    background: #3B4CCA;
    color: #F5EDD6;
}

.appearances-list {
    text-align: center;
    color: #2C2C2C;
    margin-bottom: 20px;
    font-size: 0.9em;
    padding: 15px;
    background: #E8DCC4;
    border: 2px solid rgba(59, 76, 202, 0.3);
    border-radius: 10px;
    line-height: 1.6;
    font-weight: 600;
}

.appearances-list strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
    color: #3B4CCA;
}

.close-but-wrong-message {
    background: rgba(255, 203, 5, 0.2);
    border: 3px solid #FFCB05;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1em;
    color: #2C2C2C;
    font-weight: bold;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.close-but-wrong-message.show {
    opacity: 1;
    transform: translateY(0);
}

footer {
    margin-top: auto;
    padding: 40px 20px;
    text-align: center;
    font-size: 12px;
    color: #2C2C2C;
    border-top: 3px solid rgba(59, 76, 202, 0.3);
    background: #E8DCC4;
    backdrop-filter: blur(10px);
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-bottom: 0;
    position: relative;
}

footer p {
    line-height: 1.8;
    margin: 8px 0;
}

footer a {
    color: #3B4CCA;
    text-decoration: underline;
    font-weight: 600;
}

/* ── Victory Modal (updated) ── */

.victory-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.victory-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.victory-content {
    background: linear-gradient(135deg, #E8DCC4, #D4C4A8);
    border: 5px solid #3B4CCA;
    border-radius: 20px;
    padding: 30px;
    max-width: 380px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 0 50px rgba(59, 76, 202, 0.5);
    animation: victoryPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

@keyframes victoryPop {
    0%   { transform: scale(0.5) rotate(-5deg); opacity: 0; }
    50%  { transform: scale(1.1) rotate(2deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.victory-content h2 {
    color: #3B4CCA;
    font-size: 2em;
    margin-bottom: 15px;
    letter-spacing: 3px;
    font-weight: 900;
    text-shadow: 2px 2px 0 #FFCB05;
}

.victory-character-img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    border: 4px solid #3B4CCA;
    margin: 15px 0;
    object-fit: cover;
    box-shadow: 0 0 20px rgba(59, 76, 202, 0.4);
    background: #F5EDD6;
}

.victory-content h3 {
    color: #2C2C2C;
    font-size: 1.5em;
    margin-bottom: 8px;
    font-weight: 700;
}

.victory-content p {
    color: #4A4A4A;
    font-size: 1em;
    margin-bottom: 15px;
    font-weight: 600;
}

.victory-emojis {
    background: #E8DCC4;
    border: 3px solid rgba(59, 76, 202, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin: 15px 0;
    font-size: 1.2em;
    line-height: 1.6;
}

.victory-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.play-again-btn {
    width: 100%;
    padding: 15px 25px;
    font-size: 1.1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    color: white;
    background: linear-gradient(135deg, #4CAF50, #45A049);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.play-again-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

/* Share row: X | coffee (grows) | logo | copy */
.share-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: stretch;
    width: 100%;
}

.share-btn,
.copy-btn {
    padding: 15px 10px;
    font-size: 0.9em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    color: white;
}

.share-btn {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    min-width: 52px;
    padding: 15px 14px;
    flex-shrink: 0;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #2a2a4e, #26314e);
}

.x-logo-sm {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
}

.coffee-victory-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    padding: 15px 12px;
    font-size: 0.95em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: linear-gradient(135deg, #FFDD00, #FFB800);
    box-shadow: 0 4px 15px rgba(255, 221, 0, 0.4);
    text-decoration: none;
    color: #000;
    line-height: 1;
    white-space: nowrap;
}

.coffee-victory-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 221, 0, 0.6);
}

.home-logo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    min-width: 52px;
    max-width: 52px;
    flex-shrink: 0;
    padding: 10px;
    border-radius: 10px;
    background: rgba(59, 76, 202, 0.08);
    border: 2px solid rgba(59, 76, 202, 0.25);
    text-decoration: none;
    transition: all 0.3s;
    overflow: hidden;
}

.home-logo-btn:hover {
    background: rgba(59, 76, 202, 0.15);
    border-color: rgba(59, 76, 202, 0.45);
    transform: translateY(-2px);
}

.home-logo-btn img {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.copy-btn {
    background: linear-gradient(135deg, #FFCB05, #FFA500);
    box-shadow: 0 4px 15px rgba(255, 203, 5, 0.4);
    color: #2C2C2C;
    white-space: nowrap;
    padding: 15px 16px;
    flex-shrink: 0;
}

.copy-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 203, 5, 0.6);
}

.mode-toggle {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.mode-btn {
    padding: 12px 30px;
    font-size: 1em;
    border: 3px solid rgba(59, 76, 202, 0.3);
    border-radius: 10px;
    background: #E8DCC4;
    color: rgba(44, 44, 44, 0.7);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.mode-btn:hover {
    background: #F5EDD6;
    border-color: #3B4CCA;
    transform: translateY(-2px);
}

.mode-btn.active {
    background: rgba(59, 76, 202, 0.15);
    border-color: #3B4CCA;
    color: #3B4CCA;
    box-shadow: 0 0 15px rgba(59, 76, 202, 0.2);
}

.mode-btn.active:hover {
    background: rgba(59, 76, 202, 0.25);
    box-shadow: 0 0 20px rgba(59, 76, 202, 0.3);
}

.daily-completed {
    background: #E8DCC4;
    border: 4px solid #3B4CCA;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    margin-top: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.daily-completed h2 {
    color: #3B4CCA;
    font-size: 2em;
    margin-bottom: 20px;
    font-weight: 900;
}

.daily-completed p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #2C2C2C;
    font-weight: 600;
}

.daily-completed strong {
    color: #FF4444;
}

.next-daily {
    background: rgba(59, 76, 202, 0.1);
    border: 3px solid #3B4CCA;
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0;
}

.next-daily p {
    color: #2C2C2C;
    font-size: 1em;
    margin-bottom: 10px;
    font-weight: 600;
}

.next-daily h3 {
    color: #3B4CCA;
    font-size: 2em;
    font-weight: bold;
}

.next-daily-timer {
    background: rgba(59, 76, 202, 0.1);
    border: 3px solid #3B4CCA;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
}

.next-daily-timer p {
    color: #2C2C2C;
    font-size: 0.9em;
    margin-bottom: 5px;
    font-weight: 600;
}

.next-daily-timer h4 {
    color: #3B4CCA;
    font-size: 1.5em;
    font-weight: bold;
    margin: 0;
}

.home-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.home-button img {
    max-width: 60px;
    height: auto;
    transition: all 0.3s ease;
}

.home-button:hover {
    transform: scale(1.15);
}

.home-button:active {
    transform: scale(1.05);
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    body {
        padding: 10px 5px;
        overflow-x: hidden;
    }

    .container {
        max-width: 100%;
        padding: 0 10px;
    }

    h1 {
        font-size: 2em;
        margin-bottom: 10px;
        text-shadow: 2px 2px 0 #FFCB05;
    }

    .subtitle {
        font-size: 1em;
        margin-bottom: 20px;
    }

    .mode-toggle {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 15px;
    }

    .mode-btn {
        flex: 1;
        padding: 10px 8px;
        font-size: 0.8em;
        white-space: nowrap;
    }

    .index-btn {
        padding: 8px 15px;
        font-size: 0.85em;
        margin-bottom: 15px;
    }

    #characterSearch {
        padding: 10px;
        font-size: 0.95em;
    }

    .guesses-count {
        font-size: 1.1em;
        margin-bottom: 15px;
    }

    .hints-container {
        flex-direction: row;
        gap: 5px;
        margin-bottom: 20px;
    }

    .hint-btn {
        flex: 1;
        padding: 10px 5px;
        font-size: 0.7em;
        white-space: normal;
        line-height: 1.2;
    }

    .hint-btn::after {
        font-size: 0.65em;
        bottom: -18px;
    }

    .hint-display {
        font-size: 0.9em;
        padding: 12px;
        margin-bottom: 20px;
    }

    .guesses-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -10px;
        padding: 0 10px 10px 10px;
    }

    .guess-row {
        grid-template-columns: 50px repeat(6, 1fr);
        gap: 3px;
        margin-bottom: 8px;
        min-width: 100%;
    }

    .header-row {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .header-cell {
        font-size: 0.65em;
        padding: 5px 2px;
        word-break: break-word;
    }

    .guess-character-img {
        width: 48px;
        height: 48px;
        border-radius: 8px;
        border-width: 2px;
    }

    .guess-cell {
        padding: 8px 3px;
        font-size: 0.65em;
        min-height: 50px;
        word-break: break-word;
    }

    footer {
        width: 100vw;
        margin-left: -10px;
        padding: 20px 15px;
        font-size: 11px;
        margin-top: 30px;
    }

    .home-button {
        top: 8px;
        left: 8px;
    }

    .home-button img {
        max-width: 40px;
    }

    .victory-modal {
        padding: 10px;
    }

    .victory-content {
        width: 95%;
        max-width: 380px;
        padding: 20px 15px;
        max-height: 85vh;
    }

    .victory-content h2 {
        font-size: 1.3em;
        margin-bottom: 10px;
    }

    .victory-character-img {
        width: 80px;
        height: 80px;
        margin: 10px 0;
    }

    .victory-content h3 {
        font-size: 1.1em;
        margin-bottom: 5px;
    }

    .victory-content p {
        font-size: 0.9em;
        margin-bottom: 10px;
    }

    .victory-emojis {
        padding: 10px;
        margin: 10px 0;
        font-size: 1em;
        line-height: 1.4;
    }

    .victory-buttons {
        gap: 8px;
        margin-top: 15px;
    }

    .play-again-btn {
        padding: 12px 20px;
        font-size: 1em;
    }

    .share-btn {
        width: 40px;
        min-width: 40px;
        padding: 10px;
    }

    .coffee-victory-btn {
        font-size: 0.78em;
        padding: 10px 6px;
        gap: 3px;
    }

    .home-logo-btn {
        width: 40px;
        min-width: 40px;
        padding: 8px;
    }

    .home-logo-btn img {
        width: 22px;
        height: 22px;
        max-width: 22px;
        max-height: 22px;
    }

    .copy-btn {
        font-size: 0.8em;
        padding: 10px 8px;
    }

    .next-daily-timer {
        padding: 10px;
        margin: 10px 0;
    }

    .next-daily-timer p {
        font-size: 0.8em;
        margin-bottom: 3px;
    }

    .next-daily-timer h4 {
        font-size: 1.2em;
    }

    .character-index-content {
        width: 95%;
        padding: 20px;
    }

    .character-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    h1 {
        font-size: 1.5em;
        margin-bottom: 8px;
    }

    .subtitle {
        font-size: 0.9em;
        margin-bottom: 10px;
    }

    .mode-toggle {
        margin-bottom: 10px;
    }

    .mode-btn {
        padding: 8px 10px;
        font-size: 0.75em;
    }

    .hints-container {
        margin-bottom: 15px;
    }

    .hint-btn {
        padding: 8px 4px;
        font-size: 0.65em;
    }

    .guesses-grid {
        margin-top: 10px;
    }

    .guess-row {
        grid-template-columns: 45px repeat(6, 1fr);
        gap: 2px;
        margin-bottom: 6px;
    }

    .guess-character-img {
        width: 42px;
        height: 42px;
    }

    .guess-cell {
        font-size: 0.6em;
        padding: 6px 2px;
        min-height: 45px;
    }

    .header-cell {
        font-size: 0.6em;
        padding: 4px 2px;
    }

    footer {
        padding: 15px 10px;
        font-size: 10px;
    }
}

@media (max-width: 375px) {
    h1 {
        font-size: 1.7em;
    }

    .mode-btn {
        font-size: 0.75em;
        padding: 8px 5px;
    }

    .hint-btn {
        font-size: 0.65em;
        padding: 8px 3px;
    }

    .guess-row {
        grid-template-columns: 45px repeat(6, 1fr);
    }

    .guess-character-img {
        width: 42px;
        height: 42px;
    }

    .guess-cell {
        font-size: 0.6em;
        padding: 6px 2px;
        min-height: 45px;
    }

    .header-cell {
        font-size: 0.6em;
    }
}