/* Doodle Arcade: a sketchbook look. Cream paper, ink outlines, marker colors. */

:root {
  --paper: #fdf6e3;
  --card: #fffdf6;
  --ink: #1f1d2b;
  --muted: #6f6a80;
  --line: #d9cfb6;
  --yellow: #ffd23f;
  --orange: #ff9f5a;
  --pink: #ff7aa2;
  --red: #ff5d5d;
  --purple: #b79cff;
  --blue: #5bc0eb;
  --green: #7bd389;
  /* uneven corners make boxes look hand-drawn */
  --sketch: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --sketch-2: 15px 225px 15px 255px / 255px 15px 225px 15px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(31, 29, 43, .13) 1.5px, transparent 1.6px);
  background-size: 26px 26px;
}

[hidden] { display: none !important; }

main { position: relative; z-index: 1; }

h2 { font-size: 22px; font-weight: 600; margin: 0 0 10px; }
h2 small { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 6px; }

input {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--sketch-2);
  padding: 10px 14px;
  width: 100%;
  outline: none;
}
input:focus { box-shadow: 0 0 0 4px var(--yellow); }
input::placeholder { color: #b3ad9c; }

button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 3px dashed var(--purple); outline-offset: 3px; }

kbd {
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  border: 1.5px solid var(--line);
  border-radius: 5px;
  padding: 0 5px;
  background: #fff;
}

/* ---------- background scribbles ---------- */
.doodles { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.doodles svg {
  position: absolute;
  opacity: .55;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: drift var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); }
}

/* ---------- shared pieces ---------- */
.paper {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--sketch);
  box-shadow: 5px 6px 0 var(--ink);
  padding: 20px 22px;
}

.btn {
  font-weight: 600;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--sketch-2);
  box-shadow: 3px 4px 0 var(--ink);
  padding: 9px 18px;
  transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:hover:not(:disabled) { transform: translate(-1px, -2px) rotate(-1deg); box-shadow: 4px 6px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translate(3px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-yellow { background: var(--yellow); }
.btn-big { font-size: 22px; padding: 14px 26px; }
.btn-small { font-size: 14px; padding: 5px 12px; box-shadow: 2px 3px 0 var(--ink); }

.brand { font-family: 'Gochi Hand', cursive; font-size: 26px; line-height: 1; white-space: nowrap; transform: rotate(-2deg); }

.sound-toggle {
  flex: none;
  width: 44px;
  height: 44px;
  font-size: 20px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 3px 0 var(--ink);
  padding: 0;
}
.sound-toggle:active { transform: translate(2px, 3px); box-shadow: none; }

/* avatars */
.avatar, .avatar-full, .avatar-stage { line-height: 0; }
.avatar svg, .avatar-full svg, .avatar-stage svg { width: 100%; height: 100%; display: block; overflow: visible; }
.avatar { flex: none; width: 42px; height: 46px; }
.avatar.mini { width: 24px; height: 26px; display: inline-block; vertical-align: -7px; margin-right: 4px; }
.bob { animation: bob 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-5px) rotate(1.5deg); }
}

/* ---------- 1. home ---------- */
.home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px 40px;
}

.logo {
  font-family: 'Gochi Hand', cursive;
  font-size: clamp(46px, 11vw, 104px);
  font-weight: 400;
  line-height: 1;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 .28em;
}
.logo-word { display: flex; }
.logo .letter {
  display: inline-block;
  color: var(--c);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 4px 5px 0 var(--ink);
  animation: wobble 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.27s);
}
@keyframes wobble {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-7px) rotate(3deg); }
}

.tagline { font-family: 'Gochi Hand', cursive; font-size: 24px; margin: 4px 0 20px; text-align: center; transform: rotate(-1deg); }

.home-grid {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 26px;
  align-items: stretch;
}
.builder { transform: rotate(-.6deg); }
.entry { transform: rotate(.7deg); display: flex; flex-direction: column; gap: 12px; }
.entry label { font-weight: 500; margin-bottom: -6px; }
.entry .btn-big { margin-top: 6px; }

.step {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-size: 18px;
  background: var(--pink);
  border: 3px solid var(--ink);
  border-radius: 50%;
  margin-right: 6px;
  transform: rotate(-6deg);
}

