/* Wriddle Game Styles - wriddle-styles.css */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --primary-color: #007aff;
    --primary-hover: #0d3c6d;
    --secondary-color: #5ac8fa;
    --secondary-hover: #3a98d0;
    --accent-color: #007aff;
    --error-color: #ff3b30;
    --success-color: #34c759;
    --card-bg: #f5f5f7;
    --border-color: #e5e5e5;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --warning-color: var(--error-color);
    --warning-hover: #d32f2f;
    --neutral-color: #8e8e93;
    --neutral-hover: #636366;
    --success-color: #34c759;
    --success-hover: #248a3d;
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --toggle-circle-fill: var(--bg-color);
    --toggle-circle-stroke: var(--text-color);
    --toggle-dark-fill: var(--text-color);
    --toggle-light-fill: var(--bg-color);
    
    /* Game-specific */
    --tile-bg: #ffffff;
    --tile-border: #d3d6da;
    --tile-text: #000000;
    --key-bg: #d3d6da;
    --key-text: #000000;
    --correct-color: #6aaa64;
    --present-color: #c9b458;
    --absent-color: #787c7e;
    --correct-text: #ffffff;
    --present-text: #ffffff;
    --absent-text: #ffffff;
    --header-height: 50px;
    --keyboard-height: 200px;
    --game-max-width: 500px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #000000;
        --text-color: #f5f5f5;
        --primary-color: #0a84ff;
        --secondary-color: #64d2ff;
        --accent-color: #0a84ff;
        --error-color: #ff453a;
        --success-color: #30d158;
        --card-bg: #1c1c1e;
        --border-color: #38383a;
        --shadow-color: rgba(0, 0, 0, 0.2);
        
        /* Game-specific dark mode colors */
        --tile-bg: #121213;
        --tile-border: #3a3a3c;
        --tile-text: #ffffff;
        --key-bg: #818384;
        --key-text: #ffffff;
        --correct-color: #538d4e;
        --present-color: #b59f3b;
        --absent-color: #3a3a3c;
    }
}

/* High contrast mode colors */
:root[data-colorblind="true"] {
    --correct-color: #D55E00;
    --present-color: #0072B2;
    --success-color: #009E73;
    --error-color: #D55E00;
    --primary-color: #0072B2;
}

[data-theme="dark"][data-colorblind="true"] {
    --correct-color: #D55E00;
    --present-color: #0072B2;
    --success-color: #009E73;
    --error-color: #D55E00;
    --primary-color: #0072B2;
}

/* Theme overrides */
[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #000000;
    --primary-color: #007aff;
    --secondary-color: #5ac8fa;
    --accent-color: #007aff;
    --error-color: #ff3b30;
    --success-color: #34c759;
    --card-bg: #f5f5f7;
    --border-color: #e5e5e5;
    --shadow-color: rgba(0, 0, 0, 0.05);
    
    /* Game-specific light mode colors */
    --tile-bg: #ffffff;
    --tile-border: #d3d6da;
    --tile-text: #000000;
    --key-bg: #d3d6da;
    --key-text: #000000;
    --correct-color: #6aaa64;
    --present-color: #c9b458;
    --absent-color: #787c7e;
}

[data-theme="dark"] {
    --bg-color: #000000;
    --text-color: #f5f5f5;
    --primary-color: #0a84ff;
    --primary-hover: #0055cc;
    --secondary-color: #64d2ff;
    --secondary-hover: #4ba7d8;
    --accent-color: #0a84ff;
    --error-color: #ff453a;
    --success-color: #30d158;
    --card-bg: #1c1c1e;
    --border-color: #38383a;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --warning-color: var(--error-color);
    --warning-hover: #d32f2f;
    --neutral-color: #8e8e93;
    --neutral-hover: #636366;
    --success-color: #30d158;
    --success-hover: #248a3d;
    
    /* Game-specific dark mode colors */
    --tile-bg: #121213;
    --tile-border: #3a3a3c;
    --tile-text: #ffffff;
    --key-bg: #818384;
    --key-text: #ffffff;
    --correct-color: #538d4e;
    --present-color: #b59f3b;
    --absent-color: #3a3a3c;
}

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

