/* ===== Lingo - Literary Word Game Styles ===== */

/* CSS Variables */
:root {
    /* Literary color palette */
    --bg-warm: #faf8f5;
    --bg-paper: #f5f2ed;
    --bg-card: #ffffff;

    --green-deep: #2d5a45;
    --green-light: #e8f0ec;
    --green-medium: #4a7c64;

    --gold: #d4a84b;
    --gold-light: #faf3e3;
    --gold-soft: #e8d5a8;

    --coral: #c17f6e;
    --coral-light: #faf0ed;

    --text-dark: #2c2c2c;
    --text-body: #4a4a4a;
    --text-muted: #7a7a7a;
    --text-light: #a0a0a0;

    --border: #e5e0d8;
    --border-light: #f0ebe3;

    /* Typography */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Sizing */
    --header-height: 56px;
    --max-width: 440px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Transitions */
    --transition: 200ms ease;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

html, body, input, button, a, div, span, p {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-body);
    background-color: var(--bg-warm);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input {
    font-family: inherit;
    border: none;
    outline: none;
}

/* App Container */
#app {
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-warm);
    position: relative;
}

/* Subtle paper texture */
#app::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 0;
}

/* ===== Header ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--space-md);
    background-color: var(--bg-warm);
    border-bottom: 1px solid var(--border-light);
    position: relative;
    z-index: 10;
}

.logo {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 400;
    color: var(--green-deep);
    letter-spacing: 0.5px;
}

.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition);
}

.header-btn:hover {
    color: var(--green-deep);
    background-color: var(--green-light);
}

/* ===== Screens ===== */
.screen {
    display: none;
    flex: 1;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: flex;
}

/* ===== Landing Screen ===== */
.landing-screen {
    padding: var(--space-xl) var(--space-lg);
    justify-content: center;
}

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

.landing-icon {
    margin-bottom: var(--space-xs);
}

.landing-icon svg {
    width: 72px;
    height: 72px;
}

.landing-title {
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 400;
    color: var(--green-deep);
    letter-spacing: 1px;
    margin-bottom: var(--space-xs);
}

.landing-tagline {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.landing-divider {
    width: 40px;
    height: 2px;
    background-color: var(--gold);
    margin-bottom: var(--space-lg);
}

.landing-how {
    margin-bottom: var(--space-lg);
}

.landing-how-text {
    font-family: var(--font-sans);
    font-size: 17px;
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
}

.landing-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: var(--text-light);
}

.landing-date {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-muted);
    margin-top: var(--space-lg);
}

.landing-reset {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-light);
    margin-top: var(--space-xs);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-height: 48px;
    padding: 0 var(--space-xl);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.btn-primary {
    background-color: var(--green-deep);
    color: white;
}

.btn-primary:hover {
    background-color: var(--green-medium);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-ghost {
    color: var(--text-muted);
    background: transparent;
}

.btn-ghost:hover {
    color: var(--text-dark);
    background-color: var(--border-light);
}

.btn-large {
    min-width: 220px;
    min-height: 52px;
    font-size: 16px;
}

.btn-got-it {
    width: 100%;
    margin-top: var(--space-lg);
}

/* ===== Game Screen ===== */
.game-screen {
    padding: var(--space-md);
    padding-bottom: 380px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Game Content */
.game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Progress Steps */
.game-progress {
    padding: var(--space-sm) 0 var(--space-md);
    margin-top: 12px;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    opacity: 0.4;
    transition: all var(--transition);
}

.progress-step.active {
    opacity: 1;
}

.progress-step.completed {
    opacity: 0.7;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    background-color: var(--border);
    color: var(--text-muted);
}

.progress-step.active .step-num {
    background-color: var(--green-deep);
    color: white;
}

.progress-step.completed .step-num {
    background-color: var(--green-light);
    color: var(--green-deep);
}

.step-diff {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.progress-step.active .step-diff {
    color: var(--green-deep);
    font-weight: 600;
}

.progress-line {
    width: 40px;
    height: 2px;
    background-color: var(--border);
    margin: 0 var(--space-sm);
    margin-bottom: 16px;
}


/* Dictionary Card */
.dictionary-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    position: relative;
    margin-top: var(--space-xs);
}

.dictionary-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: var(--space-md);
    bottom: var(--space-md);
    width: 3px;
    background-color: var(--green-deep);
    border-radius: 0 2px 2px 0;
}

.dict-entry {
    padding-left: var(--space-sm);
}

.dict-pos {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 11px;
    font-style: italic;
    color: var(--text-light);
    text-transform: lowercase;
    margin-bottom: var(--space-sm);
}

.dict-definition {
    font-family: var(--font-sans);
    font-size: 19px;
    line-height: 1.5;
    color: var(--text-dark);
}

.dict-example {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    padding-left: var(--space-sm);
    border-top: 1px solid var(--border-light);
    animation: fadeIn 0.4s ease;
}

.example-text {
    font-family: var(--font-sans);
    font-style: italic;
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.5;
}

.example-text::before {
    content: '"';
}

.example-text::after {
    content: '"';
}

.dict-hint {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    padding-left: var(--space-sm);
    border-top: 1px solid var(--border-light);
    animation: fadeIn 0.4s ease;
}

.hint-label {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: var(--space-xs);
}

.hint-letters {
    font-family: var(--font-sans);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 5px;
    color: var(--green-deep);
}


/* Guess Area - typed input and circles */
.guess-area {
    position: fixed;
    bottom: 28vh;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3vh;
}

.guess-area.feedback-mode {
    bottom: auto;
    top: 12vh;
}

/* Keyboard Section - fixed at bottom */
.keyboard-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md);
    padding-bottom: var(--space-lg);
    background-color: var(--bg-warm);
    max-width: var(--max-width);
    margin: 0 auto;
}