.builder-body { display: flex; gap: 20px; align-items: center; }
.builder-preview { flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.avatar-stage {
  width: 170px;
  height: 240px;
  padding: 10px 14px 6px;
  background: repeating-linear-gradient(#fff, #fff 23px, #dbe9f6 23px, #dbe9f6 25px);
  border: 3px solid var(--ink);
  border-radius: var(--sketch-2);
}
.avatar-stage svg { animation: bob 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
.builder-options { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }

.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches button {
  width: 30px;
  height: 30px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  padding: 0;
  transition: transform .1s;
}
.swatches button:hover { transform: scale(1.15) rotate(8deg); }
.swatches button.active { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--ink); }

.part-row { display: grid; grid-template-columns: 74px 40px 1fr 40px; align-items: center; gap: 6px; margin-top: 6px; }
.part-row .part-label { font-weight: 600; }
.part-row .part-value { text-align: center; background: #fff; border: 2px dashed var(--line); border-radius: 10px; padding: 5px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.part-row button {
  height: 38px;
  font-size: 18px;
  font-weight: 700;
  background: var(--blue);
  border: 3px solid var(--ink);
  border-radius: var(--sketch-2);
  box-shadow: 2px 3px 0 var(--ink);
  padding: 0;
}
.part-row button:active { transform: translate(2px, 3px); box-shadow: none; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; margin-top: 8px; }
.divider::before, .divider::after { content: ''; flex: 1; border-top: 2px dashed var(--line); }

.join-row { display: flex; gap: 10px; }
.join-row input { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 600; }

.status { min-height: 1.4em; margin: 0; color: #c2410c; text-align: center; font-weight: 500; }

/* ---------- 2. lobby ---------- */
.lobby { max-width: 1040px; margin: 0 auto; padding: 20px 16px 120px; display: flex; flex-direction: column; gap: 24px; }

.lobby-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ticket {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: var(--sketch);
  box-shadow: 4px 5px 0 var(--ink);
  padding: 6px 16px;
  transform: rotate(-1.2deg);
}
.ticket span { font-weight: 500; }
.ticket b { font-family: 'Gochi Hand', cursive; font-size: 40px; font-weight: 400; letter-spacing: .14em; line-height: 1; }

.gang { transform: rotate(.3deg); }
.gang-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: flex-end; min-height: 150px; }
.gang-member { width: 92px; text-align: center; animation: drop-in .45s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.gang-member .avatar-full { width: 80px; height: 122px; margin: 0 auto; }
.gang-member .gname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gang-member .gtag { font-size: 12px; font-weight: 600; background: var(--purple); border: 2px solid var(--ink); border-radius: 999px; padding: 0 8px; display: inline-block; }
.gang-member .gtag.me { background: var(--green); }
.gang-empty {
  width: 92px;
  height: 122px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  border: 3px dashed var(--line);
  border-radius: var(--sketch-2);
  align-self: flex-start;
  margin-top: 4px;
}
@keyframes drop-in { from { transform: translateY(-40px) scale(.6); opacity: 0; } }

.setup { transform: rotate(-.25deg); }
.setup h2 { margin-top: 18px; }
.setup-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.setup-head h2 { margin-top: 0; }
.sub { margin: -6px 0 12px; color: var(--muted); }
.host-note { margin: 0 0 16px; padding: 8px 14px; background: #eef8ff; border: 2px dashed var(--blue); border-radius: 12px; font-weight: 500; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-weight: 500;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--muted);
  transition: transform .1s, background .12s;
}
.chip::before { content: '+ '; font-weight: 700; }
.chip.on { background: var(--green); color: var(--ink); box-shadow: 2px 3px 0 var(--ink); transform: rotate(-1.5deg); }
.chip.on:nth-child(even) { transform: rotate(1.5deg); background: var(--blue); }
.chip.on:nth-child(3n) { background: var(--pink); }
.chip.on::before { content: '✓ '; }
.chip:hover:not(:disabled) { transform: scale(1.06); }
.chip:disabled { cursor: default; }
.chip:disabled:not(.on) { opacity: .45; }

.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--sketch-2);
  padding: 12px 16px;
}
.option .otext { flex: 1; min-width: 0; }
.option h3 { margin: 0; font-size: 18px; font-weight: 600; }
.option p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
button.option { transition: transform .1s, background .15s; }
button.option:hover:not(:disabled) { transform: translateY(-2px) rotate(-.5deg); }
button.option.on { background: #fff7d6; box-shadow: 3px 4px 0 var(--ink); }
button.option:disabled { cursor: default; }

.switch { flex: none; width: 58px; height: 32px; border: 3px solid var(--ink); border-radius: 999px; background: #e7e1d0; position: relative; transition: background .15s; }
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 50%;
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1);
}
.on > .switch { background: var(--green); }
.on > .switch::after { transform: translateX(26px); }

.stepper, .segments { flex: none; display: flex; align-items: center; gap: 6px; }
.stepper b { min-width: 30px; text-align: center; font-size: 22px; }
.stepper button, .segments button {
  min-width: 38px;
  height: 38px;
  font-weight: 600;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 0 8px;
}
.stepper button { font-size: 20px; background: var(--blue); }
.segments button.active { background: var(--yellow); box-shadow: 2px 3px 0 var(--ink); transform: rotate(-2deg); }
.stepper button:disabled, .segments button:disabled { cursor: default; }
.stepper button:disabled { opacity: .35; }
.segments button:disabled:not(.active) { opacity: .4; }

.lobby-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: linear-gradient(transparent, var(--paper) 35%);
}
.start-hint { margin: 0; font-family: 'Gochi Hand', cursive; font-size: 22px; }
#start:not(:disabled) { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge {
  0%, 86%, 100% { transform: rotate(0); }
  90% { transform: rotate(-2.5deg) scale(1.04); }
  95% { transform: rotate(2.5deg) scale(1.04); }
}

