:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --ink: #352a23;
  --cream: #fffaf0;
  --cream-strong: #fff3d8;
  --orange: #c95f24;
  --orange-deep: #9f431b;
  --gold: #e6aa2f;
  --teal: #237d7f;
  --shadow: 0 4px 12px rgb(50 75 68 / 18%);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #cbe5df;
  color: var(--ink);
}

button { font: inherit; }

#app {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(100vw, calc(100vh * 1.6));
  height: min(100vh, calc(100vw / 1.6));
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: #80cfd0;
  box-shadow: 0 0 0 1px rgb(39 92 83 / 10%), 0 16px 48px rgb(27 64 61 / 22%);
}

.topbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 9%;
  min-height: 48px;
  padding: 0 2%;
  background: rgb(248 239 218 / 96%);
  border-bottom: 2px solid rgb(113 90 59 / 18%);
}

.topbar__actions { flex: 0 0 17%; }

.control-button,
.primary-button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.control-button {
  display: inline-flex;
  min-width: 132px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  background: var(--cream);
  border: 2px solid rgb(137 100 52 / 18%);
  border-radius: 16px;
  box-shadow: 0 3px 0 rgb(134 90 40 / 18%);
}

.control-button:disabled { cursor: default; opacity: .55; }
.control-button:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 rgb(134 90 40 / 18%); }
.control-button__icon { color: var(--orange); font-size: 24px; letter-spacing: -5px; }

.stat-group {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  gap: 1.5%;
}

.stat {
  display: flex;
  min-width: 190px;
  height: 54px;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  background: var(--cream);
  border: 2px solid rgb(137 100 52 / 15%);
  border-radius: 18px;
  box-shadow: 0 3px 0 rgb(134 90 40 / 12%);
}

.stat__icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  font-size: 22px;
  font-weight: 900;
  background: var(--gold);
  border-radius: 50%;
  text-shadow: 0 1px 1px rgb(91 62 18 / 35%);
}

