/* Chess Pals — a cozy playroom: deep blue night, cream cards, sunshine buttons.
   One fixed look (it's a game world), so no light/dark switching. Board colors come from
   the chosen theme (--light / --dark, set in main.js). */
:root {
  --bg: #263257;
  --bg-2: #31406c;
  --card: #fff8ea;
  --card-2: #f3e7cd;
  --ink: #23263a;
  --ink-soft: #5b5f78;
  --sun: #ffc93c;
  --sun-deep: #d6970f;
  --pink: #ff6fae;
  --pink-deep: #c9447f;
  --go: #36c48c;
  --go-deep: #1f8f62;
  --sky: #8fd0ff;
  --danger: #ff5a5f;
  --light: #eef3d2;
  --dark: #7fb069;
  --font: 'Fredoka', ui-rounded, 'Arial Rounded MT Bold', system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--font);
  font-weight: 600;
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.06) 0 2px, transparent 3px) 0 0 / 46px 46px,
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.05) 0 1.5px, transparent 2.5px) 0 0 / 34px 34px,
    var(--bg);
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; }
button:disabled { opacity: 0.4; cursor: default; }
input { font: inherit; }

#app { position: relative; height: 100%; height: 100dvh; max-width: 520px; margin: 0 auto; overflow: hidden; }

.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
}

/* ---------- shared pieces ---------- */
.big-btn {
  font-weight: 700;
  font-size: clamp(1.2rem, 5.6vw, 1.5rem);
  letter-spacing: 0.02em;
  background: var(--sun);
  color: var(--ink);
  border-radius: 22px;
  padding: 0.6em 1.1em 0.55em;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 6px 0 var(--sun-deep), 0 12px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.08s, box-shadow 0.08s;
}
.big-btn b { font-weight: 400; margin-right: 0.2em; }
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--sun-deep), 0 4px 8px rgba(0, 0, 0, 0.25); }
.big-btn--go { background: var(--go); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); box-shadow: 0 6px 0 var(--go-deep), 0 12px 20px rgba(0, 0, 0, 0.25); }
.big-btn--go:active { box-shadow: 0 2px 0 var(--go-deep), 0 4px 8px rgba(0, 0, 0, 0.25); }
.big-btn--pink { background: var(--pink); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); box-shadow: 0 6px 0 var(--pink-deep), 0 12px 20px rgba(0, 0, 0, 0.25); }
.big-btn--pink:active { box-shadow: 0 2px 0 var(--pink-deep), 0 4px 8px rgba(0, 0, 0, 0.25); }
.big-btn--small { font-size: 1.1rem; width: auto; padding: 0.5em 1.4em; }

.chip-btn {
  font-weight: 600;
  font-size: 0.98rem;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 999px;
  padding: 0.55em 1.05em;
}
.sheet .chip-btn { background: var(--card-2); color: var(--ink); }
.chip-btn:active { transform: scale(0.96); }

.link-btn { color: #fff; opacity: 0.9; font-size: 1rem; padding: 0.4em 0.8em; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, 0.4); }

.corner-btn {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 14px;
  width: 44px; height: 44px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.3rem;
}

.screen-head { font-weight: 700; font-size: 1.35rem; color: #fff; margin: 0; letter-spacing: 0.03em; text-align: center; }

/* ---------- title ---------- */
.screen--title { justify-content: center; gap: 10px; }
.title-art { display: flex; justify-content: center; align-items: flex-end; gap: 2px; height: 120px; }
.title-piece { width: 84px; height: 84px; animation: hop 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * 0.22s); filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.22)); }
.title-piece:nth-child(3) { width: 104px; height: 104px; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-16px) rotate(-5deg); } }

