:root {
  --ink: #1a0c1f;
  --paper: #0e0812;
  --cream: #fff3de;
  --coral: #ff5c3d;
  --amber: #ffb627;
  --mint: #7be3c4;
  --plum: #2b1533;
  --btn: min(82vw, 44vh, 520px);
  --halo: calc(var(--btn) * 1.62);
  --mascot: clamp(78px, 22vw, 116px);
  --card: clamp(86px, 21vw, 112px);
  --score-max: 92px;
  --rail-pad: 8px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--cream);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.paper {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #140d1c url(assets/riso_backdrop.webp) center center / cover no-repeat;
  filter: sepia(0.18) saturate(1.12) brightness(1.03);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 243, 222, 0.09) 0.5px, transparent 0.65px);
  background-size: 3px 3px;
  opacity: 0.3;
  mix-blend-mode: screen;
}

.page {
  position: relative;
  z-index: 2;
  height: 100dvh;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(8px, env(safe-area-inset-top)) clamp(10px, 3vw, 26px) max(10px, env(safe-area-inset-bottom));
}

.top {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.titlewrap {
  position: relative;
  line-height: 1;
  margin-top: 1px;
}

.title {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 3px;
  font-family: 'Bungee', sans-serif;
  font-weight: 400;
  font-size: clamp(28px, 9vw, 82px);
  line-height: 0.9;
  letter-spacing: 0.055em;
  color: var(--cream);
  -webkit-text-stroke: 0.055em var(--ink);
  paint-order: stroke fill;
  transform: skewX(-1deg);
}

.title::before {
  content: attr(data-text);
  position: absolute;
  left: -7px;
  top: 7px;
  z-index: -1;
  color: var(--coral);
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
}

.scorewrap {
  position: relative;
  width: 100%;
  margin-top: 2px;
}

.scoreplate {
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: min(420px, 82vw);
  height: auto;
  transform: translateX(-50%);
  clip-path: inset(90.5% 0 0 0);
  opacity: 0.96;
  pointer-events: none;
}

.scoreinner {
  position: relative;
  z-index: 2;
  padding: 0 0 1px;
}

.scorelabel {
  text-align: center;
  padding-right: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(7px, 1.15vh, 11px);
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--cream);
  opacity: 0.56;
  line-height: 1;
  margin-bottom: 2px;
}

.scorerow {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(5px, 1.2vw, 13px);
}

.scorenum {
  flex: 0 1 auto;
  min-width: 0;
  overflow: visible;
  text-align: right;
  white-space: nowrap;
  font-family: 'Chivo Mono', monospace;
  font-weight: 700;
  font-size: var(--score-max);
  line-height: 0.84;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
  color: var(--cream);
  -webkit-text-stroke: 0.035em var(--ink);
  paint-order: stroke fill;
  text-shadow: -4px 4px 0 var(--coral);
  transform-origin: 92% 60%;
}

.medallion {
  position: relative;
  flex: 0 0 auto;
  width: clamp(58px, 9.2vh, 104px);
  aspect-ratio: 324 / 315;
  display: grid;
  place-items: center;
  transform-origin: 50% 55%;
  margin-bottom: -1px;
}

.medallion img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: sepia(1) saturate(var(--sat, 1.8)) hue-rotate(var(--hue, 0deg)) brightness(var(--bri, 1)) drop-shadow(3px 4px 0 rgba(15, 7, 20, 0.82));
  transition: filter 0.25s linear;
}

.medallionText {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  line-height: 1;
  padding-top: 4%;
}

.medallionText #mult {
  font-family: 'Chivo Mono', monospace;
  font-weight: 700;
  font-size: clamp(18px, 3.05vh, 34px);
  letter-spacing: -0.04em;
}

.medallionText small {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(5px, 0.9vh, 9px);
  letter-spacing: 0.1em;
  opacity: 0.7;
  margin-top: 3%;
}

