:root {
  --ink: #24233a;
  --muted: #68677d;
  --violet: #5548d9;
  --violet-dark: #4035b6;
  --violet-soft: #efedff;
  --blue: #51a9e8;
  --blue-dark: #2479b8;
  --gold: #f5ad39;
  --gold-dark: #c97516;
  --green: #37a875;
  --rose: #ee6f82;
  --paper: #ffffff;
  --canvas: #f3f5fb;
  --border: #dfe3f0;
  --shadow: 0 22px 60px rgba(51, 47, 105, 0.14);
  font-family: "Nunito", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(106, 170, 255, 0.13), transparent 25rem),
    radial-gradient(circle at 88% 88%, rgba(111, 87, 233, 0.10), transparent 27rem),
    var(--canvas);
  overflow-x: hidden;
}

button {
  font: inherit;
}

button:focus-visible,
[role="button"]:focus-visible {
  outline: 4px solid rgba(85, 72, 217, 0.28);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.is-active {
  display: flex;
}

.intro-screen,
.success-screen {
  position: relative;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vw, 56px);
  overflow: hidden;
  background: linear-gradient(145deg, #f7f8ff 0%, #eef0ff 100%);
}

.intro-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.45;
}

.intro-glow-left {
  left: -190px;
  bottom: -180px;
  background: #b9e4ff;
}

.intro-glow-right {
  right: -180px;
  top: -210px;
  background: #d8ceff;
}

.intro-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
  align-items: center;
  width: min(1080px, 100%);
  min-height: min(650px, calc(100vh - 80px));
  padding: clamp(34px, 6vw, 80px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 38px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.intro-copy {
  max-width: 560px;
}

.eyebrow,
.instruction-kicker {
  margin: 0 0 12px;
  color: var(--violet);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.intro-text {
  max-width: 560px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  font-weight: 650;
  line-height: 1.55;
}

.primary-button {
  min-height: 58px;
  padding: 15px 28px;
  border: 0;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, #6659e7, var(--violet));
  box-shadow: 0 10px 24px rgba(85, 72, 217, 0.28);
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(85, 72, 217, 0.32);
  filter: saturate(1.08);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0);
}

.primary-button:disabled {
  color: #9c9bad;
  background: #e2e4ec;
  box-shadow: none;
  cursor: not-allowed;
}

.intro-visual {
  position: relative;
  min-height: 410px;
}

.mini-balance {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(390px, 100%);
  height: 310px;
  transform: translate(-50%, -48%);
}

.mini-stand,
.mini-base,
.mini-pivot,
.mini-beam {
  position: absolute;
}

.mini-stand {
  left: calc(50% - 14px);
  bottom: 48px;
  width: 28px;
  height: 184px;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(90deg, #7668ea, #4b3fc4);
}

.mini-base {
  left: calc(50% - 98px);
  bottom: 28px;
  width: 196px;
  height: 30px;
  border-radius: 50% 50% 14px 14px;
  background: #4035aa;
  box-shadow: 0 15px 22px rgba(50, 45, 128, 0.24);
}

.mini-pivot {
  z-index: 3;
  left: calc(50% - 24px);
  top: 61px;
  width: 48px;
  height: 48px;
  border: 12px solid #f6c85c;
  border-radius: 50%;
  background: #fff;
}

.mini-beam {
  z-index: 2;
  left: 8%;
  top: 75px;
  width: 84%;
  height: 16px;
  border-radius: 10px;
  background: linear-gradient(#7164e5, #4b40bd);
  transform: rotate(-4deg);
  transform-origin: center;
}

.mini-chain {
  position: absolute;
  top: 8px;
  width: 3px;
  height: 88px;
  background: #726e8d;
}

.mini-chain-left { left: 34px; }
.mini-chain-right { right: 34px; }

.mini-pan {
  position: absolute;
  top: 93px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 112px;
  height: 42px;
  border-radius: 0 0 55px 55px;
  background: linear-gradient(#f9c85b, #e39a29);
  box-shadow: inset 0 -7px 0 rgba(144, 78, 10, 0.11), 0 9px 16px rgba(89, 65, 28, 0.16);
}

.mini-pan-left { left: -20px; }
.mini-pan-right { right: -20px; }

.mini-weight {
  display: grid;
  place-items: center;
  width: 46px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 16px 16px 10px 10px;
  color: white;
  background: var(--blue);
  font-size: 1.2rem;
  font-weight: 950;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.12);
}

.mini-weight-gold { background: var(--rose); }

.spark {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 4px solid var(--gold);
  transform: rotate(45deg);
}

.spark-one { top: 34px; right: 38px; }
.spark-two { bottom: 54px; left: 28px; width: 10px; height: 10px; border-color: var(--blue); }

.task-screen {
  flex-direction: column;
  background: var(--canvas);
}

.task-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 12px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(14px);
}

.task-heading-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 900;
}

.task-divider { color: #aaa9ba; }
.task-stage { color: var(--violet); }

.header-actions {
  display: flex;
  gap: 10px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--ink);
  background: white;
  cursor: pointer;
}

.icon-button:hover { background: var(--violet-soft); }

.icon-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-on-icon { display: none; }
.icon-button[aria-pressed="true"] .sound-on-icon { display: block; }
.icon-button[aria-pressed="true"] .sound-off-icon { display: none; }

.task-content {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 820px);
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
  justify-content: center;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 42px);
}

