/* Uch Maymun. LAYOUT: landscape 16:9 is the default. Every size that a portrait layout would change is a variable
   in :root (button size, panel width, HUD paddings), so a portrait version is one more block of variables. */
:root {
  --font: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --ink: #2a1a14; --paper: #fff6dc; --leaf: #2f9e44; --leaf-d: #1d3b2a; --sun: #f5c518; --red: #e5383b; --wood: #b07a45;
  --pad: max(10px, env(safe-area-inset-left)); --padr: max(10px, env(safe-area-inset-right)); --padt: max(8px, env(safe-area-inset-top)); --padb: max(8px, env(safe-area-inset-bottom));
  --btn: clamp(46px, 13vh, 64px);          /* height of a HUD button */
  --btn-w: clamp(92px, 15vw, 130px);       /* width of a HUD button */
  --stick: clamp(96px, 30vh, 130px);       /* joystick size */
  --panel-w: min(560px, 62vw);             /* gesture / item panels */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1a12; color: var(--paper); font-family: var(--font); font-weight: 700; user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; width: 100%; height: 100%; touch-action: none; }
button, input { font: inherit; color: inherit; }
button { border: 0; border-radius: 14px; background: var(--paper); color: var(--ink); padding: 10px 16px; cursor: pointer; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); transition: transform .06s, box-shadow .06s, filter .06s; }
button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); filter: brightness(.92); }
button:disabled { opacity: .45; }
button.big { background: var(--sun); font-size: clamp(16px, 5vh, 22px); padding: 12px 22px; }
input { border: 3px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); padding: 9px 12px; width: 100%; text-align: center; font-size: 18px; outline: none; user-select: text; -webkit-user-select: text; }
[hidden] { display: none !important; }

