:root {
    --bg: #f6f2e9;
    --surface: #fbf8f1;
    --stroke: #e6decd;
    --ink: #2c2a25;
    --muted: #7a7265;
    --accent: #b08d3a;
    --shake-duration: 180ms;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.game {
    width: min(900px, 94vw);
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    padding: 32px 24px 28px;
    display: grid;
    gap: 18px;
    justify-items: center;
    text-align: center;
    box-shadow: 0 10px 30px rgba(60, 50, 30, 0.08);
}

.hero { display: grid; gap: 6px; }
.title {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: 1px;
}
.subtitle {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--muted);
}

.phrase {
    font-family: "Courier New", monospace;
    font-size: clamp(24px, 4.6vw, 40px);
    letter-spacing: 1.5px;
    color: var(--accent);
    min-height: 52px;
}
.twist { font-size: 13px; color: var(--muted); }

.hud, .controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.pill {
    padding: 6px 12px;
    border: 1px solid var(--stroke);
    border-radius: 9999px;
    color: var(--muted);
    background: #ffffff;
}
.select-wrap {display: inline-flex; gap: 8px; align-items: center; }
select#difficulty {
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--stroke);
    border-radius: 8px;
    padding: 4px 10px;
    font: inherit;
}

.btn {
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid var(--stroke);
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    letter-spacing: 1px;
    cursor: pointer;
}
.btn.primary {
    background: var(--accent);
    color: #ffffff;
    border-color: transparent;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.note { font-size: 12px; color: var(--muted); }

.glow { animation: glow 500ms ease-out; }
@keyframes glow {
    0% { color: var(--accent); }
    60% { color: #f4e6b0; text-shadow: 0 0 8px rgba(209, 192, 137, 0.5); }
    100% { color: var(--accent); }
}

.shake { animation: shake var(--shake-duration) linear; }
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(2px); }
    75% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

.success-flash {
    position: fixed;
    inset: 0;
    background: rgba(176, 141, 58, 0.12);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
    z-index: 5;
}
.success-flash.active { opacity: 1; }

input#mobileinput {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    height: 0;
    width: 0;
}
