:root {
  color-scheme: light;
  --ink: #4b2f1f;
  --ink-soft: #74523a;
  --cream: #fff8e9;
  --cream-2: #fff0cf;
  --panel: rgba(255, 252, 241, 0.92);
  --wood: #e9b777;
  --wood-dark: #b97939;
  --line: #d9a35c;
  --mint: #cdd377;
  --mint-dark: #aab35c;
  --salmon: #f78a5e;
  --pink: #f69aa1;
  --pink-2: #ffd1d1;
  --tea: #9aa65a;
  --shadow: rgba(120, 73, 30, 0.24);
  --soft-shadow: rgba(132, 85, 34, 0.14);
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.75), transparent 28rem),
    radial-gradient(circle at 88% 10%, rgba(255, 238, 185, 0.8), transparent 25rem),
    linear-gradient(180deg, #ffe6ae 0%, #f8c978 54%, #f1b766 100%);
  overflow: hidden;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.game-shell {
  --shell-margin: clamp(4px, 0.85svh, 8px);
  width: min(96vw, 1500px);
  height: calc(100svh - (var(--shell-margin) * 2));
  min-height: 0;
  margin: var(--shell-margin) auto;
  padding: clamp(10px, 1.3vw, 16px);
  position: relative;
  border: 4px solid #cf8e43;
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 247, 219, 0.95), rgba(255, 231, 178, 0.95)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0 20px, transparent 20px 40px);
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, 0.5),
    0 22px 60px rgba(122, 74, 21, 0.25);
  display: grid;
  grid-template-rows:
    clamp(74px, 12svh, 112px)
    clamp(102px, 18svh, 154px)
    clamp(70px, 11svh, 106px)
    minmax(0, 1fr)
    clamp(54px, 8svh, 78px);
  gap: clamp(4px, 0.8svh, 8px);
  overflow: hidden;
  outline: none;
}

.game-shell:focus-visible {
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, 0.5),
    0 0 0 4px rgba(246, 154, 161, 0.46),
    0 22px 60px rgba(122, 74, 21, 0.25);
}

.top-board {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(420px, 1.25fr) minmax(176px, auto);
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  min-height: 0;
  height: 100%;
  padding: 4px 24px 0;
}

.brand {
  min-width: 0;
}

.logo-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.logo-wrap h1 {
  margin: 0;
  font-size: clamp(2.8rem, min(5.3vw, 8.2svh), 5rem);
  line-height: 0.86;
  color: #5a3522;
  text-shadow:
    0 4px 0 #fff,
    4px 0 0 #fff,
    -4px 0 0 #fff,
    0 -4px 0 #fff,
    0 8px 0 rgba(135, 89, 42, 0.18);
}

.logo-wrap h1 span {
  color: #6c4226;
}

.logo-wrap i {
  width: 32px;
  height: 32px;
  margin-bottom: 6px;
  border: 3px solid #ef7058;
  border-radius: 6px;
  color: #ef7058;
  background: #fff7e9;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 1.05rem;
  transform: rotate(8deg);
}

.brand p {
  margin: clamp(3px, 0.8svh, 10px) 0 0 4px;
  font-size: clamp(0.9rem, min(1.3vw, 2.2svh), 1.35rem);
  white-space: nowrap;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1.35fr 0.92fr;
  gap: clamp(10px, 2vw, 28px);
}

.stat-card {
  height: 100%;
  min-height: 0;
  padding: clamp(6px, 1.15svh, 12px) 18px clamp(5px, 0.9svh, 10px);
  border: 3px solid #edcc98;
  border-radius: 23px;
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,248,229,0.82));
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.75), 0 7px 0 rgba(191, 132, 64, 0.1);
  text-align: center;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  align-items: end;
}

.stat-card span {
  grid-column: 1 / -1;
  font-size: clamp(0.82rem, min(1.45vw, 2.45svh), 1.55rem);
  line-height: 1;
}