.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: var(--padt) var(--padr) var(--padb) var(--pad); background: rgba(13, 26, 18, .45); z-index: 20; }
.card { background: var(--leaf-d); border: 4px solid var(--ink); border-radius: 22px; padding: clamp(10px, 3.5vh, 22px) clamp(14px, 3vw, 28px); width: min(430px, 92vw); max-height: 96vh; overflow: auto; text-align: center; box-shadow: 0 10px 0 rgba(0, 0, 0, .3); }
.card.wide { width: min(760px, 94vw); }
.card h1 { margin: 0; font-size: clamp(26px, 9vh, 44px); color: var(--sun); letter-spacing: 2px; text-shadow: 0 3px 0 var(--ink); }
.card .tag { margin: 2px 0 10px; font-size: clamp(12px, 3.6vh, 15px); opacity: .9; }
.card > * + * { margin-top: clamp(6px, 2vh, 10px); }
.row { display: flex; gap: 8px; } .row.center { justify-content: center; }
.row input { flex: 1; letter-spacing: 6px; text-transform: uppercase; }
.or { font-size: 12px; opacity: .7; }
.msg { min-height: 18px; font-size: 13px; color: #ffe9a8; } .msg.bad { color: #ff9a9a; }
details { font-size: 13px; text-align: left; } details p { font-weight: 400; line-height: 1.35; margin: 6px 0 0; } summary { cursor: pointer; text-align: center; opacity: .85; }
#create { width: 100%; }

.lobby-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.roomcode span, .lvl span { font-size: 12px; opacity: .75; margin-right: 6px; }
.roomcode b { font-size: clamp(26px, 9vh, 40px); letter-spacing: 6px; color: var(--sun); user-select: text; -webkit-user-select: text; }
.lvl b { font-size: 22px; color: var(--sun); }
#seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.seat { background: rgba(255, 246, 220, .1); border: 3px dashed rgba(255, 246, 220, .35); border-radius: 16px; padding: clamp(8px, 3vh, 16px) 6px; min-height: clamp(64px, 22vh, 96px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; }
.seat.on { background: var(--paper); color: var(--ink); border: 3px solid var(--ink); }
.seat.away { opacity: .55; }
.seat b { font-size: clamp(15px, 5vh, 20px); } .seat small { font-size: 11px; opacity: .8; }
.seat .tags i { font-style: normal; font-size: 10px; background: var(--leaf); color: #fff; border-radius: 8px; padding: 1px 6px; margin: 0 2px; }
.seat .tags i.h { background: var(--red); } .seat .tags i.v { background: #2f7de0; }
.lobby-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.lobby-bottom small { display: block; font-weight: 400; font-size: 11px; opacity: .8; margin-top: 5px; line-height: 1.25; }
#voice-btn, #start { width: 100%; }
#voice-btn.on { background: #9fd68a; }

#rolecard { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(13, 26, 18, .78); }
#rolecard h2 { margin: 0; font-size: clamp(34px, 12vh, 56px); color: var(--sun); text-shadow: 0 3px 0 var(--ink); letter-spacing: 3px; }
#rolecard ul { list-style: none; padding: 0; margin: 8px 0; font-size: clamp(13px, 4.2vh, 17px); font-weight: 400; line-height: 1.5; }
#rolecard li:nth-child(2) { font-weight: 700; color: #ffe9a8; }
body.role-blind #rolecard .card { background: #000; border-color: #fff; } body.role-blind #rolecard h2 { color: #fff; text-shadow: none; } body.role-blind #rolecard li:nth-child(2) { color: #fff; }

/* ---- HUD ---- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: auto; }
#role-badge { position: absolute; left: var(--pad); top: var(--padt); background: var(--ink); color: var(--sun); border-radius: 12px; padding: 5px 12px; font-size: clamp(13px, 4.4vh, 17px); letter-spacing: 2px; pointer-events: none; }
#clock { position: absolute; left: 50%; top: var(--padt); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; }
#time { font-size: clamp(22px, 8.5vh, 34px); color: #fff; text-shadow: 0 2px 0 var(--ink), 0 0 8px rgba(0, 0, 0, .5); font-variant-numeric: tabular-nums; line-height: 1; }
#time.low { color: #ff8a8a; }
#timebar { width: clamp(130px, 24vw, 220px); height: 7px; background: rgba(0, 0, 0, .45); border-radius: 4px; overflow: hidden; } #timebar i { display: block; height: 100%; width: 100%; background: var(--sun); transform-origin: left; }
#strikes { display: flex; gap: 6px; } #strikes s { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .35); text-decoration: none; } #strikes s.x { background: var(--red); }
.chipbtn { position: absolute; right: var(--padr); top: var(--padt); font-size: 12px; padding: 7px 11px; border-radius: 12px; background: var(--ink); color: var(--paper); box-shadow: none; }
#mic.live { background: var(--leaf); color: #fff; } #mic.rule { background: var(--red); color: #fff; }
#hint { position: absolute; left: 50%; bottom: var(--padb); transform: translateX(-50%); font-size: 12px; font-weight: 400; background: rgba(0, 0, 0, .45); padding: 4px 12px; border-radius: 10px; white-space: nowrap; pointer-events: none; }
#showing { position: absolute; left: 50%; top: 27%; transform: translateX(-50%); background: var(--paper); color: var(--ink); padding: 6px 14px; border-radius: 12px; font-size: 14px; pointer-events: none; }
#stick { position: absolute; left: calc(var(--pad) + 8px); bottom: calc(var(--padb) + 8px); width: var(--stick); height: var(--stick); border-radius: 50%; background: rgba(255, 255, 255, .14); border: 2px solid rgba(255, 255, 255, .45); touch-action: none; }
#stick i { position: absolute; left: 50%; top: 50%; width: 44%; height: 44%; margin: -22% 0 0 -22%; border-radius: 50%; background: rgba(255, 255, 255, .7); }
#btns { position: absolute; right: var(--padr); bottom: var(--padb); display: flex; flex-direction: column-reverse; gap: 8px; align-items: flex-end; }
#btns button { width: var(--btn-w); height: var(--btn); font-size: clamp(12px, 3.8vh, 15px); padding: 0 6px; }
#b-bomb { background: var(--sun); } #b-manual { background: var(--sun); }
#fps { position: absolute; left: var(--pad); top: calc(var(--padt) + 34px); font: 11px/1.2 monospace; background: rgba(0, 0, 0, .5); padding: 2px 6px; border-radius: 6px; pointer-events: none; }

/* Blind: the HUD is white on black too, and shows no numbers */
body.role-blind #role-badge, body.role-blind .chipbtn { background: #000; color: #fff; border: 2px solid #fff; }
body.role-blind #time { display: none; }
body.role-blind #timebar { background: #000; border: 1px solid #fff; } body.role-blind #timebar i { background: #fff; }
body.role-blind #strikes s.x { background: #fff; }
body.role-blind #btns button, body.role-blind #gest button { background: #000; color: #fff; border: 2px solid #fff; box-shadow: none; }
body.role-blind #hint { background: #000; border: 1px solid #fff; }
body.role-blind #stick { background: #000; border-color: #fff; } body.role-blind #stick i { background: #fff; }
body.role-blind #gest { background: #000; border-color: #fff; }
body.role-blind #mic.live, body.role-blind #mic.rule { background: #000; }

.panel { position: fixed; z-index: 15; right: calc(var(--padr) + var(--btn-w) + 10px); bottom: var(--padb); width: var(--panel-w); background: var(--leaf-d); border: 3px solid var(--ink); border-radius: 18px; padding: 10px; display: grid; gap: 7px; }
#gest { grid-template-columns: repeat(4, 1fr); }
#gest button { padding: 0 4px; height: clamp(40px, 12.5vh, 54px); font-size: clamp(11px, 3.6vh, 14px); }
#gest button.n { background: #ffe9a8; font-size: 20px; }
#items { grid-template-columns: repeat(6, 1fr); }
#items .lbl { grid-column: 1 / -1; font-size: 11px; opacity: .8; text-align: left; margin: 0; }
#items button { height: clamp(38px, 12vh, 52px); padding: 0; font-size: 18px; display: flex; align-items: center; justify-content: center; }
#items button.on { outline: 4px solid var(--sun); }
#items button .dot { width: 26px; height: 15px; border-radius: 12px 12px 3px 12px; border: 2px solid var(--ink); display: block; transform: rotate(-18deg); }
#items button.coco { background: #7b5233; color: #fff; border-radius: 50%; width: clamp(38px, 12vh, 52px); justify-self: center; }
#items button svg { width: 28px; height: 28px; }
#items .put { grid-column: 1 / -1; background: #ffb0a8; font-size: 13px; height: 36px; }

#manual { position: fixed; inset: 0; z-index: 25; display: flex; align-items: stretch; justify-content: flex-start; padding: var(--padt) calc(var(--padr) + var(--btn-w) + 14px) var(--padb) var(--pad); pointer-events: none; }
#manual .book { pointer-events: auto; flex: 1; background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 8px 0 rgba(0, 0, 0, .3); }
#manual .tabs { display: flex; gap: 4px; padding: 6px 6px 0; background: var(--wood); flex-wrap: nowrap; overflow-x: auto; }
#manual .tabs button { box-shadow: none; border-radius: 10px 10px 0 0; padding: 7px 9px; font-size: clamp(10px, 3.2vh, 13px); background: #d9b98a; white-space: nowrap; }
#manual .tabs button.on { background: var(--paper); }
#manual .tabs .x { margin-left: auto; background: var(--red); color: #fff; }
#manual .pages { flex: 1; overflow-y: auto; padding: 8px 14px 14px; font-weight: 400; font-size: clamp(12px, 3.9vh, 15px); line-height: 1.35; touch-action: pan-y; -webkit-overflow-scrolling: touch; text-align: left; }
#manual h2 { margin: 2px 0 6px; font-size: 1.35em; color: #8f2a20; } #manual h3 { margin: 10px 0 4px; font-size: 1.05em; }
#manual p { margin: 5px 0; } #manual ul { margin: 4px 0; padding-left: 20px; } #manual li { margin: 3px 0; }
#manual table { border-collapse: collapse; margin: 6px 0; width: 100%; } #manual th, #manual td { border: 2px solid var(--ink); padding: 4px 6px; text-align: center; font-size: .95em; } #manual th { background: #ead9b0; text-align: left; width: 26%; }
#manual td.big { font-size: 1.4em; font-weight: 700; }
#manual .chip { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); vertical-align: -2px; margin-right: 4px; }
#manual .fr { display: inline-flex; flex-direction: column; align-items: center; width: 54px; font-size: .78em; vertical-align: top; } #manual .fr img { width: 34px; height: 34px; } #manual .fr i { font-style: normal; }
#manual .flist { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin: 6px 0; border: 2px solid var(--ink); border-radius: 10px; padding: 4px; } #manual .flist s { text-decoration: none; opacity: .5; } #manual .flist .tag { background: var(--ink); color: var(--paper); border-radius: 8px; padding: 6px 8px; margin-right: 6px; }
#manual .stickers .fr { width: 62px; } #manual .stickers img { width: 40px; height: 40px; }

#end .card h1 { font-size: clamp(30px, 11vh, 52px); } #end.boom .card { background: #2b2020; } #end.boom h1 { color: #ff8a5a; }
#end-stars { font-size: clamp(30px, 11vh, 50px); letter-spacing: 8px; color: var(--sun); min-height: 1em; } #end-stars .off { opacity: .22; }
#end-text { font-size: 16px; margin: 4px 0; } .note { font-size: 12px; font-weight: 400; opacity: .85; }
#end small { display: block; opacity: .8; }

#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 18; transition: opacity .7s; } #flash.on { opacity: 1; transition: none; }
#splat { position: fixed; inset: 0; pointer-events: none; z-index: 12; opacity: 0; transition: opacity .9s; background: radial-gradient(ellipse at 50% 45%, rgba(245, 197, 24, .95) 0 14%, rgba(245, 197, 24, .7) 22%, transparent 46%); } #splat.on { opacity: 1; transition: none; }
#toast { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 40; background: var(--ink); color: var(--paper); padding: 8px 16px; border-radius: 12px; font-size: 14px; }
#rotate { position: fixed; inset: 0; z-index: 100; background: var(--leaf-d); display: none; align-items: center; justify-content: center; text-align: center; font-size: 20px; }
#rotate .phone { width: 46px; height: 80px; border: 5px solid var(--paper); border-radius: 10px; margin: 0 auto 18px; animation: turn 1.6s ease-in-out infinite; }
@keyframes turn { 0%, 20% { transform: rotate(0); } 70%, 100% { transform: rotate(90deg); } }
/* portrait is not laid out yet: ask for landscape (touch devices only) */
@media (orientation: portrait) and (pointer: coarse) { #rotate { display: flex; } }
body.no-touch #stick { display: none; }

/* ================= v0.2 jungle look: one style for every button, card and panel ================= */
@font-face { font-family: "Fredoka"; font-weight: 500; font-display: swap; src: url("assets/fonts/fredoka-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 700; font-display: swap; src: url("assets/fonts/fredoka-latin-700-normal.woff2") format("woff2"); }
:root { --font: "Fredoka", "Trebuchet MS", "Segoe UI", system-ui, sans-serif; --wood-l: #d9a465; --wood-d: #7a4f2c; --bark: #4e3222; }
html, body { font-weight: 700; }
/* wooden plank buttons */
button { background: linear-gradient(#e9bd7c, #c98f52 55%, #b47a40); color: #2a1a14; border: 3px solid var(--bark); border-radius: 16px; box-shadow: 0 4px 0 var(--bark), inset 0 2px 0 rgba(255, 255, 255, .35); text-shadow: 0 1px 0 rgba(255, 255, 255, .35); letter-spacing: .5px; }
button:active { box-shadow: 0 1px 0 var(--bark), inset 0 2px 0 rgba(255, 255, 255, .2); }
button.big, #b-bomb, #b-manual { background: linear-gradient(#ffe066, #f5c518 55%, #e0a90c); }
#voice-btn.on { background: linear-gradient(#c5ec9c, #8fd45a 60%, #6dbb3c); }
#items .put, #manual .tabs .x { background: linear-gradient(#ff9a8a, #e5383b); color: #fff; text-shadow: none; }
input { border: 3px solid var(--bark); border-radius: 14px; background: #fff6dc; font-family: var(--font); font-weight: 700; }
/* cards: a leafy board with a wooden rim */
.card { background: radial-gradient(120% 90% at 50% 0%, #2f6b3f 0%, #1d3b2a 70%); border: 5px solid var(--bark); box-shadow: 0 0 0 3px var(--wood-l), 0 0 0 6px var(--bark), 0 12px 0 6px rgba(0, 0, 0, .3); border-radius: 26px; position: relative; }
.card h1 { font-weight: 700; color: #ffd84a; text-shadow: 0 3px 0 var(--bark), 0 6px 0 rgba(0, 0, 0, .25); }
.screen { background: rgba(10, 30, 16, .5); }
.seat { border-radius: 18px; border-color: rgba(217, 164, 101, .6); }
.seat.on { background: linear-gradient(#fff6dc, #f1dfb4); border: 3px solid var(--bark); box-shadow: 0 3px 0 var(--bark); }
.roomcode b { text-shadow: 0 3px 0 var(--bark); }
/* HUD */
#role-badge { background: linear-gradient(#7a4f2c, #4e3222); color: #ffd84a; border: 3px solid var(--bark); box-shadow: 0 0 0 2px var(--wood-l); border-radius: 14px; }
.chipbtn { background: linear-gradient(#7a4f2c, #4e3222); color: #fff6dc; border: 3px solid var(--bark); text-shadow: none; }
#mic.live { background: linear-gradient(#57c26a, #2f9e44); } #mic.rule { background: linear-gradient(#f0605f, #c92a2d); }
#time { font-weight: 700; }
#timebar { height: 9px; border: 2px solid var(--bark); background: rgba(0, 0, 0, .5); border-radius: 6px; } #timebar i { background: linear-gradient(#ffe066, #f5a318); }
#strikes s { border: 3px solid var(--bark); background: #fff6dc; width: 18px; height: 18px; } #strikes s.x { background: radial-gradient(#ff8a5a, #e5383b); }
#hint { background: rgba(46, 28, 16, .78); border: 2px solid var(--wood-d); font-weight: 500; }
#showing { border: 3px solid var(--bark); box-shadow: 0 3px 0 var(--bark); }
#stick { background: rgba(122, 79, 44, .35); border: 3px solid rgba(255, 246, 220, .7); } #stick i { background: radial-gradient(#fff6dc, #d9a465); border: 2px solid var(--bark); }
.panel { background: radial-gradient(120% 90% at 50% 0%, #2f6b3f 0%, #1d3b2a 70%); border: 4px solid var(--bark); box-shadow: 0 0 0 3px var(--wood-l), 0 8px 0 3px rgba(0, 0, 0, .3); }
#gest button.n { background: linear-gradient(#fff6dc, #f1dfb4); }
#items button.coco { background: radial-gradient(circle at 35% 30%, #a06c42, #6b4426); color: #fff; text-shadow: 0 1px 0 #000; }
/* HUD buttons carry a small picture of what they do (our own SVG paths) */
#btns button { display: flex; align-items: center; justify-content: center; gap: 6px; }
#btns button::before { content: ""; width: 1.5em; height: 1.5em; flex: none; background-position: center; background-size: contain; background-repeat: no-repeat; }
#b-bomb::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='15' r='8' fill='%232a1a14'/%3E%3Cpath d='M15 9l3-3' stroke='%232a1a14' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M18 6q3-4 5 0' stroke='%23e5383b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3Ccircle cx='7' cy='12' r='2' fill='%23fff' opacity='.6'/%3E%3C/svg%3E"); }
#b-manual::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 5q5-2 10 1 5-3 10-1v14q-5-2-10 1-5-3-10-1z' fill='%23fff6dc' stroke='%232a1a14' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M12 6v14' stroke='%232a1a14' stroke-width='2'/%3E%3C/svg%3E"); }
#b-gest::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 22V12l-2-5q1-2 3 0l2 4V3q2-2 3 0v7-8q2-2 3 0v8-6q2-2 3 0v13q0 5-5 6z' fill='%23f3d2a2' stroke='%232a1a14' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E"); }
#b-items::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6q2 12 17 11-9 0-13-12z' fill='%23ffd23f' stroke='%232a1a14' stroke-width='1.8' stroke-linejoin='round'/%3E%3Ccircle cx='17' cy='8' r='5' fill='%237b5233' stroke='%232a1a14' stroke-width='1.6'/%3E%3C/svg%3E"); }
#b-throw::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 10q2 9 12 8-6 0-9-9z' fill='%23ffd23f' stroke='%232a1a14' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M2 6h6M1 11h5M3 16h4' stroke='%232a1a14' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
/* the manual: an old book */
#manual .book { border: 5px solid var(--bark); box-shadow: 0 0 0 3px var(--wood-l), 0 8px 0 3px rgba(0, 0, 0, .3); background: linear-gradient(#fff8e2, #f6e8c2); }
#manual .tabs { background: linear-gradient(#b07a45, #8a5a33); }
#manual .tabs button { border: 2px solid var(--bark); border-bottom: 0; box-shadow: none; background: #d9b98a; } #manual .tabs button.on { background: #fff8e2; }
#manual h2 { font-weight: 700; } #manual .pages { font-weight: 500; }
#end.boom .card { background: radial-gradient(120% 90% at 50% 0%, #4a3a36 0%, #231c1c 70%); }
#toast { border: 3px solid var(--wood-l); background: var(--bark); }
/* Blind: the same shapes in plain white lines on black - no colour, no wood */
body.role-blind button, body.role-blind #role-badge, body.role-blind .chipbtn, body.role-blind #hint, body.role-blind .panel { background: #000 !important; color: #fff; border: 2px solid #fff; box-shadow: none; text-shadow: none; }
body.role-blind #btns button::before { filter: grayscale(1) brightness(0) invert(1); }
body.role-blind #timebar { border: 1px solid #fff; background: #000; } body.role-blind #timebar i { background: #fff; }
body.role-blind #strikes s { border: 2px solid #fff; background: #000; } body.role-blind #strikes s.x { background: #fff; }
body.role-blind #stick { background: #000; border: 2px solid #fff; } body.role-blind #stick i { background: #fff; border: 0; }
body.role-blind #rolecard .card { background: #000; border: 3px solid #fff; box-shadow: none; }
body.role-blind #rolecard button { background: #000 !important; }

/* practice (one player alone) */
#solo { width: 100%; font-size: 14px; padding: 9px; }
#b-role { background: linear-gradient(#c5ec9c, #8fd45a 60%, #6dbb3c); }
#btns #b-role::before { display: none; }
#end-levels button { min-width: 44px; padding: 8px 0; } #end-levels small { margin-bottom: 4px; }
body.practice #role-badge::before { content: attr(data-p) " · "; color: #9fe08a; }
body.role-blind #end-levels button { background: linear-gradient(#e9bd7c, #c98f52 55%, #b47a40) !important; color: #2a1a14; }

/* the mark of a tap on the bomb (Blind): a white ring where the finger landed */
#tapfx { position: fixed; z-index: 11; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; border: 5px solid #fff; pointer-events: none; opacity: 0; box-shadow: 0 0 12px rgba(255, 255, 255, .8); }
#tapfx.on { animation: tapfx .38s ease-out; }
@keyframes tapfx { 0% { opacity: 1; transform: scale(.35); } 100% { opacity: 0; transform: scale(1.25); } }

/* ---- the manual, v0.2.3: big steps on the left, a drawing and one example on the right ---- */
#manual .tabs button { font-size: clamp(10px, 3.3vh, 13px); padding: 7px 8px; }
#manual .pages { padding: 6px 12px 10px; font-size: clamp(13px, 4.2vh, 16px); line-height: 1.3; }
#manual h2 { margin: 0 0 2px; font-size: 1.3em; } #manual h3 { margin: 4px 0 3px; font-size: 1em; color: #8f2a20; }
#manual .goal { margin: 0 0 6px; font-weight: 700; background: #ffe9a8; border-radius: 8px; padding: 4px 8px; }
#manual .cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; align-items: start; }
#manual ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: st; }
#manual ol.steps > li { counter-increment: st; position: relative; padding: 3px 0 3px 30px; margin: 0 0 3px; }
#manual ol.steps > li::before { content: counter(st); position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: #2a1a14; color: #ffe066; font-weight: 700; font-size: .9em; display: flex; align-items: center; justify-content: center; }
#manual ol.steps ul { margin: 2px 0 0; padding-left: 16px; } #manual ol.steps ul li { margin: 1px 0; }
#manual .chip { width: 15px; height: 15px; margin: 0 2px; vertical-align: -2px; } #manual .fi { vertical-align: middle; }
#manual table.mini { width: auto; margin: 3px 0 0; } #manual table.mini td, #manual table.mini th { padding: 2px 7px; font-size: .95em; border-width: 2px; width: auto; text-align: center; } #manual table.mini th { text-align: left; font-size: .8em; background: #ead9b0; }
#manual table.mini.an td { font-size: .78em; padding: 2px 4px; } #manual table.mini.an td b { font-size: 1.35em; } #manual table.mini.sw td { white-space: nowrap; padding: 2px 4px; }
#manual .pic { display: block; width: 100%; max-width: 230px; max-height: 26vh; margin: 0 auto 4px; } #manual .pic.wide { max-width: 100%; max-height: 22vh; margin-bottom: 6px; }
#manual .ex { border: 3px solid #2a1a14; border-radius: 12px; background: #fff; padding: 5px 8px; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: .92em; }
#manual .ex > b { align-self: flex-start; background: #2fa84f; color: #fff; border-radius: 7px; padding: 0 7px; font-size: .8em; margin-bottom: 2px; }
#manual .ex i { font-style: normal; font-size: .6em; line-height: 1; opacity: .55; } #manual .ex > span:last-child { font-weight: 700; background: #ffe9a8; border-radius: 7px; padding: 1px 7px; }
#manual .flist { margin: 3px 0 0; padding: 1px 4px; border-width: 2px; gap: 1px; flex-wrap: nowrap; } #manual .flist > b { background: #2a1a14; color: #fff6dc; border-radius: 6px; padding: 2px 7px; margin-right: 4px; }
#manual .keys { display: grid; grid-template-columns: 54px 54px; gap: 5px; justify-content: center; margin: 0 0 5px; } #manual .keys span { position: relative; background: #f2e6c8; border: 3px solid #2a1a14; border-radius: 9px; height: 46px; display: flex; align-items: center; justify-content: center; } #manual .keys b { position: absolute; left: 3px; top: 0; font-size: .85em; }
#manual table.dict { margin: 0; } #manual table.dict th { width: 46%; font-size: .82em; padding: 2px 5px; } #manual table.dict td { text-align: left; font-size: .82em; padding: 2px 5px; }
#manual .stk { display: flex; gap: 4px; flex-wrap: wrap; } #manual .stk span { display: inline-flex; flex-direction: column; align-items: center; font-size: .62em; width: 40px; } #manual .stk i { font-style: normal; }
#manual .small { font-size: .82em; margin: 3px 0 0; }
#role-job { display: block; font-size: 13px; letter-spacing: 2px; color: #9fe08a; margin-top: 2px; }
#rolecard ul { text-align: left; display: inline-block; margin: 4px 0 8px; } #rolecard li { counter-increment: rj; padding-left: 26px; position: relative; } #rolecard ul { counter-reset: rj; }
#rolecard li::before { content: counter(rj); position: absolute; left: 0; top: .15em; width: 19px; height: 19px; border-radius: 50%; background: #ffe066; color: #2a1a14; font-size: .75em; font-weight: 700; display: flex; align-items: center; justify-content: center; }
#rolecard li:nth-child(4)::before { content: "!"; background: #9fe08a; }
body.role-blind #rolecard li::before { background: #fff; color: #000; } body.role-blind #role-job { color: #fff; }
/* manual: tighter so most pages fit one phone screen */
#manual .pages { font-size: clamp(12.5px, 3.7vh, 15px); line-height: 1.24; padding: 4px 12px 8px; }
#manual h2 { display: none; } #manual .goal { margin: 2px 0 5px; padding: 3px 8px; }
#manual ol.steps > li { padding: 2px 0 2px 28px; margin: 0 0 2px; }
#manual .pic { max-height: 19vh; } #manual .pic.wide { max-height: 17vh; }
#manual .ex { font-size: .88em; padding: 3px 8px; } #manual .ex i { display: none; } #manual .ex > span { padding: 1px 0; border-bottom: 1px dashed #c9b88a; width: 100%; } #manual .ex > span:last-child { border: 0; }
#manual table.dict th, #manual table.dict td { padding: 1px 5px; } #manual h3 { margin: 2px 0 2px; }
#manual .keys span { height: 40px; } #manual .keys { grid-template-columns: 50px 50px; gap: 4px; }

#manual .stk i { font-size: 1.2em; } #manual .stk span { width: 44px; font-size: .68em; } #manual table.mini.an td { font-size: .84em; } #manual .ex > b { font-size: .9em; } #manual table.mini th { font-size: .84em; } #manual table.dict th, #manual table.dict td { font-size: .86em; }

/* ---- languages ---- */
@font-face { font-family: "Rubik"; font-weight: 500; font-display: swap; src: url("assets/fonts/rubik-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Rubik"; font-weight: 700; font-display: swap; src: url("assets/fonts/rubik-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
:root { --font: "Fredoka", "Rubik", "Trebuchet MS", "Segoe UI", system-ui, sans-serif; }      /* Fredoka has no Cyrillic: Russian letters come from Rubik */
#lang { position: absolute; right: 10px; top: 10px; display: flex; gap: 4px; margin: 0; }
#lang button { padding: 4px 9px; font-size: 12px; border-radius: 10px; border-width: 2px; box-shadow: 0 2px 0 var(--bark); opacity: .7; }
#lang button.on { opacity: 1; background: linear-gradient(#ffe066, #f5c518 55%, #e0a90c); }
/* Russian words are longer: a little smaller where space is tight */
body.lang-ru #btns button { font-size: clamp(10.5px, 3.3vh, 13px); letter-spacing: 0; gap: 4px; }
body.lang-ru #btns button::before { width: 1.3em; height: 1.3em; }
body.lang-ru #solo { font-size: 12px; } body.lang-ru #role-badge { letter-spacing: 1px; font-size: clamp(12px, 4vh, 15px); }
body.lang-ru .chipbtn { font-size: 11px; padding: 7px 8px; } body.lang-ru #hint { font-size: 11.5px; }
body.lang-ru #manual .tabs button { font-size: clamp(9.5px, 3vh, 12px); padding: 7px 6px; }
body.lang-ru #manual .pages { font-size: clamp(12px, 3.5vh, 14.5px); }
body.lang-ru #rolecard h2 { letter-spacing: 1px; } body.lang-ru #rolecard ul { font-size: clamp(12.5px, 4vh, 16px); }
body.lang-ru #gest button { font-size: clamp(10.5px, 3.3vh, 13px); }
body.lang-ru #end .card h1 { font-size: clamp(24px, 9vh, 42px); } body.lang-ru button.big { font-size: clamp(14px, 4.4vh, 19px); }
body.lang-ru .lobby-bottom small { font-size: 10.5px; }
#menu .card { padding-top: clamp(30px, 9vh, 40px); }
