*{box-sizing:border-box}
:root{--paper:#f6f1e4;--ink:#2b2a33;--muted:#7b776b;--line:#cfc7b0;--accent:#c2410c;--accent2:#ea580c;--ok:#15803d;--bad:#dc2626;--clue:#e7edf3;--cell:#fffdf7;--word:#fdf0b8;--cur:#fbbf24;--empty:#3e4756;--rev:#1d4ed8}
body{margin:0;font:16px system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:var(--paper);color:var(--ink)}
main{max-width:860px;margin:0 auto;padding:12px 12px 48px}
h1{font-size:26px;margin:8px 0 2px}h2{font-size:18px;margin:0 0 10px}h3{font-size:14px;margin:14px 0 6px;color:var(--muted);font-weight:600}
a{color:var(--accent)}
.card{background:#fffdf7;border:1px solid var(--line);border-radius:14px;padding:14px;margin-bottom:12px;box-shadow:0 1px 2px rgba(0,0,0,.04)}
input,select,button{font:inherit;padding:9px 12px;border-radius:9px;border:1px solid var(--line);background:#fff;color:var(--ink)}
input[type=radio]{width:auto;padding:0}
button{background:var(--accent);color:#fff;border:0;font-weight:700;cursor:pointer}
button:hover{background:var(--accent2)}button:disabled{opacity:.45;cursor:not-allowed}
button.sec{background:#fff;color:var(--ink);border:1px solid var(--line)}button.sec:hover{background:#f3eedd}
button.danger{background:#fff;color:var(--bad);border:1px solid #e9b4b4}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:8px 0}
.muted{color:var(--muted);font-size:13px}.err{color:var(--bad)}
.msg{min-height:22px;color:#92400e;font-size:14px;margin:4px 0}
.stats{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}.stat{background:#f3eedd;border-radius:10px;padding:6px 12px;font-size:13px}.stat b{font-size:17px;display:block;color:var(--accent)}
.badges{display:flex;gap:6px;flex-wrap:wrap}.badge{font-size:22px;filter:grayscale(1);opacity:.35}.badge.got{filter:none;opacity:1}
.linkbox{display:flex;gap:8px;flex-wrap:wrap}.linkbox input{flex:1;min-width:200px;font-size:13px}
.choice{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0}.choice label{display:flex;gap:6px;align-items:center;border:1px solid var(--line);border-radius:10px;padding:8px 12px;background:#fff;cursor:pointer;font-size:14px}
.choice label.on{border-color:var(--accent);background:#fff1e6}
.cool{background:#fff1e6;border:1px solid #f4c7a6;border-radius:10px;padding:10px;margin:8px 0}
ul.list{list-style:none;margin:0;padding:0}ul.list li{display:flex;justify-content:space-between;gap:8px;padding:6px 0;border-bottom:1px solid #eee7d3;font-size:14px}ul.list li:last-child{border:0}
table{width:100%;border-collapse:collapse;font-size:14px}th,td{padding:5px 8px;text-align:left;border-bottom:1px solid #eee7d3}th{color:var(--muted);font-size:12px;font-weight:600}tr.me td{background:#fff1e6;font-weight:700}
.tabs{display:flex;gap:6px;margin-bottom:8px}.tabs button{padding:6px 12px;font-size:13px}.tabs button.on{background:var(--accent);color:#fff}
/* игра */
.gamebar{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}
.timer{font-variant-numeric:tabular-nums;font-weight:700;font-size:18px}
.cluebar{background:#fff8dc;border:1px solid #ecd98a;border-radius:10px;padding:8px 12px;min-height:44px;margin:6px 0;font-size:15px}
.cluebar small{color:var(--muted)}
#gridwrap{overflow-x:auto;padding-bottom:4px}
#grid{display:grid;gap:1px;background:#a9a18a;border:2px solid #a9a18a;width:max-content;margin:0 auto;user-select:none;touch-action:manipulation}
.cell{width:var(--cs);height:var(--cs);display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}
.cell.empty{background:var(--empty)}
.cell.clue{background:var(--clue);flex-direction:column;align-items:stretch;justify-content:center;padding:1px;cursor:pointer}
.cell.clue .cl{font-size:max(6px,calc(var(--cs)*.2));line-height:1.05;color:#33415c;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;word-break:break-word}
.cell.clue.single .cl{-webkit-line-clamp:5}
.cell.clue .cl i{font-style:normal;color:var(--accent);font-weight:700}
.cell.letter{background:var(--cell);font-size:calc(var(--cs)*.58);font-weight:700;cursor:pointer;color:var(--ink)}
.cell.letter.inword{background:var(--word)}
.cell.letter.cur{background:var(--cur)}
.cell.letter.wrong{color:var(--bad);background:#fde4e4}
.cell.letter.rev{color:var(--rev)}
.kbd{display:flex;flex-direction:column;gap:5px;margin:10px auto 4px;max-width:520px}
.kbd .kr{display:flex;gap:4px;justify-content:center}
.kbd button{flex:1;max-width:44px;min-width:0;padding:10px 0;background:#fff;color:var(--ink);border:1px solid var(--line);font-size:16px;border-radius:7px}
.kbd button.wide{max-width:64px;background:#f3eedd}
.tools{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;margin:8px 0}.tools button{padding:7px 10px;font-size:13px}.tools button small{opacity:.75;font-weight:400}
.cluelist{columns:2;column-gap:20px;font-size:13px}@media(max-width:560px){.cluelist{columns:1}}
.cluelist div{padding:2px 0;cursor:pointer;break-inside:avoid}.cluelist div:hover{color:var(--accent)}.cluelist .h{font-weight:700;color:var(--muted);cursor:default;margin-top:6px}
.overlay{position:fixed;inset:0;background:rgba(40,35,20,.55);display:flex;align-items:center;justify-content:center;padding:16px;z-index:10}
.modal{background:#fffdf7;border-radius:16px;padding:20px;max-width:380px;width:100%;box-shadow:0 10px 40px rgba(0,0,0,.35)}
.modal h2{font-size:22px;color:var(--ok)}.modal .total{font-size:36px;font-weight:800;color:var(--accent);text-align:center;margin:6px 0}
.modal table td:last-child{text-align:right;font-weight:700}