.stat-card strong {
  font-size: clamp(2rem, min(4vw, 6.2svh), 4.3rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.stat-card small {
  padding: 0 0 clamp(3px, 0.8svh, 10px) 4px;
  font-size: clamp(0.78rem, min(1.25vw, 1.9svh), 1.15rem);
}

.round-actions {
  display: flex;
  gap: clamp(16px, 2vw, 28px);
  justify-content: flex-end;
}

.circle-button {
  width: 80px;
  display: grid;
  justify-items: center;
  gap: 6px;
  background: transparent;
}

.circle-button span {
  width: clamp(46px, 7.2svh, 68px);
  height: clamp(46px, 7.2svh, 68px);
  border: 4px solid #be8347;
  border-radius: 999px;
  background: #fff7e9;
  color: #633a23;
  display: grid;
  place-items: center;
  font-size: clamp(2rem, 5.4svh, 3.5rem);
  line-height: 1;
  box-shadow: inset 0 4px 0 rgba(255,255,255,0.75);
  transition: transform 160ms ease, background 160ms ease;
}

.circle-button:hover span,
.circle-button:focus-visible span {
  transform: translateY(-2px) rotate(-2deg);
  background: #fff0d1;
}

.circle-button small {
  font-size: clamp(0.78rem, 1.8svh, 1.1rem);
}

.order-stage {
  min-height: 0;
  height: 100%;
  position: relative;
  display: grid;
  grid-template-columns: 260px 1fr 270px;
  align-items: center;
  gap: 18px;
  padding: clamp(6px, 1svh, 8px) 42px;
  border: 3px solid #c0b55b;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(219, 221, 126, 0.78), rgba(198, 207, 105, 0.76)),
    linear-gradient(90deg, rgba(255,255,255,0.12), transparent 50%, rgba(255,255,255,0.18));
  box-shadow: inset 0 -4px 0 rgba(138, 132, 44, 0.12);
  overflow: hidden;
}

.order-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 2px solid rgba(141, 133, 53, 0.28);
}

.chef-seal,
.special-plate,
.order-card {
  position: relative;
  z-index: 1;
}

.asset-image {
  display: block;
  max-width: none;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 8px 0 rgba(103, 66, 30, 0.1));
}

.chef-seal {
  height: 100%;
  transform: scale(0.9);
  transform-origin: left bottom;
}

.chef-seal-art {
  position: absolute;
  left: -24px;
  bottom: clamp(-38px, -4svh, -24px);
  width: clamp(218px, 26svh, 304px);
}

.sign-label {
  position: absolute;
  z-index: 5;
  left: 207px;
  top: 44px;
  width: 86px;
  display: block;
  color: #6a4329;
  font-size: 1.8rem;
  white-space: nowrap;
  transform: rotate(3deg);
  text-shadow: 0 2px 0 rgba(255, 246, 222, 0.75);
}

