:root { font-family: "Trebuchet MS", "Segoe UI", sans-serif; color: #372c36; background: #f6f1eb; font-synthesis: none; }
* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; background: radial-gradient(circle at 12% 16%, #f4dbe8 0, transparent 29%), radial-gradient(circle at 90% 78%, #e7dbee 0, transparent 28%), #f6f1eb; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(100% - 32px, 520px); margin: 0 auto; padding: clamp(30px, 7vh, 76px) 0 24px; }
.intro { margin: 0 0 24px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 9px; color: #8f5b74; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #d84491; }
h1 { margin: 0; font-size: clamp(4.5rem, 16vw, 6.6rem); line-height: .95; letter-spacing: -.09em; }
.title-dot { color: #d84491; }
.lede { max-width: 380px; margin: 16px 0 0; color: #746770; line-height: 1.55; }
.lede strong { color: #9a3e71; }
.game-card, .error-card { padding: clamp(16px, 4vw, 25px); border: 1px solid rgba(133, 87, 110, .11); border-radius: 26px; background: rgba(255, 253, 250, .9); box-shadow: 0 18px 50px rgba(75, 44, 62, .10), 0 2px 8px rgba(75, 44, 62, .04); }
.game-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.scores { display: flex; gap: 8px; }
.score-card { min-width: 86px; padding: 8px 12px 7px; border-radius: 12px; background: #f5eaf0; text-align: center; }
.score-card span { display: block; color: #906f80; font-size: .67rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.score-card strong { display: block; margin-top: 1px; color: #643b53; font-size: 1.3rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 10px 17px; border: 0; border-radius: 12px; background: #563d4f; color: #fff; font: inherit; font-size: .85rem; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.button:hover { background: #72475f; transform: translateY(-2px); }
.button:focus-visible, a:focus-visible { outline: 3px solid #d84491; outline-offset: 3px; }
.button span { font-size: 1.1rem; font-weight: 400; }
.board-frame { padding: 10px; border-radius: 18px; background: #a98e9b; box-shadow: inset 0 2px 5px rgba(58, 37, 48, .13); }
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; touch-action: none; user-select: none; }
.tile { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 10px; background: rgba(255, 251, 247, .25); font-size: clamp(1.55rem, 7vw, 2.45rem); font-weight: 900; letter-spacing: -.06em; font-variant-numeric: tabular-nums; transition: background .12s ease, color .12s ease; }
.tile[data-value="2"] { background: #fff3e8; color: #785c52; }
.tile[data-value="4"] { background: #fce0c8; color: #795244; }
.tile[data-value="8"] { background: #f7ad79; color: #4d2c31; }
.tile[data-value="16"] { background: #ee8c79; color: #fff; }
.tile[data-value="32"] { background: #e66d7d; color: #fff; }
.tile[data-value="64"] { background: #d84f85; color: #fff; }
.tile[data-value="128"] { background: #bb69a6; color: #fff; }
.tile[data-value="256"] { background: #9d6cbe; color: #fff; }
.tile[data-value="512"] { background: #7977c4; color: #fff; }
.tile[data-value="1024"] { background: #5d91c8; color: #fff; }
.tile[data-value="2048"] { background: #e4bf5c; color: #513b29; box-shadow: inset 0 0 0 3px rgba(255,255,255,.35); }
.tile[data-value="4096"], .tile[data-value="8192"], .tile[data-value="16384"] { background: #3c384f; color: #fff; }
.tile-high { background: #3c384f; color: #fff; }
.tile[data-digits="4"] { font-size: clamp(1.25rem, 5.5vw, 2rem); }
.tile[data-digits="5"] { font-size: clamp(1rem, 4vw, 1.55rem); }
.game-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 58px; }
.message { margin: 0; color: #7b6873; font-size: .79rem; line-height: 1.45; }
.controls { display: flex; align-items: center; gap: 3px; margin: 0; white-space: nowrap; }
.key { display: inline-grid; place-items: center; width: 21px; height: 22px; border: 1px solid #e7dce1; border-bottom-width: 2px; border-radius: 5px; color: #826776; font-size: .75rem; }
.controls-label { margin-left: 5px; color: #8b7782; font-size: .72rem; }
.page-note { margin: 19px 0 0; color: #a18c97; font-size: .72rem; text-align: center; }
.error-card { padding: clamp(24px, 6vw, 36px); }
.error-tiles { display: flex; gap: 10px; margin-bottom: 28px; }
.error-tile { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 12px; font-size: 2.4rem; font-weight: 900; box-shadow: 0 7px 15px rgba(70, 41, 56, .10); }
.error-tile:nth-child(1) { background: #fce0c8; color: #795244; transform: rotate(-7deg); }
.error-tile:nth-child(2) { background: #e66d7d; color: #fff; transform: rotate(4deg) translateY(-5px); }
.error-tile:nth-child(3) { background: #9d6cbe; color: #fff; transform: rotate(8deg); }
.error-card h2 { margin: 0 0 10px; font-size: clamp(1.7rem, 6vw, 2.35rem); letter-spacing: -.04em; }
.error-card p { max-width: 380px; margin: 0 0 26px; color: #746770; line-height: 1.55; }
@media (max-width: 460px) { .game-toolbar { align-items: stretch; flex-direction: column; } .scores { width: 100%; } .score-card { flex: 1; } .button { width: 100%; } .game-footer { align-items: flex-start; flex-direction: column; padding-top: 16px; gap: 10px; } .board { gap: 7px; } .board-frame { padding: 7px; } }
@media (prefers-reduced-motion: reduce) { .button, .tile { transition: none; } }