.stat--level .stat__icon { background: #6f9e57; }
.stat--score .stat__icon { background: #e2a127; }
.stat__label { font-size: 20px; font-weight: 800; white-space: nowrap; }
.stat__value { margin-left: auto; color: var(--orange); font-size: 30px; font-variant-numeric: tabular-nums; }

.game-area {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 91%;
  overflow: hidden;
  outline: none;
  cursor: crosshair;
  user-select: none;
  touch-action: manipulation;
}

.game-area:focus-visible { box-shadow: inset 0 0 0 5px rgb(255 242 183 / 90%); }
.game-area__background { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.water-atmosphere {
  position: absolute;
  top: 29.5%;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.water-shaft {
  position: absolute;
  top: -9%;
  width: 21%;
  height: 86%;
  background: linear-gradient(180deg, rgb(246 255 218 / 16%), rgb(197 244 226 / 5%) 68%, transparent 100%);
  clip-path: polygon(29% 0, 70% 0, 100% 100%, 0 100%);
  opacity: .32;
  transform-origin: 50% 0;
  animation: water-shaft-sway 12s ease-in-out infinite;
}

.water-shaft--left { left: 10%; animation-delay: -3.5s; }
.water-shaft--middle { left: 48%; width: 17%; opacity: .22; animation-delay: -8.2s; animation-duration: 15s; }
.water-shaft--right { right: 8%; opacity: .27; animation-delay: -6.4s; animation-duration: 13.5s; }

.water-seam {
  position: absolute;
  left: -3%;
  width: 106%;
  height: 78px;
  background: linear-gradient(180deg, transparent, rgb(61 193 196 / 82%) 43%, rgb(51 185 190 / 82%) 57%, transparent);
  filter: blur(10px);
  opacity: .96;
}

.water-seam--upper { top: 18%; }
.water-seam--lower {
  top: 43%;
  background: linear-gradient(180deg, transparent, rgb(17 170 180 / 80%) 43%, rgb(10 158 171 / 80%) 57%, transparent);
  opacity: .94;
}

.water-particle {
  --particle-size: 3px;
  --particle-shift: 12px;
  position: absolute;
  display: block;
  width: var(--particle-size);
  aspect-ratio: 1;
  background: rgb(229 255 241 / 60%);
  border-radius: 50%;
  box-shadow: 0 0 5px rgb(217 255 244 / 28%);
  opacity: 0;
  animation: water-particle-drift 11s ease-in-out infinite;
}

.water-particle:nth-of-type(6) { --particle-size: 2px; left: 6%; top: 29%; animation-delay: -2s; }
.water-particle:nth-of-type(7) { left: 15%; top: 72%; animation-delay: -8s; animation-duration: 13s; }
.water-particle:nth-of-type(8) { --particle-size: 4px; left: 24%; top: 46%; animation-delay: -5s; }
.water-particle:nth-of-type(9) { left: 33%; top: 84%; animation-delay: -9s; animation-duration: 14s; }
.water-particle:nth-of-type(10) { --particle-size: 2px; left: 41%; top: 27%; animation-delay: -3s; }
.water-particle:nth-of-type(11) { left: 49%; top: 63%; animation-delay: -7s; animation-duration: 12.5s; }
.water-particle:nth-of-type(12) { --particle-size: 4px; left: 57%; top: 39%; animation-delay: -10s; }
.water-particle:nth-of-type(13) { --particle-size: 2px; left: 64%; top: 77%; animation-delay: -1s; }
.water-particle:nth-of-type(14) { left: 72%; top: 21%; animation-delay: -6s; animation-duration: 13.8s; }
.water-particle:nth-of-type(15) { --particle-size: 4px; left: 79%; top: 57%; animation-delay: -4s; }
.water-particle:nth-of-type(16) { --particle-size: 2px; left: 87%; top: 82%; animation-delay: -11s; animation-duration: 14.5s; }
.water-particle:nth-of-type(17) { left: 93%; top: 34%; animation-delay: -7.5s; }
.water-particle:nth-of-type(18) { --particle-size: 4px; left: 12%; top: 91%; animation-delay: -12s; animation-duration: 15s; }
.water-particle:nth-of-type(19) { --particle-size: 2px; left: 83%; top: 68%; animation-delay: -2.8s; animation-duration: 12.8s; }

@keyframes water-shaft-sway {
  0%, 100% { transform: translateX(-10px) skewX(-2deg); opacity: .2; }
  50% { transform: translateX(12px) skewX(2deg); opacity: .34; }
}

@keyframes water-particle-drift {
  0%, 10% { opacity: 0; transform: translate(0, 12px); }
  28%, 72% { opacity: .34; }
  100% { opacity: 0; transform: translate(var(--particle-shift), -54px); }
}

.bubble-field {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.bubble-cluster {
  position: absolute;
  width: 54px;
  height: 142px;
}

.bubble-cluster--left { left: 8%; top: 56%; }
.bubble-cluster--right { right: 8%; top: 44%; }
.bubble-cluster--deep-left { left: 21%; bottom: 7%; }
.bubble-cluster--deep-right { right: 20%; bottom: 9%; }

.bubble {
  --bubble-size: 11px;
  --bubble-rise: -112px;
  --bubble-drift: 7px;
  --bubble-delay: -1.4s;
  --cluster-delay: 0s;
  position: absolute;
  left: 8px;
  bottom: 0;
  display: block;
  width: var(--bubble-size);
  aspect-ratio: 1;
  background: radial-gradient(circle at 32% 28%, rgb(255 255 255 / 48%) 0 9%, transparent 14%);
  border: 1.5px solid rgb(225 252 246 / 76%);
  border-radius: 50%;
  box-shadow: inset 1px 1px 1px rgb(255 255 255 / 34%);
  opacity: 0;
  animation: bubble-rise 7.2s ease-in-out infinite;
  animation-delay: calc(var(--bubble-delay) + var(--cluster-delay));
}

.bubble:nth-child(1) { --bubble-size: 9px; --bubble-rise: -96px; --bubble-drift: 4px; --bubble-delay: -1.4s; }
.bubble:nth-child(2) { --bubble-size: 15px; --bubble-rise: -136px; --bubble-drift: 15px; --bubble-delay: -4.8s; left: 24px; animation-duration: 8.6s; }
.bubble:nth-child(3) { --bubble-size: 8px; --bubble-rise: -110px; --bubble-drift: -5px; --bubble-delay: -6.1s; left: 43px; animation-duration: 6.4s; }
.bubble:nth-child(4) { --bubble-size: 12px; --bubble-rise: -126px; --bubble-drift: -11px; --bubble-delay: -3.2s; left: 13px; animation-duration: 7.8s; }

.bubble-cluster--right .bubble { --cluster-delay: -2.3s; }
.bubble-cluster--deep-left .bubble { --cluster-delay: -3.8s; }
.bubble-cluster--deep-right .bubble { --cluster-delay: -5.1s; }

@keyframes bubble-rise {
  0%, 8% { opacity: 0; transform: translate(0, 0) scale(.72); }
  20% { opacity: .62; }
  72% { opacity: .42; }
  100% { opacity: 0; transform: translate(var(--bubble-drift), var(--bubble-rise)) scale(1.05); }
}

.entity-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; }

.fishing-scene {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  transform-origin: 40% 25%;
  will-change: transform;
}

.fisherman {
  position: absolute;
  z-index: 1;
  left: 28.125%;
  top: -3.571%;
  width: 23.438%;
  aspect-ratio: 1;
  clip-path: inset(0 0 16% 0);
  background-image: url("./assets/generated-motion-v0.2-candidate/fisherman-motion-sheet-v03-beard-fix-alpha-clean-candidate.png");
  background-repeat: no-repeat;
  background-size: 300% 300%;
  filter: drop-shadow(0 4px 3px rgb(79 61 34 / 18%));
}

.fisherman[data-frame="0"] { background-position: 0 0; }
.fisherman[data-frame="1"] { background-position: 50% 0; }
.fisherman[data-frame="2"] { background-position: 100% 0; }
.fisherman[data-frame="3"] { background-position: 0 50%; }
.fisherman[data-frame="4"] { background-position: 50% 50%; }
.fisherman[data-frame="5"] { background-position: 100% 50%; }
.fisherman[data-frame="6"] { background-position: 0 100%; }
.fisherman[data-frame="7"] { background-position: 50% 100%; }
.fisherman[data-frame="8"] { background-position: 100% 100%; }

.boat-static {
  position: absolute;
  z-index: 2;
  left: 31.641%;
  top: 12.775%;
  width: 17.969%;
  height: auto;
  filter: drop-shadow(0 5px 3px rgb(79 61 34 / 20%));
}

.entity {
  --sprite-position: 0 0;
  --swim-delay: 0ms;
  --fish-water-filter: saturate(.94) brightness(.98) hue-rotate(2deg) drop-shadow(0 3px 6px rgb(21 78 84 / 11%));
  position: absolute;
  left: 0;
  top: 0;
  aspect-ratio: 1;
  transform-origin: 50% 50%;
  will-change: transform;
}

.entity__visual {
  position: absolute;
  inset: 0;
  background-image: var(--fish-sprite);
  background-repeat: no-repeat;
  background-position: var(--sprite-position);
  background-size: 200% 200%;
  filter: var(--fish-water-filter);
  transform-origin: 50% 50%;
  will-change: transform;
  animation: fish-underwater-drift 3.2s ease-in-out infinite;
  animation-delay: var(--swim-delay);
}

.entity__visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(108deg, transparent 27%, rgb(232 255 245 / 14%) 46%, transparent 64%);
  background-position: 130% 0;
  background-size: 230% 100%;
  opacity: .42;
  pointer-events: none;
  -webkit-mask-image: var(--fish-sprite);
  mask-image: var(--fish-sprite);
  -webkit-mask-position: var(--sprite-position);
  mask-position: var(--sprite-position);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 200% 200%;
  mask-size: 200% 200%;
  animation: fish-waterlight 5.6s ease-in-out infinite;
  animation-delay: calc(var(--swim-delay) - 1.1s);
}

.entity[data-depth="top"] {
  --fish-water-filter: saturate(.94) brightness(.98) hue-rotate(2deg) drop-shadow(0 3px 6px rgb(21 78 84 / 11%));
}

.entity[data-depth="middle"] {
  --fish-water-filter: saturate(.86) brightness(.94) hue-rotate(7deg) drop-shadow(0 3px 7px rgb(17 70 78 / 9%));
}

.entity[data-depth="bottom"] {
  --fish-water-filter: saturate(.78) brightness(.90) hue-rotate(12deg) blur(.2px) drop-shadow(0 3px 8px rgb(12 57 68 / 8%));
}

.entity[data-frame="0"] { --sprite-position: 0 0; }
.entity[data-frame="1"] { --sprite-position: 100% 0; }
.entity[data-frame="2"] { --sprite-position: 0 100%; }
.entity[data-frame="3"] { --sprite-position: 100% 100%; }

.caught-fish[data-frame="0"] .caught-fish__visual { background-position: 0 0; }
.caught-fish[data-frame="1"] .caught-fish__visual { background-position: 100% 0; }
.caught-fish[data-frame="2"] .caught-fish__visual { background-position: 0 100%; }
.caught-fish[data-frame="3"] .caught-fish__visual { background-position: 100% 100%; }
.entity--shark { z-index: 9; }

@keyframes fish-underwater-drift {
  0%, 100% { transform: translateY(-3px) rotate(-1deg); }
  50% { transform: translateY(3px) rotate(1deg); }
}

@keyframes fish-waterlight {
  0%, 18% { background-position: 130% 0; opacity: .18; }
  52% { opacity: .42; }
  82%, 100% { background-position: -130% 0; opacity: .16; }
}

.hook-rig {
  --hook-x: 50%;
  --hook-y: 220px;
  --hook-rotation: 0deg;
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
}

.hook-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hook-line__path {
  fill: none;
  stroke: #665747;
  stroke-width: 2.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(1px 0 1px rgb(255 255 255 / 55%));
}

.hook-visual {
  position: absolute;
  z-index: 2;
  left: var(--hook-x);
  top: var(--hook-y);
  width: 2.97%;
  transform: rotate(var(--hook-rotation));
  transform-origin: 0 0;
}

.hook-image {
  display: block;
  width: 100%;
  height: auto;
  transform: translate(-72%, -18%);
  filter: drop-shadow(0 3px 2px rgb(10 43 48 / 30%));
}

.hook-rig[data-visible="false"] .hook-line,
.hook-rig[data-visible="false"] .hook-visual,
.hook-rig[data-visible="false"] .caught-fish { visibility: hidden; }

.caught-fish {
  position: absolute;
  left: var(--hook-x);
  top: var(--hook-y);
  aspect-ratio: 1;
  z-index: 1;
  transform-origin: var(--mouth-x) var(--mouth-y);
  animation: caught-fish-hook .12s ease-out both;
  filter: drop-shadow(0 4px 2px rgb(10 43 48 / 25%));
}

.caught-fish__visual {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: 200% 200%;
  transform-origin: var(--mouth-x) var(--mouth-y);
  animation: caught-fish-swing .7s ease-in-out .12s infinite alternate;
}

@keyframes caught-fish-hook {
  from { transform: translate(var(--mouth-translate-x), var(--mouth-translate-y)) rotate(-24deg); }
  to { transform: translate(var(--mouth-translate-x), var(--mouth-translate-y)) rotate(-82deg); }
}

@keyframes caught-fish-swing {
  from { transform: rotate(-4deg); }
  to { transform: rotate(4deg); }
}

.surface-ripple {
  position: absolute;
  z-index: 13;
  left: 50%;
  top: 228px;
  width: 11.72%;
  height: auto;
  opacity: 0;
  transform: translate(-50%, -52%) scale(.6);
  filter: contrast(1.15) drop-shadow(0 1px 2px rgb(255 255 255 / 55%));
  pointer-events: none;
}

.surface-ripple.is-visible { animation: ripple .7s ease-out both; }

@keyframes ripple {
  0% { opacity: 0; transform: translate(-50%, -52%) scale(.48); }
  18% { opacity: 1; }
  64% { opacity: .72; }
  100% { opacity: 0; transform: translate(-50%, -52%) scale(1.18); }
}

.feedback {
  position: absolute;
  z-index: 22;
  left: 50%;
  top: 255px;
  min-width: 170px;
  padding: 10px 18px;
  color: white;
  font-size: 26px;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 2px 2px rgb(70 40 17 / 35%);
  background: rgb(43 112 105 / 86%);
  border: 2px solid rgb(255 250 216 / 80%);
  border-radius: 14px;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
}

.feedback.is-visible { animation: feedback 1s ease both; }
.feedback.is-shark { background: rgb(56 75 85 / 91%); }

@keyframes feedback {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(.9); }
  18%, 72% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -10px) scale(.98); }
}