html {
    height: 100%;
    touch-action: manipulation;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

button {
    font-family: var(--font-family);
    cursor: pointer;
}

/* Theme toggle styles */
.theme-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.3s ease;
    position: relative;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-toggle:focus {
    outline: none;
}

.color-mode-icon {
    width: 1.2rem;
    height: 1.2rem;
    transition: transform 0.6s ease;
    position: absolute;
    transform: translate3d(0, 0, 0);
}

[data-theme="dark"] .color-mode-icon {
    transform: rotate(180deg) translate3d(0, 0, 0);
}

/* Header Styles */
header {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 0 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    width: 100%;
    max-width: 500px;
    padding: 0 1rem;
}

.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    color: var(--text-color);
}

.title-container {
    display: flex;
    align-items: center;
}

.game-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

.game-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.timer-container {
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-right: 0.25rem;
    text-align: right;
}

.header-button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    padding: 0;
    border-radius: 50%;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.header-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

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

[data-theme="dark"] .header-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Game Content */
#game {
    width: 100%;
    max-width: var(--game-max-width);
    margin: 0 auto;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Riddle Section */
.riddle-section {
    text-align: center;
    width: 100%;
}

.riddle-container {
    padding: 1rem;
    margin: 1rem;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.riddle-container p {
    font-size: 1rem;
    font-style: italic;
    margin: 0;
}

#board-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

/* Game Board */
#game-board {
    display: grid;
    grid-template-rows: repeat(5, 1fr);
    grid-gap: 10px;
    padding: 0;
    box-sizing: border-box;
}

.board-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.error-message {
    text-align: center;
    padding: 2rem;
    line-height: 1.5;
}

.tile {
    width: 3.5rem;
    height: 3.5rem;
    border: 2px solid var(--tile-border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    background-color: var(--tile-bg);
    color: var(--tile-text);
    user-select: none;
}

/* Tile States */
.tile[data-state="tbd"] {
    border-color: var(--border-color);
    color: var(--text-color);
}

.tile[data-state="correct"] {
    background-color: var(--correct-color);
    border-color: var(--correct-color);
    color: var(--correct-text);
}

.tile[data-state="present"] {
    background-color: var(--present-color);
    border-color: var(--present-color);
    color: var(--present-text);
}

.tile[data-state="absent"] {
    background-color: var(--absent-color);
    border-color: var(--absent-color);
    color: var(--absent-text);
}

.tile.focused {
    border-color: var(--primary-color);
}

/* Keyboard */
#keyboard {
    height: var(--keyboard-height);
    margin-top: auto;
    width: 100%;
    max-width: var(--game-max-width);
}