.stage {
  position: relative;
  z-index: 3;
  flex: 1 1 auto;
  width: 100%;
  max-width: 1120px;
  min-height: 0;
  display: grid;
  place-items: center;
  margin-top: clamp(1px, 0.7vh, 8px);
}

.halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--halo);
  aspect-ratio: 962 / 951;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.haloimg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.9;
  animation: haloSpin 120s linear infinite;
  filter: brightness(var(--heat-b, 1)) saturate(var(--heat-s, 1));
  will-change: transform, filter;
}

.rays {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background:
    repeating-conic-gradient(from -2deg at 50% 50%, rgba(255, 92, 61, 0.26) 0deg 4.6deg, transparent 4.9deg 21deg),
    repeating-conic-gradient(from -5deg at 50% 50%, rgba(255, 182, 39, 0.6) 0deg 2.1deg, rgba(255, 92, 61, 0.28) 2.1deg 4.2deg, transparent 4.2deg 11deg);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 0 40%, #000 44%, #000 87%, transparent 89%);
  mask-image: radial-gradient(circle at 50% 50%, transparent 0 40%, #000 44%, #000 87%, transparent 89%);
  mix-blend-mode: screen;
  opacity: 0.72;
  will-change: opacity;
}

.ringkick {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.buttonLean {
  position: relative;
  z-index: 2;
  transform-origin: 50% 90%;
  will-change: transform;
}

.buttonScale {
  transform: scale(1);
  transition: transform 0.08s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.buttonScale.press {
  transform: scale(0.952);
}

.bigbutton {
  position: relative;
  display: block;
  width: var(--btn);
  aspect-ratio: 422 / 437;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 10px 0 rgba(15, 7, 20, 0.82));
  outline: none;
  touch-action: manipulation;
}

.bigbutton .face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.045s linear;
  pointer-events: none;
  -webkit-user-drag: none;
}

.bigbutton .face.idle { opacity: 1; }

.bigbutton.charged .face.idle { opacity: 0; }
.bigbutton.charged .face.charged { opacity: 1; }

.bigbutton.pressed .face.idle { opacity: 0; }
.bigbutton.pressed .face.charged { opacity: 0; }
.bigbutton.pressed .face.pressed { opacity: 1; }

.bigbutton:focus-visible {
  outline: 3px dashed var(--cream);
  outline-offset: 4px;
  border-radius: 50%;
}

.gloss {
  position: absolute;
  z-index: 2;
  left: 29%;
  top: 21%;
  width: 32%;
  height: 24%;
  border-radius: 50%;
  transform: rotate(-18deg);
  pointer-events: none;
  background-color: rgba(255, 243, 222, 0.3);
  background-image: radial-gradient(rgba(255, 243, 222, 0.92) 1.1px, transparent 1.35px);
  background-size: 4.5px 4.5px;
  mix-blend-mode: screen;
  opacity: 0.9;
}

.gloss::after {
  content: '';
  position: absolute;
  left: 14%;
  top: 13%;
  width: 27%;
  height: 25%;
  border-radius: 50%;
  background: rgba(255, 243, 222, 0.92);
}

.domeShade {
  position: absolute;
  z-index: 1;
  left: 37%;
  top: 51%;
  width: 40%;
  height: 29%;
  border-radius: 50%;
  transform: rotate(-14deg);
  pointer-events: none;
  background-color: rgba(255, 92, 61, 0.14);
  background-image: radial-gradient(rgba(43, 15, 34, 0.5) 1px, transparent 1.2px);
  background-size: 5px 5px;
  mix-blend-mode: multiply;
  opacity: 0.75;
}

.btnlabel {
  position: absolute;
  left: 50%;
  top: 54.5%;
  transform: translate(-50%, -50%);
  z-index: 3;
  font-family: 'Bungee', sans-serif;
  font-weight: 400;
  font-size: calc(var(--btn) * 0.105);
  letter-spacing: 0.05em;
  color: var(--cream);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: -3px 3px 0 var(--coral);
  pointer-events: none;
  transition: transform 0.06s linear;
}

.bigbutton.pressed .btnlabel {
  transform: translate(-50%, -43%);
}

.mascot {
  position: absolute;
  z-index: 4;
  top: 46%;
  left: max(2px, calc(50% - var(--btn) / 2 - var(--mascot) * 0.7));
  width: var(--mascot);
  transform: translateY(-50%);
  pointer-events: none;
  animation: mascotBob 2.6s ease-in-out infinite;
  will-change: transform;
}

.mascot img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(3px 4px 0 rgba(15, 7, 20, 0.72));
}