.level-progress {
  position: absolute;
  z-index: 18;
  right: 18px;
  bottom: 16px;
  display: grid;
  width: 220px;
  gap: 5px;
  padding: 9px 13px;
  color: #57442f;
  font-size: 15px;
  font-weight: 800;
  background: rgb(255 249 232 / 88%);
  border: 1px solid rgb(89 75 55 / 18%);
  border-radius: 11px;
  box-shadow: var(--shadow);
}

.level-progress__track { display: block; height: 8px; overflow: hidden; background: #e3d6b8; border-radius: 4px; }
.level-progress__fill { display: block; width: 0; height: 100%; background: var(--orange); transition: width .2s ease; }

.overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(20 83 85 / 26%);
  backdrop-filter: blur(2px);
}

.overlay[hidden] { display: none; }

.overlay__card {
  width: min(520px, 78%);
  padding: 30px 36px 34px;
  text-align: center;
  background: rgb(255 250 239 / 97%);
  border: 3px solid rgb(255 255 255 / 78%);
  border-radius: 24px;
  box-shadow: 0 12px 36px rgb(30 62 55 / 28%);
}

.overlay__card--small { width: min(420px, 70%); }
.overlay__eyebrow { margin: 0 0 7px; color: var(--teal); font-size: 17px; font-weight: 900; letter-spacing: .14em; }
.overlay h1, .overlay h2 { margin: 0; color: #3e3026; font-size: 42px; line-height: 1.2; }
.overlay p { margin: 15px 0 23px; font-size: 20px; line-height: 1.65; }

.primary-button {
  min-width: 220px;
  min-height: 58px;
  padding: 0 28px;
  color: white;
  font-size: 24px;
  font-weight: 900;
  background: var(--orange);
  border: 2px solid #ad4b1d;
  border-radius: 16px;
  box-shadow: 0 5px 0 #8f3b18;
}

.primary-button:active { transform: translateY(3px); box-shadow: 0 2px 0 #8f3b18; }
.primary-button:focus-visible, .control-button:focus-visible { outline: 4px solid #ffda58; outline-offset: 3px; }

.result-score { display: flex; align-items: baseline; justify-content: center; gap: 16px; margin: 17px 0 20px; font-size: 20px; }
.result-score strong { color: var(--orange); font-size: 52px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 24px; }
.result-grid span { padding: 10px; font-size: 18px; background: var(--cream-strong); border-radius: 9px; }
.result-grid strong { color: var(--orange-deep); font-size: 22px; }

.speed-tuner {
  position: absolute;
  top: 88px;
  right: 0;
  z-index: 32;
  display: flex;
  align-items: flex-start;
  width: 286px;
  color: #493727;
  transition: transform .22s ease;
}

.speed-tuner.is-collapsed { transform: translateX(244px); }

.speed-tuner__toggle {
  flex: 0 0 42px;
  min-height: 92px;
  padding: 9px 7px;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  background: #c75d27;
  border: 2px solid rgb(255 255 255 / 80%);
  border-right: 0;
  border-radius: 14px 0 0 14px;
  box-shadow: -4px 5px 14px rgb(40 71 64 / 22%);
}

.speed-tuner__panel {
  flex: 1;
  padding: 17px 18px 16px;
  background: rgb(255 249 233 / 96%);
  border: 2px solid rgb(255 255 255 / 88%);
  border-right: 0;
  border-radius: 0 0 0 18px;
  box-shadow: -7px 8px 22px rgb(34 71 66 / 22%);
  backdrop-filter: blur(6px);
}

.speed-tuner__eyebrow { margin: 0 0 10px; color: #9b7045; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.speed-tuner__title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 18px; font-weight: 900; }
.speed-tuner__title-row output { color: var(--orange-deep); font-size: 24px; font-variant-numeric: tabular-nums; }
.speed-tuner input[type="range"] { width: 100%; margin: 14px 0 5px; accent-color: var(--orange); }
.speed-tuner__ticks { display: flex; justify-content: space-between; color: #796653; font-size: 11px; font-weight: 700; }
.speed-tuner__times { margin: 14px 0 10px; padding: 9px 11px; background: rgb(229 239 211 / 72%); border-radius: 10px; }
.speed-tuner__times div { display: flex; justify-content: space-between; padding: 3px 0; }
.speed-tuner__times dt, .speed-tuner__times dd { margin: 0; font-size: 13px; font-weight: 800; }
.speed-tuner__times dd { color: #47713c; font-variant-numeric: tabular-nums; }
.difficulty-tuner { margin: 13px 0 11px; padding-top: 12px; border-top: 1px solid rgb(121 92 59 / 18%); }
.difficulty-tuner__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.difficulty-tuner__heading strong { font-size: 16px; }
.difficulty-tuner__heading output { color: #47713c; font-size: 12px; font-weight: 900; }
.difficulty-tuner__levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.difficulty-tuner__levels button { min-height: 32px; color: #604830; font-size: 13px; font-weight: 900; background: #f7ead0; border: 1px solid #d8c39c; border-radius: 8px; }
.difficulty-tuner__levels button[aria-pressed="true"] { color: #fff; background: #5f8d4e; border-color: #426d35; box-shadow: inset 0 -2px 0 rgb(41 83 45 / 30%); }
.difficulty-tuner__dynamic { width: 100%; min-height: 32px; margin-top: 7px; color: #426d35; font-size: 12px; font-weight: 900; background: #edf3df; border: 1px solid #b7ca9e; border-radius: 8px; }
.difficulty-tuner__dynamic:disabled { color: #998b78; background: #eee8dc; border-color: #d8d0c1; opacity: .72; }
.speed-tuner__note { margin: 0 0 12px; color: #71604f; font-size: 12px; line-height: 1.5; }
.speed-tuner__reset { width: 100%; min-height: 34px; color: #704329; font-weight: 900; background: #fff0cf; border: 1px solid #d8b883; border-radius: 9px; }
.speed-tuner button:focus-visible, .speed-tuner input:focus-visible { outline: 3px solid #ffda58; outline-offset: 2px; }

@media (max-width: 1040px), (max-height: 680px) {
  .topbar { padding: 0 1.5%; }
  .topbar__actions { flex-basis: 15%; }
  .control-button { min-width: 104px; min-height: 40px; padding: 0 12px; font-size: 17px; border-radius: 12px; }
  .stat-group { gap: 1%; }
  .stat { min-width: 148px; height: 42px; gap: 7px; padding: 0 11px; border-radius: 13px; }
  .stat__icon { width: 28px; height: 28px; font-size: 17px; }
  .stat__label { font-size: 16px; }
  .stat__value { font-size: 23px; }
  .overlay__card { padding: 22px 28px 26px; }
  .overlay h1, .overlay h2 { font-size: 34px; }
  .overlay p { margin: 10px 0 16px; font-size: 17px; }
  .primary-button { min-height: 48px; font-size: 20px; }
  .level-progress { transform: scale(.86); transform-origin: bottom right; }
  .speed-tuner { top: 80px; transform: scale(.86); transform-origin: top right; }
  .speed-tuner.is-collapsed { transform: translateX(244px) scale(.86); }
}

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