.instruction-card,
.play-card {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 14px 40px rgba(46, 48, 93, 0.08);
}

.instruction-card {
  position: sticky;
  top: 98px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: clamp(22px, 3vw, 34px);
}

.instruction-card h2 {
  margin-bottom: 16px;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.instruction-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 620;
  line-height: 1.58;
}

.mechanic-tip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: var(--violet-soft);
}

.mechanic-tip p {
  color: #4d468a;
  font-size: 0.95rem;
  line-height: 1.45;
}

.tip-pointer {
  font-size: 1.4rem;
}

.play-card {
  min-width: 0;
  padding: clamp(16px, 3vw, 28px);
}

.balance-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  width: fit-content;
  margin: 0 auto 6px;
  padding: 9px 15px;
  border-radius: 999px;
  color: #514f65;
  background: #f0f2f8;
  font-weight: 850;
}

.status-symbol {
  position: relative;
  display: block;
  width: 26px;
  height: 14px;
}

.status-symbol::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 2px;
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: currentColor;
  transform: rotate(-15deg);
}

.balance-status.is-right .status-symbol::before { transform: rotate(15deg); }
.balance-status.is-equal .status-symbol::before { transform: rotate(0deg); }
.balance-status.is-equal { color: #247b58; background: #e5f7ef; }

.balance-scene {
  position: relative;
  min-height: 350px;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(to bottom, #f7fbff 0 72%, #edf0f7 72% 75%, #e6e9f1 75% 100%);
}

.balance-machine {
  position: absolute;
  inset: 14px 0 auto;
  width: 100%;
  height: 330px;
  --tilt: -6.5deg;
  --counter-tilt: 6.5deg;
}

.beam-group {
  position: absolute;
  z-index: 5;
  top: 57px;
  left: 8%;
  width: 84%;
  height: 210px;
  transform: rotate(var(--tilt));
  transform-origin: 50% 12px;
  transition: transform 430ms cubic-bezier(.2,.75,.35,1);
}

.balance-beam {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  border-radius: 12px;
  background: linear-gradient(#6f62e3, #493db8);
  box-shadow: inset 0 -5px 0 rgba(37, 29, 123, 0.18), 0 7px 16px rgba(62, 51, 164, 0.18);
}

.pan-station {
  position: absolute;
  top: 8px;
  width: min(250px, 40%);
  height: 185px;
  transform: rotate(var(--counter-tilt));
  transform-origin: 50% 0;
  transition: transform 430ms cubic-bezier(.2,.75,.35,1);
}

.pan-station-left { left: -4%; }
.pan-station-right { right: -4%; }

.pan-cords {
  position: absolute;
  inset: 0 10px auto;
  height: 118px;
}

.pan-cords span {
  position: absolute;
  top: 0;
  width: 3px;
  height: 120px;
  border-radius: 3px;
  background: #74728a;
}

.pan-cords span:first-child { left: 18%; transform: rotate(-13deg); transform-origin: top; }
.pan-cords span:last-child { right: 18%; transform: rotate(13deg); transform-origin: top; }

.pan-bowl {
  position: absolute;
  left: 0;
  bottom: 6px;
  width: 100%;
  height: 60px;
  border-radius: 8px 8px 95px 95px;
  background: linear-gradient(#f9c75a, #e49c2b);
  box-shadow: inset 0 -9px 0 rgba(137, 77, 12, 0.12), 0 10px 18px rgba(108, 78, 27, 0.14);
}

.pan-bowl::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 3%;
  width: 94%;
  height: 16px;
  border-radius: 50%;
  background: #ffda76;
  box-shadow: inset 0 3px 4px rgba(255, 255, 255, 0.55);
}

.pan-drop-zone {
  position: absolute;
  z-index: 4;
  left: 4%;
  bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  width: 92%;
  min-height: 112px;
  padding: 12px 8px 4px;
  border: 3px dashed transparent;
  border-radius: 26px 26px 52px 52px;
}

.fixed-weights {
  display: contents;
}

.pan-drop-zone.is-drop-ready,
.weights-table.is-drop-ready {
  border-color: rgba(85, 72, 217, 0.55);
  background: rgba(239, 237, 255, 0.65);
}

.balance-pivot {
  position: absolute;
  z-index: 8;
  top: 42px;
  left: calc(50% - 33px);
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #f5b83e;
  box-shadow: inset 0 -8px 0 rgba(167, 93, 13, 0.16), 0 7px 12px rgba(96, 72, 18, 0.14);
}

.balance-pivot span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  box-shadow: inset 0 3px 6px rgba(68, 55, 139, 0.18);
}

.balance-column {
  position: absolute;
  z-index: 3;
  top: 82px;
  left: calc(50% - 18px);
  width: 36px;
  height: 190px;
  border-radius: 18px 18px 7px 7px;
  background: linear-gradient(90deg, #6a5ede, #483cb4);
  box-shadow: inset -8px 0 0 rgba(44, 33, 136, 0.15);
}

.balance-base {
  position: absolute;
  z-index: 4;
  left: calc(50% - 116px);
  top: 258px;
  width: 232px;
  height: 42px;
  border-radius: 60% 60% 18px 18px;
  background: linear-gradient(#5e51d1, #3d32a3);
  box-shadow: 0 13px 18px rgba(48, 40, 132, 0.18);
}

.weights-table {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  margin-top: 14px;
  padding: 34px 18px 16px;
  border: 3px dashed #dfe2ee;
  border-radius: 20px;
  background: #fafbfe;
  transition: border-color 160ms ease, background 160ms ease;
}

.table-label {
  position: absolute;
  top: 11px;
  left: 16px;
  color: #77758a;
  font-size: 0.84rem;
  font-weight: 850;
}

.table-items {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  min-height: 74px;
}

.weight {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  width: 66px;
  height: 72px;
  padding: 12px 8px 8px;
  border: 0;
  border-radius: 21px 21px 13px 13px;
  color: white;
  background: #8c86a8;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.13), 0 8px 15px rgba(41, 42, 74, 0.16);
  font-family: inherit;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
}

.movable-weight {
  cursor: grab;
  touch-action: manipulation;
  transition: transform 140ms ease, box-shadow 140ms ease, outline-color 140ms ease;
}

.movable-weight:hover { transform: translateY(-3px); }
.movable-weight:active { cursor: grabbing; }
.movable-weight.is-selected {
  outline: 5px solid rgba(85, 72, 217, 0.30);
  outline-offset: 4px;
  transform: translateY(-5px);
}

.movable-weight.is-dragging { opacity: 0.55; }
.weight-blue { background: linear-gradient(#60b9f0, #308dd0); }
.weight-gold { background: linear-gradient(#f7b946, #df8c20); }
.weight-rose { background: linear-gradient(#f08498, #cf516b); }
.weight-green { background: linear-gradient(#56c694, #2c966a); }
.weight-violet { background: linear-gradient(#8d7bea, #6551c8); }
.fixed-weight { background: linear-gradient(#8e89a6, #625e7c); }

.weight-handle {
  position: absolute;
  top: -14px;
  left: calc(50% - 16px);
  width: 32px;
  height: 23px;
  border: 7px solid currentColor;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  opacity: 0.72;
}

.weight-number {
  align-self: end;
  font-size: 1.75rem;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.weight-unit {
  font-size: 0.72rem;
  font-weight: 900;
  opacity: 0.9;
}

.lock-badge {
  position: absolute;
  right: -8px;
  bottom: -7px;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 3px solid white;
  border-radius: 50%;
  background: #575269;
  font-size: 0.82rem;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
}

.task-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-height: 78px;
  padding-top: 18px;
}

.feedback {
  flex: 1;
  margin: 0;
  color: #b13f55;
  font-weight: 800;
  line-height: 1.35;
}

.feedback.is-positive { color: #247b58; }
.check-button { min-width: 148px; }

.success-screen {
  text-align: center;
}

.success-card {
  position: relative;
  width: min(660px, 100%);
  padding: clamp(34px, 7vw, 64px);
  border: 1px solid white;
  border-radius: 36px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.success-card h1 {
  margin-bottom: 18px;
  font-size: clamp(2.5rem, 7vw, 4.4rem);
}

.success-card > p:not(.eyebrow):not(.prototype-note) {
  max-width: 520px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.55;
}

.success-medal {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin: 0 auto 22px;
  border: 9px solid #dff4ea;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 2.8rem;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(55, 168, 117, 0.22);
}

.success-balance {
  position: relative;
  width: min(390px, 100%);
  height: 110px;
  margin: 0 auto 26px;
}

.success-line {
  position: absolute;
  top: 12px;
  left: 10%;
  width: 80%;
  height: 10px;
  border-radius: 8px;
  background: var(--violet);
}

.success-line::after {
  content: "";
  position: absolute;
  left: calc(50% - 7px);
  top: 5px;
  width: 14px;
  height: 82px;
  border-radius: 10px;
  background: var(--violet);
}

.success-pan {
  position: absolute;
  top: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 120px;
  height: 36px;
  border-radius: 0 0 60px 60px;
  color: white;
  background: var(--gold);
  font-weight: 950;
}

.success-pan::before,
.success-pan::after {
  content: "";
  position: absolute;
  bottom: 30px;
  width: 2px;
  height: 43px;
  background: #77758a;
}

.success-pan::before { left: 18px; }
.success-pan::after { right: 18px; }
.success-pan-left { left: 2%; }
.success-pan-right { right: 2%; }

.success-pan span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 36px;
  margin-top: -26px;
  border-radius: 10px;
  background: var(--blue);
}

.success-pan-right span { background: var(--rose); }

.prototype-note {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--violet);
  font-size: 0.94rem;
  font-weight: 800;
}

.final-card {
  width: min(760px, 100%);
}

.final-medal {
  border-color: #fff1c8;
  background: linear-gradient(145deg, #f8bd43, #e59020);
  box-shadow: 0 10px 22px rgba(218, 139, 24, 0.24);
}

.final-result {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: min(620px, 100%);
  min-height: 150px;
  margin: 0 auto 22px;
  padding: 30px 0 60px;
}

.result-pan {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 58px;
  padding: 8px 10px 14px;
  border-radius: 8px 8px 70px 70px;
  background: linear-gradient(#f9c75a, #e49c2b);
  box-shadow: inset 0 -8px 0 rgba(137, 77, 12, 0.12), 0 8px 16px rgba(108, 78, 27, 0.14);
}

.result-pan::before,
.result-pan::after {
  content: "";
  position: absolute;
  bottom: 44px;
  width: 2px;
  height: 32px;
  background: #77758a;
  z-index: 0;
}

.result-pan::before { left: 18%; }
.result-pan::after { right: 18%; }

.result-pan span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 42px;
  margin-top: -20px;
  border-radius: 11px 11px 7px 7px;
  color: white;
  background: var(--blue);
  font-weight: 950;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.12);
}

.result-pan-right span:nth-child(2n) { background: var(--rose); }
.result-pan-right span:nth-child(3n) { background: var(--green); }

.result-stand {
  position: relative;
  align-self: stretch;
  min-height: 80px;
  border-radius: 12px;
  background: linear-gradient(90deg, #6557d9, #4337b0);
}

.result-stand::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  width: min(600px, 58vw);
  height: 9px;
  border-radius: 7px;
  background: var(--violet);
  transform: translateX(-50%);
}

.unused-weight {
  position: absolute;
  bottom: 0;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.unused-weight > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 46px;
  border-radius: 14px 14px 9px 9px;
  color: white;
  background: linear-gradient(#8d7bea, #6551c8);
  font-weight: 950;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.12);
}

.unused-weight small {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 10px 18px;
  border: 2px solid #dcefe7;
  border-radius: 18px;
  color: #247b58;
  background: #f0fbf6;
}

.score-number {
  font-size: 2rem;
  font-weight: 950;
  line-height: 1;
}

.score-caption {
  font-weight: 900;
}

@media (min-width: 901px) and (max-height: 820px) {
  .task-content {
    padding-block: 18px;
  }

  .instruction-card {
    top: 88px;
    gap: 20px;
    padding: 26px;
  }

  .play-card {
    padding: 16px 22px;
  }

  .balance-status {
    min-height: 38px;
    margin-bottom: 2px;
    padding-block: 7px;
  }

  .balance-scene {
    min-height: 276px;
  }

  .balance-machine {
    inset-block-start: 8px;
    height: 268px;
  }

  .beam-group {
    top: 43px;
    height: 175px;
  }

  .pan-station {
    height: 155px;
  }

  .pan-cords {
    height: 91px;
  }

  .pan-cords span {
    height: 93px;
  }

  .pan-bowl {
    height: 52px;
  }

  .pan-drop-zone {
    bottom: 18px;
    min-height: 94px;
  }

  .balance-pivot {
    top: 28px;
  }

  .balance-column {
    top: 67px;
    height: 142px;
  }

  .balance-base {
    top: 197px;
    height: 36px;
  }

  .weights-table {
    min-height: 104px;
    margin-top: 10px;
    padding-block: 30px 10px;
  }

  .table-items {
    min-height: 64px;
  }

  .weight {
    width: 58px;
    height: 64px;
  }

  .weight-number {
    font-size: 1.5rem;
  }

  .task-footer {
    min-height: 60px;
    padding-top: 10px;
  }
}

@media (max-width: 900px) {
  .intro-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .intro-copy { margin: 0 auto; }
  .intro-visual { min-height: 320px; }

  .task-content {
    grid-template-columns: 1fr;
  }

  .instruction-card {
    position: static;
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    align-items: center;
  }
}

@media (max-width: 620px) {
  .intro-screen,
  .success-screen {
    padding: 14px;
  }

  .intro-card,
  .success-card {
    min-height: calc(100vh - 28px);
    padding: 30px 20px;
    border-radius: 26px;
  }

  h1 { font-size: clamp(2.8rem, 15vw, 4.2rem); }
  .intro-text { font-size: 1rem; }
  .intro-visual { min-height: 270px; }

  .mini-balance {
    width: 310px;
    height: 270px;
  }

  .mini-beam { top: 62px; }
  .mini-pivot { top: 48px; }
  .mini-stand { bottom: 42px; height: 160px; }
  .mini-base { bottom: 23px; }

  .task-header {
    min-height: 66px;
    padding-inline: 14px;
  }

  .task-heading-wrap {
    gap: 4px;
    font-size: 0.92rem;
  }
  .icon-button { width: 42px; height: 42px; }

  .task-content { padding: 14px; }
  .instruction-card {
    display: flex;
    gap: 18px;
    padding: 21px;
  }

  .mechanic-tip { padding: 13px; }
  .play-card { padding: 12px; }
  .balance-status { font-size: 0.88rem; }
  .balance-scene { min-height: 310px; }
  .balance-machine { height: 300px; }
  .beam-group { top: 54px; left: 5%; width: 90%; }

  .pan-station {
    width: 43%;
    height: 170px;
  }

  .pan-station-left { left: -5%; }
  .pan-station-right { right: -5%; }
  .pan-cords { height: 105px; }
  .pan-cords span { height: 105px; }
  .pan-bowl { height: 52px; }
  .pan-drop-zone { bottom: 17px; min-height: 101px; gap: 3px; padding-inline: 2px; }

  .balance-column { height: 167px; }
  .balance-base { top: 236px; left: calc(50% - 90px); width: 180px; }

  .weight {
    width: 56px;
    height: 64px;
    border-radius: 18px 18px 11px 11px;
  }

  .weight-number { font-size: 1.45rem; }
  .weight-handle { left: calc(50% - 14px); width: 28px; height: 20px; border-width: 6px; }
  .lock-badge { width: 25px; height: 25px; font-size: 0.67rem; }

  .weights-table { min-height: 120px; }
  .task-footer { flex-direction: column; align-items: stretch; gap: 10px; }
  .feedback { text-align: center; }
  .check-button { width: 100%; }

  .final-card {
    padding-inline: 16px;
  }

  .final-result {
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
    gap: 5px;
    padding-top: 26px;
  }

  .result-pan {
    gap: 3px;
    padding-inline: 4px;
  }

  .result-pan span {
    width: 26px;
    height: 34px;
    font-size: 0.83rem;
  }

  .result-stand::before {
    width: 78vw;
  }
}

@media (min-width: 621px) {
  .task-screen[data-mode="main"] .beam-group {
    left: 3%;
    width: 94%;
  }

  .task-screen[data-mode="main"] .pan-station {
    width: min(310px, 44%);
  }

  .task-screen[data-mode="main"] .pan-station-left { left: -2%; }
  .task-screen[data-mode="main"] .pan-station-right { right: -2%; }

  .task-screen[data-mode="main"] .pan-drop-zone {
    flex-wrap: wrap;
    align-content: flex-end;
    gap: 4px;
    min-height: 118px;
    padding-inline: 4px;
  }

  .task-screen[data-mode="main"] .weight {
    width: 48px;
    height: 56px;
    padding: 10px 5px 6px;
    border-radius: 17px 17px 10px 10px;
  }

  .task-screen[data-mode="main"] .weight-number {
    font-size: 1.35rem;
  }

  .task-screen[data-mode="main"] .weight-handle {
    top: -11px;
    left: calc(50% - 13px);
    width: 26px;
    height: 19px;
    border-width: 6px;
  }

  .task-screen[data-mode="main"] .lock-badge {
    right: -5px;
    bottom: -5px;
    width: 23px;
    height: 23px;
    border-width: 2px;
    font-size: 0.62rem;
  }
}

@media (max-width: 620px) {
  .task-screen[data-mode="main"] .balance-scene {
    min-height: 344px;
  }

  .task-screen[data-mode="main"] .balance-machine {
    height: 332px;
  }

  .task-screen[data-mode="main"] .beam-group {
    top: 48px;
    left: 2%;
    width: 96%;
    height: 235px;
  }

  .task-screen[data-mode="main"] .pan-station {
    width: 47%;
    height: 218px;
  }

  .task-screen[data-mode="main"] .pan-station-left { left: -6%; }
  .task-screen[data-mode="main"] .pan-station-right { right: -6%; }

  .task-screen[data-mode="main"] .pan-cords,
  .task-screen[data-mode="main"] .pan-cords span {
    height: 142px;
  }

  .task-screen[data-mode="main"] .pan-drop-zone {
    flex-wrap: wrap;
    align-content: flex-end;
    gap: 3px;
    min-height: 158px;
    padding: 4px 2px;
  }

  .task-screen[data-mode="main"] .weight {
    width: 38px;
    height: 48px;
    padding: 8px 3px 5px;
    border-radius: 13px 13px 8px 8px;
  }

  .task-screen[data-mode="main"] .weight-number {
    font-size: 1.08rem;
  }

  .task-screen[data-mode="main"] .weight-unit {
    font-size: 0.58rem;
  }

  .task-screen[data-mode="main"] .weight-handle {
    top: -9px;
    left: calc(50% - 10px);
    width: 20px;
    height: 15px;
    border-width: 4px;
  }

  .task-screen[data-mode="main"] .lock-badge {
    right: -4px;
    bottom: -4px;
    width: 19px;
    height: 19px;
    border-width: 2px;
    font-size: 0.5rem;
  }

  .task-screen[data-mode="main"] .balance-column {
    height: 194px;
  }

  .task-screen[data-mode="main"] .balance-base {
    top: 266px;
  }

  .task-screen[data-mode="main"] .table-items {
    gap: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
