:root {
  --bg: #121316; --panel: #1d1f24; --line: #2e3138; --text: #eceef2; --mute: #9298a4;
  --green: #4caf50; --yellow: #d4a72c; --grey: #3a3d45; --red: #d9534f; --accent: #7c6cff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
header { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; font-size: 20px; color: var(--text); text-decoration: none; }
.who { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--mute); }
.who input { width: 96px; }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
input, button { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { cursor: pointer; font-weight: 600; }
button:hover { border-color: var(--mute); }
button.primary { background: var(--accent); border-color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > input { flex: 1; min-width: 0; }
.center { text-align: center; }
.mute { color: var(--mute); font-size: 14px; }
h2 { margin: 4px 0 2px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 14px 0; }

/* home */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.card { display: block; text-decoration: none; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card .icon { font-size: 30px; }
.card b { display: block; margin: 4px 0; font-size: 18px; }
.card.done { opacity: .7; }
.card.done b::after { content: " ✓"; color: var(--green); }

.gamehead { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

/* toast */
#toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-weight: 600; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 9; }
#toast.show { opacity: 1; }

/* wordle */
.grid { display: grid; grid-template-rows: repeat(6, 1fr); gap: 6px; width: min(320px, 100%); margin: 8px auto 16px; }
.grid .r { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tile { aspect-ratio: 1; display: grid; place-items: center; font-size: 28px; font-weight: 800; text-transform: uppercase; border: 2px solid var(--line); border-radius: 6px; }
.tile.f { border-color: var(--mute); }
.g { background: var(--green) !important; border-color: var(--green) !important; }
.y { background: var(--yellow) !important; border-color: var(--yellow) !important; }
.b { background: var(--grey) !important; border-color: var(--grey) !important; }
.kb { display: grid; gap: 6px; }
.kb .r { display: flex; gap: 5px; justify-content: center; }
.kb button { flex: 1; max-width: 44px; padding: 14px 0; text-transform: uppercase; background: #4a4e57; border: 0; }
.kb button.wide { max-width: 68px; flex: 1.5; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* songs */
.bar { height: 10px; background: var(--grey); border-radius: 5px; overflow: hidden; position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); width: 0; }
.bar .mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bg); }
.tries { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.tries li { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 40px; font-size: 14px; }
.tries li.wrong { border-color: var(--red); }
.tries li.skip { color: var(--mute); }
.tries li.right { border-color: var(--green); }
.sugg { display: grid; gap: 2px; margin-top: 4px; }
.sugg button { text-align: left; font-weight: 400; font-size: 14px; padding: 6px 10px; }
.reveal { display: flex; gap: 12px; align-items: center; }
.reveal img { width: 96px; height: 96px; border-radius: 8px; }
.big-play { font-size: 22px; padding: 14px 28px; }

/* hive */
.hive { display: grid; grid-template-columns: repeat(3, 72px); gap: 8px; justify-content: center; margin: 16px 0; }
.hive button { width: 72px; height: 72px; border-radius: 50%; font-size: 26px; text-transform: uppercase; }
.hive button.c { background: var(--yellow); border-color: var(--yellow); color: #111; }
.word { font-size: 28px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; min-height: 40px; text-align: center; }
.word .c { color: var(--yellow); }
.found { display: flex; flex-wrap: wrap; gap: 6px; }
.found span { background: var(--grey); border-radius: 6px; padding: 2px 8px; font-size: 14px; }
.found span.p { background: var(--yellow); color: #111; font-weight: 700; }
.found span.miss { background: transparent; border: 1px dashed var(--line); color: var(--mute); }

/* warmer */
.guesses { display: grid; gap: 4px; margin-top: 10px; }
.guess { position: relative; display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 8px; background: var(--grey); overflow: hidden; }
.guess i { position: absolute; inset: 0 auto 0 0; opacity: .55; }
.guess span { position: relative; }
.guess.last { outline: 2px solid var(--text); }

/* higher */
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vs .side { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; display: flex; flex-direction: column; gap: 8px; justify-content: space-between; min-height: 260px; }
.vs img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; background: var(--grey); }
.vs .views { font-size: 22px; font-weight: 800; }
.vs .t { font-weight: 700; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
td pre { margin: 0; font: inherit; white-space: pre-wrap; }

@media (max-width: 420px) {
  .hive { grid-template-columns: repeat(3, 64px); } .hive button { width: 64px; height: 64px; }
  .vs .side { min-height: 220px; } .vs img { height: 90px; }
}
