:root {
    /* Color Palette - Light Mode (Default) */
    --color-tone-1: #1a1a1b;
    /* Text */
    --color-tone-2: #787c7e;
    /* Absent/Gray */
    --color-tone-3: #878a8c;
    --color-tone-4: #d3d6da;
    /* Border */
    --color-tone-5: #edeff1;
    --color-tone-6: #f6f7f8;
    --color-tone-7: #ffffff;
    /* Background */

    --color-correct: #6aaa64;
    /* Green */
    --color-present: #c9b458;
    /* Yellow */
    --color-absent: #787c7e;
    /* Gray */

    --key-bg: #d3d6da;
    --key-text: #000000;

    --modal-content-bg: #ffffff;

    --font-stack: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    --header-height: 50px;
    --keyboard-height: 200px;
}

.dark-mode {
    --color-tone-1: #ffffff;
    --color-tone-2: #818384;
    --color-tone-3: #565758;
    --color-tone-4: #3a3a3c;
    --color-tone-5: #272729;
    --color-tone-6: #1a1a1b;
    --color-tone-7: #121213;

    --color-correct: #538d4e;
    --color-present: #b59f3b;
    --color-absent: #3a3a3c;

    --key-bg: #818384;
    --key-text: #ffffff;

    --modal-content-bg: #121213;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-stack);
    background-color: var(--color-tone-7);
    color: var(--color-tone-1);
    height: 100vh;
    width: 100%;
    overflow: hidden;
    /* Prevent scrolling on mobile */
    user-select: none;
    -webkit-user-select: none;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

/* Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    border-bottom: 1px solid var(--color-tone-4);
    padding: 0 16px;
}

.game-title {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.1rem;
    margin: 0;
    text-align: center;
    white-space: nowrap;
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.mode-btn {
    background: none;
    border: none;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: bold;
    color: var(--color-tone-3);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.mode-btn.active {
    background-color: var(--color-tone-2);
    color: var(--color-tone-7);
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--color-tone-1);
}

/* Footer */
.game-footer {
    text-align: center;
    font-size: 10px;
    color: var(--color-tone-3);
    padding: 5px;
}

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

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--modal-content-bg);
    border: 1px solid var(--color-tone-4);
    border-radius: 8px;
    box-shadow: 0 4px 23px 0 rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90%;
    overflow-y: auto;
    z-index: 1001;
    padding: 16px;
}

.modal.hidden,
.modal-overlay.hidden {
    display: none;
}

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

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-tone-1);
}

/* Ad Containers */
.ad-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--color-tone-6);
    margin: 5px 0;
    min-height: 50px;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.action-btn.secondary {
    background-color: var(--color-absent);
}

.action-btn.secondary:hover {
    background-color: var(--color-tone-4);
}