/* PEP Games. Loaded after ../facts.css, so colours, fonts and dark mode come from the site tokens.
   Only the names the games use but the site does not define are added here. */
:root {
  --surface-2: color-mix(in srgb, var(--panel) 62%, var(--paper-2));
  --ink-2: color-mix(in srgb, var(--ink) 82%, var(--panel));
  --grid: var(--rule);
  --accent-ink: #ffffff;
  --warn-bg: var(--gold); --warn-ink: #0b0b0b;
  --danger: #b3412e; --purple: #79559f;
  --font: var(--f-body); --mono: var(--f-mono);
  --radius: 20px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent-ink: #0c110e; --danger: #e0826f; --purple: #b99bdf; --gold: #e0b45a; } }
:root[data-theme="dark"] { --accent-ink: #0c110e; --danger: #e0826f; --purple: #b99bdf; --gold: #e0b45a; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { -webkit-font-smoothing: antialiased; }
/* the games use .wrap and .card too; undo the site's grid versions of them */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0; display: block; gap: 0; padding-top: 0; }
.card { display: block; gap: 0; align-content: normal; color: var(--ink); }
.site-head, footer.site-foot { max-width: 1180px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* games sub-navigation under the site header */
.g-sub { max-width: 1180px; margin: 14px auto 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.g-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.g-nav a { text-decoration: none; color: var(--ink-2); padding: 7px 14px; border-radius: 999px; font-weight: 500; font-size: .95rem; border: 1px solid var(--grid); background: var(--panel); }
.g-nav a[aria-current="page"], .g-nav a:hover { background: var(--accent-wash); color: var(--accent-deep); border-color: transparent; }
.g-me { font-size: .9rem; color: var(--ink-2); margin-left: auto; padding: 6px 14px; border-radius: 999px; border: 1.5px dashed var(--muted); background: var(--panel); }
.g-me.in { border: 1.5px solid var(--accent); background: var(--accent-wash); color: var(--accent-deep); }
.g-me b { font-weight: 700; }

/* cards & buttons */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--grid); padding: 20px; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 8px; }
h2 { font-size: 1.25rem; margin: 0 0 12px; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 .95rem var(--font);
  padding: 10px 16px; border-radius: 14px; line-height: 1.3; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; transition: transform .05s, background .15s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.discord { background: #5865F2; color: #fff; border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 6px 10px; font-size: .85rem; border-radius: 8px; }
.btn.big { padding: 14px 22px; font-size: 1.05rem; }
input[type=text], input[type=number], input[type=password], input[type=datetime-local], select {
  font: 1rem var(--font); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus-visible, select:focus-visible, .btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
label { font-size: .875rem; font-weight: 500; color: var(--ink-2); display: block; margin-bottom: 4px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.stack > * + * { margin-top: 12px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; vertical-align: middle; letter-spacing: .01em; white-space: nowrap; }
.badge.ver { background: #5865F2; color: #fff; }
.badge.guest { background: var(--grid); color: var(--muted); font-weight: 500; }
.badge.host { background: var(--warn-bg); color: var(--warn-ink); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent-wash); color: var(--accent-deep); font-size: .8rem; font-weight: 700; }

/* lobby */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; padding: 34px 0 10px; align-items: stretch; }
.hero .lead { font-size: 1.1rem; color: var(--ink-2); max-width: 46ch; }
.sched { background: linear-gradient(150deg, var(--accent-deep), #208241 70%); color: #f7f5ef; border: 0; position: relative; overflow: hidden; }
:root[data-theme="dark"] .sched { background: linear-gradient(150deg, #1f4d2c, #2a6a3b); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sched { background: linear-gradient(150deg, #1f4d2c, #2a6a3b); } }
.sched .when { font-size: .9rem; opacity: .85; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.sched .title { font-size: 1.6rem; font-weight: 700; margin: 4px 0 14px; }
.countdown { display: flex; gap: 10px; }
.countdown div { background: rgba(255,255,255,.12); border-radius: 12px; padding: 8px 0; text-align: center; min-width: 64px; }
.countdown b { display: block; font: 700 1.7rem/1.1 var(--mono); }
.countdown span { font-size: .72rem; opacity: .8; text-transform: uppercase; letter-spacing: .06em; }
.sched .frog { position: absolute; right: -24px; bottom: -28px; width: 150px; opacity: .22; transform: rotate(-12deg); }
.rooms { display: grid; gap: 10px; }
.room-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--grid); border-radius: 12px; background: var(--surface-2); }
.room-item .ico { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-wash); font-size: 1.3rem; }
.room-item .meta { flex: 1; min-width: 0; }
.room-item .meta b { display: block; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mode-card .ill { height: 120px; border-radius: 10px; background: var(--accent-wash); display: grid; place-items: center; margin-bottom: 12px; overflow: hidden; }

/* room */
.room { display: grid; grid-template-columns: 230px minmax(0, 1fr) 310px; gap: 16px; padding: 16px 0 24px; align-items: start; }
.room > * { min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--grid); border-radius: var(--radius); box-shadow: var(--shadow); }
.players { padding: 12px; }
.players h3 { display: flex; justify-content: space-between; align-items: center; }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; align-items: center; padding: 7px 6px; border-radius: 9px; }
.plist li + li { border-top: 1px solid var(--grid); }
.plist li.drawing { background: var(--accent-wash); }
.plist li.got { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.plist li.me .nick { font-weight: 700; }
.plist .nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .score { font: 700 .95rem var(--mono); }
.plist .kick { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: .9rem; }
.plist .kick:hover { color: var(--danger); }
.stage { overflow: hidden; }
.stage-top { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--grid); }
.word { text-align: center; font: 700 1.45rem var(--mono); letter-spacing: .32em; white-space: pre-wrap; word-break: break-word; }
.word.secret { color: var(--accent); letter-spacing: .04em; }
.word.plain { letter-spacing: 0; font-family: var(--font); font-size: 1.15rem; }
.word small { display: block; font: 500 .75rem var(--font); letter-spacing: 0; color: var(--muted); }
.timer { position: relative; width: 52px; height: 52px; }
.timer svg { transform: rotate(-90deg); }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 1.05rem var(--mono); }
.timer.low b { color: var(--danger); }
.roundinfo { font-size: .85rem; color: var(--muted); line-height: 1.25; }
.roundinfo b { color: var(--ink); font-size: 1rem; }
.canvas-wrap { position: relative; background: #fff; aspect-ratio: 10 / 7; touch-action: none; }
.canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.canvas-wrap.can-draw { cursor: crosshair; }
.canvas-wrap.pixel canvas { image-rendering: pixelated; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(16,24,20,.62); color: #f7f5ef; text-align: center; padding: 20px; backdrop-filter: blur(2px); }
.overlay .big { font-size: clamp(1.4rem, 3.4vw, 2.4rem); font-weight: 700; letter-spacing: -.01em; }
.overlay .ans { display: inline-block; margin-top: 6px; background: var(--warn-bg); color: var(--warn-ink); padding: 4px 14px; border-radius: 10px; font-weight: 700; font-size: 1.4rem; }
.overlay table { margin: 12px auto 0; border-collapse: collapse; min-width: 260px; background: rgba(0,0,0,.25); border-radius: 10px; }
.overlay td { padding: 6px 12px; text-align: left; }
.overlay td:last-child { text-align: right; font-family: var(--mono); }
.tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--grid); }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--accent); }
.size { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.size i { display: block; border-radius: 50%; background: var(--ink); }
.size[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-wash); }
.tools .sep { width: 1px; height: 26px; background: var(--grid); }
.hostbar { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px dashed var(--line); background: var(--surface-2); align-items: center; }
.hostbar .lbl { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; }
.chat { display: flex; flex-direction: column; height: min(72vh, 640px); }
.chat h3 { padding: 12px 14px 0; }
.msgs { flex: 1; overflow-y: auto; padding: 6px 14px; font-size: .93rem; }
.msgs p { margin: 3px 0; overflow-wrap: anywhere; }
.msgs .sys { color: var(--muted); font-style: italic; font-size: .86rem; }
.msgs .ok { color: var(--accent); font-weight: 700; font-style: normal; }
.msgs .close { color: var(--gold); font-weight: 500; }
.msgs .priv { opacity: .85; }
.msgs .priv::before { content: "🤫 "; }
.msgs b { color: var(--ink); }
.chat form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--grid); }
.imgpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.imgpick button { aspect-ratio: 1; border-radius: 10px; border: 2px solid var(--grid); padding: 0; overflow: hidden; background: #fff; cursor: pointer; }
.imgpick button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.imgpick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hostpanel { padding: 14px; border-top: 1px dashed var(--line); background: var(--surface-2); }
.join { max-width: 520px; margin: 40px auto; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 500; z-index: 99; box-shadow: var(--shadow); max-width: 90vw; }
.toast.good { background: var(--accent); color: var(--accent-ink); }
.toast.bad { background: var(--danger); color: #fff; }

/* ranking */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0; }
.tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); padding: 8px 14px; border-radius: 999px; font: 500 .95rem var(--font); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
table.rank { width: 100%; border-collapse: collapse; }
table.rank th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.rank td { padding: 10px; border-bottom: 1px solid var(--grid); }
table.rank td.num, table.rank th.num { text-align: right; font-family: var(--mono); }
table.rank tr.top1 td { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.medal { font-size: 1.1rem; }
.hof { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.foot { padding: 30px 0 40px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--grid); margin-top: 30px; }

@media (max-width: 1000px) {
  .room { grid-template-columns: 1fr 300px; }
  .players { grid-column: 1 / -1; }
  .plist { display: flex; gap: 6px; overflow-x: auto; }
  .plist li { flex: 0 0 auto; border: 1px solid var(--grid); grid-template-columns: auto auto auto; white-space: nowrap; }
  .plist .nick { overflow: visible; }
  .plist li + li { border-top: 1px solid var(--grid); }
}
@media (max-width: 760px) {
  .wrap { padding: 0 12px; }
  .hero, .modes { grid-template-columns: 1fr; }
  .room { grid-template-columns: 1fr; gap: 10px; padding-top: 10px; }
  .chat { height: 46vh; }
  .g-nav a { padding: 6px 8px; font-size: .88rem; }
  .g-brand small, .g-nav a.home { display: none; }
  .g-me { margin-left: 0; font-size: .85rem; }
  .g-brand span { white-space: nowrap; }
  .word { font-size: 1.15rem; letter-spacing: .22em; }
  .stage-top { padding: 8px 10px; gap: 8px; }
  .timer { width: 44px; height: 44px; }
  .countdown div { min-width: 56px; }
}

/* odliczanie 3-2-1 (Guess the Picture): nieprzezroczysta „kurtyna” — obrazek ładuje się pod spodem i pojawia u wszystkich naraz */
.overlay.countdown-ov { background: radial-gradient(circle at 50% 45%, #1f5c34 0%, #10301c 70%); backdrop-filter: none; }
.cd-wrap { display: grid; justify-items: center; gap: 6px; }
.cd-label { font-weight: 700; letter-spacing: .02em; opacity: .9; }
.cd-num { font: 700 clamp(5rem, 18vw, 9rem)/1 var(--font); color: #f7f5ef; text-shadow: 0 6px 0 #16532A, 0 10px 30px rgba(0,0,0,.35);
  animation: cd-pop 1s ease-out both; }
@keyframes cd-pop { 0% { transform: scale(1.6); opacity: 0; } 18% { transform: scale(1); opacity: 1; } 80% { transform: scale(.94); opacity: 1; } 100% { transform: scale(.8); opacity: .2; } }

/* przerywnik między rundami („Next round”) z żabką (wideo w pętli) */
.overlay.intermission-ov { background: rgba(16,36,24,.88); container-type: size; padding: 12px; }
.inter-card { display: grid; justify-items: center; gap: 2px; animation: inter-in .35s ease-out both; }
.inter-title { font-size: clamp(1.5rem, 3.6vw, 2.4rem); font-weight: 700; letter-spacing: -.01em; }
.inter-sub { font-size: 1.05rem; opacity: .92; }
@keyframes inter-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.inter-media { display: block; width: min(400px, 92cqw, (100cqh - 118px) * 1.4184); height: auto; aspect-ratio: 400 / 282;
  object-fit: cover; border-radius: 6px;  /* mały promień: znak wodny pepecoin.com w prawym dolnym rogu zostaje cały */ margin: 0 auto 8px; background: #1d3a27; box-shadow: 0 10px 30px rgba(0,0,0,.35); pointer-events: none; }
@container (max-height: 300px) { .intermission-ov .inter-title { font-size: 1.4rem; } .intermission-ov .inter-sub { font-size: .95rem; } }

/* odsłonięcie w trybie obrazka: pasek na dole, obrazek widoczny */
.overlay.reveal-bar { background: transparent; backdrop-filter: none; place-items: end center; }
.overlay.reveal-bar > div { background: rgba(16,24,20,.78); padding: 10px 18px; border-radius: 12px; }

@media (prefers-reduced-motion: reduce) {
  .cd-num, .inter-card { animation: none !important; }
}
#chatsend { white-space: nowrap; min-width: 5.5em; }

/* ---------- table games (Chess / Checkers / Connect Four) ---------- */
.table-room { grid-template-columns: 240px minmax(0, 1fr) 310px; }
.tstage-top { grid-template-columns: 1fr; }
#status.mine { color: var(--accent); }
#status small { margin-top: 2px; }
.board-wrap { position: relative; padding: 14px; display: grid; place-items: center; background: var(--surface-2); }
.board { display: grid; width: min(100%, 560px); aspect-ratio: 1; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 2px var(--accent-deep), var(--shadow); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.board .sq { position: relative; border: 0; padding: 0; margin: 0; display: grid; place-items: center; cursor: default; font: inherit; min-width: 0; min-height: 0; }
.board.chess .sq.lt { background: #eef0e2; } .board.chess .sq.dk { background: #6f9e7b; }
.board.checkers .sq.lt { background: #eef0e2; } .board.checkers .sq.dk { background: #3f7350; }
.board .sq.can { cursor: pointer; }
.board .sq.last { box-shadow: inset 0 0 0 999px rgba(246,187,96,.42); }
.board .sq.sel { box-shadow: inset 0 0 0 999px rgba(246,187,96,.75); }
.board .sq.tgt, .board .sq.tcap { cursor: pointer; }
.board .sq.tgt::after { content: ""; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: rgba(22,83,42,.55); pointer-events: none; }
.board .sq.tcap::after { content: ""; position: absolute; inset: 6%; border-radius: 50%; border: 4px solid rgba(22,83,42,.6); pointer-events: none; }
.board .sq.gone .man { opacity: .35; }
.board .sq.incheck { background: radial-gradient(circle, #e8553f 0%, #c0392b 45%, transparent 80%) !important; }
.board .crd { position: absolute; font: 700 .62rem var(--mono); font-style: normal; opacity: .7; pointer-events: none; }
.board .crd.rk { left: 3px; top: 2px; } .board .crd.fl { right: 3px; bottom: 1px; }
.board .sq.dk .crd { color: #eef0e2; } .board .sq.lt .crd { color: #3f7350; }
.pc { font-family: "DejaVu Sans", "Segoe UI Symbol", "Noto Sans Symbols 2", "Apple Symbols", serif; font-size: min(9.2vw, 54px); line-height: 1; pointer-events: none; }
.pc.w { color: #fffdf6; text-shadow: 0 0 1px #15201b, 1px 0 0 #15201b, -1px 0 0 #15201b, 0 1px 0 #15201b, 0 -1px 0 #15201b, 0 2px 3px rgba(0,0,0,.35); }
.pc.b { color: #15201b; text-shadow: 0 0 1px #fffdf6, 0 1px 0 rgba(255,255,255,.35), 0 2px 3px rgba(0,0,0,.3); }
.man { width: 78%; height: 78%; border-radius: 50%; display: grid; place-items: center; pointer-events: none; font-size: min(5.6vw, 30px); line-height: 1;
  font-family: "DejaVu Sans", "Segoe UI Symbol", serif; }
.man.b { background: radial-gradient(circle at 35% 30%, #4a4f4c, #15201b 70%); box-shadow: inset 0 0 0 3px #2f3632, 0 3px 4px rgba(0,0,0,.4); color: #F6BB60; }
.man.w { background: radial-gradient(circle at 35% 30%, #ffffff, #e2ddcd 70%); box-shadow: inset 0 0 0 3px #cfc7b2, 0 3px 4px rgba(0,0,0,.35); color: #c99a2e; }
.board.connect4 { grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, 1fr); aspect-ratio: 7 / 6; background: #2f6fd2; padding: 6px; gap: 4px;
  box-shadow: 0 0 0 2px #1f4f9e, var(--shadow); width: min(100%, 520px); }
.board.connect4 .cell { border: 0; padding: 0; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; cursor: default; min-width: 0; min-height: 0;
  box-shadow: inset 0 3px 6px rgba(0,0,0,.25); }
.board.connect4 .cell.can { cursor: pointer; }
.board.connect4 .cell.can:hover { background: color-mix(in srgb, var(--surface-2) 75%, #F6BB60); }
.disc { width: 88%; height: 88%; border-radius: 50%; display: block; }
.disc.drop { animation: drop .28s ease-in both; }
.disc.r { background: radial-gradient(circle at 35% 30%, #f06a5c, #c0392b 70%); }
.disc.y { background: radial-gradient(circle at 35% 30%, #ffe36e, #e7b416 70%); }
.cell.last .disc { box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(0,0,0,.25); }
.cell.win .disc { box-shadow: 0 0 0 4px #16532A, 0 0 14px 4px #fff; }
@keyframes drop { from { transform: translateY(-120%); opacity: .3; } to { transform: none; opacity: 1; } }
.seat-dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1px var(--line); }
.seat-dot.chess.s1, .seat-dot.checkers.s2 { background: #fffdf6; } .seat-dot.chess.s2, .seat-dot.checkers.s1 { background: #15201b; }
.seat-dot.connect4.s1 { background: #c0392b; } .seat-dot.connect4.s2 { background: #e7b416; }
.plist .away { color: var(--danger); }
.watchers { margin: 10px 4px 0; }
.movelist { display: flex; gap: 10px; overflow-x: auto; padding: 8px 14px 12px; white-space: nowrap; font-family: var(--mono); color: var(--ink-2); }
.movelist .mv b { color: var(--muted); font-weight: 500; }
.trules { padding: 8px 14px 0; } .trules summary { cursor: pointer; font-weight: 500; color: var(--ink-2); } .trules div { padding: 6px 0 4px; color: var(--ink-2); }
.promo .pc { font-size: 44px; } .promo-btn { padding: 6px 12px; background: #eef0e2; }
.tgame-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.tgame-pick label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; cursor: pointer; background: var(--surface); font-weight: 500; }
.tgame-pick input { accent-color: var(--accent); }
.tgame-pick label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-wash); }
.topts { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: .92rem; }
.topts label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
@media (max-width: 1000px) { .table-room { grid-template-columns: 1fr 300px; } }
@media (max-width: 760px) {
  .table-room { grid-template-columns: 1fr; }
  .board-wrap { padding: 8px 4px; }
  .pc { font-size: 10vw; }
  .table-room .chat { height: 38vh; }
}
@media (prefers-reduced-motion: reduce) { .disc { animation: none; } }

/* ---------- zegary przy stole ---------- */
.tclock { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--surface); border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); }
.tclock .tc-name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tclock .tc-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.tclock .tc-time { font-family: var(--mono); font-size: 26px; font-weight: 700; padding: 2px 12px; border-radius: 8px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); min-width: 92px; text-align: center; font-variant-numeric: tabular-nums; }
.tclock.run .tc-time { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.tclock.run.low .tc-time, .tclock.flag .tc-time { background: var(--danger); color: #fff; }
.tclock.run.low .tc-time { animation: tc-pulse 1s ease-in-out infinite; }
@keyframes tc-pulse { 50% { opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .tclock.run.low .tc-time { animation: none; } }
.tgame-tc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.tgame-tc label.tc-opt { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; font-size: 14px; }
.tgame-tc label.tc-opt:has(input:checked) { background: var(--accent-wash); box-shadow: inset 0 0 0 2px var(--accent); }
.tgame-tc label.tc-opt input { margin: 0; accent-color: var(--accent); }
.tgame-tc .tc-custom { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.tgame-tc .tc-custom input { width: 64px; }
@media (max-width: 640px) { .tclock { padding: 6px 10px; } .tclock .tc-time { font-size: 22px; min-width: 80px; } }
.tc-pill { font-weight: 500; background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); vertical-align: 1px; } .tc-pill.timed { background: var(--accent-wash); color: var(--accent-deep); box-shadow: none; }

/* ---------- vs bot + Sea Battle ---------- */
.botrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.botrow .tgame-tc { margin-top: 0; }
.board.battleship { display: block; aspect-ratio: auto; width: min(100%, 980px); box-shadow: none; overflow: visible; background: none; }
.sea { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.sea-side { min-width: 0; }
.sea-title { font-weight: 700; color: var(--ink-2); margin: 0 0 6px 4px; font-size: .95rem; }
.sea-grid { display: grid; grid-template-columns: 22px repeat(10, 1fr); gap: 2px; padding: 6px; border-radius: 10px; background: #1d5f8a; box-shadow: 0 0 0 2px #154766, var(--shadow); }
.sea-grid .sg-lbl, .sea-grid .sg-corner { font: 700 .7rem var(--mono); color: #d8ecf7; display: grid; place-items: center; }
.sea-grid .sc { aspect-ratio: 1; border: 0; padding: 0; min-width: 0; border-radius: 3px; background: #3c8dbc; cursor: default; position: relative; }
.sea-grid .sc.ship { background: #7c8b94; box-shadow: inset 0 0 0 2px #5d6a72; }
.sea-grid .sc.miss::after { content: ""; position: absolute; inset: 36%; border-radius: 50%; background: #e9f4fb; opacity: .9; }
.sea-grid .sc.hit { background: #f08a24; } .sea-grid .sc.hit::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; }
.sea-grid .sc.sunk { background: #b3412e; box-shadow: inset 0 0 0 2px #7a2a1d; } .sea-grid .sc.sunk::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; }
.sea-grid .sc.last { outline: 3px solid #F6BB60; outline-offset: -1px; z-index: 1; }
.sea-grid.armed { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
.sea-grid .sc.can { cursor: crosshair; } .sea-grid .sc.can:hover { background: #6db3dc; }
.sea-grid[data-owner] .sc:not(.can) { cursor: default; }
.sea-tools { margin-top: 12px; display: grid; gap: 8px; }
.sea-ships { display: flex; flex-wrap: wrap; gap: 6px; }
.ship-chip.on { box-shadow: 0 0 0 2px var(--accent); background: var(--accent-wash); }
.ship-chip.placed { opacity: .55; }
.seat-dot.battleship.s1 { background: #2f6fd2; } .seat-dot.battleship.s2 { background: #f08a24; }
@media (max-width: 760px) { .sea-grid { grid-template-columns: 18px repeat(10, 1fr); gap: 1px; padding: 4px; } .sea { gap: 12px; } }
/* table games on phones: 2 players → wrap instead of a sideways-scrolling strip */
@media (max-width: 1000px) {
  .table-room .plist { flex-wrap: wrap; overflow-x: visible; }
  .table-room .plist li { flex: 1 1 140px; min-width: 0; grid-template-columns: auto 1fr auto; white-space: normal; }
  .table-room .plist .nick { white-space: normal; overflow-wrap: anywhere; }
}
/* Draw & Guess overlay on phones: keep the waiting screen (invite link + Start) inside the stage */
@media (max-width: 760px) {
  .overlay { padding: 10px; overflow-y: auto; place-items: safe center; }
  .overlay p { margin: .35em 0; font-size: .85rem; }
  .overlay .mono { display: block; font-size: .72rem; word-break: break-all; }
  .overlay .btn.big { font-size: 1rem; padding: 10px 18px; }
}
/* very narrow phones (≤400 px): header brand + 3 links must fit without overlapping */
@media (max-width: 400px) {
  .g-brand { gap: 6px; flex-shrink: 0; }
  .g-brand img { width: 28px; height: 28px; }
  .g-nav { gap: 0; min-width: 0; }
  .g-nav a { padding: 6px 6px; font-size: .84rem; }
}
@media (max-width: 340px) { .g-brand span { display: none; } }

/* frogs and the "no game server yet" state */
.frog-s { display: block; height: auto; margin: 0 auto 8px; }
.empty { text-align: center; padding: 6px 0; }
.empty p { margin: 0; }
.frogcard { display: none; align-items: center; gap: 18px; background: linear-gradient(150deg, var(--accent-wash), var(--panel)); }
.frogcard img { flex: none; width: 120px; height: auto; }
.frogcard .when { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--accent-deep); }
.frogcard .title { font-size: 1.5rem; font-weight: 700; margin: 4px 0 6px; }
.frogcard p { margin: 0; color: var(--ink-2); }
.no-server .frogcard { display: flex; }
.no-server .sched, .no-server #play, .no-server #maingames, .no-server .maingames, .no-server #tlist, .no-server #tables > h3:first-of-type,
.no-server #tcreate #nt-tc, .no-server #tcreate .topts label:has(#nt-private), .no-server #tcreate .topts label:has(#nt-spec), .no-server #tcreate .tplay-col:first-child { display: none !important; }

/* rules and privacy pages */
.wrap > .page-head { margin: 18px 0 22px; }
.g-prose { max-width: 68ch; margin: 0 auto 10px 0; }
.g-prose h2 { margin: 22px 0 8px; }
.g-prose ul { margin: 0; padding-left: 22px; display: grid; gap: 8px; }

/* identity ("Who are you?" / "Playing as") — the one thing a visitor must notice */
.identity { border: 2px solid var(--accent); background: linear-gradient(160deg, var(--accent-wash), var(--surface) 70%); box-shadow: 0 0 0 5px var(--accent-wash), var(--shadow); }
.identity h2 { font-size: 1.6rem; margin: 6px 0 12px; }
.identity.is-in { border-style: solid; }
.id-step { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); padding: 3px 10px; border-radius: 999px; }
.id-step.ok { background: var(--accent-deep); }
.id-name { color: var(--accent-deep); }
.identity input[type=text] { font-size: 1.1rem; padding: 12px 14px; border: 2px solid var(--accent); }
.identity .btn.primary { font-size: 1.05rem; padding: 12px 22px; }
.btn.reddit { background: #FF4500; color: #fff; border-color: transparent; }
.btn:disabled.discord, .btn:disabled.reddit { opacity: .55; }
.empty-pic { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto 12px; border-radius: var(--radius); }

/* emotes: small pictures in chat + a picker, and humorous accents */
.emote { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; margin: 0 2px; }
.emote-big { width: 56px; height: 56px; object-fit: contain; vertical-align: middle; }
.msgs .emote { width: 44px; height: 44px; }
.loadrow { display: flex; align-items: center; gap: 8px; }
.hostttl { display: flex; align-items: center; gap: 10px; }
.emote-btn { padding: 6px 10px; font-size: 1.1rem; line-height: 1; }
.emote-pop { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); z-index: 20; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--grid); border-radius: var(--radius); box-shadow: var(--shadow); }
.emote-pop.hidden { display: none; }
.emote-pop p { flex: 0 0 100%; margin: 4px 0 0; }
.emote-pick { width: 64px; height: 64px; padding: 4px; border: 1px solid var(--grid); border-radius: 12px; background: var(--panel); cursor: pointer; }
.emote-pick:hover, .emote-pick:focus-visible { border-color: var(--accent); background: var(--accent-wash); }
.emote-pick.host { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.emote-pick img { width: 100%; height: 100%; object-fit: contain; }

/* plan, picture queue, last question, winners */
.planrow { align-items: flex-end; gap: 16px; }
.planrow > div { flex: 1 1 200px; }
.multctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip { border: 1.5px solid var(--grid); background: var(--panel); border-radius: 999px; padding: 6px 12px; font-weight: 700; cursor: pointer; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.multnum { width: 74px; }
.qlist { display: grid; gap: 8px; }
.qitem { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px; border: 1px solid var(--grid); border-radius: 12px; background: var(--surface); }
.qitem.next { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-wash); }
.qn { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); min-width: 3.2em; }
.qthumb { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; background: #fff; }
.qitem input[type=text] { flex: 1 1 160px; min-width: 120px; }
.qitem input.needs { border-color: var(--danger); }
.btn.danger-solid { background: #c43d2f; color: #fff; border-color: transparent; font-weight: 700; }
.btn.danger-solid:hover { filter: brightness(1.08); }
.lastctl { position: relative; display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lastpop { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 30; width: min(360px, 86vw); padding: 14px; background: var(--surface); border: 2px solid #c43d2f; border-radius: var(--radius); box-shadow: var(--shadow); }
.lastbadge { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: #c43d2f; color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .04em; animation: pulse 1.4s ease-in-out infinite; }
.lastbadge.soon { background: var(--gold); color: #0b0b0b; animation: none; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.winners { margin-top: 10px; position: relative; }
.wlist { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.win { display: flex; align-items: center; gap: 8px; }
.win .wpts { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 2px 10px; font-weight: 700; font-family: var(--mono); }
.win.w1 .emote-big { width: 72px; height: 72px; animation: bounce .8s ease-in-out infinite alternate; }
@keyframes bounce { to { transform: translateY(-8px) rotate(-4deg); } }
.lastline { margin-top: 10px; font-weight: 700; color: var(--gold); }
.confetti { position: absolute; inset: -30px 0 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -10px; left: calc(var(--i) * 12.5% + 3%); font-style: normal; font-size: 1.4rem; animation: fall 2.4s ease-in calc(var(--i) * .15s) infinite; }
@keyframes fall { to { transform: translateY(170px) rotate(300deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .confetti i, .win.w1 .emote-big, .lastbadge { animation: none; } }
.multctl input.multnum, .planrow input.multnum { width: 78px; flex: none; }
.qitem select { width: auto; flex: none; }
.qitem .qthumb { flex: none; }
.qitem .btn { flex: none; }

/* lobby layout: login + leaderboard, countdown, two main games, mini-games table */
.lobby-head { padding: 26px 0 8px; }
.lobby-head h1 { margin: 0 0 6px; }
.lobby-head .lead { margin: 0; font-size: 1.1rem; color: var(--ink-2); max-width: 60ch; }
.top2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin-top: 14px; align-items: start; }
.top2 h2 { margin-top: 0; }
#sched { margin-top: 18px; }
.sched-host { margin-top: 14px; position: relative; z-index: 1; }
.sched-form { margin-top: 10px; padding: 14px; border-radius: 12px; background: rgba(0,0,0,.22); color: #f7f5ef; }
.sched-form label { color: #f7f5ef; }
.sched .btn.sm { position: relative; z-index: 1; }
.sect-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 26px 0 10px; }
.sect-head h2 { margin: 0; }
.maingames { margin-top: 0; align-items: start; }
.mode-card h3 { margin: 4px 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mode-card h4 { margin: 16px 0 8px; font-size: 1rem; }
.how { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); font-size: .95rem; }
.mode-card .ill.media { height: auto; aspect-ratio: 800 / 336; padding: 0; background: #f3ecd9; position: relative; }
.mode-card .ill.media video, .mode-card .ill.media canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.pixlabel { position: absolute; right: 10px; bottom: 8px; background: rgba(16,24,20,.78); color: #f7f5ef; padding: 2px 12px; border-radius: 999px; font: 700 1.1rem var(--mono); }
.pixlabel.ok { background: var(--accent); color: var(--accent-ink); }
.small-empty { display: flex; align-items: center; gap: 10px; justify-content: center; }
.small-empty p { margin: 0; }
#newroom { margin: 14px 0 16px; padding: 14px; border-radius: 12px; background: var(--accent-wash); }
#newroom h4 { margin-top: 0; }
#tables { margin-top: 26px; }
#tables h3 { margin: 18px 0 8px; }
.tscroll { overflow-x: auto; }
.gtable { width: 100%; border-collapse: collapse; }
.gtable th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 12px; border-bottom: 2px solid var(--grid); }
.gtable td { padding: 10px 12px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.gtable tbody tr:last-child td { border-bottom: 0; }
.gtable td.act { text-align: right; white-space: nowrap; }
.gtable td.num { text-align: right; }
.gtable td.medal { width: 2.4em; font-size: 1.1rem; }
.gtable.pick tr.pickrow { cursor: pointer; }
.gtable.pick tr.pickrow:hover td { background: var(--accent-wash); }
.gtable.pick tr.pickrow:has(input:checked) td { background: var(--accent-wash); }
.gtable.pick tr.pickrow:has(input:checked) td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.pickname { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; white-space: nowrap; }
.pickname input { accent-color: var(--accent); }
.tplay { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.tplay-col { padding: 14px; border: 1px solid var(--grid); border-radius: 12px; background: var(--surface-2); }
.tplay-col .tgame-tc { margin-top: 8px; }
.top5 td { padding: 8px 10px; }
@media (max-width: 640px) {
  .gtable.tables thead, .gtable.pick thead { display: none; }
  .gtable.tables tr, .gtable.pick tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--grid); }
  .gtable.tables td, .gtable.pick td { display: flex; gap: 8px; border: 0; padding: 3px 4px; }
  .gtable.tables td[data-label]::before, .gtable.pick td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); min-width: 5.5em; font-size: .85rem; }
  .gtable.tables td.act { justify-content: flex-start; padding-top: 6px; }
}
.sched .small, .sched p { color: #f7f5ef; }
.sched a { color: #f7f5ef; }
/* chat stickers (img/stickers/manifest.json) */
.msgs .sticker { display: inline-block; vertical-align: middle; }
.msgs .sticker img { width: 96px; height: 96px; object-fit: contain; display: block; }
@media (max-width: 560px) { .msgs .sticker img { width: 72px; height: 72px; } .sticker-btn { padding: 6px 8px; } }

/* room waiting screen and game over pictures */
.overlay.lobby-ov { background: linear-gradient(rgba(10, 16, 12, 0.45), rgba(10, 16, 12, 0.6)), #fff url(img/room-waiting.webp) center 35% / cover no-repeat; backdrop-filter: none; }
@media (prefers-reduced-motion: reduce) { .overlay.lobby-ov { background-image: linear-gradient(rgba(10, 16, 12, 0.62), rgba(10, 16, 12, 0.72)), url(img/room-waiting-still.webp); } }
.overlay.lobby-ov .big, .overlay.lobby-ov p { text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7); }
.cheer-pic { display: block; margin: 0 auto 6px; width: 140px; height: auto; }

/* mini games: game cards with small board previews */
.gcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.gcard { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin: 0;
  padding: 16px 14px 14px; border: 2px solid var(--grid); border-radius: 16px; background: var(--surface); cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.gcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.gcard input { position: absolute; opacity: 0; pointer-events: none; }
.gcard:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash), var(--shadow); }
.gcard:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.gcard-check { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .85rem; opacity: 0; transform: scale(.6); transition: .15s ease; }
.gcard:has(input:checked) .gcard-check { opacity: 1; transform: none; }
.gcard-name { font-size: 1.1rem; margin-top: 6px; }
.gcard-desc { font-size: .88rem; color: var(--ink-2); line-height: 1.4; }
.gcard-opt { font-size: .78rem; color: var(--muted); margin-top: auto; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); }
.gprev { --pw: 124px; display: grid; width: var(--pw); aspect-ratio: 1; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 14px -6px rgba(0,0,0,.35); }
.gprev > span { min-width: 0; min-height: 0; }
.gprev-chess, .gprev-checkers { grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); padding: 5px; border-radius: 8px; background: #2c4a35; }
.gprev-battleship { grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(6, 1fr); }
.gprev-chess .lt, .gprev-checkers .lt { background: #eef0e2; }
.gprev-chess .dk { background: #6f9e7b; }
.gprev-checkers .dk { background: #3f7350; }
.gprev-chess span, .gprev-checkers span { display: grid; place-items: center; }
.gprev-chess i { font-style: normal; font-size: calc(var(--pw) / 10.5); line-height: 1; }
.gprev-chess .pb { color: #18211b; }
.gprev-chess .pw { color: #fff; text-shadow: -.6px 0 #18211b, .6px 0 #18211b, 0 -.6px #18211b, 0 .6px #18211b; }
.gprev-checkers i { width: 76%; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 1px 1px rgba(0,0,0,.35); }
.gprev-checkers .pb { background: radial-gradient(circle at 35% 30%, #5a5a5a, #1c1c1c 70%); }
.gprev-checkers .pw { background: radial-gradient(circle at 35% 30%, #fff, #d8d2c2 70%); }
.gprev-connect4 { grid-template-columns: repeat(7, 1fr); aspect-ratio: 7 / 6; width: calc(var(--pw) * 7 / 6); padding: 4px; gap: 2px; background: #2f63c8; }
.gprev-connect4 .hole { border-radius: 50%; background: #e9eef8; display: grid; place-items: center; overflow: hidden; }
.gprev-connect4 .disc { width: 100%; height: 100%; }
.gprev-battleship { gap: 1px; background: #9cc3e4; padding: 1px; }
.gprev-battleship .sea { background: #d9ecfb; position: relative; }
.gprev-battleship .ship { background: #7d8a96; }
.gprev-battleship .hit::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; color: #d63c2f; font-weight: 700; font-size: 14px; }
.gprev-battleship .miss::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #5f86a8; }
@media (prefers-reduced-motion: reduce) { .gcard, .gcard-check { transition: none; } .gcard:hover { transform: none; } }
@media (max-width: 520px) { .gcards { grid-template-columns: 1fr 1fr; gap: 10px; } .gcard { padding: 12px 8px; } .gprev { --pw: 100px; } .gcard-desc { font-size: .8rem; } }

/* Draw & Guess card picture: whole drawing visible on its paper colour */
.mode-card .ill.media img.ill-contain { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; background: #f6f0df; }
#game-dg .ill.media { background: #f6f0df; }

/* Cloudflare Turnstile check before guest sign-in: invisible unless Cloudflare asks for a click */
.ts-wrap { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(10, 16, 12, 0.55); opacity: 0; pointer-events: none; transition: opacity .15s; }
.ts-wrap.show { opacity: 1; pointer-events: auto; }
.ts-card { background: var(--surface, #fff); color: inherit; border-radius: 14px; padding: 18px 20px; max-width: 360px; width: 100%; display: grid; gap: 12px; justify-items: center; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.ts-card p { margin: 0; }

/* server unreachable: Pepe with the magnifying glass + a plain message */
.offline-note { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2, rgba(0,0,0,.04)); }
.offline-note img { width: 76px; height: 76px; flex: none; object-fit: cover; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }
.offline-note p { margin: 0; font-size: .92rem; color: var(--ink-2, inherit); line-height: 1.45; }

/* lobby: Pepe Miner card */
.miner-promo { margin-top: 26px; display: flex; gap: 18px; align-items: center; }
.miner-promo img { width: 96px; height: 96px; flex: none; filter: drop-shadow(0 8px 14px rgba(20, 60, 30, .3)); }
.miner-promo h2 { margin: 0 0 6px; }
@media (max-width: 520px) { .miner-promo { flex-direction: column; text-align: center; } }

/* ------------------------------------------------------------------ lobby: hero, main games, chat (2026-10) */
.g-chat { display: inline-flex; align-items: center; gap: 7px; }
.g-nav a.g-chat { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-deep); font-weight: 700; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #2fbf5b; box-shadow: 0 0 0 3px rgba(47, 191, 91, .25); flex: none; }
.g-login { margin-left: auto; position: relative; }
button.g-me { font: inherit; font-size: .88rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
button.g-me::after { content: "▾"; font-size: .75rem; opacity: .7; }
.identity-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: min(360px, calc(100vw - 24px)); padding: 16px; margin: 0;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .4); }
.identity-pop.identity { box-shadow: 0 0 0 4px var(--accent-wash), 0 24px 50px -20px rgba(0, 0, 0, .4); }
.identity-pop .id-step { display: none; }
.identity-pop h2 { font-size: 1.15rem; margin: 0 0 10px; }
.identity-pop input[type=text] { font-size: 1rem; padding: 9px 12px; }
.identity-pop .btn.primary { font-size: .95rem; padding: 9px 16px; }
.identity-pop .row { gap: 8px; }
.identity-pop .btn.reddit { display: none; }
.linkbtn { appearance: none; border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }

.lobby-hero { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center; margin: 18px 0;
  padding: 22px 28px; border-radius: 26px; border: 1px solid var(--grid); overflow: hidden;
  background: linear-gradient(120deg, var(--accent-wash), var(--panel) 70%); }
.lobby-hero .lobby-head { padding: 0; }
.lobby-hero h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.lobby-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.lobby-chips > span { background: var(--panel); border: 1px solid var(--grid); padding: 6px 12px; border-radius: 999px; font-size: .88rem; }
.lobby-chips > span[hidden] { display: none; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.lobby-main { display: grid; gap: 18px; min-width: 0; }
.lobby-main > * { margin: 0; }
.mg { background: var(--accent); border-radius: 26px; padding: 18px; box-shadow: 0 18px 40px -22px rgba(22, 83, 42, .7); }
.mg .sect-head { margin: 2px 4px 14px; color: #fff; }
.mg .sect-head h2 { color: #fff; font-size: 1.5rem; margin: 0; }
.mg .sect-head label, .mg .sect-head span { color: #f2fbf3; }
:root[data-theme="dark"] .mg .sect-head h2, :root[data-theme="dark"] .mg .sect-head label { color: #0c110e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mg .sect-head h2, :root:not([data-theme="light"]) .mg .sect-head label { color: #0c110e; } }
.mg .modes { gap: 14px; }
.mg .mode-card { border: 0; }
#game-miner .miner-thumb { display: block; aspect-ratio: 800 / 336; background: #2b2216; }
#game-miner .miner-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
#game-miner .btn.big { margin-top: 14px; }
.mm-you { margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: var(--accent-wash); color: var(--accent-deep); font-weight: 600; font-size: .9rem; }
details.lb > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
details.lb > summary::-webkit-details-marker { display: none; }
details.lb > summary h2 { margin: 0; }
details.lb[open] > summary .small::after { content: " ▴"; }
details.lb:not([open]) > summary .small::after { content: " ▾"; }
details.lb[open] > summary .small { font-size: 0; }
details.lb[open] > summary .small::after { font-size: .85rem; content: "hide ▴"; }
details.lb #topboard-body { margin-top: 14px; }
.pictures > h2 { margin: 6px 0 12px; }
.pp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pp-grid .sched { margin: 0; }

.lobby-chat { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 10px; padding: 16px; max-height: calc(100vh - 104px); }
.chat-head { display: flex; align-items: center; gap: 10px; }
.chat-head h2 { margin: 0; font-size: 1.15rem; }
.chat-online { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--accent-deep); }
.chat-online[hidden] { display: none; }
.chat-x { display: none; appearance: none; border: 0; background: none; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; margin-left: 4px; }
.chat-warn { margin: 0; padding: 8px 10px; border-radius: 10px; font-size: .78rem; font-weight: 600; line-height: 1.35;
  background: color-mix(in srgb, var(--danger, #b3412e) 12%, var(--panel)); color: var(--danger, #b3412e); border: 1px solid color-mix(in srgb, var(--danger, #b3412e) 35%, transparent); }
.chat-msgs { flex: 1; min-height: 280px; height: 560px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; }
.chat-msgs > :first-child { margin-top: auto; }
.cmsg { font-size: .88rem; line-height: 1.4; overflow-wrap: anywhere; position: relative; padding-right: 2px; }
.cmsg .ct { color: var(--muted); font-size: .72rem; margin-right: 6px; font-variant-numeric: tabular-nums; }
.cmsg .cn { color: var(--accent-deep); }
.cmsg .cv { color: var(--accent); font-size: .75rem; margin-left: 2px; }
.cmsg .emote { width: 26px; height: 26px; vertical-align: middle; }
.cmod { margin-left: 6px; white-space: nowrap; }
.cmod button { appearance: none; border: 0; background: none; cursor: pointer; padding: 0 2px; font-size: .85rem; opacity: .55; }
.cmod button:hover { opacity: 1; }
.chat-form { display: flex; gap: 6px; align-items: center; }
.chat-form input { flex: 1; min-width: 0; }
.chat-rules { margin: 0; font-size: .74rem; color: var(--muted); }
.chat-fab { display: none; }

@media (max-width: 900px) {
  .lobby-grid { grid-template-columns: 1fr; }
  .lobby-chat { display: none; }
  .lobby-chat.open { display: flex; position: fixed; inset: auto 10px 10px 10px; top: 70px; z-index: 80; max-height: none; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55); }
  .lobby-chat.open .chat-msgs { height: auto; }
  .chat-x { display: block; }
  .chat-fab { display: inline-flex; position: fixed; left: 16px; bottom: 18px; z-index: 46; align-items: center; gap: 4px; padding: 0 18px; height: 46px;
    border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 700 .95rem var(--font, inherit); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .5); cursor: pointer; }
  .chat-fab .g-online[hidden] { display: none; }
  body.chat-open .totop, body.chat-open .chat-fab { display: none; }
  .pp-grid { grid-template-columns: 1fr; }
}
:root[data-theme="dark"] .chat-fab { color: #0c110e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chat-fab { color: #0c110e; } }
@media (max-width: 760px) {
  .lobby-hero { grid-template-columns: 1fr; padding: 18px; }
  .g-login { margin-left: 0; }
  .identity-pop { right: auto; left: 0; }
  .g-sub { padding: 0 12px; }
}

.host-wanted { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: center; margin-bottom: 18px; }
.host-wanted[hidden] { display: none; }
.host-wanted img { width: 150px; height: auto; border-radius: 16px; display: block; }
.host-wanted h3 { margin: 0 0 6px; }
.host-wanted p { margin: 0 0 8px; color: var(--ink-2); }
@media (max-width: 560px) { .host-wanted { grid-template-columns: 90px minmax(0, 1fr); gap: 12px; } .host-wanted img { width: 90px; } }
.pp-grid:has(#sched[hidden]) { grid-template-columns: 1fr; }
/* owner statistics page */
.st .lobby-head { margin-bottom: 14px; }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.st-tile { display: grid; gap: 2px; padding: 14px 16px; }
.st-tile b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.st-tile .st-p { font-size: 1.15rem; margin-top: 6px; }
.st-l { font: 700 .75rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.st > #st-body > .card { margin-bottom: 18px; }
.st-chart { display: flex; align-items: flex-end; gap: 4px; height: 220px; padding: 8px 0 22px; overflow-x: auto; }
.st-bar { position: relative; flex: 1 0 18px; max-width: 42px; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.st-bar i { position: absolute; bottom: 0; width: 70%; background: var(--accent); border-radius: 4px 4px 0 0; }
.st-bar i.pp { width: 40%; background: var(--accent-deep); }
.st-bar span { position: absolute; bottom: -20px; font-size: .62rem; color: var(--muted); white-space: nowrap; transform: rotate(-35deg); transform-origin: top right; right: 50%; }
.st-login { display: grid; gap: 12px; justify-items: start; max-width: 460px; }
/* Start a game: 1. fren or bot  2. game  3. options */
.tmodes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.tmode { appearance: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px;
  padding: 14px 16px; border-radius: 16px; border: 2px solid var(--grid); background: var(--surface-2); }
.tmode .tmode-ico { grid-row: 1 / span 2; font-size: 1.9rem; display: grid; place-items: center; }
.tmode b { font-size: 1.05rem; }
.tmode:hover { border-color: var(--accent); }
.tmode.on { border-color: var(--accent); background: var(--accent-wash); box-shadow: 0 0 0 3px var(--accent-wash); }
.gcards.off { opacity: .45; pointer-events: none; filter: grayscale(.6); }
.topts-box { margin-top: 16px; padding: 16px; border-radius: 16px; border: 2px solid var(--accent); background: linear-gradient(160deg, var(--accent-wash), var(--surface) 70%); }
.no-server .tmode-fren { display: none; }