.order-card {
  min-height: 0;
  height: 100%;
  padding: clamp(12px, 2.2svh, 20px) 30px clamp(9px, 1.7svh, 17px);
  border: 4px solid rgba(137, 130, 72, 0.72);
  border-radius: 25px;
  background: linear-gradient(180deg, #fffefa, #fff9ea);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.88),
    0 6px 0 rgba(120, 102, 43, 0.12);
  text-align: center;
}

.order-card h2 {
  margin: 0;
  font-size: clamp(1.8rem, min(3.9vw, 6.2svh), 3.8rem);
  line-height: 1.05;
  white-space: nowrap;
}

.order-card p {
  margin: clamp(8px, 1.5svh, 14px) 0 0;
  color: #ee7e89;
  font-size: clamp(1.2rem, min(2.4vw, 3.9svh), 2.55rem);
  line-height: 1;
  word-break: break-all;
}

.special-plate {
  height: 100%;
  transform: scale(0.9);
  transform-origin: right center;
}

.featured-sushi {
  position: absolute;
  right: -8px;
  top: 0;
  width: clamp(170px, 24svh, 250px);
}

.conveyor {
  margin-inline: -22px;
  border-top: 8px solid #f7d093;
  border-bottom: 8px solid #f7d093;
  background:
    linear-gradient(#d59b5f 0 0) top / 100% 2px no-repeat,
    linear-gradient(#af7439 0 0) bottom / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, #e3ad70 0 142px, #d59958 142px 146px, #eab87a 146px 288px);
}

.belt {
  height: 100%;
  position: relative;
  background:
    linear-gradient(180deg, #dba062, #c88b4c 52%, #ba7a3a);
  overflow: hidden;
}

.belt-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 3px solid rgba(104, 59, 22, 0.18);
}

.sushi-rail {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: clamp(12px, 2.4vw, 40px);
  list-style: none;
  margin: 0;
  padding: 9px clamp(54px, 7vw, 96px) 0;
}

.sushi-plate {
  min-width: 0;
  position: relative;
  height: 100%;
  animation: floatPlate 2.4s ease-in-out infinite;
}

.sushi-plate:nth-child(2n) {
  animation-delay: -0.6s;
}

.sushi-plate:nth-child(3n) {
  animation-delay: -1.2s;
}

.sushi-image {
  position: absolute;
  left: 50%;
  bottom: clamp(-10px, -1svh, -4px);
  width: min(100%, 184px);
  height: min(104px, calc(100% + 12px));
  object-fit: contain;
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 0 rgba(99, 59, 23, 0.13));
}

.typing-area {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(560px, 2.7fr) minmax(205px, 1fr);
  align-items: end;
  gap: clamp(8px, 2vw, 28px);
  padding: 0 22px;
}

.type-panel {
  min-width: 0;
  align-self: start;
  height: 100%;
  min-height: 0;
  padding: clamp(8px, 1.35svh, 12px) 20px clamp(9px, 1.55svh, 14px);
  border: 4px solid #d0a35f;
  border-radius: 28px;
  background: rgba(255, 250, 239, 0.95);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.75),
    0 9px 0 rgba(142, 89, 39, 0.1);
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: clamp(6px, 1.05svh, 10px);
}

.message-bar {
  min-height: clamp(18px, 3svh, 28px);
  color: #956b38;
  text-align: center;
  font-size: clamp(0.86rem, min(1.45vw, 2.25svh), 1.35rem);
}

.input-frame {
  min-height: clamp(58px, 10svh, 78px);
  padding: clamp(6px, 1.1svh, 10px);
  border: 4px solid var(--pink);
  border-radius: 22px;
  background: #fffdf7;
  display: grid;
  grid-template-columns: 1fr minmax(124px, 158px);
  align-items: center;
  gap: 12px;
  box-shadow: inset 0 3px 0 rgba(255, 201, 201, 0.55);
}

.input-frame.shake {
  animation: shake 180ms linear;
}

.typed-display {
  min-width: 0;
  padding: 8px 14px 8px 20px;
  font-size: clamp(1.55rem, min(3.35vw, 5.1svh), 3.5rem);
  line-height: 1.08;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  font-family: "Trebuchet MS", "Hiragino Maru Gothic ProN", sans-serif;
}

.typed-display .typed {
  color: #8fdb98;
}

.typed-display .pending {
  color: var(--ink);
}

.typed-display .caret {
  display: inline-block;
  width: 4px;
  height: 1.1em;
  margin-left: 2px;
  transform: translateY(0.12em);
  border-radius: 999px;
  background: #a95a4f;
  animation: blink 0.85s steps(1) infinite;
}

.serve-button {
  height: clamp(48px, 8.2svh, 62px);
  border: 4px solid #ec838b;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffa7ae, #f27e8a);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.52),
    0 4px 0 #cc6570;
  text-shadow: 0 2px 0 rgba(151, 62, 72, 0.28);
  transition: transform 120ms ease, filter 120ms ease;
}

.serve-button strong {
  display: block;
  font-size: clamp(1.2rem, min(2.2vw, 3.2svh), 2.05rem);
  line-height: 1;
}

.serve-button small {
  font-size: clamp(0.74rem, 1.8svh, 1rem);
}

.serve-button:active {
  transform: translateY(3px);
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.52), 0 1px 0 #cc6570;
}

.serve-button.ready {
  filter: saturate(1.18) brightness(1.03);
  animation: readyPulse 1.05s ease-in-out infinite;
}

.keyboard {
  display: grid;
  gap: clamp(4px, 0.8svh, 7px);
  align-content: center;
  justify-items: center;
}

.key-row {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: clamp(4px, min(1vw, 0.9svh), 12px);
}

.key {
  padding: 0;
  flex: 1 1 0;
  width: auto;
  max-width: 72px;
  min-width: 0;
  height: clamp(31px, 5.5svh, 45px);
  border: 3px solid #dfc59e;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffaf0, #fff1d8);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.75),
    0 4px 0 rgba(170, 116, 58, 0.12);
  display: grid;
  place-items: center;
  color: #50321f;
  font-size: clamp(0.95rem, min(2.1vw, 3.2svh), 2rem);
  transition: transform 100ms ease, background 100ms ease, border-color 100ms ease;
}

