:root {
  --bg: #f4ece2;
  --bg2: #eadccb;
  --panel: #fffaf4;
  --ink: #3b2a20;
  --muted: #8a7566;
  --line: #e2d3c2;
  --clay: #c8714f;
  --clay-dark: #a3553a;
  --good: #3f9b5a;
  --good-bg: #e2f3e6;
  --bad: #c0453a;
  --close: #c98a12;
  --secret: #f1e7ff;
  --shadow: 0 6px 24px rgba(80, 50, 30, .12);
  --radius: 14px;
  --font: 'Fredoka', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }

.btn { border: 2px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 500; transition: transform .08s, background .15s; }
.btn:hover { background: #fff; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--clay); border-color: var(--clay-dark); color: #fff; box-shadow: 0 3px 0 var(--clay-dark); }
.btn.primary:hover { background: #d27b58; }
.btn.primary:disabled { background: #cbb8a8; border-color: #b8a291; box-shadow: none; cursor: not-allowed; }
.btn.big { font-size: 18px; padding: 12px 18px; width: 100%; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { background: transparent; }

/* ---------- home ---------- */
.home { min-height: 100%; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 30% 20%, #fbe3cf 0, transparent 50%), radial-gradient(circle at 80% 90%, #e8d5f0 0, transparent 45%), var(--bg); }
.home-card { width: min(400px, 100%); background: var(--panel); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); border: 2px solid var(--line); }
.logo { font-size: 38px; font-weight: 700; display: flex; align-items: center; gap: 12px; color: var(--clay-dark); }
.blob { width: 44px; height: 40px; background: var(--clay); border-radius: 58% 42% 55% 45% / 50% 60% 40% 50%; box-shadow: inset -6px -6px 0 rgba(0,0,0,.12), inset 5px 5px 0 rgba(255,255,255,.25); animation: squish 3s ease-in-out infinite; }
@keyframes squish { 50% { border-radius: 45% 55% 40% 60% / 60% 45% 55% 40%; transform: rotate(8deg); } }
.tag { color: var(--muted); margin: 4px 0 22px; }
.field { display: block; font-weight: 500; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.field input, .join-row input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; font-size: 17px; outline: none; }
.field input:focus, .join-row input:focus, .chat-form input:focus { border-color: var(--clay); }
.or { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 10px; position: relative; }
.or::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.or span { background: var(--panel); padding: 0 8px; position: relative; }
.join-row { display: flex; gap: 8px; }
.join-row input { margin: 0; text-transform: uppercase; letter-spacing: 6px; font-weight: 600; text-align: center; }
.err { color: var(--bad); min-height: 20px; margin-top: 10px; font-size: 14px; }

/* ---------- game layout ---------- */
.game { height: 100%; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); border-bottom: 2px solid var(--line); min-height: 58px; }
.code-chip { border: 2px dashed var(--clay); background: #fff4ec; border-radius: 10px; padding: 6px 10px; cursor: pointer; display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.code-chip b { font-size: 20px; letter-spacing: 3px; color: var(--clay-dark); }
.code-chip span { font-size: 12px; }
.hint { flex: 1; text-align: center; font-size: 24px; font-weight: 600; letter-spacing: 6px; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.hint small { font-size: 13px; letter-spacing: 0; color: var(--muted); font-weight: 400; margin-left: 6px; }
.hint .label { font-size: 14px; letter-spacing: 0; color: var(--muted); font-weight: 400; margin-right: 8px; }
.hint.solved { color: var(--good); }
.top-right { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.round { color: var(--muted); font-size: 14px; }
.timer { min-width: 54px; text-align: center; font-weight: 700; font-size: 20px; background: var(--bg2); border-radius: 999px; padding: 4px 12px; }
.timer:empty { visibility: hidden; }
.timer.low { background: var(--bad); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }

.main { flex: 1; display: grid; grid-template-columns: 210px 1fr 290px; min-height: 0; }
.players { background: var(--panel); border-right: 2px solid var(--line); overflow-y: auto; padding: 10px; }
.pl { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; margin-bottom: 6px; background: #fff; border: 2px solid transparent; }
.pl.me { border-color: var(--line); }
.pl.guessed { background: var(--good-bg); }
.pl.drawer { border-color: var(--clay); }
.pl.away { opacity: .55; }
.pl .badge.away { background: var(--muted); }
.pl .rank { width: 20px; color: var(--muted); font-size: 13px; text-align: right; }
.pl .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.pl .who { flex: 1; min-width: 0; }
.pl .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .sc { font-size: 12px; color: var(--muted); }
.pl .badge { font-size: 11px; background: var(--clay); color: #fff; border-radius: 6px; padding: 1px 6px; }
.pl .badge.host { background: var(--bg2); color: var(--ink); }

.stage { position: relative; min-width: 0; min-height: 0; overflow: hidden;
  background: radial-gradient(ellipse at 50% 35%, #fff8f0 0, #efe2d3 60%, #e2d0bd 100%); }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.help-tip { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--muted); background: rgba(255,250,244,.85); padding: 4px 10px; border-radius: 999px; pointer-events: none; white-space: nowrap; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; }
.help-tip:empty { display: none; }
.cut-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.help-tip { transition: opacity .6s ease; }
.help-tip.faded { opacity: 0; }

.tools { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(640px, calc(100% - 20px)); background: rgba(255,250,244,.95); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.tool-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.tool { flex: 1; min-width: 70px; border: 2px solid var(--line); background: #fff; border-radius: 9px; padding: 6px 4px; cursor: pointer; font-weight: 500; }
.tool.on { background: var(--clay); color: #fff; border-color: var(--clay-dark); }
.sliders { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.sliders label { display: flex; align-items: center; gap: 6px; }
.sliders input[type=range] { width: 110px; accent-color: var(--clay); }
.sliders .chk input { accent-color: var(--clay); }
.hist-btns { display: flex; gap: 6px; margin-left: auto; }
.swatches { display: flex; gap: 5px; flex-wrap: wrap; }
.sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(0,0,0,.12); cursor: pointer; padding: 0; }
.sw.on { outline: 3px solid var(--ink); outline-offset: 1px; }

.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(60,40,25,.28); padding: 16px; }
.overlay.light { background: transparent; place-items: start center; pointer-events: none; }
.overlay.light .card { pointer-events: auto; margin-top: 46px; }
.card { background: var(--panel); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); border: 2px solid var(--line); width: min(420px, 100%); text-align: center; max-height: 100%; overflow-y: auto; }
.card h2 { margin: 0 0 6px; font-size: 24px; }
.card p { margin: 6px 0; color: var(--muted); }
.big-code { font-size: 44px; font-weight: 700; letter-spacing: 10px; color: var(--clay-dark); margin: 4px 0; }
.share-row { display: flex; gap: 6px; justify-content: center; margin: 8px 0 16px; flex-wrap: wrap; }
.set-row { display: flex; gap: 10px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.set-row label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; text-align: left; }
.set-row select { padding: 6px 10px; border-radius: 9px; border: 2px solid var(--line); background: #fff; }
.word-choices { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.word-choices .btn { font-size: 18px; text-transform: capitalize; }
.reveal-word { font-size: 30px; font-weight: 700; color: var(--clay-dark); text-transform: capitalize; }
.gains { list-style: none; padding: 0; margin: 12px 0 0; text-align: left; }
.gains li { display: flex; justify-content: space-between; padding: 3px 8px; }
.gains .plus { color: var(--good); font-weight: 600; }
.gains .zero { color: var(--muted); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 18px 0 8px; }
.pod { width: 96px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pod .bar { width: 100%; border-radius: 10px 10px 4px 4px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 22px; }
.pod .nm { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .sc { font-size: 12px; color: var(--muted); }
.mini-timer { font-size: 13px; color: var(--muted); margin-top: 10px; }

.chat { background: var(--panel); border-left: 2px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.log { flex: 1; overflow-y: auto; padding: 10px; font-size: 14px; }
.msg { padding: 4px 8px; border-radius: 8px; word-wrap: break-word; }
.msg:nth-child(even) { background: rgba(0,0,0,.025); }
.msg b { margin-right: 4px; }
.msg.sys { font-weight: 600; }
.msg.good { color: var(--good); background: var(--good-bg); }
.msg.bad { color: var(--bad); }
.msg.close { color: var(--close); }
.msg.info { color: var(--clay-dark); }
.msg.secret { background: var(--secret); }
.chat-form { padding: 10px; border-top: 2px solid var(--line); }
.chat-form input { width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; outline: none; }
.chat-form .hide-chat { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.chat-form .hide-chat input { width: auto; padding: 0; accent-color: var(--clay); }

@media (max-width: 900px) {
  .main { grid-template-columns: 1fr; grid-template-rows: auto minmax(300px, 1fr) 190px; }
  .players { display: flex; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 2px solid var(--line); padding: 6px; }
  .pl { margin: 0; flex: none; padding: 4px 8px; }
  .pl .rank { display: none; }
  .chat { border-left: 0; border-top: 2px solid var(--line); }
  .top { flex-wrap: wrap; gap: 6px; padding: 8px; }
  .hint { order: 3; flex-basis: 100%; font-size: 20px; }
  .top-right { margin-left: auto; }
  .tools { bottom: 6px; padding: 6px; gap: 5px; }
  .tool { min-width: 0; padding: 4px 2px; font-size: 13px; }
  .sliders input[type=range] { width: 80px; }
}

/* ---------- clay avatars (claymation: poses held on frames, steps()) ---------- */
.av { display: block; overflow: visible; flex: none; }
.av .rig, .av .eyes, .av .face { transform-box: fill-box; }
.av .rig { transform-origin: 50% 100%; animation: av-idle 1.8s steps(1, end) infinite; }
.av .eyes { transform-origin: 50% 50%; animation: av-blink 4.2s steps(1, end) infinite; }
.av.happy .rig { animation: av-jump 1s steps(1, end) infinite; }
.av.happy .av-shadow { transform-box: fill-box; transform-origin: 50% 50%; animation: av-shadow 1s steps(1, end) infinite; }
.av.busy .rig { animation: av-busy 1.1s steps(1, end) infinite; }
.av.pop .rig { animation: av-pop .6s steps(1, end) 1; }
@keyframes av-idle {
  0%   { transform: scale(1, 1); }
  25%  { transform: scale(1.035, .965); }
  50%  { transform: scale(1, 1); }
  75%  { transform: scale(.97, 1.03) translateY(-1px); }
}
@keyframes av-blink { 0% { transform: scaleY(1); } 93% { transform: scaleY(.12); } 96% { transform: scaleY(1); } }
@keyframes av-jump {
  0%  { transform: scale(1.12, .86); }
  17% { transform: translateY(-10px) scale(.9, 1.12); }
  34% { transform: translateY(-17px) scale(1, 1) rotate(-4deg); }
  50% { transform: translateY(-12px) scale(1, 1) rotate(4deg); }
  67% { transform: translateY(-3px) scale(.95, 1.06); }
  84% { transform: scale(1.1, .9); }
}
@keyframes av-shadow { 0% { transform: scale(1); } 17% { transform: scale(.8); } 34% { transform: scale(.65); } 50% { transform: scale(.75); } 67% { transform: scale(.92); } 84% { transform: scale(1.05); } }
@keyframes av-busy {
  0%  { transform: rotate(-5deg) scale(1.02, .98); }
  25% { transform: rotate(0deg) translateY(-2px); }
  50% { transform: rotate(5deg) scale(1.02, .98); }
  75% { transform: rotate(0deg) translateY(-2px); }
}
@keyframes av-pop {
  0%  { transform: scale(1.25, .7); }
  20% { transform: scale(.82, 1.22) translateY(-6px); }
  45% { transform: scale(1.1, .92); }
  70% { transform: scale(.96, 1.04); }
  90% { transform: scale(1, 1); }
}
@media (prefers-reduced-motion: reduce) { .av .rig, .av .eyes, .av .av-shadow { animation: none !important; } }

/* avatar picker */
.picker { margin-bottom: 16px; }
.picker-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.picker-stage { width: 104px; height: 104px; border-radius: 18px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #fff 0, #f3e3d2 75%); border: 2px solid var(--line); cursor: pointer; }
.picker-name { font-size: 22px; font-weight: 600; }
.picker-sub { font-size: 13px; color: var(--muted); }
.picker-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.pick { border: 2px solid transparent; border-radius: 12px; background: #fff; padding: 2px; cursor: pointer; display: grid; place-items: center; aspect-ratio: 1; }
.pick:hover { border-color: var(--line); }
.pick.on { border-color: var(--clay); background: #fff4ec; }
.pick .av { width: 100%; height: auto; }

/* avatars in game UI */
.pl .av { margin: -6px 0 -4px; }
.lobby-crew { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; margin: 4px 0 8px; }
.gains li { align-items: center; }
.gains .g-who { display: flex; align-items: center; gap: 6px; }
.pod .av { margin-bottom: -4px; }
.wait-av { display: flex; justify-content: center; margin-bottom: 4px; }
.shape-pick { position: relative; display: inline-block; }
.shape-pick #shapeBtn b { font-weight: 700; }
/* the panel of shapes opens upward, above the toolbar */
.shape-panel { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 40; width: min(340px, 86vw); background: #fff; border: 2px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 8px; }
.shape-panel[hidden] { display: none; }
.shape-panel-head { font-size: 12px; color: var(--muted); margin: 0 2px 6px; }
.shape-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.shape-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px 5px; border: 2px solid transparent; border-radius: 10px; background: #fbf6f1; cursor: pointer; font: inherit; color: var(--ink); }
.shape-opt:hover, .shape-opt:focus-visible { border-color: var(--clay); outline: none; }
.shape-opt.on { border-color: var(--clay); background: #fff1e6; }
.shape-pic { width: 54px; height: 54px; background: center / contain no-repeat; }
.shape-label { font-size: 12px; font-weight: 600; }

/* ---------- title screen ---------- */
.title-screen { position: relative; min-height: 100%; display: grid; place-items: center; padding: 24px 16px; overflow: hidden;
  background: radial-gradient(circle at 20% 15%, #ffd9bf 0, transparent 40%), radial-gradient(circle at 85% 80%, #e3d0f2 0, transparent 40%), radial-gradient(circle at 80% 10%, #d3ecd9 0, transparent 30%), var(--bg); }
.title-inner { position: relative; z-index: 1; text-align: center; width: min(760px, 100%); }
.title-logo { margin: 0; display: flex; justify-content: center; gap: .02em; font-weight: 700; line-height: 1; font-size: clamp(64px, 17vw, 160px); user-select: none; }
.title-logo span { display: inline-block; color: var(--c); cursor: pointer; filter: url(#sk-boil);
  text-shadow: 0 .045em 0 color-mix(in srgb, var(--c) 68%, #000), 0 .09em .06em rgba(70, 40, 20, .25);
  transform-origin: 50% 100%; animation: letter-bob 1.6s steps(1, end) infinite; }
.title-logo span.pop { animation: av-pop .6s steps(1, end) 1; }
@keyframes letter-bob {
  0%  { transform: translateY(0) rotate(var(--r, 0deg)) scale(1, 1); }
  25% { transform: translateY(-.04em) rotate(calc(var(--r, 0deg) * -1)) scale(.97, 1.03); }
  50% { transform: translateY(0) rotate(var(--r, 0deg)) scale(1.03, .97); }
  75% { transform: translateY(-.02em) rotate(0deg) scale(1, 1); }
}
.title-tag { font-size: clamp(16px, 3vw, 22px); color: var(--muted); margin: 10px 0 18px; }
.parade { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 3px; margin: 0 auto 26px; max-width: 760px; }
.parade button { background: none; border: 0; padding: 0; cursor: pointer; }
.title-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.btn.huge { font-size: 26px; padding: 14px 64px; border-radius: 16px; box-shadow: 0 5px 0 var(--clay-dark); }
.btn.huge:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--clay-dark); }
.deco { position: absolute; border-radius: 58% 42% 55% 45% / 50% 60% 40% 50%; opacity: .55; filter: url(#sk-boil);
  box-shadow: inset -10px -10px 0 rgba(0,0,0,.08), inset 8px 8px 0 rgba(255,255,255,.25); animation: squish 4s ease-in-out infinite; }
.d1 { width: 140px; height: 120px; background: #f0a17f; left: -40px; top: 12%; }
.d2 { width: 90px; height: 84px; background: #a8d68f; right: 6%; top: 8%; animation-delay: -1s; }
.d3 { width: 170px; height: 150px; background: #c3b0ea; right: -50px; bottom: 10%; animation-delay: -2s; }
.d4 { width: 70px; height: 64px; background: #f5d77a; left: 8%; bottom: 8%; animation-delay: -3s; }
.how-wrap { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: rgba(60,40,25,.3); padding: 16px; }
.how { text-align: left; }
.how h2 { text-align: center; }
.how ol { padding-left: 20px; margin: 12px 0 18px; line-height: 1.45; }
.how li { margin-bottom: 8px; }
.how .btn { display: block; margin: 0 auto; }
.back-link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; margin-bottom: 8px; font-size: 14px; }
.back-link:hover { color: var(--clay-dark); }
@media (prefers-reduced-motion: reduce) { .title-logo span, .deco { animation: none; } }

/* ---------- 3D logo + avatar maker ---------- */
.logo-wrap { position: relative; }
.logo3d { display: block; width: 100%; height: auto; aspect-ratio: 2.6 / 1; margin: -10px auto -6px; }
.logo3d:not(.ready) { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.logo3d.ready + .title-logo { display: none; }
.home-card { width: min(820px, 100%); }
.logo img { height: 64px; width: auto; display: block; margin: -6px 0 4px -8px; }
.home-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; margin-top: 10px; align-items: start; }
.join-side { padding-top: 6px; }
.maker { display: flex; flex-direction: column; gap: 8px; }
.cast-pick { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; gap: 6px; }
.cast-pick b { text-align: center; font-size: 18px; font-weight: 600; }
.cast-pick .arr { height: 36px; border-radius: 10px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-size: 20px; line-height: 1; padding: 0; color: var(--ink); }
.cast-pick .arr:hover { border-color: var(--clay); }
.maker-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }
.maker-btns .btn:not(.small) { flex: 1 1 140px; }
.maker-btns #partsBtn { flex-basis: 100%; }
.maker-parts { display: flex; flex-direction: column; gap: 6px; }
.maker-parts-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
.maker-rows.dim { opacity: .45; }
.tut-note { font-size: 12px; color: var(--muted) !important; }
.maker-stage { width: 100%; height: 210px; border-radius: 18px; display: grid; place-items: center; cursor: pointer; border: 2px solid var(--line);
  background: radial-gradient(circle at 50% 35%, #fff 0, #f5e8da 60%, #ead6c2 100%); padding: 0; }
.shuffle { position: relative; }
.maker-rows { display: flex; flex-direction: column; gap: 6px; }
.mrow { display: grid; grid-template-columns: 64px 30px 1fr 30px; align-items: center; gap: 4px; }
.mrow > span { font-size: 13px; color: var(--muted); }
.mrow .arr { height: 30px; border-radius: 8px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.mrow .arr:hover { border-color: var(--clay); }
.mrow b { text-align: center; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 4px; }
.crow > span { font-size: 13px; color: var(--muted); }
.crow .sws { display: flex; flex-wrap: wrap; gap: 3px; }
.crow .sw { width: 20px; height: 20px; }
@media (max-width: 720px) { .home-grid { grid-template-columns: 1fr; } }

/* ---------- Quick Play ---------- */
.btn.quick { display: flex; flex-direction: column; align-items: center; gap: 0; line-height: 1.15; margin-bottom: 10px; }
.btn.quick small { font-size: 12px; font-weight: 400; opacity: .9; }
.btn.secondary { background: #fff; border-color: var(--line); box-shadow: 0 3px 0 var(--line); }
.pub-badge { display: inline-block; background: #e3d0f2; color: #5b3d86; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; margin-bottom: 6px; }
.auto-timer { font-size: 18px; font-weight: 600; color: var(--clay-dark); margin: 10px 0; }
.small-note { font-size: 13px; }
.leave { margin-left: 4px; }

/* =================================================================
   VIBRANT THEME — bold, saturated "toy box" colors
   ================================================================= */
:root {
  --bg: #f3ecff;
  --bg2: #e4d6ff;
  --panel: #ffffff;
  --ink: #23124f;
  --muted: #6b5aa6;
  --line: #e2d4ff;
  --clay: #ff2d87;
  --clay-dark: #c8115f;
  --good: #10b867;
  --good-bg: #d8f8e7;
  --bad: #f2333f;
  --close: #f08c00;
  --secret: #efe3ff;
  --shadow: 0 10px 30px rgba(43, 12, 120, .25);
  --stage: radial-gradient(ellipse at 50% 30%, #c39bff 0%, #8a4dff 50%, #5b25e0 100%);
  --hero: radial-gradient(ellipse at 50% 25%, #7a3dff 0%, #4a1fd1 50%, #2a0f8a 100%);
}
body { background: var(--bg); }

/* title + home backdrop: deep electric violet with candy-colored clay blobs */
.title-screen, .home { background: var(--hero); }
.title-tag { color: #fff; font-weight: 500; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.title-actions .btn.ghost { color: #fff; border-color: rgba(255,255,255,.55); }
.title-actions .btn.ghost:hover { background: rgba(255,255,255,.12); }
.d1 { background: #ff2d87; opacity: .9; }
.d2 { background: #1fcf4a; opacity: .9; }
.d3 { background: #ffae00; opacity: .9; }
.d4 { background: #1e8fff; opacity: .9; }
.deco { box-shadow: inset -12px -12px 0 rgba(0,0,0,.14), inset 10px 10px 0 rgba(255,255,255,.35); }
.parade .av { filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); }

.btn.primary { background: var(--clay); border-color: var(--clay-dark); box-shadow: 0 4px 0 var(--clay-dark); }
.btn.primary:hover { background: #ff4b99; }
.btn.huge { box-shadow: 0 6px 0 var(--clay-dark), 0 12px 24px rgba(255, 45, 135, .45); }
.btn.quick { background: linear-gradient(135deg, #ff2d87, #ff6a00); border-color: #c8115f; }
.btn.secondary { color: var(--ink); }

/* photo logo (Blender render) */
.logo-photo { display: none; width: 114%; max-width: 114%; height: auto; margin: -10% -7% -7%; cursor: pointer; filter: drop-shadow(0 10px 20px rgba(0,0,0,.25)); }
@media (max-width: 520px) { .logo-photo { width: 106%; max-width: 106%; margin: -9% -3% -6%; } }
.logo-wrap.has-photo .logo-photo { display: block; }
.logo-wrap.has-photo .logo3d, .logo-wrap.has-photo .title-logo { display: none; }
.logo img { height: 70px; margin: -14px 0 0 -14px; }
.css-pop { animation: canvas-pop .6s steps(1, end) 1; transform-origin: 50% 100%; }
@keyframes canvas-pop { 0% { transform: scale(1.25, .75); } 20% { transform: scale(.85, 1.2) translateY(-6%); } 45% { transform: scale(1.08, .93); } 70% { transform: scale(.97, 1.03); } 90% { transform: none; } }

/* home card */
.home-card { border: 0; box-shadow: 0 20px 60px rgba(20, 0, 80, .45); }
.maker-stage { background: var(--stage); border: 0; }
.mrow .arr { border-color: var(--line); color: var(--clay); font-weight: 700; }
.mrow .arr:hover { background: var(--clay); color: #fff; border-color: var(--clay); }

/* game screen */
.top { background: linear-gradient(90deg, #ff2d87, #8b3dff 55%, #1e8fff); border-bottom: 0; color: #fff; }
.code-chip { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.7); color: #fff; }
.code-chip b { color: #fff; }
.hint { color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.hint small, .hint .label, .round { color: rgba(255,255,255,.85); }
.hint.solved { color: #b6ffd6; }
.timer { background: #fff; color: var(--ink); }
.timer.low { background: #ffd23f; color: #23124f; }
.leave { color: #fff; border-color: rgba(255,255,255,.6); }
.stage { background: var(--stage); }
.help-tip { background: rgba(255,255,255,.9); color: var(--ink); }
.players, .chat { background: #fff; border-color: var(--line); }
.pl { background: #f7f2ff; }
.pl.drawer { border-color: var(--clay); }
.pl .badge { background: var(--clay); }
.tools { border: 0; }
.tool.on { background: var(--clay); border-color: var(--clay-dark); }
.overlay { background: rgba(35, 10, 100, .35); }
.big-code { color: var(--clay); }
.pub-badge { background: #ffe14d; color: #5a3a00; }
.auto-timer { color: var(--clay); }
.reveal-word { color: var(--clay); }

/* =================================================================
   CONFETTI THEME — bright white with candy polka dots (like a clay box)
   ================================================================= */
:root {
  --bg: #ffffff;
  --bg2: #fff2e6;
  --panel: #ffffff;
  --ink: #2b1a12;
  --muted: #7a5f50;
  --line: #f0e3d8;
  --clay: #ff5a1f;
  --clay-dark: #d63c06;
  --secret: #fff1e0;
  --shadow: 0 10px 28px rgba(90, 40, 10, .14);
  --dots:
    radial-gradient(circle, #ff7a1a 0 11px, transparent 12px) 40px 60px / 330px 290px,
    radial-gradient(circle, #ffc21a 0 14px, transparent 15px) 210px 190px / 410px 370px,
    radial-gradient(circle, #1e9bff 0 10px, transparent 11px) 300px 30px / 370px 430px,
    radial-gradient(circle, #6cc644 0 13px, transparent 14px) 120px 310px / 470px 390px,
    radial-gradient(circle, #ef3b2d 0 8px, transparent 9px) 330px 250px / 290px 350px,
    radial-gradient(circle, #ffc21a 0 7px, transparent 8px) 80px 160px / 250px 230px,
    radial-gradient(circle, #1e9bff 0 15px, transparent 16px) 260px 380px / 530px 470px,
    radial-gradient(circle, #ef3b2d 0 6px, transparent 7px) 380px 120px / 310px 270px;
  --stage: radial-gradient(ellipse at 50% 35%, #ffffff 0%, #fff7ee 55%, #ffe9d6 100%);
  --hero: var(--dots), #ffffff;
}
body { background: #fff; }
.title-screen, .home { background: var(--dots), #ffffff; }
.deco { display: none; }
.title-tag { color: var(--ink); text-shadow: none; font-weight: 600; }
.title-actions .btn.ghost { color: var(--ink); border-color: var(--line); background: #fff; }
.title-actions .btn.ghost:hover { background: #fff6ee; }
.parade { background: rgba(255,255,255,.85); border-radius: 22px; padding: 6px 10px; box-shadow: 0 6px 20px rgba(90,40,10,.08); }
.parade .av { filter: none; }
.logo-photo { filter: none; }

.btn.primary { background: var(--clay); border-color: var(--clay-dark); box-shadow: 0 4px 0 var(--clay-dark); }
.btn.primary:hover { background: #ff6e3a; }
.btn.huge { box-shadow: 0 6px 0 var(--clay-dark), 0 12px 24px rgba(255, 90, 31, .35); }
.btn.quick { background: linear-gradient(135deg, #ff5a1f, #ef3b2d); border-color: #c42a10; }

.home-card { border: 3px solid #fff; box-shadow: 0 16px 50px rgba(90, 40, 10, .18); }
.maker-stage { background: var(--stage); border: 2px solid var(--line); }
.mrow .arr { color: var(--clay); }
.mrow .arr:hover { background: var(--clay); border-color: var(--clay); color: #fff; }

/* game screen */
.top { background: #fff; color: var(--ink); border-bottom: 0; position: relative;
  box-shadow: 0 6px 0 -2px #fff, 0 2px 12px rgba(90,40,10,.08); }
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px;
  background: linear-gradient(90deg, #ef3b2d 0 16.6%, #ff7a1a 0 33.3%, #ffc21a 0 50%, #6cc644 0 66.6%, #1e9bff 0 83.3%, #8b3dff 0); }
.code-chip { background: #fff6ee; border-color: var(--clay); color: var(--muted); }
.code-chip b { color: var(--clay); }
.hint { color: var(--ink); text-shadow: none; }
.hint small, .hint .label, .round { color: var(--muted); }
.hint.solved { color: var(--good); }
.timer { background: #fff2e6; color: var(--ink); }
.timer.low { background: #ef3b2d; color: #fff; }
.leave { color: var(--ink); border-color: var(--line); }
.stage { background: var(--stage); }
.pl { background: #fffaf5; }
.overlay { background: rgba(60, 25, 5, .25); }
.pub-badge { background: #ffc21a; color: #5a3a00; }
#botsBtn { margin-top: 10px; }

/* ---------- sculpting toolbar: 7 tools in two even rows ---------- */
.tool-btns { display: grid; grid-template-columns: repeat(4, 1fr); }
.tool { min-width: 0; }

/* ---------- PC: a wide, low toolbar (all the tools in one row) so the clay sits lower and more centered ---------- */
@media (min-width: 1100px) {
  .tools { width: min(1100px, calc(100% - 24px)); }
  .tool-btns { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .tool { padding: 7px 2px; white-space: nowrap; font-size: 13px; }
}

/* ---------- in-game "are you sure?" box ---------- */
.confirm-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(60, 25, 5, .35); }
.confirm-wrap[hidden] { display: none; }
.confirm-card { width: min(360px, 100%); }
.confirm-card p { color: var(--ink); font-size: 17px; margin: 4px 0 16px; }
.confirm-btns { display: flex; gap: 10px; justify-content: center; }
.confirm-btns .btn { min-width: 110px; }

/* ---------- undo / redo ---------- */
.btn:disabled { opacity: .4; cursor: default; transform: none; }

/* ---------- sculpting tools on phones ---------- */
.tools-min { display: none; }
@media (max-width: 900px) {
  .main { grid-template-rows: auto minmax(300px, 1fr) 150px; }
  .tools { gap: 5px; }
  .tools-min { display: block; align-self: flex-end; margin: -2px 0 -2px; padding: 2px 8px; font-size: 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
  .tools.min .sliders, .tools.min .swatches { display: none; }
  .sliders { gap: 6px 10px; font-size: 12px; }
  .sliders input[type=range] { width: 70px; }
  .hist-btns { margin-left: 0; width: 100%; }
  .hist-btns .btn { flex: 1; }
  .swatches { flex-wrap: nowrap; overflow-x: auto; padding: 2px; scrollbar-width: none; }
  .sw { flex: none; width: 26px; height: 26px; }
}

/* ---------- phones: a tighter top bar and toolbar, folded part pickers ---------- */
.parts-toggle { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: default; }
.parts-toggle .caret { display: none; }
@media (max-width: 720px) {
  .parts-toggle { cursor: pointer; font-weight: 600; color: var(--ink); }
  .parts-toggle .caret { display: inline-block; transition: transform .2s; }
  .maker-parts.open .parts-toggle .caret { transform: rotate(180deg); }
  .maker-parts:not(.open) .maker-rows { display: none; }
  .maker-stage { height: 170px; }
}
@media (max-width: 600px) {
  .top { padding: 6px 8px; gap: 4px 6px; min-height: 0; }
  #copyNote { display: none; }
  .code-chip { padding: 3px 8px; }
  .top-right { gap: 6px; }
  .round { font-size: 12px; }
  .timer { min-width: 42px; font-size: 16px; padding: 2px 10px; }
  .hint { font-size: 18px; }
  .tool-btns { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .tool { font-size: 12px; padding: 5px 1px; }
}

/* ---------- beginner helpers: tool options, Front/Side/Top views ---------- */
.tool-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tool-opts[hidden] { display: none; }
.tool-opts em { font-style: normal; font-size: 12px; }
.depth-row { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); }
.sliders .depth-row input[type=range] { width: 110px; accent-color: var(--clay); }
.depth-axis { display: inline-flex; gap: 3px; }
.depth-axis .opt { padding: 1px 8px; font-size: 14px; line-height: 1.3; }
.opt { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 12px; cursor: pointer; font: inherit; font-weight: 500; color: var(--ink); }
.opt.on { background: var(--clay); border-color: var(--clay-dark); color: #fff; }
.opt:active { transform: scale(.96); }
#reshapeBtn[aria-expanded="true"] { background: var(--clay); color: #fff; border-color: var(--clay-dark); }
.view-btns { position: absolute; top: 40px; right: 10px; display: flex; flex-direction: column; gap: 4px; }
.view-btns[hidden] { display: none; }
.view-btns button { border: 2px solid var(--line); background: rgba(255,255,255,.9); border-radius: 8px; padding: 3px 9px; font: inherit; font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer; }
.view-btns button:hover { border-color: var(--clay); }
@media (max-width: 900px) {
  .tool-opts > span { display: none; }
  .opt { padding: 2px 9px; font-size: 12px; }
  .view-btns { top: 36px; right: 6px; }
  .tools.min .tool-opts { display: none; }
}

/* ---------- word difficulty ---------- */
.word-pick { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 120px; line-height: 1.1; }
.word-pick .wp-tier { font-size: 11px; font-weight: 500; text-transform: none; opacity: .9; }
.word-pick.medium { background: #e08a1e; border-color: #b96d10; }
.word-pick.hard { background: #c0392b; border-color: #922b20; }
.lvl-note { font-size: 13px; }
.tier-chip { display: inline-block; vertical-align: middle; font-size: 11px; letter-spacing: 0; font-weight: 600; text-transform: uppercase; color: #fff; background: #4caf50; border-radius: 999px; padding: 2px 8px; margin-right: 10px; text-shadow: none; }
.tier-chip.medium { background: #e08a1e; }
.tier-chip.hard { background: #c0392b; }

/* ---------- end-of-game sculpture gallery ---------- */
.card.wide { width: min(760px, 100%); }
.gallery { margin-top: 14px; border-top: 2px solid var(--line); padding-top: 10px; }
.gallery h3 { margin: 4px 0 10px; font-size: 17px; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gal-card { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; transition: transform .15s; }
.gal-card.fav { border-color: #f2b300; box-shadow: 0 0 0 3px rgba(242,179,0,.25); }
.gal-card.mine-vote { transform: translateY(-2px); }
.gal-pic { position: relative; width: 100%; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: radial-gradient(ellipse at 50% 35%, #fff8f0 0, #efe2d3 60%, #e2d0bd 100%); display: grid; place-items: center; }
.gal-pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gal-missing { font-size: 12px; color: var(--muted); }
.gal-crown { position: absolute; top: 4px; right: 6px; font-size: 22px; color: #f2b300; text-shadow: 0 1px 0 #fff; display: none; }
.gal-card.fav .gal-crown { display: block; }
.gal-word { font-weight: 700; text-transform: capitalize; }
.gal-by { font-size: 12px; color: var(--muted); }
.gal-count { font-size: 12px; font-weight: 600; color: var(--clay-dark); min-height: 15px; }
.gal-yours { font-size: 12px; color: var(--muted); padding: 4px 0; }
.gal-card .btn { padding: 3px 14px; }
@media (max-width: 520px) { .gal-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- tutorial ---------- */
.tut { padding: 6px 4px; }
.tut-progress { font-size: 12px; font-weight: 600; color: var(--clay-dark); text-transform: uppercase; letter-spacing: .5px; }
.tut h3 { margin: 4px 0; font-size: 19px; }
.tut p { margin: 4px 0 10px; color: var(--ink); line-height: 1.4; }
.tut-list { margin: 6px 0 0; padding-left: 22px; font-size: 13px; color: var(--muted); }
.tut-list li { margin: 3px 0; }
.tut-list li.now { color: var(--ink); font-weight: 600; }
.tut-list li.done { color: #3a9a4a; text-decoration: line-through; }
.tut-list li.done::marker { content: '✓  '; }
.tut-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.tut-done h3 { color: #3a9a4a; }
.tool.pulse { animation: tool-pulse 1.2s ease-in-out infinite; }
@keyframes tool-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,106,40,.0); } 50% { box-shadow: 0 0 0 4px rgba(255,106,40,.45); } }
@media (prefers-reduced-motion: reduce) { .tool.pulse { animation: none; outline: 3px solid rgba(255,106,40,.6); } }
#tutBtn2 { margin-top: 6px; }

/* ---------- title screen: the cast scattered around the logo ---------- */
.scatter { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.sc-item { position: absolute; width: var(--sz, 90px); height: var(--sz, 90px); transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); background: none; border: 0; padding: 0; cursor: pointer; pointer-events: auto; animation: sc-bob 3.2s ease-in-out infinite; }
@keyframes sc-bob { 0%, 100% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); } 50% { transform: translate(-50%, calc(-50% - 7px)) rotate(calc(var(--rot, 0deg) * -0.6)); } }
.sc-item:hover { filter: brightness(1.05); }
.sc-item[hidden] { display: none; }
.sc-item .av { width: 100% !important; height: 100% !important; filter: drop-shadow(0 5px 6px rgba(80,40,10,.18)); }
.sc-item.css-pop { animation: sc-pop .5s ease-out 1, sc-bob 3.2s ease-in-out .5s infinite; }
@keyframes sc-pop { 0% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1); } 30% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1.18, .82); } 60% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(.92, 1.1); } 100% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1); } }
@media (prefers-reduced-motion: reduce) { .sc-item, .sc-item.css-pop { animation: none; } }

/* ---------- save / share a sculpture ---------- */
.share-card { width: min(400px, 100%); }
.share-card h3 { margin: 0 0 10px; }
.share-prev { width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #efe2d3; }
.share-prev img { width: 100%; height: 100%; display: block; }
.share-base { display: inline-flex; gap: 6px; align-items: center; margin: 10px 0; font-size: 14px; color: var(--ink); }
.share-views { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.share-views[hidden] { display: none; }
.share-views .btn.on { background: var(--clay); border-color: var(--clay-dark); color: #fff; }
.share-note { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.share-base input { accent-color: var(--clay); }
.share-card .confirm-btns { flex-wrap: wrap; }
.share-card .confirm-btns .btn { min-width: 0; }
.gal-save { position: absolute; left: 6px; bottom: 6px; font: inherit; font-size: 11px; font-weight: 600; background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; cursor: pointer; color: var(--ink); }
.gal-save:hover { border-color: var(--clay); }

/* ---------- lobby: our own words ---------- */
.own-words { margin: -4px auto 12px; max-width: 360px; text-align: left; }
.own-words[hidden] { display: none; }
.own-words textarea { width: 100%; box-sizing: border-box; border: 2px solid var(--line); border-radius: 9px; padding: 6px 8px; font: inherit; font-size: 13px; resize: vertical; }
.own-words small { font-size: 12px; color: var(--muted); }

/* ---------- Extras: pieces to stick on ---------- */
.extra-opts { flex-wrap: wrap; }
.extra-opts .opt { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 8px 3px 5px; }
.extra-opts .x-ico { font-size: 15px; line-height: 1; }

/* tutorial: progress dots, a cheer after each step, a tip */
.tut-dots { display: flex; gap: 5px; margin: 2px 0 6px; }
.tut-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.tut-dots span.done { background: #3a9a4a; }
.tut-dots span.now { background: var(--clay); transform: scale(1.25); }
.tut-nice { display: inline-block; background: #e6f6e8; color: #2d7a3a; font-weight: 700; border-radius: 999px; padding: 2px 12px; margin-bottom: 6px; animation: tut-pop .4s ease-out; }
@keyframes tut-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.tut-tip { font-size: 13px; color: var(--muted) !important; background: #fff7ee; border-radius: 8px; padding: 6px 8px; }
@media (prefers-reduced-motion: reduce) { .tut-nice { animation: none; } }

/* ---------- the room's difficulty (Play screen) ---------- */
.diff-field { display: block; margin: -2px 0 12px; }
.diff-field[hidden] { display: none; }
.name-field { margin: 2px 0 0; }
.diff-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.diff-pick button { font: inherit; font-weight: 600; font-size: 14px; padding: 8px 4px; border-radius: 10px; border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.diff-pick button:hover { border-color: var(--clay); }
.diff-pick button.on { background: var(--clay); border-color: var(--clay); color: #fff; }
.diff-pick button[data-diff="easy"].on { background: #3a9a4a; border-color: #3a9a4a; }
.diff-pick button[data-diff="hard"].on { background: #8b3dff; border-color: #8b3dff; }

/* ---------- player menu: mute / remove ---------- */
.pl.can-menu { cursor: pointer; position: relative; }
.pl.can-menu:hover { background: rgba(255, 106, 40, .06); }
.pl-menu { position: fixed; z-index: 60; background: #fff; border: 2px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 4px; display: flex; flex-direction: column; min-width: 170px; }
.pl-menu button { font: inherit; font-size: 14px; text-align: left; background: none; border: 0; border-radius: 8px; padding: 7px 10px; cursor: pointer; color: var(--ink); }
.pl-menu button:hover, .pl-menu button:focus-visible { background: #fff1e6; outline: none; }

/* ---------- privacy links ---------- */
.title-foot, .home-foot { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--muted); }
.title-foot a, .home-foot a { color: inherit; }
.title-foot a:hover, .home-foot a:hover { color: var(--clay); }
.home-foot { display: block; text-align: center; }

/* the message that goes with a shared picture */
.share-msg { margin: 0 0 10px; padding: 8px 10px; background: #fff7ee; border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; line-height: 1.4; color: var(--ink); user-select: all; word-break: break-word; }

/* the cast fades in once their pictures are ready (no popping in one by one) */
.scatter { opacity: 0; transition: opacity .5s ease; }
.scatter.ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .scatter { transition: none; } }

.own-head { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }

/* making up your own word */
.write-word { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0 10px; }
.write-word input { flex: 1 1 200px; max-width: 280px; font: inherit; font-size: 18px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; }
.write-word input:focus { outline: none; border-color: var(--clay); }
.write-err { flex-basis: 100%; text-align: center; }
.word-pick.write-pick { background: #fff; color: var(--ink); border: 2px dashed var(--clay); }
.write-opt { display: flex; justify-content: center; gap: 6px; font-size: 13px; color: var(--ink); margin: -4px 0 10px; }

/* Fill, with the colors */
.sw-fill { display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 9px 0 6px; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; flex: none; }
.sw-fill:hover { border-color: var(--clay); }
.sw-fill.on { background: var(--clay); border-color: var(--clay); color: #fff; }
.sw-fill-ico { font-size: 14px; line-height: 1; }
