*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --font-ui: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, -apple-system, sans-serif;
  --font-round: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --ink: #3a2f28;
  --ink-soft: #7a6555;
  --warm: #c2410c;
  --good: #1c9a5f;
  --bad: #d6443b;
  --gold: #e6a417;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg-bottom);
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

/* Keep the home link apart from the play area and other controls. */
.home-link {
  position: absolute;
  top: calc(var(--safe-top, 0px) + 12px);
  left: calc(var(--safe-left, 0px) + 12px);
  z-index: 18;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(58, 47, 40, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: #514636;
  box-shadow: 0 3px 10px rgba(58, 47, 40, 0.12);
  text-decoration: none;
  touch-action: manipulation;
  cursor: pointer;
}

.home-link svg {
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.home-link:hover {
  background: #fff;
}

.home-link:focus-visible {
  outline: 3px solid #4c88ce;
  outline-offset: 3px;
}

.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Soft shapes behind everything, in the puzzle's colors. */
.backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, var(--blob-a) 0 70px, transparent 71px),
    radial-gradient(circle at 92% 30%, var(--blob-b) 0 54px, transparent 55px),
    radial-gradient(circle at 80% 88%, var(--blob-a) 0 90px, transparent 91px),
    radial-gradient(circle at 6% 76%, var(--blob-b) 0 40px, transparent 41px);
  pointer-events: none;
}

/* Screens: title, problem list, result, pause */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--safe-top) + 72px) calc(var(--safe-right) + 16px) calc(var(--safe-bottom) + 24px) calc(var(--safe-left) + 16px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: center;
}

.title {
  font-family: var(--font-round);
  font-size: clamp(36px, 11vw, 60px);
  font-weight: 900;
  line-height: 1.15;
  color: var(--ink);
  text-shadow: 0 3px 0 #fff, 0 8px 20px rgba(58, 47, 40, 0.18);
  white-space: nowrap;
}

.title-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-shadow: none;
}

.hero {
  position: relative;
  margin-top: 16px;
}

.hero-caption {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}

.hero-caption strong {
  color: var(--accent-dark);
  font-size: 17px;
}

.card {
  width: min(100%, 340px);
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.7;
  box-shadow: 0 8px 24px rgba(58, 47, 40, 0.14);
}

.card strong {
  color: var(--accent-dark);
}

.card-best {
  margin-top: 6px;
  color: var(--warm);
}

.card-best:empty {
  display: none;
}

/* Buttons */
.actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: min(100%, 340px);
  margin-top: auto;
  padding-top: 18px;
}

.btn {
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-round);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.3;
}

.btn:active:not(:disabled) {
  transform: translateY(2px);
}

.btn:disabled {
  cursor: default;
  opacity: 0.45;
}

.btn-gold {
  background: #ffc93c;
  color: #5a3b00;
  box-shadow: 0 5px 0 #e0a100;
}

.btn-main {
  border: 2px solid rgba(58, 47, 40, 0.16);
  background: #fff;
  color: var(--ink);
}

.btn-sub {
  background: var(--ink);
  color: #fff;
}

.btn-note {
  display: block;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.8;
}

.btn-note:empty {
  display: none;
}

