/* Riddle-da-Fiddle test page. Plain on purpose: the real design comes with your own assets. */

:root {
  --bg: #2b1d15;                      /* dark forest brown: what shows behind phone toolbars and on overscroll */
  --ink: #2b1608;                     /* dark text straight on the orange */
  --panel: rgba(43, 20, 6, 0.8);      /* dark see-through brown so cream text stays readable */
  --panel-border: rgba(255, 255, 255, 0.14);
  --highlight: #fff3dc;               /* turn / selected / matching cards (gold is too close to orange) */
  --text: #f4efe3;
  --muted: #bfcbbf;
  --accent: #e9c46a;
  --primary: #b8430a;                 /* dark orange: Create game, Start, Guess, Ready, Send… */
  --danger: #c4453c;
  --card-w: 100px;                    /* pixel cards are 50x75: whole-number scales keep pixels even */
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

main { max-width: 960px; margin: 0 auto; padding: 0 16px 48px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 960px; margin: 0 auto; padding: 16px;
}
.topbar h1 { margin: 0; font-size: 1.5rem; letter-spacing: 0.02em; color: var(--ink); }
.topbar-buttons { display: flex; gap: 8px; }
#rules-btn, #host-game-controls .btn { color: var(--ink); border-color: rgba(43, 22, 8, 0.5); }
#leave-btn { background: var(--danger); color: #fff; border-color: transparent; }
#leave-btn:hover { background: #a8352d; }

h2 { font-size: 1rem; margin: 0 0 10px; }

.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: normal; }
.center { text-align: center; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.narrow { max-width: 420px; margin: 24px auto; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field { display: block; margin-bottom: 12px; }

input, select {
  font: inherit; color: #1b1b1b; background: #fbf8f0;
  border: 0; border-radius: 8px; padding: 10px 12px;
}
.field input { display: block; width: 100%; margin-top: 6px; }
.code-input { flex: 1; text-transform: uppercase; letter-spacing: 0.3em; font-weight: 700; min-width: 0; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  color: var(--text); background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px;
  padding: 10px 16px;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: transparent; }
.btn.danger { background: var(--danger); border-color: transparent; }
.btn.gold { background: var(--accent); color: #2b2210; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 0.85rem; }
.btn.wide { width: 100%; }
.btn.selected { outline: 3px solid var(--highlight); }

.divider { display: flex; align-items: center; gap: 8px; margin: 16px 0; color: var(--muted); font-size: 0.9rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--panel-border); }

.room-code-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.room-code { font-size: 2.4rem; font-weight: 800; letter-spacing: 0.25em; color: var(--accent); }

.seat-list { list-style: none; padding: 0; margin: 0 0 16px; }
.seat-list li {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--panel-border);
}
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.15); margin-left: 4px;
}
.badge.host { background: var(--accent); color: #2b2210; }
.badge.bot { background: #5a6fa8; }
.badge.hacker { background: #8a3fa0; }
.badge.warn { background: var(--danger); }

#host-controls .row { margin-bottom: 12px; }
#host-controls select { flex: 1; }

/* players around the table */
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 16px; }
.player {
  background: var(--panel); border: 2px solid transparent; border-radius: var(--radius); padding: 10px;
}
.player.current { border-color: var(--highlight); }
.player.out { opacity: 0.45; }
.player .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .meta { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
.player .btn { margin-top: 6px; }
.mini-backs { display: flex; margin-top: 6px; flex-wrap: wrap; gap: 2px; }
.mini-back { width: 12px; height: 18px; border-radius: 2px; background: #ffc9a3; border: 2px solid #fff9ef; }

.table { text-align: center; }
.current-guess { font-size: 1.8rem; font-weight: 800; margin: 6px 0; }
.status-line { color: var(--muted); min-height: 1.4em; }

.turn-controls { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.type-picker { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.qty { display: flex; align-items: center; gap: 12px; font-size: 1.6rem; font-weight: 800; }
.qty span { min-width: 2ch; }
.actions { justify-content: center; }

.joker-chooser { margin-top: 16px; }
.joker-chooser .row { justify-content: center; margin-top: 8px; }

.game-over { margin-top: 16px; font-size: 1.3rem; font-weight: 700; }
.game-over .btn { margin-top: 12px; }

/* cards */
.hand { display: flex; flex-wrap: wrap; gap: 8px; }
.card {
  width: var(--card-w); aspect-ratio: 2 / 3; display: block;
  image-rendering: pixelated;                       /* keep the pixel art crisp when scaled up */
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}
.card.small { --card-w: 50px; }
.reveal-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.reveal-row .who { width: 110px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reveal-row .cards { display: flex; flex-wrap: wrap; gap: 8px; }

/* dealing animation */
.deck, .fly-card {
  aspect-ratio: 2 / 3;
  background: url("cards/back.png") center / 100% 100% no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}
.deck { width: 50px; margin: 8px auto; }
.fly-card { position: fixed; z-index: 20; pointer-events: none; transform-origin: 0 0; }
.card.undealt, .mini-back.pending { visibility: hidden; }
.card.dealt-in { animation: flip-in 0.25s ease-out; }
@keyframes flip-in { from { transform: rotateY(90deg); } to { transform: none; } }

/* round results screen */
.results-overlay {
  position: fixed; inset: 0; z-index: 10; overflow-y: auto;
  background: rgba(30, 14, 4, 0.96); padding: 24px 16px;   /* nearly opaque: the new hand stays hidden */
}
.results-box {
  max-width: 640px; margin: 0 auto; padding: 20px;
  background: #3a1e0b;
  border: 1px solid var(--panel-border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: pop-in 0.25s ease-out;
}
@keyframes pop-in { from { transform: scale(0.95); opacity: 0; } to { transform: none; opacity: 1; } }
.results-headline { font-size: 1.3rem; margin: 4px 0 8px; }
.results-verdict { font-size: 1.05rem; margin: 0 0 8px; }
.results-key { font-size: 0.85rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.key { display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: #fff; }
.key.match { outline: 3px solid var(--accent); }
.key.joker { outline: 3px solid #b48ae0; margin-left: 10px; }
.result-row { padding: 10px 0; border-top: 1px solid var(--panel-border); }
.result-who { margin-bottom: 6px; }
.result-row .cards { display: flex; flex-wrap: wrap; gap: 10px; }   /* room for the 3px outlines */
.card.match { outline: 3px solid var(--accent); outline-offset: 1px; }
.card.joker { outline: 3px solid #b48ae0; outline-offset: 1px; }
.card.dim { opacity: 0.45; }
.change { font-weight: 700; margin-left: 6px; }
.change.minus { color: #ff8a80; }
.change.plus { color: #8be28b; }
.results-next { font-weight: 700; margin: 12px 0 8px; }
.results-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.results-bar-fill { height: 100%; width: 100%; background: var(--accent); transition: width 0.5s linear; }
.results-actions { margin-top: 12px; }

.log { margin: 0; padding-left: 20px; max-height: 220px; overflow-y: auto; font-size: 0.9rem; }
.log li { margin: 2px 0; }
.log li.chat { color: #fff; list-style: none; margin-left: -20px; padding: 2px 6px; background: rgba(255, 255, 255, 0.08); border-radius: 6px; overflow-wrap: anywhere; }
.chat-form { margin-top: 10px; flex-wrap: nowrap; }
.chat-form input { flex: 1; min-width: 0; }
.chat-bubble {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 30;
  max-width: min(420px, calc(100% - 32px)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: inherit; text-align: left; cursor: pointer;
  background: #fff3dc; color: var(--ink); border: 0; border-radius: 20px; padding: 10px 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); animation: pop-in 0.2s ease-out;
}

/* rule book */
.rules-overlay {
  position: fixed; inset: 0; z-index: 25; overflow-y: auto;
  background: rgba(30, 14, 4, 0.85); padding: 24px 16px;
}
.rules-box {
  position: relative; max-width: 680px; margin: 0 auto; padding: 20px 22px 28px;
  background: #3a1e0b; border: 1px solid var(--panel-border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); line-height: 1.5;
  animation: pop-in 0.2s ease-out;
}
.rules-close { position: sticky; top: 0; float: right; z-index: 1; background: #5a3017; }
.rules-title { font-size: 1.4rem; margin: 0 40px 12px 0; }
.rules-box h3 { color: var(--accent); margin: 22px 0 8px; font-size: 1.05rem; }
.rules-box p, .rules-box ul { margin: 0 0 8px; }
.rules-box ul { padding-left: 20px; }
.rules-summary { background: rgba(255, 255, 255, 0.07); border-radius: 10px; padding: 4px 14px 6px; }
.rules-summary h3 { margin-top: 10px; }
.rules-table { border-collapse: collapse; margin-bottom: 8px; }
.rules-table th { text-align: left; padding: 4px 12px 4px 0; }
.rules-table td { padding: 4px 12px 4px 0; }
.rule-cards { white-space: nowrap; }
.rule-cards img, .rule-with-card img { width: 50px; aspect-ratio: 2 / 3; image-rendering: pixelated; margin-right: 4px; vertical-align: middle; flex: none; }
.rule-with-card { list-style: none; margin-left: -20px; display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.rules-moves dt { font-weight: 800; font-size: 1.05rem; margin-top: 10px; color: #fff; }
.rules-moves dt.fiddle { color: #ff8a80; }
.rules-moves dt.riddle { color: var(--accent); }
.rules-moves dd { margin: 2px 0 8px 0; }
.rules-example {
  list-style: none; font-size: 0.9rem; color: var(--muted); margin: 6px 0;
  padding: 6px 10px; border-left: 3px solid var(--accent); background: rgba(255, 255, 255, 0.05);
}
li.rules-example { margin-left: -20px; }
.rules-credits { font-size: 0.85rem; color: var(--muted); }
.rules-credits a { color: var(--highlight); }

.toast {
  z-index: 40;
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #222; color: #fff; padding: 10px 16px; border-radius: 8px;
  max-width: calc(100% - 32px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

@media (max-width: 520px) {
  :root { --card-w: 50px; }
  .room-code { font-size: 2rem; }
  .current-guess { font-size: 1.4rem; }
}

/* ================================================================
   Pixel skin: frames and buttons from Quintino Pixels' Fantasy UI
   pack (CC0), drawn at 2x with crisp pixels. Each piece is a
   stretchable 9-slice frame (border-image), so it fits any size.
   ================================================================ */
/* Font: Jersey 10 (Google Fonts, Open Font License) for everything.
   It's drawn smaller than most fonts, so "RDF Jersey" scales it 115% to keep the
   site's sizes the same; if those files ever move, the plain "Jersey 10" from the
   Google Fonts link takes over (just a little smaller).
   It only has one weight, so fake bold is switched off and bold text uses colour instead. */
@font-face {
  font-family: "RDF Jersey";
  src: url("https://fonts.gstatic.com/s/jersey10/v4/GftH7vZKsggXMf9n_J5n_5jh.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  size-adjust: 115%;
  font-display: swap;
}
@font-face {
  font-family: "RDF Jersey";
  src: url("https://fonts.gstatic.com/s/jersey10/v4/GftH7vZKsggXMf9n_J5n8Zjh-1w.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
  size-adjust: 115%;
  font-display: swap;
}
body { font-family: "RDF Jersey", "Jersey 10", system-ui, sans-serif; font-variant-ligatures: none; font-synthesis: none; letter-spacing: 0.02em; }
/* bold text: a stronger colour instead of smeared fake bold */
b, strong { font-weight: normal; color: var(--strong, #fff); }
.panel, .results-box, .rules-box { --strong: #1a0b02; }
.table.panel, .player { --strong: #ffffff; }
button, input, select { font-variant-ligatures: none; }

/* parchment: home, lobby, hand, last reveal, log & chat, results, rules */
.panel, .results-box, .rules-box {
  --text: #3b2410; --muted: #7a5536; --panel-border: rgba(90, 50, 20, 0.25);
  color: var(--text);
  background: none; border-radius: 0; box-shadow: none;
  border-style: solid; border-width: 16px;
  border-image: url("ui/panel_parchment.png") 8 fill / 16px stretch;
  image-rendering: pixelated;
  padding: 6px 8px;
}
.results-box, .rules-box { padding: 10px 14px 16px; }

/* the table: dark teal felt with the vine-and-gem frame */
.table.panel {
  --text: #f4efe3; --muted: #bfe0da; --panel-border: rgba(255, 255, 255, 0.15);
  border-width: 24px;
  border-image: url("ui/panel_table.png") 12 fill / 24px stretch;
  padding: 4px 8px 8px;
}

/* player seats: wood; whose turn it is gets the gem frame */
.player {
  background: none; border-radius: 0;
  border-style: solid; border-width: 12px;
  border-image: url("ui/panel_wood.png") 6 fill / 12px stretch;
  image-rendering: pixelated;
  padding: 2px 4px;
}
.player.current { border-width: 20px; border-image: url("ui/panel_turn.png") 10 fill / 20px stretch; padding: 0; }

/* headings on a little scroll banner */
.panel > h2, .rules-box h3, .results-headline {
  display: inline-block; color: #3b2410;
  border-style: solid; border-width: 8px 12px;
  border-image: url("ui/banner.png") 4 6 fill / 8px 12px stretch;
  image-rendering: pixelated;
  padding: 0 6px 0 12px; margin-bottom: 8px;
}
.results-headline { display: block; }
.rules-summary h3 { margin-top: 6px; }

/* buttons */
.btn, .btn.ghost, #leave-btn, #rules-btn, #host-game-controls .btn, .rules-close {
  background: none; border-radius: 0;
  border-style: solid; border-width: 8px;
  border-image: url("ui/button_wood.png") 4 fill / 8px stretch;
  image-rendering: pixelated;
  color: #fff4e2; padding: 2px 10px; line-height: 1.3;
}
.btn:hover:not(:disabled) { background: none; filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { border-image-source: url("ui/button_teal.png"); color: #0f302a; }
.btn.danger, #leave-btn { border-image-source: url("ui/button_red.png"); color: #fff; }
#leave-btn:hover { background: none; }
.btn.gold { border-image-source: url("ui/button_gold.png"); color: #3b2410; }
.btn.small, #rules-btn, #music-btn, #leave-btn { border-width: 6px; border-image-width: 6px; padding: 0 6px; font-size: 0.9rem; }
.btn.selected { outline: 3px solid #fff3dc; outline-offset: 2px; }

/* readable colours on parchment */
.room-code { color: #b8430a; }
.badge { background: rgba(0, 0, 0, 0.14); }
.player .badge, .table .badge { background: rgba(255, 255, 255, 0.18); }
.badge.host { background: var(--accent); color: #2b2210; }
.badge.bot { background: #5a6fa8; color: #fff; }
.badge.hacker { background: #8a3fa0; color: #fff; }
.badge.warn { background: var(--danger); color: #fff; }
.log li.chat { color: #2b1608; background: rgba(0, 0, 0, 0.07); }
.change.minus { color: #b3261e; }
.change.plus { color: #2e7d32; }
.rules-moves dt { color: #2b1608; }
.rules-moves dt.fiddle { color: #b3261e; }
.rules-moves dt.riddle { color: #a0600a; }
.rules-example { background: rgba(0, 0, 0, 0.05); border-left-color: #b8430a; }
.rules-summary { background: rgba(0, 0, 0, 0.06); }
.rules-credits a { color: #8a3a08; }
.key { background: #fff9ef; }

/* results countdown: dark slider track with a teal fill */
.results-bar { height: 8px; border-radius: 0; background: #2e222f; }
.results-bar-fill { background: #30e1b9; }

@media (max-width: 520px) {
  .panel, .results-box, .rules-box { border-width: 12px; border-image-width: 12px; }
  .table.panel { border-width: 18px; border-image-width: 18px; }
}
.topbar-buttons .btn { white-space: nowrap; }
@media (max-width: 520px) { .topbar h1 { font-size: 1.2rem; } }

/* ================================================================
   Forest background: Forest Background by Luis Zuno (ansimuz), CC0.
   Four 272x160 layers stacked; each loops sideways (drift) at its own
   speed, and shifts up a little as you scroll (parallax). Layers are
   106vh tall so the scroll shift never shows a gap; one tile is then
   272/160 * 106vh = 180.2vh wide.
   ================================================================ */
#forest { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
#forest .layer {
  position: absolute; left: 0; top: -3vh; height: 106vh; width: 100%;
  transform: translateY(max(-3vh, calc(var(--scroll, 0) * var(--depth) * -1px)));
  will-change: transform;
}
#forest .strip {
  height: 100%; width: calc(100vw + 180.2vh);
  background-repeat: repeat-x; background-size: auto 100%; background-position: 0 0;
  image-rendering: pixelated;
  animation: forest-drift var(--speed) linear infinite;
  will-change: transform;
}
@keyframes forest-drift { to { transform: translateX(-180.2vh); } }
#forest .vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(20, 8, 2, 0.05) 40%, rgba(20, 8, 2, 0.55) 100%);
}
@media (prefers-reduced-motion: reduce) {
  #forest .strip { animation: none; }
  #forest .layer { transform: none; }
}

/* text sitting straight on the forest */
.topbar h1 { color: #fff4e2; text-shadow: 2px 2px 0 #2b1608; }

/* pixel icons (Nikoichu, CC0) in the top-bar buttons */
.px-icon { width: 32px; height: 32px; image-rendering: pixelated; display: block; }
.icon-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px; }
.icon-btn .px-icon { margin: -6px 0; }   /* keep the button the same height as Leave */

/* pixel mouse cursor: arrow everywhere, pointing hand on things you can click */
html, body { cursor: url("ui/cursor-arrow.png") 6 2, auto; }
button:not(:disabled), a, select, .chat-bubble, [data-remove], [data-tobot] { cursor: url("ui/cursor-hand.png") 12 1, pointer; }
input { cursor: text; }

/* End game button: same gap above and below */
#host-game-controls { margin: 0 0 16px; }

/* base colour behind everything (also the iPhone toolbar and overscroll areas) */
html { background: var(--bg); }
body { background: transparent; }   /* let the forest (behind the body) show through */

/* logo: big on the home screen, small in the top bar */
/* shown on the home screen while the sleeping game server starts up */
.waking { margin: 0 0 10px; padding: 6px 10px; text-align: center; color: #5a2e12; background: rgba(255, 255, 255, 0.4); border-radius: 4px; animation: waking-pulse 1.2s ease-in-out infinite alternate; }
@keyframes waking-pulse { from { opacity: 0.6; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .waking { animation: none; } }
.home-logo { text-align: center; margin: 8px 0 -8px; }
.home-logo img { width: 330px; max-width: 100%; height: auto; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)); }
.topbar h1 { line-height: 0; }
.logo-small { width: 182px; height: auto; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }
.topbar-buttons { margin-left: auto; }   /* stay on the right even when the title is hidden */
@media (max-width: 520px) { .logo-small { width: 130px; } }

/* joker choice: what happened and what your choice does */
.joker-context { font-size: 1.1rem; margin-bottom: 4px; }
.joker-tip { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }

/* winner badge (K4nnx violin on Quintino's gem frame, one combined image) */
.badge-img { width: 96px; height: auto; image-rendering: pixelated; display: block; margin: 0 auto 6px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }
.badge-img.small { width: 32px; display: inline-block; vertical-align: middle; margin: 0 6px 0 0; filter: none; }
.log li.win-line { font-weight: 700; }

/* big-moment callouts: chunky outlined pixel text, red for bad news, gold for good */
.callouts { text-align: center; margin: 6px 0 10px; }
.callout {
  font-size: 2.1rem; line-height: 1.05; color: #fff4e2; text-align: center; letter-spacing: 0.04em;
  text-shadow: 2px 0 #2b1608, -2px 0 #2b1608, 0 2px #2b1608, 0 -2px #2b1608,
               2px 2px #2b1608, -2px 2px #2b1608, 2px -2px #2b1608, -2px -2px #2b1608, 4px 4px var(--callout-shadow);
  animation: callout-pop 0.45s cubic-bezier(.2, 1.6, .4, 1) both;
}
/* green = you came out on top, red = you lost out, neutral = it's about someone else */
.callout.green { --callout-shadow: #1f6b2e; color: #d9ffd2; }
.callout.red { --callout-shadow: #8e1e1e; color: #ffd9d2; }
.callout.neutral { --callout-shadow: #7a4a1c; color: #fff4e2; }
.callout.small { font-size: 1.3rem; margin-top: 4px; animation-delay: 0.15s; }
@keyframes callout-pop { from { transform: scale(0.4) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
#table-callout .callouts { margin: 0 0 4px; }
#table-callout .callout { font-size: 1.5rem; }
#table-callout .callout.small { font-size: 1.1rem; }
.log li.callout-line { list-style: none; margin-left: -20px; font-size: 1.05em; }
.log li.callout-line.neutral { color: #6a3c10; }
@media (prefers-reduced-motion: reduce) { .callout { animation: none; } }
@media (max-width: 520px) { .callout { font-size: 1.6rem; } .callout.small { font-size: 1.1rem; } }

/* Last Stand: purple, for the callout, the log line and the player's seat */
.callout.purple { --callout-shadow: #5b2a8c; color: #efdcff; }
.log li.callout-line.purple { color: #6b2fa0; }
.player.last-stand { outline: 3px solid #b77ee8; outline-offset: 2px; box-shadow: 0 0 14px 2px rgba(183, 126, 232, 0.7); animation: last-stand-glow 1.6s ease-in-out infinite; }
@keyframes last-stand-glow { 50% { box-shadow: 0 0 22px 6px rgba(183, 126, 232, 0.9); } }
@media (prefers-reduced-motion: reduce) { .player.last-stand { animation: none; } }

/* splash text (like Minecraft's): tilted, yellow, gently pulsing, on the logo's corner */
.logo-wrap { position: relative; display: inline-block; }
.splash {
  position: absolute; right: 80%; top: 8px; transform-origin: right center;   /* top-left corner, ending by the start of RIDDLE */
  transform: rotate(-16deg); white-space: nowrap; color: #ffef3a; letter-spacing: 0.02em;
  text-shadow: 2px 2px 0 #3d2a00;
  animation: splash-pulse 0.9s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes splash-pulse { from { transform: rotate(-16deg) scale(1); } to { transform: rotate(-16deg) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .splash { animation: none; } }
@media (max-width: 520px) { .splash { right: auto; left: -4px; top: 40px; transform-origin: left center; } }

/* big monitors: the home screen (logo + create/join) is scaled up 125%; the game screens stay as they are */
@media (min-width: 1400px) {
  #home-logo, #screen-home { zoom: 1.25; }
}

/* log without line numbers (3-digit numbers used to push lines off the left edge) */
.log { list-style: none; padding-left: 0; }
.log li.chat, .log li.callout-line { margin-left: 0; }

/* player name colours */
.pname { font-weight: normal; }
.seat-name { border-bottom: 3px solid var(--name-color); padding-bottom: 1px; }

/* friend pop-up (only shown to that player) */
.name-popup { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 35; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.name-popup .callout { font-size: 2.6rem; }

/* text boxes: Jersey 10's first letter sat a pixel or two outside the box's text area and got clipped */
input { padding-left: 14px; padding-right: 14px; text-indent: 1px; letter-spacing: 0.02em; }

/* stickers */
.sticker-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px;
  margin-top: 10px; padding: 8px; background: rgba(0, 0, 0, 0.07); border-radius: 8px;
}
.sticker-choice { background: none; border: 0; padding: 4px; border-radius: 6px; display: grid; place-items: center; }
.sticker-choice:hover { background: rgba(0, 0, 0, 0.1); }
.sticker-choice img { max-width: 48px; max-height: 48px; width: auto; height: 48px; image-rendering: pixelated; }
.sticker { display: block; height: 64px; width: auto; max-width: 100%; margin-top: 4px; image-rendering: pixelated; }
.sticker.small { display: inline-block; height: 28px; margin: 0 0 0 4px; vertical-align: middle; }
.log li.sticker-line { background: none; }
#sticker-btn .px-icon { margin: -6px 0; }
.chat-bubble { white-space: nowrap; }