.logo { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: 0.92; }
.logo span { font-weight: 700; font-size: clamp(3rem, 17vw, 4.4rem); letter-spacing: 0.04em; color: var(--sun); text-shadow: 0 5px 0 var(--sun-deep), 0 10px 18px rgba(0, 0, 0, 0.3); }
.logo span + span { color: var(--pink); text-shadow: 0 5px 0 var(--pink-deep), 0 10px 18px rgba(0, 0, 0, 0.3); }
.tagline { margin: 4px 0 10px; color: #fff; opacity: 0.85; font-size: 1.05rem; }
.title-buttons { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.scoreboard { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.score { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.1); color: #fff; border-radius: 999px; padding: 6px 12px 6px 8px; font-size: 0.92rem; }
.score__av { font-size: 1.3rem; }
.score__name { max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score__badges { letter-spacing: 1px; }

/* ---------- setup ---------- */
.screen--setup { gap: 10px; }
.setup-top { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.back-btn { width: 44px; height: 44px; border-radius: 14px; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 1.1rem; display: grid; place-items: center; }
.back-btn--ghost { background: none; }
.setup-scroll { flex: 1; width: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px 2px 8px; -webkit-overflow-scrolling: touch; }
.setup-label { color: #fff; opacity: 0.8; font-weight: 600; font-size: 0.95rem; margin: 8px 4px 0; }

.player-card {
  display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center;
  background: var(--card); border-radius: 22px; padding: 12px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.18);
}
.player-card .help-toggle { grid-column: 1 / -1; }
.avatar-btn { width: 64px; height: 64px; border-radius: 20px; background: var(--card-2); font-size: 2.3rem; line-height: 1; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08); }
.avatar-btn:active { transform: scale(0.92) rotate(-6deg); }
.player-card__mid { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.name-input {
  width: 100%; border: 3px solid var(--card-2); background: #fff; border-radius: 14px;
  padding: 0.35em 0.6em; font-size: 1.2rem; font-weight: 700; color: var(--ink); text-transform: uppercase;
  -webkit-user-select: text; user-select: text;
}
.name-input:focus { outline: none; border-color: var(--sun); }
.color-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--ink-soft); }
.color-chip i { width: 26px; height: 26px; }

.help-toggle {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left;
  background: var(--card-2); border-radius: 16px; padding: 8px 12px; width: 100%;
}
.help-toggle b { grid-row: 1 / 3; font-size: 1.6rem; font-weight: 400; align-self: center; }
.help-toggle span { font-weight: 700; }
.help-toggle small { color: var(--ink-soft); font-weight: 500; font-size: 0.82rem; }
.help-toggle.is-on { background: #fff1b8; box-shadow: inset 0 0 0 3px var(--sun); }
.help-row .help-toggle { background: var(--card); }
.help-row .help-toggle.is-on { background: #fff1b8; }

.vs-row { display: flex; justify-content: center; gap: 10px; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button {
  background: rgba(255, 255, 255, 0.12); color: #fff; border-radius: 16px; padding: 10px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.86rem; line-height: 1.15;
}
.seg button b { font-size: 1.25rem; font-weight: 400; height: 28px; display: grid; place-items: center; }
.seg button small { opacity: 0.75; font-weight: 500; font-size: 0.74rem; }
.seg button[aria-checked='true'] { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 3px var(--sun); }
.swatch { display: inline-block; width: 24px; height: 24px; border-radius: 50%; border: 3px solid #4b3322; }
.swatch--w { background: #fff5df; }
.swatch--b { background: #4c4170; border-color: #1d1833; }

.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme {
  display: grid; grid-template-columns: 1fr 1fr; border-radius: 12px; overflow: hidden; position: relative;
  aspect-ratio: 1; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
}
.theme i { display: block; }
.theme span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 0.72rem; padding: 2px 0; }
.theme.is-on { box-shadow: 0 0 0 3px var(--sun), 0 3px 0 rgba(0, 0, 0, 0.2); }
.themes--small { grid-template-columns: repeat(4, 40px); gap: 6px; }
.themes--small .theme span { display: none; }

.who { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.who-btn { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.12); color: #fff; border-radius: 16px; padding: 8px 12px; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.who-btn b { font-size: 1.8rem; font-weight: 400; }
.who-btn.is-on { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 3px var(--sun); }

.buddies { display: flex; flex-direction: column; gap: 8px; }
.buddy {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left;
  background: rgba(255, 255, 255, 0.12); color: #fff; border-radius: 18px; padding: 10px 14px; position: relative;
}
.buddy__emoji { grid-row: 1 / 3; font-size: 2.3rem; font-weight: 400; }
.buddy__name { font-weight: 700; font-size: 1.08rem; }
.buddy__stars { color: var(--sun); letter-spacing: 1px; justify-self: end; }
.buddy__stars i { font-style: normal; opacity: 0.3; }
.buddy__blurb { grid-column: 2 / 4; font-size: 0.84rem; opacity: 0.8; font-weight: 500; }
.buddy__beat { position: absolute; top: -8px; right: 10px; background: var(--go); color: #fff; font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; }
.buddy.is-on { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 3px var(--sun); }
.buddy.is-on .buddy__stars { color: var(--sun-deep); }

/* ---------- game ---------- */
.screen--game { gap: 8px; padding-left: 8px; padding-right: 8px; justify-content: center; }
.board-area { width: 100%; display: flex; justify-content: center; padding: 8px 0; }
.board-wrap {
  position: relative;
  width: min(100%, calc(100dvh - 334px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  aspect-ratio: 1;
  border-radius: 14px;
  box-shadow: 0 0 0 6px #5a3f2a, 0 0 0 9px #3d2a1c, 0 14px 30px rgba(0, 0, 0, 0.4);
  touch-action: none;
}
.board, .pieces { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; }
.pieces { pointer-events: none; overflow: visible; }
.sq {
  position: absolute; width: 12.5%; height: 12.5%;
  left: calc(var(--x) * 12.5%); top: calc(var(--y) * 12.5%);
}
.sq--light { background: var(--light); }
.sq--dark { background: var(--dark); }
.coord { position: absolute; font-style: normal; font-weight: 700; font-size: clamp(8px, 2.4vw, 12px); opacity: 0.6; line-height: 1; }
.sq--light .coord { color: var(--dark); }
.sq--dark .coord { color: var(--light); }
.coord--file { right: 3px; bottom: 2px; }
.coord--rank { left: 3px; top: 3px; }
.mark { position: absolute; inset: 0; pointer-events: none; }

.sq.is-last::before, .sq.is-selected::before, .sq.is-hint::before, .sq.is-over::before, .sq.is-danger::before {
  content: ''; position: absolute; inset: 0;
}
.sq.is-last::before { background: rgba(255, 220, 70, 0.42); }
.sq.is-selected::before { background: rgba(255, 201, 60, 0.75); }
.sq.is-over::before { box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.85); }
.sq.is-danger::before { background: radial-gradient(circle, rgba(255, 90, 95, 0.45) 30%, rgba(255, 90, 95, 0) 72%); }
.sq.is-check { background: radial-gradient(circle, #ff5a5f 0%, #ff8a7a 40%, rgba(255, 90, 95, 0.25) 75%), var(--light); animation: checkPulse 1s ease-in-out infinite alternate; }
@keyframes checkPulse { from { filter: brightness(1); } to { filter: brightness(1.15); } }
.sq.is-hint::before { background: rgba(110, 220, 255, 0.55); animation: hintGlow 0.9s ease-in-out infinite alternate; }
@keyframes hintGlow { from { opacity: 0.5; } to { opacity: 1; } }
.sq.is-dot .mark::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 30%; height: 30%;
  transform: translate(-50%, -50%); border-radius: 50%; background: rgba(35, 38, 58, 0.28);
  animation: dotIn 0.18s ease-out;
}
.sq.is-cap .mark::after {
  content: ''; position: absolute; inset: 5%; border-radius: 50%;
  border: 5px solid rgba(255, 90, 95, 0.75);
  animation: dotIn 0.18s ease-out;
}
@keyframes dotIn { from { transform: translate(-50%, -50%) scale(0); } }
.sq.is-cap .mark::after { animation-name: ringIn; }
@keyframes ringIn { from { transform: scale(0.4); opacity: 0; } }

.piece {
  position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%;
  transition: transform 0.26s cubic-bezier(0.3, 1.25, 0.5, 1);
  will-change: transform;
}
.pieces.no-anim .piece { transition: none; }
.piece .pc { width: 90%; height: 90%; margin: 5%; transition: transform 0.15s; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.18)); }
.piece.is-moving { z-index: 3; }
.piece.is-lifted .pc { transform: translateY(-8%) scale(1.1); filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.25)); }
.piece.is-dragging { opacity: 0.25; }
.piece.is-captured { z-index: 4; animation: poof 0.42s ease-in forwards; }
@keyframes poof { 40% { opacity: 1; } to { opacity: 0; scale: 0.2; rotate: 200deg; translate: 0 -40%; } }
.piece.is-shaking .pc { animation: shake 0.42s; }
@keyframes shake { 20%, 60% { transform: translateX(-8%) rotate(-6deg); } 40%, 80% { transform: translateX(8%) rotate(6deg); } }
.piece.is-bouncing .pc { animation: boing 0.45s 2; }
@keyframes boing { 50% { transform: translateY(-18%) scale(1.06); } }
.piece.is-promoted .pc { animation: promoted 0.7s; }
@keyframes promoted { 0% { transform: scale(0.3) rotate(-30deg); } 60% { transform: scale(1.3) rotate(8deg); } 100% { transform: scale(1); } }
.piece.is-worried .pc { animation: jitter 0.9s ease-in-out infinite; }
@keyframes jitter { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }

.drag-ghost { position: absolute; left: 0; top: 0; z-index: 10; pointer-events: none; filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.3)); }

/* Sitting across the table: the top player's bar and Black's pieces face the far side. */
.is-across .bar--top { transform: rotate(180deg); }
.is-across .piece--b .pc, .is-across .bar--top .bar__caps .pc { transform: rotate(180deg); }
.is-across .piece--b.is-lifted .pc { transform: rotate(180deg) translateY(-8%) scale(1.1); }
.is-across .sq .coord { display: none; }

/* Player bars */
.bar {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.1); color: #fff; border-radius: 18px; padding: 8px 12px; min-height: 58px;
  transition: background 0.2s, box-shadow 0.2s;
}
.bar.is-turn { background: var(--card); color: var(--ink); box-shadow: 0 0 0 3px var(--sun), 0 6px 0 rgba(0, 0, 0, 0.18); }
.bar__av { font-size: 2rem; line-height: 1; }
.bar.is-turn .bar__av { animation: hop 1.6s ease-in-out infinite; }
.bar__who { display: flex; flex-direction: column; min-width: 0; }
.bar__name { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
.bar__king { display: inline-block; width: 22px; height: 22px; flex: none; }
.bar__status { font-size: 0.86rem; font-weight: 600; min-height: 1.1em; color: var(--pink-deep); }
.bar:not(.is-turn) .bar__status { color: var(--sun); }
.bar__caps { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; max-width: 46vw; max-width: min(46vw, 220px); }
.bar__caps i { width: 20px; height: 20px; margin-left: -5px; }
.bar__caps b { margin-left: 6px; font-size: 0.85rem; background: var(--go); color: #fff; padding: 1px 7px; border-radius: 999px; }
.dots i { font-style: normal; animation: dot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.2; } 30% { opacity: 1; } }

.game-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.act-btn {
  background: rgba(255, 255, 255, 0.12); color: #fff; border-radius: 16px; padding: 7px 4px;
  display: flex; flex-direction: column; align-items: center; font-size: 0.9rem;
}
.act-btn b { font-size: 1.25rem; font-weight: 400; line-height: 1.2; }
.act-btn:active:not(:disabled) { transform: scale(0.95); }
.act-btn[hidden] { display: flex !important; visibility: hidden; }

.tip {
  width: 100%; min-height: 62px;
  display: flex; gap: 10px; align-items: center;
  background: var(--card); color: var(--ink); border-radius: 18px; padding: 8px 12px; z-index: 20;
  box-shadow: 0 0 0 3px var(--sun);
  font-size: 0.86rem; font-weight: 500; line-height: 1.25; pointer-events: none;
  visibility: hidden;
}
.tip.is-on { visibility: visible; animation: tipIn 0.2s ease-out; }
.tip i { flex: none; width: 40px; height: 40px; }
.tip b { font-weight: 700; }
.tip--top { position: absolute; left: 12px; right: 12px; width: auto; top: calc(env(safe-area-inset-top, 0px) + 80px); transform: rotate(180deg); box-shadow: 0 0 0 3px var(--sun), 0 10px 24px rgba(0, 0, 0, 0.35); }
@keyframes tipIn { from { opacity: 0; translate: 0 10px; } }

/* ---------- toast, confetti ---------- */
.toast {
  position: fixed; left: 50%; top: 42%; z-index: 60; max-width: min(88vw, 420px);
  transform: translate(-50%, -50%) scale(0.85); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; text-align: center; font-size: 1.02rem; line-height: 1.3;
  padding: 12px 18px; border-radius: 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: opacity 0.18s, transform 0.18s;
}
.toast.is-on { opacity: 0.96; transform: translate(-50%, -50%) scale(1); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i {
  position: absolute; top: -20px; left: var(--x); width: 10px; height: 14px; border-radius: 3px;
  animation: fall var(--t) cubic-bezier(0.3, 0.1, 0.5, 1) var(--d) forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(var(--r)); } }

/* ---------- sheets (pop-ups) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(15, 20, 40, 0.55); animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 420px; max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--card); border-radius: 26px; padding: 20px 18px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2), 0 20px 40px rgba(0, 0, 0, 0.35);
  animation: popIn 0.22s cubic-bezier(0.3, 1.4, 0.5, 1);
}
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } }
.sheet h2 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.sheet p { margin: 0; color: var(--ink-soft); font-weight: 500; line-height: 1.35; }
.sheet--small { max-width: 340px; }
.sheet--promo.is-flipped { transform: rotate(180deg); animation: none; }
.sheet-buttons { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; margin-top: 4px; }
.sheet-buttons--row { flex-direction: row; justify-content: center; }

.promo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.promo-btn { background: var(--card-2); border-radius: 18px; padding: 8px 2px; font-size: 0.82rem; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.promo-btn i { width: 100%; max-width: 70px; aspect-ratio: 1; }
.promo-btn:active { transform: scale(0.94); }
.promo-btn:first-child { box-shadow: inset 0 0 0 3px var(--sun); }

.end-hero { font-size: 4rem; line-height: 1; animation: hop 1.8s ease-in-out infinite; }

.menu-list { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; background: var(--card-2); border-radius: 14px; padding: 12px 14px; font-size: 1.02rem; }
.menu-item--themes { flex-wrap: wrap; }
.moves { background: #fff; border-radius: 14px; padding: 8px 12px; max-height: 30vh; overflow-y: auto; text-align: left; font-size: 0.95rem; }
.moves ol { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 16px; }
.moves li { display: grid; grid-template-columns: 2.2em 1fr 1fr; break-inside: avoid; padding: 1px 0; }
.moves li b { color: var(--ink-soft); font-weight: 600; }
.moves p { margin: 4px 0; }

.sheet--tall { max-width: 460px; }
.help { text-align: left; display: flex; flex-direction: column; gap: 10px; width: 100%; }
.help-piece { display: flex; gap: 12px; align-items: center; background: var(--card-2); border-radius: 16px; padding: 8px 12px; }
.help-piece i { flex: none; width: 52px; height: 52px; }
.help-piece b { font-weight: 700; }
.help-piece small { color: var(--ink-soft); font-weight: 500; }
.help-piece p { margin: 2px 0 0; font-size: 0.92rem; }
.help h3 { margin: 6px 0 0; font-size: 1.1rem; }
.help > p { font-size: 0.93rem; color: var(--ink); }
.help b { font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .title-piece, .bar.is-turn .bar__av, .end-hero, .piece.is-worried .pc, .pc .pc-eyes { animation: none; }
}
@media (max-height: 640px) {
  .title-art { height: 90px; }
  .title-piece { width: 64px; height: 64px; }
  .title-piece:nth-child(3) { width: 80px; height: 80px; }
  .bar { min-height: 50px; padding: 6px 10px; }
  .bar__av { font-size: 1.6rem; }
}
