:root{--ink:#0f172a;--muted:#475569;--line:#cbd5e1;--bg:#e8f1f7;--surface:#fff;--primary:#1f4e9a;--primary-hover:#183e7b;--amber-ink:#8a4b00;--p1:#13284d;--serif:"Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;--radius:10px;color:var(--ink);-webkit-text-size-adjust:100%;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*{box-sizing:border-box}html,body{overscroll-behavior:none;background:var(--bg);height:100dvh;margin:0;overflow:hidden}body{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}[hidden]{display:none!important}button{font:inherit;color:inherit}.btn{border-radius:var(--radius);border:1px solid var(--line);background:var(--surface);min-height:44px;color:var(--ink);cursor:pointer;white-space:nowrap;padding:0 16px;font-size:15px;font-weight:600}.btn:focus-visible,.icon:focus-visible,.link:focus-visible,input:focus-visible{outline-offset:2px;outline:3px solid #f5a623}.btn.primary{background:var(--primary);border-color:var(--primary);color:#fff}.btn.primary:hover{background:var(--primary-hover)}.btn.secondary{color:var(--primary);border-color:#9db2d6}.btn.secondary:hover{background:#f1f5fb}.btn.big{width:100%;min-height:56px;font-size:17px}.link{min-height:44px;color:var(--primary);text-underline-offset:3px;cursor:pointer;background:0 0;border:0;font-size:15px;text-decoration:underline}.screen{height:100dvh;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}.home{background:linear-gradient(#f7f3ea,#cfe3ee);justify-content:center;align-items:center;display:flex;overflow-y:auto}.home-inner{text-align:center;flex-direction:column;align-items:center;width:min(100%,420px);padding:24px 20px;display:flex}.logo{width:120px;height:90px;margin-bottom:8px}.home h1{font-family:var(--serif);letter-spacing:-.01em;margin:0;font-size:48px;font-weight:600;line-height:1.05}.lead{color:var(--muted);margin:8px 0 28px;font-size:17px}.stack{flex-direction:column;gap:12px;width:100%;display:flex}.field{text-align:left;flex-direction:column;gap:6px;width:100%;margin-top:12px;display:flex}.field span{color:var(--muted);font-size:14px}.field input{min-height:44px;font:inherit;color:var(--ink);background:var(--surface);border-radius:var(--radius);-webkit-user-select:text;user-select:text;border:1px solid #94a3b8;padding:0 12px;font-size:16px}.error{color:#b91c1c;background:#fff;border-radius:8px;margin:12px 0 0;padding:8px 12px}#btn-rules-home{margin-top:16px}.game{grid-template:"bar""info""banner""stage"minmax(0,1fr)"actions"/minmax(0,1fr);display:grid}.bar{background:var(--surface);grid-area:bar;align-items:center;gap:8px;padding:8px max(8px,50% - 480px) 4px;display:flex}.turn{border-left:6px solid #0000}.bar.p0 .turn{border-left-color:#2b2f36}.bar.p1{background:var(--p1);color:#fff}.bar.p1 .turn-sub{color:#d5deec}.bar.p1 .swatch{border-color:#fff}.icon{border-radius:var(--radius);border:1px solid var(--line);background:var(--surface);width:44px;height:44px;color:var(--ink);cursor:pointer;flex:none;place-items:center;font-size:20px;font-weight:700;display:grid}.icon svg{width:22px;height:22px}.turn{flex:1;align-items:center;gap:10px;min-width:0;padding:0 4px;display:flex}.swatch{background:#f4f1ea;border:3px solid #2b2f36;border-radius:50%;flex:none;width:32px;height:32px}.swatch.p1{background:#13284d;border-color:#8fa6c8}.swatch.none{visibility:hidden}.turn-text{min-width:0}.turn-main{overflow-wrap:anywhere;font-size:20px;font-weight:700;line-height:1.25}.turn-sub{color:var(--muted);min-height:1.3em;font-size:15px;line-height:1.3}.info{background:var(--surface);border-bottom:1px solid var(--line);color:var(--muted);flex-wrap:wrap;grid-area:info;justify-content:space-between;gap:2px 12px;min-height:8px;padding:0 12px 8px;font-size:13px;display:flex}.info:has(#presence:empty):has(#stock:empty){padding-bottom:4px}#presence.warn,#stock.warn{color:#9a3412;font-weight:600}.rules-stock{color:var(--muted);margin:8px 0 0;font-size:14px}.banner{color:#78350f;text-align:center;background:#fef3c7;border-bottom:1px solid #fcd34d;grid-area:banner;padding:8px 12px;font-size:14px;font-weight:600}.stage{grid-area:stage;min-height:0;position:relative;overflow:hidden}#c{touch-action:none;outline:none;width:100%;height:100%;display:block}.actions{padding:8px 8px max(8px, env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--line);grid-area:actions;justify-content:center;gap:8px;display:flex}.actions .btn{flex:1 1 0;max-width:220px;padding:0 10px}.toast{background:var(--ink);color:#fff;border-radius:var(--radius);text-align:center;pointer-events:none;max-width:calc(100% - 24px);padding:10px 14px;font-size:15px;font-weight:600;position:absolute;top:12px;left:50%;transform:translate(-50%);box-shadow:0 4px 16px #0f172a40}.card{background:var(--surface);border:1px solid var(--line);text-align:center;border-radius:14px;max-width:440px;margin:0 auto;padding:20px;position:absolute;left:12px;right:12px;box-shadow:0 10px 30px #0f172a2e}.card h2{margin:0 0 6px;font-size:22px;line-height:1.2}.card p{color:var(--muted);margin:0 0 12px;font-size:15px;line-height:1.45}.card .row{flex-wrap:wrap;justify-content:center;gap:10px;display:flex}.card .row .btn{flex:140px}.wait,.msg{top:50%;transform:translateY(-50%)}.end{bottom:12px}.end h2{justify-content:center;align-items:center;gap:10px;font-size:26px;display:flex}.end h2 .swatch{width:28px;height:28px}.end .note{color:var(--ink);font-weight:600}.link-big{word-break:break-all;border:1px solid var(--line);border-radius:var(--radius);-webkit-user-select:all;user-select:all;background:#f1f5f9;padding:10px 12px;font-size:18px;font-weight:700;color:var(--ink)!important}.waiting{justify-content:center;align-items:center;gap:8px;display:flex;margin:14px 0 0!important}.spinner{border:2px solid #cbd5e1;border-top-color:var(--primary);border-radius:50%;width:16px;height:16px;animation:.9s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.modal{z-index:20;background:#0f172a73;justify-content:center;align-items:center;padding:16px;display:flex;position:fixed;inset:0}.sheet{background:var(--surface);border-radius:14px;width:min(100%,460px);max-height:calc(100dvh - 32px);padding:20px;overflow-y:auto;box-shadow:0 10px 30px #0f172a4d}.sheet h2{margin:0 0 12px;font-size:22px}.sheet-title{margin:0 0 16px;font-size:18px;font-weight:700}.sheet .row{justify-content:flex-end;gap:10px;margin-top:16px;display:flex}.sheet .row .btn{flex:1 1 0}.sheet .field{margin-top:0}.rules{margin:0;padding-left:22px;font-size:15px;line-height:1.45}.rules li{margin-bottom:6px}@media (width>=900px){.turn-main{font-size:22px}}.nogl{text-align:center;background:var(--surface);place-items:center;padding:24px;font-size:17px;display:grid;position:absolute;inset:0}@media (orientation:landscape) and (height<=540px){.game{grid-template:"bar actions""info actions""banner actions""stage actions"minmax(0,1fr)/minmax(0,1fr) auto}.bar{border-bottom:1px solid var(--line);max-height:48px;padding:2px 8px}.turn-text{white-space:nowrap;align-items:baseline;gap:8px;display:flex;overflow:hidden}.turn-main{text-overflow:ellipsis;font-size:16px;overflow:hidden}.turn-sub{min-height:0;font-size:14px}.info{padding:2px 12px 4px}.actions{border-top:0;border-left:1px solid var(--line);padding:max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 8px 8px;flex-direction:column;justify-content:flex-start;width:170px}.actions .btn{flex:none;max-width:none}.end{padding:14px;bottom:8px}.end h2{font-size:22px}}@media (prefers-reduced-motion:reduce){.spinner{animation-duration:2.5s}}
