:root {
  --paper: #f6f1e6;
  --paper-2: #efe8d8;
  --ink: #23201b;
  --muted: #7d766a;
  --line: #d9d0bd;
  --accent: #b5532b;
  --water: #cfe3ef;
  --water-line: #a9c9dc;
  --good: #2f8f46;
  --bad: #a3261b;
  --c-solid: #3a362f; --c-wood: #7a4a21; --c-push: #1f4e8c; --c-platform: #9a6b2f; --c-open: #3f7f6f;
  --c-hunt: #b3261e; --c-flee: #2f7d4a; --c-fly: #4f7cc9; --c-hot: #d9480f; --c-wet: #1f6fb2; --c-bomb: #a51d3c; --c-win: #2f8f46;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input { font: inherit; color: inherit; }
button { background: #fffaf0; border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; }
button.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.good { background: var(--good); color: #fff; border-color: var(--good); }
button.bad { color: var(--bad); }
button.link { border: none; background: none; color: var(--muted); text-decoration: underline; }
input { background: #fffdf8; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.brand { font-family: Georgia, serif; font-size: 20px; font-weight: 700; }
.brand span { font-weight: 400; color: var(--muted); font-size: 15px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.tabs button.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tabs .count { opacity: .7; margin-left: 4px; }

main { max-width: 980px; margin: 0 auto; padding: 16px; }
.login { display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin: 40px auto; }
.error { color: var(--bad); min-height: 20px; }
.status { color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 16px; }

.card { background: #fffdf8; border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; grid-template-columns: auto 1fr; gap: 16px; }
@media (max-width: 640px) { .card { grid-template-columns: 1fr; } }
.card h2 { font-family: Georgia, serif; font-style: italic; font-weight: 400; margin: 0 0 4px; font-size: 21px; }
.meta { color: var(--muted); font-size: 13px; }
.words { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.word { font-family: Georgia, serif; font-weight: 700; font-size: 13px; padding: 1px 7px; border-radius: 6px; border: 1px solid currentColor; }
.word.GHOST { color: #6f695e; background: #ebe6db; border-color: #c9c2b4; font-weight: 400; }
.solution { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); word-break: break-all; }
.reports { color: var(--bad); font-size: 13px; margin: 6px 0 0; padding-left: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.reason { color: var(--bad); font-size: 13px; }

.board { position: relative; background: #fbf7ee; box-shadow: 0 0 0 1px var(--line); border-radius: 6px; overflow: hidden; }
.cell { position: absolute; }
.cell.water { background: repeating-linear-gradient(170deg, var(--water) 0 5px, var(--water-line) 5px 6px); }
.tile { position: absolute; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-family: Georgia, serif; font-weight: 700; white-space: nowrap; border: 1.5px solid currentColor; background: #fffdf8; }
.tile.GHOST { color: #6f695e; background: #ebe6db; border-color: #c9c2b4; font-weight: 400; }
.me { position: absolute; border-radius: 50%; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; font-family: Georgia, serif; font-weight: 700; }
.p-SOLID { color: var(--c-solid); } .p-WOOD { color: var(--c-wood); } .p-PUSH { color: var(--c-push); }
.p-PLATFORM { color: var(--c-platform); } .p-OPEN { color: var(--c-open); } .p-HUNT { color: var(--c-hunt); }
.p-FLEE { color: var(--c-flee); } .p-FLY { color: var(--c-fly); } .p-HOT { color: var(--c-hot); }
.p-WET { color: var(--c-wet); } .p-BOMB { color: var(--c-bomb); } .p-WIN { color: var(--c-win); }