.btn:focus-visible,
.more-games:focus-visible,
.link-button:focus-visible,
.round-button:focus-visible,
.stage:focus-visible,
.board:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.links {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.more-games,
.link-button {
  align-self: center;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Round buttons in the corners: back, how to play, sound. */
.round-button {
  position: absolute;
  top: calc(var(--safe-top) + 12px);
  z-index: 15;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(58, 47, 40, 0.1);
  color: var(--ink);
  font-family: var(--font-round);
  font-size: 22px;
  font-weight: 900;
}

.back-toggle {
  left: calc(var(--safe-left) + 76px);
}

.help-toggle {
  right: calc(var(--safe-right) + 64px);
}

.sound-toggle {
  right: calc(var(--safe-right) + 12px);
}

.round-button svg {
  width: 24px;
  height: 24px;
}

.sound-toggle .icon-off,
.sound-toggle[aria-pressed="false"] .icon-on {
  display: none;
}

.sound-toggle[aria-pressed="false"] .icon-off {
  display: block;
}

/* The top middle, between the corner buttons: which problem, or the time left. */
.top-label {
  position: absolute;
  top: calc(var(--safe-top) + 18px);
  left: calc(var(--safe-left) + 128px);
  right: calc(var(--safe-right) + 116px);
  z-index: 14;
  max-width: none;
  padding: 5px 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(58, 47, 40, 0.12);
  font-family: var(--font-round);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.top-label.is-low {
  color: var(--bad);
}

/* Problem list */
.select-screen {
  padding-top: calc(var(--safe-top) + 72px);
}

.screen-title {
  min-height: 32px;
  padding: 0 96px;
  font-family: var(--font-round);
  font-size: 20px;
  white-space: nowrap;
  font-weight: 900;
  line-height: 32px;
}

.select-total {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

.levels {
  display: grid;
  gap: 12px;
  width: min(100%, 440px);
  margin-top: 16px;
  text-align: left;
}

.level {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px rgba(58, 47, 40, 0.1);
}

.level-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-badge {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-round);
  font-size: 12px;
  font-weight: 900;
}

.level-name {
  min-width: 0;
  font-family: var(--font-round);
  font-size: 16px;
  font-weight: 900;
}

.level-count {
  flex: none;
  margin-left: auto;
  color: #b27a0c;
  font-size: 13px;
  font-weight: 900;
}

.level-note {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 56px;
  padding: 4px 0;
  border: 2px solid rgba(58, 47, 40, 0.14);
  border-radius: 14px;
  background: #fff;
}

.stage-no {
  font-family: var(--font-round);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

.mini-stars {
  min-height: 15px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: -1px;
  line-height: 1.2;
}

.stage.is-cleared {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.stage.is-next {
  border-color: #e0a100;
  background: #fff6d6;
  box-shadow: 0 0 0 3px rgba(255, 201, 60, 0.45);
}

.random-card {
  width: min(100%, 440px);
  text-align: left;
}

.random-card h3 {
  font-family: var(--font-round);
  font-size: 16px;
}

.card-note {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.random-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.random-level {
  padding: 10px 2px;
  font-size: 13px;
}

/* Play */
.play {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 72px) calc(var(--safe-right) + 12px) calc(var(--safe-bottom) + 14px) calc(var(--safe-left) + 12px);
}

.hud-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 440px);
  padding: 8px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px rgba(58, 47, 40, 0.1);
}

.timebar {
  width: min(100%, 440px);
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(58, 47, 40, 0.12);
}

.timebar-fill {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: #36b37e;
  transform-origin: left center;
}

.timebar-fill.is-low {
  background: #e5483e;
}

.message {
  min-height: 3.2em;
  max-width: min(100%, 440px);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
  text-align: center;
}

.message.is-bad {
  color: var(--bad);
}

.message.is-good {
  color: var(--good);
}

.message.is-hint {
  color: #9a6a00;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: min(100%, 440px);
}

.controls .btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 4px;
  font-size: 14px;
  box-shadow: 0 3px 0 rgba(58, 47, 40, 0.12);
}

.btn-hint {
  border: 2px solid #f0cf7a;
  background: #fff8df;
  color: #6b4a00;
}

/* Result: over the play screen */
.result-screen {
  justify-content: center;
  background: rgba(58, 47, 40, 0.38);
  z-index: 12;
}

.result-screen .actions {
  margin-top: 16px;
}

.result-screen .links .more-games,
.result-screen .links .link-button {
  color: #fff;
  text-shadow: 0 1px 4px rgba(40, 30, 20, 0.7);
}

.result-card {
  margin-top: 0;
  animation: pop-in 0.3s ease;
}

.result-label {
  color: var(--ink-soft);
  font-size: 14px;
}

.result-big {
  font-family: var(--font-round);
  font-size: 44px;
  font-weight: 900;
  line-height: 1.2;
  color: var(--accent-dark);
}

.result-stars {
  color: var(--gold);
  font-size: 40px;
  letter-spacing: 4px;
  line-height: 1.2;
}

.result-stars span {
  display: inline-block;
  animation: star-pop 0.4s ease backwards;
}

.result-stars span:nth-child(2) {
  animation-delay: 0.12s;
}

.result-stars span:nth-child(3) {
  animation-delay: 0.24s;
}

.result-line {
  font-size: 15px;
}

.result-line:empty {
  display: none;
}

.result-line.is-new {
  color: var(--warm);
  font-size: 17px;
}

.result-note {
  color: var(--bad);
  font-size: 13px;
}

.result-note:empty {
  display: none;
}

.pause-screen {
  justify-content: center;
  z-index: 13;
  background: rgba(58, 47, 40, 0.3);
}

.pause-title {
  font-family: var(--font-round);
  font-size: 24px;
  font-weight: 900;
}

.cta {
  margin-top: 16px;
  padding: 12px 30px;
  border-radius: 999px;
  background: #ffc93c;
  color: #5a3b00;
  font-family: var(--font-round);
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 5px 0 #e0a100;
}

/* Banner */
.banner {
  position: absolute;
  top: calc(var(--safe-top) + 120px);
  left: 50%;
  z-index: 16;
  max-width: calc(100% - 32px);
  padding: 10px 22px;
  border-radius: 24px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-round);
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  white-space: pre-line;
  box-shadow: 0 8px 22px rgba(58, 47, 40, 0.25);
  opacity: 0;
  transform: translate(-50%, -10px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.banner.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* How to play */
.help-sheet {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 16px);
  background: rgba(40, 30, 20, 0.5);
}

.help-panel {
  width: min(100%, 360px);
  max-height: 100%;
  overflow-y: auto;
  padding: 20px 18px 16px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.help-title {
  font-family: var(--font-round);
  font-size: 21px;
  font-weight: 900;
  text-align: center;
}

.help-steps {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  text-align: left;
}

.help-steps li {
  position: relative;
  margin-top: 10px;
  padding-left: 34px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  counter-increment: step;
}

.help-steps li::before {
  content: counter(step);
  position: absolute;
  top: 1px;
  left: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-round);
  font-size: 14px;
  font-weight: 900;
  line-height: 24px;
  text-align: center;
}

.help-steps strong {
  color: var(--warm);
}

.help-close {
  display: block;
  margin: 16px auto 0;
  padding: 10px 34px;
  border: 0;
  border-radius: 999px;
  background: #ffc93c;
  color: #5a3b00;
  font-family: var(--font-round);
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 4px 0 #e0a100;
}

/* Confetti on a clear */
.confetti {
  position: absolute;
  inset: 0;
  z-index: 11;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -12px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fall 1.6s ease-in forwards;
}

@keyframes confetti-fall {
  to {
    transform: translate(var(--dx), 110vh) rotate(var(--spin));
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}

@keyframes star-pop {
  from {
    opacity: 0;
    transform: scale(2.2);
  }
}

@keyframes shake {
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

@keyframes hop {
  30% {
    transform: translateY(-14px);
  }
  60% {
    transform: translateY(0);
  }
  80% {
    transform: translateY(-6px);
  }
}

/* ---------- てんびんパズル ---------- */
:root {
  --accent: #e0762a;
  --accent-dark: #b4561a;
  --accent-soft: #fdeede;
  --accent-line: #f3c9a4;
  --bg-top: #fde3c9;
  --bg-bottom: #fff6e6;
  --blob-a: rgba(224, 118, 42, 0.08);
  --blob-b: rgba(120, 190, 90, 0.14);
  --wood: #b98552;
  --wood-dark: #8a5a2e;
  --metal: #8d97a8;
}

.hero-scale {
  display: block;
  width: min(290px, 80vw);
  margin: 0 auto;
}

.task {
  display: block;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
  text-align: left;
}

.play-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(100%, 440px);
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.facts {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 8px;
  width: 100%;
}

.fact {
  padding: 6px 6px 2px;
  border: 2px dashed #e3c9a8;
  border-radius: 16px;
  background: rgba(255, 250, 242, 0.94);
  text-align: center;
}

.fact-label {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.fact-scale {
  display: block;
  width: 100%;
  max-width: 260px;
  max-height: 13vh;
  margin: 0 auto;
}

.scale {
  display: block;
  flex: none;
  width: min(100%, 400px);
  max-height: 30vh;
  overflow: visible;
  touch-action: none;
}

.scale-foot {
  fill: var(--wood-dark);
}

.scale-post {
  fill: var(--wood);
}

.scale-beam {
  fill: var(--wood);
  stroke: var(--wood-dark);
  stroke-width: 2;
}

.scale-hook,
.scale-pivot {
  fill: #fff;
  stroke: var(--wood-dark);
  stroke-width: 3;
}

.scale-needle {
  fill: var(--accent);
}

.scale-string {
  stroke: var(--metal);
  stroke-width: 2;
}

.scale-pan {
  fill: #dfe4ec;
  stroke: #9aa4b5;
  stroke-width: 2;
}

/* てんびんくん: a face on the post that shows how the scale feels. */
.face-skin {
  fill: #ffe2b0;
  stroke: var(--wood-dark);
  stroke-width: 2.5;
}

.face-line {
  fill: none;
  stroke: #3a2f28;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.face-eye {
  fill: #3a2f28;
}

.face-mouth {
  fill: #b83a2e;
  stroke: #3a2f28;
  stroke-linejoin: round;
  stroke-width: 2;
}

.face-cheek {
  fill: rgba(255, 120, 120, 0.5);
}

.face-sweat {
  fill: #8fd3ff;
}

.face-think {
  fill: var(--accent-dark);
  font-family: var(--font-round);
  font-size: 18px;
  font-weight: 900;
  text-anchor: middle;
}

.face-spark {
  fill: #ffc93c;
}

.face.is-happy {
  animation: face-bounce 0.6s ease 2;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes face-bounce {
  40% {
    transform: translateY(-6px) scale(1.08);
  }
}

.weight-knob {
  fill: #6e7788;
}

.weight-body {
  stroke: rgba(40, 40, 60, 0.35);
  stroke-width: 1.5;
}

.weight-shine {
  fill: rgba(255, 255, 255, 0.45);
}

.weight-number {
  fill: #26303f;
  font-family: var(--font-round);
  font-size: 18px;
  font-weight: 900;
  text-anchor: middle;
}

.fruit-body {
  stroke: rgba(80, 30, 10, 0.35);
  stroke-width: 1.5;
}

.fruit-apple .fruit-body {
  fill: #e8453c;
}

.fruit-mikan .fruit-body {
  fill: #f79a1e;
}

.fruit-stem {
  fill: none;
  stroke: #7a4a1e;
  stroke-linecap: round;
  stroke-width: 3;
}

.fruit-leaf {
  fill: #3fa34d;
}

.fruit-shine {
  fill: rgba(255, 255, 255, 0.55);
}

.fruit-dot {
  fill: rgba(170, 80, 0, 0.45);
}

.is-movable {
  cursor: grab;
}

.weight.is-hint .weight-body {
  stroke: var(--gold);
  stroke-width: 4;
}

.drop-zone {
  fill: transparent;
}

.drop-zone.is-over {
  fill: rgba(224, 118, 42, 0.12);
  stroke: var(--accent);
  stroke-dasharray: 6 5;
  stroke-width: 2;
}

.pan-total rect {
  fill: #fff;
  stroke: #e0cfb4;
  stroke-width: 1.5;
}

.pan-total text,
.scale-lock text {
  fill: var(--ink);
  font-family: var(--font-round);
  font-size: 17px;
  font-weight: 900;
  text-anchor: middle;
}

.scale-lock rect {
  fill: #fff4dc;
  stroke: #efcd84;
  stroke-width: 1.5;
}

.lock-body {
  fill: #e0a62b !important;
  stroke: #9a6a00 !important;
}

.lock-shackle {
  fill: none;
  stroke: #9a6a00;
  stroke-width: 3;
}

.scale-lock text {
  font-size: 13px;
}

.tray {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 12px 6px;
  width: 100%;
  min-height: 70px;
  padding: 14px 8px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px rgba(58, 47, 40, 0.1);
  touch-action: none;
}

.tray-weight {
  position: relative;
  display: grid;
  place-items: center;
  width: calc(var(--w) + 8px);
  height: 52px;
  padding: 0;
  border: 0;
  background: none;
  touch-action: none;
}

.tray-body,
.drag-ghost {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--w);
  height: 34px;
  border: 1.5px solid rgba(40, 40, 60, 0.35);
  border-radius: 8px;
  background: var(--c);
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.4), 0 3px 0 rgba(40, 40, 60, 0.18);
  color: #26303f;
  font-family: var(--font-round);
  font-size: 20px;
  font-weight: 900;
}

.tray-body::before,
.drag-ghost::before {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 16px;
  height: 10px;
  border-radius: 5px 5px 2px 2px;
  background: #6e7788;
  content: "";
  transform: translateX(-50%);
}

.tray-weight.is-away .tray-body {
  border: 2px dashed #d9cdb8;
  background: transparent;
  box-shadow: none;
  color: #b9ad98;
}

.tray-weight.is-away .tray-body::before {
  background: #e6ddcd;
}

.tray-weight.is-selected .tray-body {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.tray-weight.is-hint .tray-body {
  animation: hint-glow 0.9s ease-in-out infinite;
}

.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  margin: -17px 0 0 calc(var(--w) / -2);
  pointer-events: none;
  opacity: 0.92;
}

.side-picker {
  display: grid;
  flex: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.side-picker .btn {
  padding: 10px 4px;
  font-size: 14px;
}

.steps {
  flex: none;
  width: 100%;
  margin: 0;
  padding: 12px 16px 12px 2.2em;
  border: 2px solid #f0cf7a;
  border-radius: 16px;
  background: #fff8df;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.8;
  text-align: left;
}

.controls .btn-gold {
  order: -1;
}

@keyframes hint-glow {
  50% {
    filter: drop-shadow(0 0 6px rgba(230, 164, 23, 0.9));
    transform: translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tray-weight.is-hint .tray-body,
  .result-card,
  .result-stars span,
  .face.is-happy {
    animation: none;
  }

  .tray-weight.is-hint .tray-body {
    outline: 3px solid var(--gold);
  }
}

/* Shorter phones: a little tighter, so everything fits without scrolling. */
@media (max-height: 700px) {
  .screen {
    padding-top: calc(var(--safe-top) + 72px);
  }

  .title-screen .hero {
    margin-top: 6px;
    zoom: 0.85;
  }

  .card {
    margin-top: 10px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.6;
  }

  .actions {
    gap: 8px;
    padding-top: 12px;
  }

  .btn {
    padding: 10px 18px;
  }

  .play {
    padding-top: calc(var(--safe-top) + 72px);
    gap: 6px;
  }

  .message {
    min-height: 2.6em;
    font-size: 14px;
  }
}
