:root{
  --bg:#f4f1ea; --ink:#1d2433; --muted:#667085; --card:#fff;
  --brand:#4f46e5; --brand-d:#3d35c4; --accent:#ffb020; --ok:#12a150; --no:#e5484d;
  --radius:18px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:ui-rounded,"Nunito","Segoe UI",system-ui,-apple-system,sans-serif}
body{min-height:100vh;display:flex;flex-direction:column}
.app{flex:1;width:100%;max-width:560px;margin:0 auto;padding:18px 16px 8px}
.screen{display:none;flex-direction:column;align-items:center;text-align:center;gap:14px}
.screen.active{display:flex}
.hidden{display:none!important}
.logo{font-size:clamp(40px,12vw,64px);margin:14px 0 0;letter-spacing:-1px;font-weight:900;color:var(--brand)}
.logo span{color:var(--accent)}
.lead{font-size:18px;line-height:1.45;color:var(--muted);margin:0;max-width:440px}
.lead.small{font-size:16px}
.card{background:var(--card);border-radius:var(--radius);box-shadow:0 2px 0 rgba(0,0,0,.05),0 8px 24px rgba(30,30,60,.07);padding:16px;width:100%}
.settings .row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0}
.settings .row+.row{border-top:1px solid #eee}
.settings label{font-weight:700;text-align:left}
.seg{display:flex;gap:6px}
.seg button{border:2px solid #e3e3ee;background:#fff;border-radius:12px;padding:8px 14px;font-size:15px;font-weight:700;color:var(--ink);cursor:pointer}
.seg button.on{background:var(--brand);border-color:var(--brand);color:#fff}
button.big{background:var(--brand);color:#fff;border:0;border-radius:16px;padding:16px 34px;font-size:20px;font-weight:800;cursor:pointer;box-shadow:0 5px 0 var(--brand-d);transition:transform .08s,box-shadow .08s;min-width:200px}
button.big:active{transform:translateY(4px);box-shadow:0 1px 0 var(--brand-d)}
button.big:disabled{opacity:.5;cursor:default}
button.big.ok{background:var(--ok);box-shadow:0 5px 0 #0c7a3d}
button.big.no{background:var(--no);box-shadow:0 5px 0 #b5353a}
button.ghost{background:#fff;border:2px solid #e3e3ee;border-radius:12px;padding:10px 16px;font-size:15px;font-weight:700;color:var(--ink);cursor:pointer}
.status{font-size:14px;color:var(--muted);margin:0;max-width:440px;line-height:1.4}
.status.ok{color:var(--ok);font-weight:700}
.status.warn{background:#fff7e0;border-radius:12px;padding:10px 12px;color:#7a5b00}

.round-label{font-weight:800;color:var(--muted);margin:10px 0 0;letter-spacing:.5px}
.word-card{background:#fff;border-radius:28px;padding:30px 24px;width:100%;box-shadow:0 10px 30px rgba(30,30,60,.1);border:3px solid var(--accent)}
.word-card .emoji{font-size:84px;line-height:1}
.word-card .word{font-size:clamp(34px,10vw,52px);font-weight:900;margin-top:10px;color:var(--brand);word-break:break-word}

.topbar{display:flex;align-items:center;justify-content:space-between;width:100%;gap:10px}
.target{font-size:clamp(20px,6vw,28px);text-align:left}
.target b{color:var(--brand)}
.time{min-width:54px;height:54px;border-radius:50%;background:var(--ink);color:#fff;display:grid;place-items:center;font-size:24px;font-weight:900}
.timebar{width:100%;height:10px;background:#e6e3da;border-radius:99px;overflow:hidden}
.timebar i{display:block;height:100%;width:100%;background:var(--ok);transition:width .1s linear}
.timebar i.low{background:var(--no)}
.canvas-wrap{position:relative;width:100%;aspect-ratio:1/1;max-height:62vh;max-width:62vh;margin:0 auto}
#canvas{width:100%;height:100%;background:#fff;border-radius:var(--radius);box-shadow:0 2px 0 rgba(0,0,0,.05),0 8px 24px rgba(30,30,60,.1);touch-action:none;cursor:crosshair;display:block}
.overlay{position:absolute;inset:0;background:rgba(244,241,234,.93);border-radius:var(--radius);display:grid;place-items:center;padding:16px}
.overlay-card{display:flex;flex-direction:column;gap:10px;align-items:center}
.overlay-emoji{font-size:64px}
.overlay h2{margin:0;font-size:26px}
.overlay p{margin:0;color:var(--muted);font-size:17px;line-height:1.4}
#ov-buttons{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.guess{width:100%;background:#fff;border-radius:var(--radius);padding:12px 14px;text-align:left;box-shadow:0 2px 0 rgba(0,0,0,.05)}
.guess-title{font-weight:800;margin-bottom:6px;color:var(--muted);font-size:14px}
.hint{color:var(--muted);font-size:15px;padding:6px 0}
.gr{display:grid;grid-template-columns:minmax(90px,38%) 1fr 42px;align-items:center;gap:8px;padding:3px 0;font-size:16px}
.gr.first .gn{font-weight:900;color:var(--brand)}
.gb{height:10px;background:#eceaf6;border-radius:99px;overflow:hidden}
.gb i{display:block;height:100%;background:var(--brand);border-radius:99px;transition:width .25s}
.gr:not(.first) .gb i{background:#a9a4e8}
.gp{text-align:right;color:var(--muted);font-size:14px}
.tools{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}

.res-title{font-size:30px;margin:8px 0 0}
.score-big{font-size:72px;font-weight:900;color:var(--brand);line-height:1}
.score-big small{font-size:20px;color:var(--muted);margin-left:8px}
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;width:100%}
.grid figure{margin:0;background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 2px 0 rgba(0,0,0,.05);border:3px solid transparent}
.grid figure.won{border-color:var(--ok)} .grid figure.lost{border-color:#f0c4c6}
.grid img{width:100%;display:block;background:#fff}
.grid figcaption{display:flex;justify-content:space-between;padding:8px 10px;font-weight:700;font-size:15px;text-align:left}
.grid .won b{color:var(--ok)} .grid .lost b{color:var(--no)}
footer{text-align:center;color:#98a0b0;font-size:12px;padding:14px 10px}