.key.space {
  flex: 0 1 240px;
  width: min(28vw, 240px);
  max-width: 240px;
}

.key.wide {
  flex: 1.6 1 0;
  width: auto;
  max-width: 140px;
  font-size: clamp(0.82rem, 1.1vw, 1.05rem);
  line-height: 1.05;
  text-align: center;
}

.key.active,
.key.next {
  border-color: #f2848e;
  background: linear-gradient(180deg, #ffd0d4, #f9949e);
  color: #fff;
  text-shadow: 0 1px 0 rgba(147, 67, 74, 0.38);
  transform: translateY(3px);
}

.key.bad {
  animation: keyBad 190ms linear;
}

.mascot {
  position: relative;
  min-height: 318px;
  transform: scale(0.9);
  transform-origin: bottom center;
}

.mascot-art {
  position: absolute;
  z-index: 2;
  bottom: 4px;
  width: 255px;
}

.cat-art {
  left: -4px;
}

.penguin-art {
  right: -4px;
  width: 300px;
}

.speech {
  position: absolute;
  z-index: 4;
  top: 0;
  min-width: 196px;
  padding: 24px 18px 20px;
  border: 4px solid #d0a35f;
  border-radius: 48% 52% 45% 50%;
  background: #fff9e9;
  box-shadow: 0 5px 0 rgba(122, 75, 30, 0.11);
  text-align: center;
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
  line-height: 1.55;
}

.speech::after {
  content: "";
  position: absolute;
  bottom: -24px;
  width: 28px;
  height: 26px;
  border: 4px solid #d0a35f;
  border-top: 0;
  border-left: 0;
  background: #fff9e9;
}

.speech.left {
  left: 10px;
}

.speech.left::after {
  left: 72px;
  transform: rotate(28deg);
}

.speech.right {
  right: 0;
}

.speech.right::after {
  right: 60px;
  transform: rotate(-18deg);
}

.plate-stack {
  position: absolute;
  left: -56px;
  bottom: -16px;
  width: 126px;
  height: 76px;
  border-radius: 50%;
  background:
    linear-gradient(#f59aa0 0 0) 0 0 / 100% 18px no-repeat,
    linear-gradient(#fff4d0 0 0) 0 18px / 100% 18px no-repeat,
    linear-gradient(#9cc6d1 0 0) 0 36px / 100% 18px no-repeat,
    linear-gradient(#f3cd5e 0 0) 0 54px / 100% 18px no-repeat;
  border: 4px solid rgba(124, 82, 45, 0.45);
  box-shadow: 0 5px 0 rgba(126, 82, 38, 0.12);
}

.tea-cup {
  position: absolute;
  left: 94px;
  bottom: -12px;
  width: 66px;
  height: 66px;
  border: 4px solid #a18f68;
  border-radius: 18px 18px 28px 28px;
  background: linear-gradient(180deg, #fff7d9, #e5d29b);
}

.tea-cup::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 8px;
  height: 16px;
  border-radius: 50%;
  background: #879542;
}

.progress-dock {
  width: min(100%, 1040px);
  height: 100%;
  min-height: 0;
  margin: -2px auto 0;
  padding: clamp(5px, 0.9svh, 8px) 18px;
  border: 4px solid #d0a35f;
  border-radius: 20px;
  background: #fff7e7;
  display: grid;
  grid-template-columns: 100px 1fr 100px;
  align-items: center;
  gap: 14px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.75);
}

.level-label {
  display: grid;
  grid-template-columns: 1fr 34px;
  align-items: center;
  gap: 4px;
}

.level-label span,
.level-label strong {
  grid-column: 1;
}

.level-label span {
  font-size: 1.05rem;
  line-height: 1;
  white-space: nowrap;
}

.level-label strong {
  font-size: 1.28rem;
  line-height: 1;
  white-space: nowrap;
}

.level-label button {
  grid-column: 2;
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  border: 3px solid #d4b176;
  border-radius: 999px;
  background: #fffaf0;
  color: #bb8041;
  font-size: 2rem;
  line-height: 0.8;
}

.progress-track {
  position: relative;
  height: min(52px, 100%);
}

.progress-track::before,
.progress-fill {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 28px;
  height: 10px;
  border-radius: 999px;
}

.progress-track::before {
  border: 3px solid #efb5aa;
  background: #ffe4d9;
}

.progress-fill {
  right: auto;
  width: 0%;
  border: 0;
  background: linear-gradient(90deg, #8ed8b1, #ffd763, #f58e92);
  transition: width 240ms ease;
}

.milestones {
  list-style: none;
  padding: 0;
  margin: 0;
}

.milestones li {
  position: absolute;
  left: calc(var(--pos) * 100%);
  top: 0;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 4px;
}

.mini-sushi-img {
  width: clamp(34px, 5.4svh, 52px);
  height: clamp(24px, 4svh, 38px);
  object-fit: contain;
  filter: drop-shadow(0 4px 0 rgba(120, 79, 33, 0.12));
}

.milestones em {
  font-style: normal;
  font-size: 0.95rem;
  white-space: nowrap;
}

.goal {
  justify-self: end;
  width: 92px;
  text-align: center;
  color: #c98322;
  display: grid;
  gap: 2px;
}

.goal span {
  font-size: 1.6rem;
  line-height: 1;
}

.goal strong {
  font-size: 1.1rem;
}

.modal {
  width: min(92vw, 520px);
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(79, 48, 25, 0.34);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  padding: 34px 34px 30px;
  border: 4px solid #cf8e43;
  border-radius: 26px;
  background: linear-gradient(180deg, #fffaf0, #ffe9ba);
  color: var(--ink);
  box-shadow: 0 20px 50px rgba(80, 42, 12, 0.24);
  text-align: center;
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 44px;
  height: 44px;
  border: 3px solid #bc8245;
  border-radius: 999px;
  background: #fff6e4;
  font-size: 2rem;
  line-height: 1;
}

.modal h2 {
  margin: 0 0 18px;
  font-size: 2.5rem;
}

.modal p {
  margin: 12px 0;
  font-size: 1.1rem;
  line-height: 1.75;
}

.modal ul {
  display: grid;
  gap: 9px;
  justify-content: center;
  list-style: none;
  padding: 8px 0 0;
  margin: 0;
}

kbd {
  padding: 3px 10px;
  border: 2px solid #d3ad70;
  border-radius: 8px;
  background: #fffaf1;
  box-shadow: inset 0 -2px 0 rgba(166, 109, 49, 0.12);
}

.result-score {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  justify-content: center;
  width: fit-content;
  margin: 0 auto 20px;
}

.result-score span {
  grid-column: 1 / -1;
  font-size: 1.2rem;
}

.result-score strong {
  font-size: 4.7rem;
  line-height: 0.92;
}

.result-score small {
  padding: 0 0 8px 6px;
  font-size: 1.1rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 24px;
}

.result-grid div {
  padding: 12px;
  border: 3px solid #edcc98;
  border-radius: 16px;
  background: rgba(255, 252, 241, 0.76);
}

.result-grid dt {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.result-grid dd {
  margin: 4px 0 0;
  font-size: 1.35rem;
}

.primary-action {
  min-height: 58px;
  padding: 0 26px;
  border: 4px solid #ee818a;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffafb5, #f27f89);
  color: #fff;
  box-shadow: 0 5px 0 #cc6570;
  font-size: 1.25rem;
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

@keyframes keyBad {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); background: #ffd5d5; }
}

@keyframes readyPulse {
  50% { transform: translateY(-1px); }
}

@keyframes floatPlate {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@media (max-width: 1320px) {
  .game-shell {
    width: min(98vw, 1220px);
  }

  .top-board {
    grid-template-columns: minmax(210px, 0.85fr) minmax(390px, 1.2fr) minmax(152px, auto);
    gap: 14px;
    padding-inline: 14px;
  }

  .brand p {
    font-size: 1rem;
  }

  .stats {
    gap: 12px;
  }

  .stat-card {
    min-height: 96px;
  }

  .round-actions {
    gap: 12px;
  }

  .circle-button {
    width: 66px;
  }

  .circle-button span {
    width: 62px;
    height: 62px;
    font-size: 2.8rem;
  }

  .circle-button small {
    font-size: 0.92rem;
  }

  .order-stage {
    grid-template-columns: 200px 1fr 196px;
    padding-inline: 24px;
  }

  .chef-seal {
    transform: scale(0.82);
    transform-origin: left bottom;
  }

  .special-plate {
    transform: scale(0.86);
    transform-origin: right center;
  }

  .order-card h2 {
    font-size: clamp(2.15rem, 3.45vw, 3.35rem);
  }

  .typing-area {
    grid-template-columns: 1fr;
    padding-inline: 8px;
  }

  .mascot {
    display: none;
  }

  .type-panel {
    width: min(100%, 850px);
    min-height: 350px;
    justify-self: center;
  }
}

@media (max-width: 1120px) {
  .game-shell {
    width: min(98vw, 980px);
    min-height: auto;
  }

  .top-board {
    grid-template-columns: 1fr;
    padding-inline: 8px;
  }

  .stats {
    order: 2;
  }

  .round-actions {
    position: absolute;
    right: 24px;
    top: 24px;
  }

  .circle-button {
    width: 62px;
  }

  .circle-button span {
    width: 58px;
    height: 58px;
    font-size: 2.6rem;
  }

  .circle-button small {
    font-size: 0.88rem;
  }

  .order-stage {
    grid-template-columns: 150px 1fr;
    padding: 14px;
  }

  .chef-seal {
    transform: scale(0.72);
    transform-origin: left bottom;
  }

  .special-plate {
    display: none;
  }

  .typing-area {
    grid-template-columns: 1fr;
    padding-inline: 0;
  }

  .mascot {
    display: none;
  }

  .type-panel {
    min-height: 366px;
  }

  .sushi-rail {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    padding-inline: 30px;
  }

  .sushi-plate:nth-child(n + 5) {
    display: none;
  }
}

@media (max-width: 700px) {
  body {
    background: linear-gradient(180deg, #ffe6ae, #f7bf68);
  }

  .game-shell {
    width: 100vw;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
    border-width: 0;
    padding: 10px;
    gap: 10px;
  }

  .logo-wrap h1 {
    font-size: 3rem;
  }

  .brand p {
    font-size: 0.98rem;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }

  .stat-card {
    min-height: 76px;
    padding: 10px 8px 8px;
    border-width: 2px;
    border-radius: 16px;
  }

  .stat-card span {
    font-size: 0.9rem;
  }

  .stat-card strong {
    font-size: 2rem;
  }

  .stat-card small {
    padding-bottom: 4px;
    font-size: 0.78rem;
  }

  .round-actions {
    right: 8px;
    top: 8px;
    gap: 8px;
  }

  .circle-button {
    width: 46px;
  }

  .circle-button span {
    width: 42px;
    height: 42px;
    border-width: 3px;
    font-size: 2rem;
  }

  .circle-button small {
    display: none;
  }

  .order-stage {
    grid-template-columns: 1fr;
    min-height: 156px;
  }

  .chef-seal {
    display: none;
  }

  .order-card {
    min-height: 116px;
    padding: 22px 12px 18px;
  }

  .order-card h2 {
    font-size: clamp(1.9rem, 9vw, 2.8rem);
  }

  .order-card p {
    margin-top: 12px;
    font-size: clamp(1.25rem, 7vw, 2rem);
  }

  .conveyor {
    margin-inline: -10px;
  }

  .belt {
    height: 96px;
  }

  .sushi-rail {
    grid-template-columns: repeat(3, 1fr);
    padding: 10px 12px 0;
    gap: 10px;
  }

  .sushi-plate:nth-child(n + 4) {
    display: none;
  }

  .type-panel {
    padding: 10px;
    min-height: 345px;
    border-radius: 20px;
  }

  .message-bar {
    min-height: 24px;
    font-size: 0.95rem;
  }

  .input-frame {
    min-height: 88px;
    grid-template-columns: 1fr;
    border-width: 3px;
    border-radius: 16px;
    gap: 8px;
  }

  .typed-display {
    padding-inline: 10px;
    text-align: center;
    font-size: clamp(1.35rem, 7.8vw, 1.9rem);
  }

  .serve-button {
    width: min(100%, 168px);
    height: 50px;
    justify-self: end;
    border-radius: 14px;
  }

  .serve-button strong {
    font-size: 1.15rem;
  }

  .serve-button small {
    font-size: 0.72rem;
  }

  .key-row {
    gap: 4px;
  }

  .key {
    min-width: 0;
    width: auto;
    height: 46px;
    border-width: 2px;
    font-size: 1.05rem;
  }

  .key.wide {
    width: calc((100vw - 64px) / 5);
    font-size: 0.68rem;
  }

  .key.space {
    width: 140px;
    flex-basis: 140px;
  }

  .progress-dock {
    grid-template-columns: 72px 1fr 58px;
    gap: 8px;
    padding: 10px 8px;
    border-radius: 16px;
  }

  .level-label span {
    font-size: 0.8rem;
  }

  .level-label strong {
    font-size: 0.95rem;
  }

  .level-label button {
    width: 26px;
    height: 26px;
    font-size: 1.4rem;
  }

  .milestones li:nth-child(even) em {
    display: none;
  }

  .goal {
    width: 54px;
  }

  .goal strong {
    font-size: 0.75rem;
  }
}

@media (min-width: 701px) and (max-width: 1120px) {
  .game-shell {
    width: min(98vw, 1080px);
  }

  .top-board {
    grid-template-columns: minmax(185px, 0.85fr) minmax(380px, 1.25fr) minmax(132px, auto);
    gap: 10px;
    padding-inline: 12px;
  }

  .stats {
    order: 0;
  }

  .round-actions {
    position: static;
    right: auto;
    top: auto;
    gap: 8px;
  }

  .order-stage {
    grid-template-columns: 140px 1fr;
    padding: 10px 14px;
  }

  .type-panel {
    width: min(100%, 780px);
    min-height: 0;
  }
}

@media (max-height: 820px) {
  .game-shell {
    padding: clamp(7px, 1.1vw, 12px);
    border-width: 3px;
    border-radius: 22px;
    grid-template-rows:
      clamp(62px, 11.5svh, 92px)
      clamp(88px, 17svh, 132px)
      clamp(58px, 10svh, 82px)
      minmax(0, 1fr)
      clamp(44px, 7.2svh, 60px);
  }

  .top-board {
    padding-top: 0;
  }

  .brand p {
    margin-top: 2px;
  }

  .order-stage {
    border-width: 2px;
  }

  .order-card h2 {
    font-size: clamp(1.55rem, min(3.15vw, 5.2svh), 2.85rem);
  }

  .order-card p {
    margin-top: 5px;
    font-size: clamp(0.95rem, min(2.05vw, 3.1svh), 1.55rem);
  }

  .conveyor {
    border-top-width: 5px;
    border-bottom-width: 5px;
  }

  .sushi-rail {
    padding-top: 4px;
  }

  .typing-area {
    gap: 10px;
  }

  .type-panel {
    border-width: 3px;
    border-radius: 20px;
  }

  .input-frame {
    border-width: 3px;
    border-radius: 17px;
  }

  .key {
    border-width: 2px;
    border-radius: 8px;
  }

  .progress-dock {
    border-width: 3px;
    border-radius: 16px;
    gap: 10px;
  }

  .level-label span {
    font-size: 0.86rem;
  }

  .level-label strong {
    font-size: 1rem;
  }

  .milestones em {
    font-size: 0.8rem;
  }

  .goal {
    align-self: center;
  }

  .goal span {
    font-size: 1.12rem;
  }

  .goal strong {
    font-size: 0.82rem;
  }
}

@media (max-width: 700px) {
  .game-shell {
    width: 100vw;
    height: 100svh;
    min-height: 0;
    margin: 0;
    padding: 6px;
    border-radius: 0;
    border-width: 0;
    grid-template-rows:
      clamp(96px, 17svh, 124px)
      clamp(94px, 17svh, 116px)
      clamp(54px, 10svh, 76px)
      minmax(0, 1fr)
      clamp(42px, 7.4svh, 52px);
    gap: clamp(4px, 0.8svh, 6px);
  }

  .top-board {
    height: 100%;
    padding: 0 6px;
    gap: 5px;
  }

  .logo-wrap {
    align-items: center;
    gap: 6px;
  }

  .logo-wrap h1 {
    font-size: clamp(1.9rem, 10vw, 2.45rem);
    line-height: 0.9;
  }

  .logo-wrap i {
    width: 24px;
    height: 24px;
    margin-bottom: 0;
    font-size: 0.78rem;
    border-width: 2px;
  }

  .brand p {
    margin-top: 2px;
    font-size: clamp(0.7rem, 3.3vw, 0.82rem);
  }

  .stats {
    gap: 5px;
  }

  .stat-card {
    min-height: 0;
    height: clamp(48px, 8.4svh, 62px);
    padding: 5px 6px 4px;
    border-width: 2px;
    border-radius: 12px;
  }

  .stat-card span {
    font-size: clamp(0.62rem, 2.8vw, 0.78rem);
  }

  .stat-card strong {
    font-size: clamp(1.4rem, 7.2vw, 1.85rem);
  }

  .stat-card small {
    padding-bottom: 2px;
    font-size: clamp(0.6rem, 2.4vw, 0.7rem);
  }

  .round-actions {
    right: 6px;
    top: 5px;
    gap: 6px;
  }

  .circle-button {
    width: 34px;
  }

  .circle-button span {
    width: 32px;
    height: 32px;
    border-width: 2px;
    font-size: 1.5rem;
  }

  .order-stage {
    height: 100%;
    min-height: 0;
    padding: 6px;
    border-width: 2px;
  }

  .order-card {
    height: 100%;
    min-height: 0;
    padding: clamp(9px, 2.1svh, 14px) 10px 8px;
    border-width: 3px;
    border-radius: 18px;
  }

  .order-card h2 {
    font-size: clamp(1.45rem, 7.1vw, 2rem);
  }

  .order-card p {
    margin-top: 7px;
    font-size: clamp(1rem, 5.6vw, 1.35rem);
  }

  .conveyor {
    border-top-width: 4px;
    border-bottom-width: 4px;
  }

  .belt {
    height: 100%;
  }

  .sushi-rail {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 2px 8px 0;
  }

  .sushi-image {
    height: min(76px, calc(100% + 12px));
  }

  .typing-area {
    min-height: 0;
    height: 100%;
  }

  .type-panel {
    height: 100%;
    min-height: 0;
    padding: 7px 8px;
    border-width: 3px;
    border-radius: 16px;
    gap: 5px;
  }

  .message-bar {
    min-height: 16px;
    font-size: clamp(0.76rem, 3.3vw, 0.88rem);
  }

  .input-frame {
    min-height: clamp(70px, 12.6svh, 90px);
    padding: 6px;
    border-width: 3px;
    border-radius: 14px;
    gap: 5px;
  }

  .typed-display {
    padding-inline: 7px;
    font-size: clamp(1.12rem, 6.7vw, 1.6rem);
  }

  .serve-button {
    width: min(100%, 148px);
    height: clamp(39px, 6.8svh, 48px);
    border-width: 3px;
    border-radius: 12px;
  }

  .serve-button strong {
    font-size: clamp(0.98rem, 4.6vw, 1.12rem);
  }

  .serve-button small {
    font-size: 0.62rem;
  }

  .keyboard {
    gap: clamp(3px, 0.7svh, 5px);
  }

  .key-row {
    gap: 3px;
  }

  .key {
    height: clamp(28px, 5.1svh, 36px);
    border-width: 2px;
    border-radius: 7px;
    font-size: clamp(0.78rem, 4.2vw, 1rem);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75), 0 2px 0 rgba(170, 116, 58, 0.12);
  }

  .key.wide {
    font-size: 0.55rem;
  }

  .key.space {
    flex-basis: 120px;
    max-width: 120px;
  }

  .progress-dock {
    height: 100%;
    min-height: 0;
    grid-template-columns: 54px 1fr 42px;
    gap: 5px;
    padding: 4px 6px;
    border-width: 2px;
    border-radius: 12px;
  }

  .level-label {
    grid-template-columns: 1fr 20px;
    grid-template-rows: 1fr 1fr;
    align-items: center;
    gap: 1px;
  }

  .level-label span {
    font-size: 0.62rem;
  }

  .level-label strong {
    font-size: 0.76rem;
  }

  .level-label button {
    width: 20px;
    height: 20px;
    border-width: 2px;
    font-size: 1rem;
  }

  .progress-track {
    height: 100%;
  }

  .progress-track::before,
  .progress-fill {
    top: 19px;
    height: 7px;
  }

  .mini-sushi-img {
    width: 28px;
    height: 19px;
  }

  .milestones li {
    gap: 0;
  }

  .milestones em {
    display: none;
  }

  .goal {
    width: 40px;
  }

  .goal span {
    font-size: 1rem;
  }

  .goal strong {
    font-size: 0.62rem;
  }
}

.modal-card {
  max-height: min(88svh, 640px);
  overflow: auto;
}

@media (max-height: 520px), (max-width: 340px) {
  html,
  body {
    min-height: 540px;
    overflow: auto;
  }

  body {
    overflow: auto;
  }

  .game-shell {
    height: max(100svh, 540px);
  }
}

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