/* Connections: index cards on a corkboard. */
:root {
  --cork: #c9a071; --cork-2: #b98d5e; --card: #fbf7ee; --card-ink: #2b2118; --pin: #d63a2f; --ink: #2b2118; --ink-2: #6b5a48; --line: #a88355;
  --l1: #f9df6d; --l2: #a0c35a; --l3: #b0c4ef; --l4: #ba81c5;
  --bg: var(--cork); --surface: var(--card); --surface-2: #f0e8d8; --ok: #4c8a2a; --warn: #d9a521; --bad: var(--pin); --info: #3b6fb6; --accent: var(--card-ink); --accent-ink: #fbf7ee;
  --font-display: "Special Elite", "Courier New", monospace; --font-ui: "Karla", "Inter", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cork: #2b2620; --cork-2: #211d19; --card: #f1ebe0; --ink: #f1ebe0; --ink-2: #b8ad9d; --line: #4a4036; --bg: var(--cork); --surface: #3a3229; --surface-2: #47392d; --accent: #f1ebe0; --accent-ink: #2b2118; } }
:root[data-theme="dark"] { --cork: #2b2620; --cork-2: #211d19; --card: #f1ebe0; --ink: #f1ebe0; --ink-2: #b8ad9d; --line: #4a4036; --bg: var(--cork); --surface: #3a3229; --surface-2: #47392d; --accent: #f1ebe0; --accent-ink: #2b2118; }
:root[data-colorblind="1"] { --l1: #e69f00; --l2: #009e73; --l3: #56b4e9; --l4: #cc79a7; }
body { background-image: radial-gradient(circle at 20% 30%, rgb(255 255 255 / .08) 0 1px, transparent 2px), radial-gradient(circle at 70% 60%, rgb(0 0 0 / .08) 0 1px, transparent 2px), radial-gradient(circle at 40% 80%, rgb(0 0 0 / .06) 0 1px, transparent 2px); background-size: 23px 23px, 31px 31px, 17px 17px; }
.screen { gap: 14px; max-width: 520px; margin-inline: auto; }
.topbar { display: flex; align-items: center; gap: 6px; min-height: 44px; }
.screen-title { font-size: 1.8rem; font-weight: 400; margin-left: 6px; }
.btn { font-weight: 700; } .cta { font-size: 1.1rem; min-height: 52px; }
.hero { padding-top: 6px; } .tapes { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tape { font-family: var(--font-display); color: #2b2118; padding: 6px 18px; transform: rotate(-1.2deg); box-shadow: 0 2px 4px rgb(0 0 0 / .18); letter-spacing: .04em; }
.tape.l1 { background: var(--l1); font-size: 1.9rem; transform: rotate(-2deg); } .tape.l2 { background: var(--l2); transform: rotate(1deg); } .tape.l3 { background: var(--l3); transform: rotate(-.6deg); } .tape.l4 { background: var(--l4); transform: rotate(1.4deg); }
.card-panel { background: var(--card); color: var(--card-ink); border-radius: 4px; padding: 16px; box-shadow: 0 4px 12px rgb(0 0 0 / .25); position: relative; transform: rotate(-.4deg); }
.card-panel::before { content: ""; position: absolute; top: -6px; left: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--pin); box-shadow: inset -2px -2px 0 rgb(0 0 0 / .25), 0 2px 3px rgb(0 0 0 / .3); transform: translateX(-50%); }
.daily-card { display: flex; flex-direction: column; gap: 10px; } .daily-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-display); font-size: 1.2rem; } .daily-head span { font-family: var(--font-ui); font-size: .9rem; color: #6b5a48; }
.streak-pill { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface); color: var(--warn); font-weight: 700; box-shadow: var(--shadow-1); }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; min-height: 64px; border-radius: 4px; background: var(--surface); color: var(--ink); text-align: left; box-shadow: 0 3px 8px rgb(0 0 0 / .2); border: 2px solid transparent; }
.mode b { font-family: var(--font-display); font-size: 1.1rem; font-weight: 400; } .mode span { color: var(--ink-2); font-size: .8rem; line-height: 1.2; } .mode[aria-pressed="true"] { border-color: var(--pin); }
.archive { display: flex; flex-wrap: wrap; gap: 6px; } .archive button { padding: 8px 12px; border-radius: 4px; background: var(--surface); box-shadow: var(--shadow-1); font-weight: 700; font-size: .9rem; } .archive button[data-done="true"] { opacity: .6; text-decoration: line-through; }
.home-actions { display: flex; gap: 8px; } .home-actions .cta { flex: 2; } .home-actions > .btn:not(.cta) { flex: 1; background: var(--surface); box-shadow: var(--shadow-1); }

/* Play */
.screen[data-screen="play"] { height: 100dvh; min-height: 0; overflow: hidden; gap: 8px; }
.hud-title { font-family: var(--font-display); font-size: 1.25rem; } .hud-note { color: var(--ink); font-weight: 700; }
.prompt { text-align: center; color: var(--ink-2); font-weight: 700; font-size: .95rem; }
.cork { display: flex; flex-direction: column; gap: 8px; }
.bands { display: flex; flex-direction: column; gap: 8px; }
.band { position: relative; min-height: 64px; padding: 8px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #2b2118; font-family: var(--font-display); box-shadow: 0 3px 8px rgb(0 0 0 / .22); transform: rotate(var(--rot, -.4deg)); animation: band-in .45s var(--ease-out); }
.band[data-level="1"] { background: var(--l1); } .band[data-level="2"] { background: var(--l2); } .band[data-level="3"] { background: var(--l3); } .band[data-level="4"] { background: var(--l4); }
.band b { font-size: 1.05rem; font-weight: 400; text-transform: uppercase; letter-spacing: .06em; } .band span { font-family: var(--font-ui); font-weight: 700; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
@keyframes band-in { from { transform: scaleY(.6) rotate(var(--rot, -.4deg)); opacity: 0; } }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { position: relative; aspect-ratio: 1 / .85; min-height: 64px; border-radius: 3px; background: var(--card); color: var(--card-ink); font-family: var(--font-display); font-size: clamp(.72rem, 3.4vw, 1rem); text-transform: uppercase; letter-spacing: .02em; display: flex; align-items: center; justify-content: center; text-align: center; padding: 4px; word-break: break-word; box-shadow: 0 3px 6px rgb(0 0 0 / .25); transform: rotate(var(--rot)); transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); }
.tile::before { content: ""; position: absolute; top: 5px; left: 50%; width: 9px; height: 9px; border-radius: 50%; background: var(--pin); box-shadow: inset -1px -1px 0 rgb(0 0 0 / .3), 0 1px 2px rgb(0 0 0 / .3); transform: translateX(-50%); }
.tile[data-sel="true"] { background: var(--card-ink); color: var(--card); transform: rotate(0deg) translateY(-3px) scale(1.04); box-shadow: 0 8px 16px rgb(0 0 0 / .35); z-index: 1; } .tile[data-sel="true"]::before { background: #f0d36b; }
.tile.anim-shake { animation: shake-x var(--t-slow); } .tile.anim-bounce { animation: bounce .5s var(--ease-out); animation-delay: calc(var(--i) * 70ms); }
.tile.fly { transition: transform .42s var(--ease-out); z-index: 3; }
.mistakes { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink-2); font-weight: 700; font-size: .9rem; }
.dots { display: flex; gap: 6px; } .dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); } .dots i[data-lost="true"] { background: transparent; border: 2px solid var(--line); }
.play-msg { text-align: center; min-height: 1.3em; color: var(--ink); font-family: var(--font-display); }
.actions { display: flex; justify-content: center; gap: 8px; padding-bottom: env(safe-area-inset-bottom); } .pill { min-height: 46px; padding: 0 16px; background: var(--surface); box-shadow: var(--shadow-1); } .pill.btn-primary { background: var(--accent); color: var(--accent-ink); } .pill:disabled { opacity: .45; }
@media (min-width: 640px) { .screen[data-screen="play"] { max-width: 600px; } .tile { min-height: 80px; } }

/* Result */
.result-verdict { font-family: var(--font-display); font-size: clamp(1.8rem, 8vw, 2.4rem); text-align: center; line-height: 1.1; } .result-verdict[data-won="false"] { color: var(--bad); }
.result-sub { text-align: center; color: var(--ink-2); font-weight: 700; }
.share-grid { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 1.3rem; line-height: 1; letter-spacing: 2px; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; } .result-actions .cta { grid-column: 1 / -1; }