.guess-display {
    min-height: 50px;
    font-family: var(--font-sans);
    font-size: 2.75rem;
    font-weight: 500;
    letter-spacing: 12px;
    color: var(--text-dark);
    text-align: center;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guess-circles {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.guess-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background-color: transparent;
    position: relative;
    transition: all 0.3s ease;
}

.guess-circle.correct {
    border-color: var(--green-deep);
    background-color: var(--green-deep);
}

.guess-circle.correct::after {
    content: '';
    position: absolute;
    left: 12px;
    top: 7px;
    width: 8px;
    height: 14px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.guess-circle.wrong {
    border-color: var(--coral);
    background-color: var(--coral);
}

.guess-circle.wrong::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* On-screen Keyboard */
.keyboard {
    width: 100%;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 5px;
}

.key {
    flex: 1;
    max-width: 36px;
    height: 54px;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.key:active {
    background-color: var(--border);
    transform: scale(0.95);
}

.key-wide {
    flex: 1.5;
    max-width: 54px;
    font-size: 18px;
}

.key-enter {
    background-color: var(--green-deep);
    color: white;
    border-color: var(--green-deep);
}

.key-enter:active {
    background-color: var(--green-medium);
}

/* Toast for wrong guesses - overlays the guess display */
.guess-toast {
    position: fixed;
    bottom: 36vh;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--coral-light);
    color: var(--coral);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    z-index: 1001;
    border: 1px solid var(--coral);
    animation: guessToastIn 0.15s ease, guessToastOut 0.2s ease 0.8s forwards;
    text-align: center;
}

@keyframes guessToastIn {
    from { opacity: 0; transform: translateX(-50%) scale(0.95); }
    to { opacity: 1; transform: translateX(-50%) scale(1); }
}

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

.guess-display.shake {
    animation: shake 0.4s ease;
    color: var(--coral);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* Feedback Area */
.feedback-area {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin-top: var(--space-md);
    animation: fadeIn 0.3s ease;
}

.feedback-area.active {
    display: flex;
}

.feedback-card {
    text-align: center;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.feedback-card.success {
    background: linear-gradient(135deg, var(--green-light) 0%, #d8ebe2 100%);
    border: 1px solid #c5ddd0;
}

.feedback-card.wrong {
    background: linear-gradient(135deg, var(--coral-light) 0%, #f5e6e2 100%);
    border: 1px solid #e8d5d0;
}

.feedback-card.failed {
    background-color: var(--bg-paper);
    border: 1px solid var(--border);
}

.feedback-status {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-sm);
}

.feedback-card.success .feedback-status {
    color: var(--green-deep);
}

.feedback-card.wrong .feedback-status {
    color: var(--coral);
}

.feedback-card.failed .feedback-status {
    color: var(--text-muted);
}

.feedback-word {
    font-family: var(--font-sans);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 4px;
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
}

.feedback-card.success .feedback-word {
    color: var(--green-deep);
    animation: successGlow 0.6s ease;
}

@keyframes successGlow {
    0% {
        opacity: 0;
        transform: scale(0.9);
        text-shadow: 0 0 0 transparent;
    }
    50% {
        text-shadow: 0 0 20px rgba(212, 168, 75, 0.6), 0 0 40px rgba(212, 168, 75, 0.3);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        text-shadow: 0 0 0 transparent;
    }
}

.feedback-card.wrong .feedback-word,
.feedback-card.failed .feedback-word {
    color: var(--text-dark);
}

.feedback-points {
    font-size: 14px;
    color: var(--text-muted);
}

.feedback-card.success .feedback-points {
    color: var(--green-medium);
    font-weight: 600;
}

/* ===== Results Screen ===== */
.results-screen {
    padding: var(--space-lg);
}

.results-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.results-header {
    margin-bottom: var(--space-lg);
}

.results-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.results-date {
    font-size: 13px;
    color: var(--text-light);
}

.results-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: var(--space-xl);
}

.score-value {
    font-family: var(--font-display);
    font-size: 72px;
    font-weight: 400;
    color: var(--green-deep);
    line-height: 1;
}

.score-of {
    font-size: 28px;
    color: var(--text-light);
    margin: 0 4px;
}

.score-total {
    font-size: 28px;
    color: var(--text-muted);
}

/* Results Words */
.results-words {
    width: 100%;
    margin-bottom: var(--space-xl);
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.result-item:active {
    transform: scale(0.98);
    background-color: var(--bg-paper);
}

.result-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.result-diff {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 4px;
    width: 58px;
    text-align: center;
    flex-shrink: 0;
}

.result-diff.easy {
    background-color: var(--green-light);
    color: var(--green-deep);
}

.result-diff.medium {
    background-color: var(--gold-light);
    color: #8b7030;
}

.result-diff.hard {
    background-color: var(--coral-light);
    color: var(--coral);
}

.result-word {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 400;
    color: var(--text-dark);
    text-transform: capitalize;
}

.result-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.result-guesses {
    font-size: 14px;
    letter-spacing: 2px;
}

.result-pts {
    font-size: 14px;
    font-weight: 600;
    min-width: 32px;
    text-align: right;
}

.result-pts.success {
    color: var(--green-deep);
}

.result-pts.failed {
    color: var(--text-light);
}

/* Results Rank */
.results-rank {
    width: 100%;
    padding: var(--space-md);
    background-color: var(--gold-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xl);
}

.rank-text {
    font-size: 15px;
    color: var(--text-body);
}

.rank-highlight {
    font-weight: 700;
    color: var(--text-dark);
}

.rank-percentile {
    font-size: 13px;
    color: #8b7030;
    font-weight: 600;
    margin-top: 2px;
}

.rank-loading, .rank-error {
    font-size: 14px;
    font-style: italic;
    color: var(--text-muted);
}

/* Results Actions */
.results-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
    margin-bottom: var(--space-xl);
}

/* Results Next */
.results-next {
    text-align: center;
    padding: var(--space-md);
    background-color: var(--bg-paper);
    border-radius: var(--radius-md);
    width: 100%;
}

.next-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.next-timer {
    font-family: var(--font-sans);
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: 2px;
}

/* ===== Modals ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(44, 44, 44, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 360px;
    max-height: 85vh;
    overflow-y: auto;
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-light);
    transition: all var(--transition);
}

.modal-close:hover {
    background-color: var(--bg-paper);
    color: var(--text-body);
}

.modal-small {
    max-width: 300px;
    text-align: center;
}

.def-word {
    font-family: var(--font-sans);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: lowercase;
    color: var(--green-deep);
    margin-bottom: var(--space-md);
}

.def-text {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-body);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 400;
    text-align: center;
    margin-bottom: var(--space-lg);
    color: var(--text-dark);
}

/* Help Modal */
.help-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.help-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background-color: var(--bg-paper);
    border-radius: var(--radius-md);
}

.help-icon {
    width: 40px;
    height: 40px;
    background-color: var(--green-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.help-text h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.help-text p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Stats Modal */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 400;
    color: var(--text-dark);
    display: block;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.streak-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    padding: var(--space-md);
    background-color: var(--gold-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.streak-item {
    text-align: center;
}

.streak-value {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 400;
    color: #8b7030;
    display: block;
}

.streak-label {
    font-size: 11px;
    color: #a08540;
}

.distribution-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.distribution-chart {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.distribution-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.distribution-label {
    width: 14px;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    color: var(--text-muted);
}

.distribution-bar-bg {
    flex: 1;
    height: 24px;
    background-color: var(--bg-paper);
    border-radius: 4px;
    overflow: hidden;
}

.distribution-bar {
    height: 100%;
    min-width: 24px;
    background-color: var(--text-light);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    transition: width 0.4s ease;
}

.distribution-bar.highlight {
    background-color: var(--green-deep);
}

.distribution-count {
    font-size: 11px;
    font-weight: 700;
    color: white;
}

/* Toast */
.toast {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-sm) var(--space-lg);
    background-color: var(--text-dark);
    color: white;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 300;
    animation: toastIn 0.2s ease;
}

.toast.hidden {
    display: none;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Mobile styles */
@media (max-width: 500px) {
    .game-screen {
        padding: var(--space-sm);
        padding-bottom: 340px;
    }

    .dictionary-card {
        padding: var(--space-md);
    }

    .dict-definition {
        font-size: 16px;
        line-height: 1.4;
    }

    .keyboard-section {
        padding: var(--space-sm);
        padding-bottom: var(--space-md);
    }

    .guess-display {
        font-size: 2.5rem;
        font-weight: 500;
        min-height: 44px;
        letter-spacing: 10px;
    }

    .guess-circles {
        gap: 12px;
    }

    .guess-circle {
        width: 30px;
        height: 30px;
    }

    .guess-circle.correct::after {
        left: 9px;
        top: 5px;
        width: 7px;
        height: 12px;
    }

    .guess-circle.wrong::after {
        width: 14px;
        height: 14px;
    }

    .key {
        height: 48px;
        font-size: 14px;
    }

    .key-wide {
        font-size: 16px;
    }

    .keyboard-row {
        gap: 4px;
        margin-bottom: 4px;
    }
}

/* Responsive */
@media (min-width: 500px) {
    .landing-title {
        font-size: 56px;
    }

    .score-value {
        font-size: 88px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States */
:focus-visible {
    outline: 2px solid var(--green-deep);
    outline-offset: 2px;
}