.mascot.leap {
  animation: mascotLeap 0.85s cubic-bezier(0.16, 0.9, 0.3, 1) infinite;
}

.particles {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: visible;
}

.p {
  position: absolute;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0;
  will-change: transform, opacity;
}

.float {
  position: absolute;
  pointer-events: none;
  z-index: 7;
  padding: 4px 8px 5px;
  border: 2px solid var(--coral);
  border-radius: 3px;
  background: var(--plum);
  box-shadow: 3px 3px 0 rgba(15, 7, 20, 0.9);
  font-family: 'Bungee', sans-serif;
  font-size: clamp(16px, 3.8vh, 32px);
  line-height: 1;
  color: var(--cream);
  white-space: nowrap;
  opacity: 0;
  will-change: transform, opacity;
}

.hint {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: calc(50% + var(--btn) * 0.5 + 7px);
  transform: translateX(-50%);
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(8px, 1.3vh, 12px);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--cream);
  opacity: 0.88;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.4s linear;
  text-align: center;
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
}

.hint.gone { opacity: 0; }

.railwrap {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  width: 100%;
  max-width: 1180px;
}

.railhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 3px 3px;
  font-size: clamp(7px, 1.1vh, 10px);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--cream);
  opacity: 0.56;
  line-height: 1;
}

.railhint { letter-spacing: 0.16em; }

.rail {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 6px 0 9px;
  scroll-snap-type: x proximity;
}

.rail::-webkit-scrollbar { display: none; }

.railInner {
  display: flex;
  gap: clamp(7px, 1vw, 13px);
  width: max-content;
  margin: 0 auto;
  padding: 0 2px;
}

.card {
  position: relative;
  flex: 0 0 auto;
  width: var(--card);
  aspect-ratio: 342 / 474;
  padding: 0;
  border: 0;
  background: none;
  scroll-snap-align: center;
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.16s linear;
  filter: brightness(0.86) saturate(0.94) drop-shadow(0 4px 0 rgba(15, 7, 20, 0.85));
  outline: none;
  font-family: 'Space Grotesk', sans-serif;
}

.card.can {
  transform: translateY(-5px);
  filter: drop-shadow(0 8px 0 rgba(15, 7, 20, 0.9));
}

.card:focus-visible {
  outline: 2px dashed var(--mint);
  outline-offset: 3px;
}

.card .plate {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-drag: none;
}

.card .body {
  position: absolute;
  inset: 5% 7% 23.5%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.card .iconwrap {
  position: relative;
  flex: 1 1 0;
  width: 82%;
  min-height: 0;
  margin-top: 1%;
  display: grid;
  place-items: center;
}

.card .iconwrap::before {
  content: '';
  position: absolute;
  inset: 4% 6%;
  background: var(--coral);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(15, 7, 20, 0.6);
  transform: rotate(-2deg);
}

.card .icon {
  position: relative;
  z-index: 2;
  width: 82%;
  height: 82%;
  object-fit: contain;
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.2, 1);
  -webkit-user-drag: none;
}

.card .name {
  margin-top: 1.5%;
  font-family: 'Bungee', sans-serif;
  font-weight: 400;
  font-size: calc(var(--card) * 0.088);
  line-height: 1.02;
  letter-spacing: 0.01em;
  color: var(--ink);
  max-width: 100%;
}

.card .lvl {
  margin-top: 2.5%;
  font-size: calc(var(--card) * 0.06);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink);
  opacity: 0.52;
  line-height: 1;
}