.keyboard-row {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.direction-key,
.keyboard-row button {
    height: 3.25rem;
    margin: 0 0.15rem;
    border-radius: 4px;
    border: none;
    background-color: var(--key-bg);
    color: var(--key-text);
    font-size: 0.875rem;
    font-weight: bold;
    text-transform: uppercase;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.1s ease;
}

.keyboard-row button:hover {
    opacity: 0.9;
}

.keyboard-row button:active {
    opacity: 0.7;
}

.wide-key {
    flex: 2.12 !important;
}

.spacer {
    flex: 0.5;
}

.spacer-with-margin {
    flex: 1;
    margin: 0 0.15rem;
}

.support-key {
    color: var(--error-color) !important;
}

/* Keyboard Key States */
.keyboard-row button[data-state="correct"] {
    background-color: var(--correct-color);
    color: var(--correct-text);
}

.keyboard-row button[data-state="present"] {
    background-color: var(--present-color);
    color: var(--present-text);
}

.keyboard-row button[data-state="absent"] {
    background-color: var(--absent-color);
    color: var(--absent-text);
}

/* App Promotion for modal */
.app-promotion {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 0.5rem;
    text-align: center;
}

.app-promotion h2 {
    color: var(--primary-color);
    margin: 1rem;
}

.app-promotion p {
    margin-bottom: 1rem;
}

.app-promotion ul {
    list-style-position: inside;
    text-align: left;
    max-width: 300px;
    margin: 0 auto 1.5rem;
}

.app-promotion li {
    margin-bottom: 0.5rem;
}

.app-store-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.app-store-button img {
    height: 2.5rem;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

footer a {
    color: var(--text-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-text {
    font-size: 0.9rem;
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.footer-content a:hover,
.footer-content a:focus {
    color: var(--accent-color);
    opacity: 0.8;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 90%;
    z-index: 9999;
}

.toast {
    padding: 0.75rem 1.5rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 0.9rem;
    text-align: center;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeInOut 2.5s ease forwards;
}

.toast.error {
    background-color: rgba(255, 59, 48, 0.9);
}

.toast.success {
    background-color: rgba(52, 199, 89, 0.9);
}

.toast.system {
    z-index: 10000;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    10% {
        opacity: 1;
        transform: translateY(0);
    }
    90% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--bg-color);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px var(--shadow-color);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin: 1rem 1rem 0;
}

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 1rem 1rem;
}

#statistics-modal .modal-body h3 {
    padding-left: 0.5rem;
}

/* Info Modal Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    gap: 1rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.5rem 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.7;
    position: relative;
    transition: opacity 0.2s ease;
}

.tab-button:hover {
    opacity: 0.9;
}

.tab-button.active {
    opacity: 1;
    font-weight: 600;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Instruction List */
.instruction-list {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.instruction-list li {
    margin-bottom: 0.5rem;
}

/* Settings Layout */
.settings-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}

.setting-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex: 1;
}

.setting-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.hard-mode-description {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 3.5rem;
    height: 2rem;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 1.5rem;
    width: 1.5rem;
    left: 0.25rem;
    bottom: 0.25rem;
    background-color: white;
    transition: .3s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(1.5rem);
}

.slider.round {
    border-radius: 2rem;
}

.slider.round:before {
    border-radius: 50%;
}

.copyright-text {
    font-size: 0.9rem;
    display: flex;
    margin-top: 1rem;
    text-align: center;
}

/* Statistics Modal Styles */
.statistics-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.guess-distribution {
    margin-bottom: 2rem;
    margin-top: 0.5rem;
}

.distribution-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.guess-label {
    font-weight: bold;
    width: 1rem;
    margin-right: 0.5rem;
}

.guess-bar-container {
    flex: 1;
    display: flex;
    align-items: center;
}

.guess-bar {
    background-color: var(--absent-color);
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0.5rem;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    min-width: 2rem;
    transition: width 0.5s ease;
}

.guess-bar.current {
    background-color: var(--primary-color);
}

.share-container,
.solution-container {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: var(--card-bg);
    border-radius: 8px;
}

.solution-word-container {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.solution-word {
    font-size: 1.2rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

.riddle-explanation {
    font-size: 0.9rem;
    font-style: italic;
}

.countdown-container {
    text-align: center;
    margin-bottom: 2rem;
}

.countdown {
    font-size: 1.8rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Base button style with no background color */
.button {
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    text-align: left;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

/* Button color variations */
.button-secondary {
    background-color: var(--secondary-color);
    text-decoration: none; /* Since it's an <a> tag */
}

.button-secondary:hover {
    background-color: var(--secondary-hover);
}

.button-success {
    background-color: var(--success-color);
}

.button-success:hover {
    background-color: var(--success-hover);
}

.button-primary {
    background-color: var(--primary-color);
}

.button-primary:hover {
    background-color: var(--primary-hover);
}

.button-warning {
    background-color: var(--warning-color);
}

.button-warning:hover {
    background-color: var(--warning-hover);
}

.button-neutral {
    background-color: var(--neutral-color);
}

.button-neutral:hover {
    background-color: var(--neutral-hover);
}

#confirmation-message {
    margin-bottom: 1rem;
}

/* Help Modal Styles */
.examples {
    margin: 1.5rem 0;
}

.example {
    margin-bottom: 1.5rem;
}

.example-row {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.example-tile {
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
}

.example-tile.correct {
    background-color: var(--correct-color);
    border-color: var(--correct-color);
    color: white;
}

.example-tile.present {
    background-color: var(--present-color);
    border-color: var(--present-color);
    color: white;
}

.example-tile.absent {
    background-color: var(--absent-color);
    border-color: var(--absent-color);
    color: white;
}

/* Animation Classes */
@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shake {
    0% { transform: translateX(0); }
    10% { transform: translateX(-5px); }
    20% { transform: translateX(5px); }
    30% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    50% { transform: translateX(-5px); }
    60% { transform: translateX(5px); }
    70% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
    90% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

@keyframes fadeReveal {
    0% {
        opacity: 0.5;
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes successGlow {
    0% {
        box-shadow: 0 0 5px rgba(106, 170, 100, 0.7);
    }
    50% {
        box-shadow: 0 0 15px rgba(106, 170, 100, 0.9);
    }
    100% {
        box-shadow: 0 0 5px rgba(106, 170, 100, 0.7);
    }
}

.pop {
    animation: popIn 100ms ease-in;
}

.shake {
    animation: shake 600ms cubic-bezier(.36,.07,.19,.97) both;
}

.victory-glow {
    animation: successGlow 2s ease-in-out infinite;
}

.fade-reveal {
    animation: fadeReveal 400ms ease-out forwards;
}

/* Rotation Message Styles */
#rotation-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

#rotation-message p {
    font-family: var(--font-family);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-color);
    margin-top: 2rem;
    max-width: 350px;
    line-height: 1.5;
}

.rotation-animation {
    width: 100px;
    height: 100px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.device-icon {
    width: 60px;
    height: 100px;
    border: 3px solid var(--text-color);
    border-radius: 10px;
    position: relative;
    animation: rotate-device 2s infinite ease-in-out;
}

.device-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 80px;
    background-color: var(--primary-color);
    opacity: 0.2;
    border-radius: 4px;
}

.device-icon::after {
    content: '';
    position: absolute;
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 3px;
}

@keyframes rotate-device {
    0% {
        transform: rotate(90deg);
    }
    20% {
        transform: rotate(90deg);
    }
    60% {
        transform: rotate(180deg);
    }
    100% {
        transform: rotate(180deg);
    }
}

/* Media query to show rotation message on mobile landscape */
@media screen and (max-height: 450px) and (orientation: landscape) {
    #game {
        display: none !important;
    }
    
    #rotation-message {
        display: flex;
    }
}

/* For small screens, reduce sizes */
@media (max-width: 450px) and (max-height: 1000px),
    (orientation: landscape) and (max-width: 1200px) {
    .game-header h1 {
        font-size: 0.8rem;
    }

    .timer-container {
        font-size: 0.7rem;
    }

    .tile {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    .keyboard-row button {
        height: 3rem;
        margin: 0 0.1rem;
        font-size: 0.75rem;
    }

    .spacer-with-margin {
        margin: 0 0.1rem;
    }

    .time-label {
        width: 4rem;
        font-size: 0.7rem;
    }

    .app-store-buttons {
        gap: 0.5rem;
    }

    .app-store-button img {
        height: 2rem;
    }

    .button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .button-neutral, .button-warning {
        font-size: 1rem;
    }

    .button-group {
        gap: 0.5rem;
    }

    .riddle-container {
        margin: 1rem 1rem 0.5rem;
        padding: 0.5rem;
    }

    .settings-row {
        gap: 0.5rem;
        margin-bottom: 0;
    }
    
    .setting-label {
        font-size: 0.9rem;
        line-height: 1.2;
        display: inline-block;
    }
    
    .setting-item {
        gap: 0.5rem;
    }
}

/* For extremely small screens, reduce sizes */
@media (max-width: 370px) and (max-height: 750px) {
    .game-header h1 {
        font-size: 0.7rem;
        letter-spacing: 0.05rem;
    }

    .title-container .game-text {
        font-size: 0.7rem;
        letter-spacing: 0.05rem;
    }

    .timer-container {
        font-size: 0.6rem;
    }

    .header-button {
        font-size: 1rem;
    }

    .color-mode-icon {
        width: 1rem;
        height: 1rem;
    }

    .game-controls {
        gap: 0.2rem;
    }

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

    .button {
        padding: 0.5rem 0.5rem;
        font-size: 0.65rem;
    }

    .button-group {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .app-store-button img {
        height: 1.5rem;
    }

    .footer-text {
        gap: 0.5rem;
    }

    .riddle-container p {
        font-size: 0.8rem;
    }
}