/* ---------- 3. game ---------- */
.game { padding: 14px 16px 24px; max-width: 1440px; margin: 0 auto; }

.topbar { display: flex; align-items: center; gap: 14px; }
.pill {
  font-size: 14px;
  font-weight: 600;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}
.word-box { flex: 1; min-width: 0; overflow-wrap: anywhere; text-align: center; min-height: 56px; display: flex; flex-direction: column; justify-content: center; }
.word { font-size: clamp(18px, 2.6vw, 30px); font-weight: 700; letter-spacing: .28em; white-space: pre-wrap; }
.category { font-size: 14px; color: var(--muted); font-weight: 500; }
.timer {
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 22px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 3px 0 var(--ink);
  font-variant-numeric: tabular-nums;
}
.timer.low { background: var(--red); color: #fff; animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.12) rotate(4deg); } }

.progress { height: 10px; background: #fff; border: 3px solid var(--ink); border-radius: 999px; margin: 10px 0 16px; overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--pink) 0 10px, var(--orange) 10px 20px); transition: width .25s linear; }

.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
.layout .paper { padding: 14px 16px; }

.players ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.players li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 2px solid transparent;
  border-radius: 14px;
}
.players li.drawing { background: #fff7d6; border-color: var(--ink); border-style: dashed; }
.players li.guessed { background: #dff6e4; border-color: var(--ink); }
.players li.guessed .avatar { animation: hop .5s ease-out; }
@keyframes hop { 40% { transform: translateY(-12px) rotate(-8deg); } }
.pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pname small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.pscore { font-weight: 700; font-variant-numeric: tabular-nums; }

.canvas-wrap {
  position: relative;
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 5px 6px 0 var(--ink);
  overflow: hidden;
  background: #fff;
  line-height: 0;
}
canvas { width: 100%; height: auto; touch-action: none; cursor: crosshair; display: block; }
.canvas-wrap.ring-cursor canvas { cursor: none; }

.cursor {
  position: absolute;
  border: 1.5px solid rgba(0, 0, 0, .7);
  outline: 1.5px solid rgba(255, 255, 255, .8);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.fx-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; line-height: 1.2; }
.fx-badges span {
  font-size: 14px;
  font-weight: 600;
  background: var(--pink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
}

/* chaos effects */
/* --fog is set from the canvas width, so the blur is equally strong on every screen */
.canvas-wrap.fx-blur canvas { filter: blur(var(--fog, 8px)); }
/* Long rumbles with a short breather in between. The canvas really moves under
   the pointer, so lines drawn during a rumble come out shaky. Distances are in
   percent of the canvas, so it is equally strong on every screen. */
.canvas-wrap.fx-quake { animation: quake 2.8s linear infinite; }
@keyframes quake {
  0%, 64%, 82%, 100% { transform: translate(0, 0) rotate(0); }
  4% { transform: translate(-1.5%, 1.33%) rotate(-1.4deg); }
  8% { transform: translate(1.38%, -1.5%) rotate(1.3deg); }
  12% { transform: translate(-1.25%, -1.17%) rotate(-1deg); }
  16% { transform: translate(1.25%, 1.67%) rotate(1.2deg); }
  20% { transform: translate(-1.63%, 0.67%) rotate(-1.5deg); }
  24% { transform: translate(1.5%, -1%) rotate(1.2deg); }
  28% { transform: translate(-1%, 1.5%) rotate(-.8deg); }
  32% { transform: translate(1.13%, -1.33%) rotate(.9deg); }
  36% { transform: translate(-1.38%, -0.83%) rotate(-1.2deg); }
  40% { transform: translate(1.25%, 1.17%) rotate(1deg); }
  44% { transform: translate(-1.13%, 1%) rotate(-.9deg); }
  48% { transform: translate(1%, -1.17%) rotate(.8deg); }
  52% { transform: translate(-0.75%, -0.67%) rotate(-.5deg); }
  56% { transform: translate(0.63%, 0.83%) rotate(.5deg); }
  60% { transform: translate(-0.38%, 0.33%) rotate(-.3deg); }
  86% { transform: translate(-0.75%, 0.67%) rotate(-.5deg); }
  90% { transform: translate(0.75%, -0.67%) rotate(.5deg); }
  94% { transform: translate(-0.5%, -0.5%) rotate(-.3deg); }
}

/* overlay on the canvas: word choice and results */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(253, 246, 227, .96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  text-align: center;
  line-height: 1.4;
  overflow: auto;
}
.overlay h3 { font-family: 'Gochi Hand', cursive; font-size: clamp(26px, 3.6vw, 40px); font-weight: 400; margin: 0; }
.overlay p { margin: 0; color: var(--muted); }
.overlay .label { font-weight: 600; color: var(--muted); }
.overlay .big { font-size: clamp(26px, 5vw, 48px); font-weight: 700; letter-spacing: .1em; }
.overlay .row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; align-items: stretch; }
.overlay .avatar-full { width: 90px; height: 138px; }

.choice { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 160px; padding: 14px 18px; }
.choice:nth-child(1) { background: #fff7d6; }
.choice:nth-child(2) { background: #e3f4fd; }
.choice:nth-child(3) { background: #ffe6ee; }
.choice b { font-size: 22px; text-transform: capitalize; }
.choice small { color: var(--muted); font-weight: 400; }
.twist {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  background: var(--purple);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 1px 10px;
}
.twist.plain { background: #fff; border-style: dashed; border-color: var(--line); color: var(--muted); font-weight: 400; }
.overlay .twist-help { font-size: 15px; max-width: 540px; }
.twist-help b { color: var(--ink); font-weight: 600; }

.scores { list-style: none; margin: 0; padding: 0; min-width: 280px; }
.scores li { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 3px 0; font-weight: 500; }
.scores .gain { color: #1f9d55; font-weight: 700; }
.scores li.winner { font-weight: 700; font-size: 21px; }

/* drawer toolbar */
.toolbar { margin-top: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.tool-group { display: flex; gap: 6px; }
.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 64px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 7px 8px 5px;
  transition: transform .08s, background .12s;
}
.tool span { font-size: 21px; line-height: 1; }
.tool:hover { transform: translateY(-2px); }
.tool:active { transform: translateY(2px); }
.tool.active { background: var(--yellow); box-shadow: 2px 3px 0 var(--ink); }

.sizes { display: flex; gap: 6px; align-items: center; }
.sizes button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 0;
}
.sizes button.active { background: var(--yellow); box-shadow: 2px 3px 0 var(--ink); }
.sizes i { display: block; background: var(--ink); border-radius: 50%; }

.colors { display: grid; grid-template-columns: repeat(10, 28px); gap: 5px; }
.colors button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  padding: 0;
  transition: transform .08s;
}
.colors button:hover { transform: scale(1.18); }
.colors button.active { box-shadow: 0 0 0 2px var(--card), 0 0 0 5px var(--ink); }

.tip { flex-basis: 100%; margin: 0; font-size: 14px; color: var(--muted); }
.tip b { color: var(--ink); font-weight: 600; }
.mode-tip { color: var(--ink); background: #efe8ff; border: 2px dashed var(--purple); border-radius: 12px; padding: 6px 12px; }

/* chaos mode: picking a curse for the next drawer */
.overlay .row .curse {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 168px;
  padding: 10px 12px;
  background: #ffe6ee;
}
.curse span { font-size: 26px; line-height: 1.1; }
.curse b { font-size: 17px; }
.curse small { font-size: 13px; font-weight: 400; color: var(--muted); line-height: 1.25; }
.curse:hover:not(:disabled) { background: var(--pink); }
.overlay .curse-note { max-width: 560px; color: var(--ink); background: #ffe6ee; border: 2px dashed var(--pink); border-radius: 12px; padding: 6px 14px; }

/* chat */
.chat { display: flex; flex-direction: column; height: min(72vh, 660px); }
.messages { flex: 1; overflow-y: auto; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 16px; }
.messages div { overflow-wrap: anywhere; }
.messages .msg, .messages .hidden {
  align-self: flex-start;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 4px 14px 14px 14px;
  padding: 3px 10px;
  animation: pop .2s ease-out;
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.messages .msg b, .messages .hidden b { font-weight: 600; margin-right: 5px; }
.messages .hidden { background: #dff6e4; border-style: dashed; }
.messages .sys { color: var(--muted); font-size: 14px; }
.messages .good { color: #1f9d55; font-weight: 600; }
.messages .close { color: #c2410c; font-size: 14px; font-weight: 500; }
.messages .chaos { color: #d6336c; font-weight: 600; }

/* ---------- small screens ---------- */
@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; }
  .stage { order: -1; }
  .chat { height: 320px; }
  .game .brand { display: none; }
}
@media (max-width: 760px) {
  .home-grid { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: 1fr; }
  .builder-body { flex-direction: column; }
  .builder-options { width: 100%; }
  .lobby-head .brand { display: none; }
  .option { flex-wrap: wrap; }
}

/* people who prefer less motion get a calm page */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