.card .price {
  position: absolute;
  left: 4.5%;
  right: 4.5%;
  bottom: 3%;
  z-index: 2;
  height: 19%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--accent, #ff5c3d);
  color: var(--ink);
  font-family: 'Chivo Mono', monospace;
  font-weight: 700;
  font-size: calc(var(--card) * 0.1);
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  padding: 0;
  transition: background 0.16s linear, box-shadow 0.16s linear;
}

.card.can .price {
  box-shadow: inset 0 0 0 3px var(--mint);
}

.card.poorflash {
  animation: cardNo 0.24s linear 1;
}

.card.buying .plate {
  animation: cardPunch 0.4s cubic-bezier(0.16, 0.9, 0.3, 1) 1;
}

.card.buying .icon {
  animation: iconProud 0.4s cubic-bezier(0.16, 0.9, 0.3, 1) 1;
}

.card.buying::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--mint);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  animation: mintFlash 0.42s linear 1;
  clip-path: polygon(5% 1%, 95% 0, 100% 6%, 99% 94%, 94% 99%, 6% 100%, 0 95%, 1% 5%);
}

.card.running .icon {
  animation: clawTick var(--tick, 0.7s) linear infinite;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  z-index: 9;
  width: min(260px, 72vw);
  aspect-ratio: 526 / 164;
  transform: translate(-50%, 8px);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s linear, transform 0.22s cubic-bezier(0.16, 0.9, 0.3, 1);
}

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

.toast img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(3px 4px 0 rgba(15, 7, 20, 0.8));
}

.toast span {
  position: relative;
  z-index: 2;
  color: var(--ink);
  font-family: 'Bungee', sans-serif;
  font-size: clamp(10px, 1.7vh, 15px);
  letter-spacing: 0.03em;
}

.sound {
  position: fixed;
  z-index: 40;
  top: max(7px, env(safe-area-inset-top));
  right: max(7px, env(safe-area-inset-right));
  width: clamp(56px, 7.5vh, 88px);
  aspect-ratio: 526 / 164;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0.9;
  outline: none;
}

.sound img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(2px 3px 0 rgba(15, 7, 20, 0.8));
}

.sound span {
  position: relative;
  z-index: 2;
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(6px, 0.95vh, 9px);
  letter-spacing: 0.08em;
}

.sound.off span { opacity: 0.55; }
.sound:focus-visible { outline: 2px dashed var(--cream); outline-offset: 3px; }

.savetag {
  position: fixed;
  z-index: 41;
  top: max(31px, calc(env(safe-area-inset-top) + 25px));
  right: max(9px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border: 1px solid rgba(255, 243, 222, 0.28);
  border-radius: 999px;
  background: rgba(43, 21, 51, 0.6);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(6px, 0.95vh, 9px);
  letter-spacing: 0.16em;
  color: var(--cream);
  opacity: 0;
  transition: opacity 0.25s linear;
  pointer-events: none;
}

.savetag i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--mint);
}

.savetag.show { opacity: 0.72; }

.ribbonlayer {
  position: fixed;
  z-index: 45;
  top: max(4px, env(safe-area-inset-top));
  left: 50%;
  width: min(92vw, 620px);
  transform: translateX(-50%);
  pointer-events: none;
}

.ribbon {
  position: relative;
  width: 100%;
  aspect-ratio: 690 / 165;
  margin-top: 2px;
  filter: drop-shadow(4px 6px 0 rgba(15, 7, 20, 0.85));
}

.ribbon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ribbon .rtxt {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-bottom: 2.5%;
  font-family: 'Bungee', sans-serif;
  font-weight: 400;
  font-size: clamp(12px, 3vw, 26px);
  letter-spacing: 0.03em;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
}

.stampl {
  position: fixed;
  inset: 0;
  z-index: 44;
  pointer-events: none;
}

.stamp {
  position: absolute;
  width: min(216px, 46vw);
  aspect-ratio: 827 / 841;
  transform: translate(-50%, -50%);
  filter: drop-shadow(5px 8px 0 rgba(15, 7, 20, 0.85));
  opacity: 0;
}

.stamp img {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-user-drag: none;
}

.livesr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes haloSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes mascotBob {
  0%, 100% { transform: translateY(-50%) translateY(-2px) rotate(-1.2deg); }
  50% { transform: translateY(-50%) translateY(4px) rotate(1.2deg); }
}

@keyframes mascotLeap {
  0% { transform: translateY(-50%) translateY(0) scale(1) rotate(0deg); }
  35% { transform: translateY(-50%) translateY(-30px) scale(1.1) rotate(-4deg); }
  62% { transform: translateY(-50%) translateY(-6px) scale(1.04) rotate(3deg); }
  100% { transform: translateY(-50%) translateY(0) scale(1) rotate(0deg); }
}

@keyframes cardPunch {
  0% { transform: scale(1); }
  30% { transform: scale(0.94); }
  68% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

@keyframes iconProud {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-7px) scale(1.08); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes mintFlash {
  0% { opacity: 0; }
  20% { opacity: 0.7; }
  100% { opacity: 0; }
}

@keyframes cardNo {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(0) translateX(-3px); }
  60% { transform: translateY(0) translateX(3px); }
}

@keyframes clawTick {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  12% { transform: rotate(-5deg) translateY(2px); }
  26% { transform: rotate(0deg) translateY(0); }
}

@media (min-aspect-ratio: 1/1) {
  .mascot { left: max(6px, calc(50% - var(--halo) / 2 - var(--mascot) * 0.98)); }
  :root {
    --btn: min(64vw, 54vh, 480px);
    --card: clamp(86px, min(12vw, 17vh), 148px);
  }
  .hint { display: none; }
}

@media (max-width: 360px) {
  .sound { width: 54px; right: 4px; }
}

@media (max-width: 560px) {
  :root {
    --card: clamp(92px, 25vw, 108px);
    --score-max: 62px;
  }
  .railhint { display: none; }
  .rail { overflow: visible; padding: 4px 0 6px; }
  .railInner {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: clamp(3px, 1vw, 6px);
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .card { width: 100%; }
  .card .body { inset: 4% 5% 19%; }
  .card .name,
  .card .lvl { display: none; }
  .card .iconwrap { width: 94%; }
  .card .icon { width: 88%; height: 88%; }
  .card .price {
    left: 4%;
    right: 4%;
    bottom: 3%;
    height: 20%;
    font-size: clamp(5px, 1.6vw, 9px);
  }
  .card.can .price { box-shadow: inset 0 0 0 2px var(--mint); }
  .railhead { font-size: 7px; }
}

@media (max-width: 360px) {
  .railInner { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .card .body { inset: 5% 7% 21%; }
  .card .price { font-size: 7px; }
}

@media (max-height: 660px) and (orientation: landscape) {
  :root {
    --card: clamp(72px, 15vh, 104px);
    --btn: min(320px, 58vw, 52vh);
    --mascot: clamp(60px, 16vh, 90px);
    --score-max: 58px;
  }
  .title { font-size: clamp(28px, 10vh, 40px); }
  .scorelabel { display: none; }
  .railhead { padding-bottom: 2px; }
  .hint { display: none; }
}

@media (max-height: 500px) {
  :root {
    --card: clamp(66px, 18vh, 92px);
    --btn: min(300px, 52vw, 50vh);
    --mascot: clamp(58px, 17vh, 82px);
    --score-max: 46px;
  }
  .title { font-size: clamp(24px, 9.5vh, 36px); }
  .scorelabel { display: none; }
  .railhead { display: none; }
  .hint { display: none; }
  .rail { padding-top: 2px; padding-bottom: 10px; }
  .stage { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .haloimg { animation: none; }
  .mascot { animation: none; }
  .bigbutton .face { transition: none; }
  .card { transition: none; }
}
