:root {
  --bg1: #0b1f5c;
  --bg2: #1a56db;
  --bg3: #38bdf8;
  --ink: #0f172a;
  --card: #ffffff;
  --accent: #fbbf24;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  background:
    linear-gradient(180deg, rgba(11, 31, 92, 0.55), rgba(11, 31, 92, 0.72)),
    url("../assets/seoul-cityhall.jpg") center / cover no-repeat fixed;
  color: #fff;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(12px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.top-bar h1 {
  flex: 1;
  margin: 0;
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  text-align: center;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

.top-bar h1.title--en,
.hero-name--en {
  font-family: "Luckiest Guy", "Arial Rounded MT Bold", "Arial Black", sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #e10600;
  -webkit-text-stroke: 3px #fff;
  paint-order: stroke fill;
  text-shadow:
    0 0 0 #1e3a8a,
    2px 3px 0 #1e3a8a,
    0 4px 10px rgba(0, 0, 0, 0.35);
}

.title-logo,
.hero-logo {
  display: block;
  width: auto;
  height: clamp(40px, 9vw, 56px);
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.35));
}

.hero-logo {
  height: clamp(36px, 8vw, 52px);
  margin-top: 2px;
}

.hello,
.hint,
.play-hint {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.icon-btn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.screen[hidden] {
  display: none !important;
}

.tap-gate[hidden] {
  display: none !important;
}

.hello {
  text-align: center;
  font-size: clamp(1.3rem, 4vw, 2rem);
  margin: 8px 0 18px;
  font-weight: 800;
}

.hint,
.play-hint {
  text-align: center;
  opacity: 0.85;
  margin: 12px 0 0;
  font-size: 1rem;
}

.mode-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-content: center;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.mode-card {
  position: relative;
  appearance: none;
  border: 0;
  border-radius: 32px;
  background: var(--card);
  color: var(--ink);
  padding: 22px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 0.15s ease;
  min-height: min(46vh, 360px);
}

.mode-card:active:not(:disabled) {
  transform: scale(0.96);
}

.mode-card strong {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 900;
}

.mode-card > span {
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  opacity: 0.8;
  line-height: 1.35;
}

.mode-card em {
  margin-top: 6px;
  font-style: normal;
  font-size: 0.9rem;
  font-weight: 800;
  color: #1d4ed8;
  background: #dbeafe;
  padding: 6px 12px;
  border-radius: 999px;
}

.mode-icon {
  width: min(42vw, 160px);
  height: min(42vw, 160px);
}

.mode-svg {
  width: 100%;
  height: 100%;
}

.mode-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f59e0b;
  color: #7c2d12;
  font-size: 0.85rem;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 999px;
}

.mode-card--soon {
  opacity: 0.72;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.mode-card--soon em {
  color: #78716c;
  background: #e7e5e4;
}

.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-content: center;
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}

.hero-card {
  position: relative;
  appearance: none;
  border: 0;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  padding: 14px 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.hero-card:active {
  transform: scale(0.94);
}

.hero-card--soon {
  opacity: 0.72;
  filter: grayscale(0.2);
}

.mode-badge--go {
  background: #22c55e;
  color: #14532d;
}

.hero-card .thumb {
  width: min(30vw, 200px);
  height: min(30vw, 200px);
  border-radius: 24px;
  overflow: hidden;
  background: transparent;
}

.hero-card span,
.hero-card .hero-name {
  font-size: clamp(1rem, 2.8vw, 1.25rem);
  font-weight: 800;
}

.hero-card .hero-name--en {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 400;
  -webkit-text-stroke: 4px #fff;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.28));
}

.hero-photo--play {
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.45));
}

.stage {
  position: relative;
  flex: 1;
  border-radius: 32px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.15), rgba(15, 23, 42, 0.45)),
    var(--stage-bg, url("../assets/seoul-cityhall.jpg")) center / cover no-repeat;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  cursor: pointer;
  --stage-bg: url("../assets/seoul-cityhall.jpg");
  transition: filter 0.35s ease;
}

.stage.stage--gwanghwamun {
  --stage-bg: url("../assets/gwanghwamun.jpg");
}

.stage.stage--cheonggyecheon {
  --stage-bg: url("../assets/cheonggyecheon.jpg");
}

.stage.stage-warp {
  animation: stage-warp 0.9s ease;
}

@keyframes stage-warp {
  0% {
    filter: brightness(1) saturate(1);
  }
  35% {
    filter: brightness(1.35) saturate(1.4) blur(2px);
  }
  70% {
    filter: brightness(0.85) saturate(1.1);
  }
  100% {
    filter: brightness(1) saturate(1);
  }
}

.fighter--villain.flee-stage {
  animation: goblin-flee-stage 0.85s ease forwards;
}

.fighter--villain.arrive-stage {
  animation: goblin-arrive-stage 0.7s cubic-bezier(0.2, 0.85, 0.25, 1);
}

@keyframes goblin-flee-stage {
  0% {
    transform: scaleX(-1) translate(0, 0) rotate(0);
    opacity: 1;
  }
  100% {
    transform: scaleX(-1) translate(55%, -45%) rotate(-30deg) scale(0.55);
    opacity: 0;
  }
}

@keyframes goblin-arrive-stage {
  0% {
    transform: scaleX(-1) translate(40%, -30%) rotate(-20deg) scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scaleX(-1) translate(0, 0) rotate(0) scale(1);
    opacity: 1;
  }
}

.arena {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 4% 4% 6%;
  z-index: 2;
}

.fighter {
  width: min(42vw, 340px);
  height: min(58vh, 420px);
  will-change: transform;
}

.fighter--hero {
  z-index: 3;
  transform-origin: center bottom;
}

.fighter--villain {
  z-index: 2;
  transform: scaleX(-1);
  transform-origin: center bottom;
}

.fighter--ally {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: min(28vw, 220px);
  height: min(40vh, 280px);
  z-index: 4;
  transform: translate(-50%, 0);
  transform-origin: center bottom;
  pointer-events: none;
}

.fighter--ally[hidden] {
  display: none !important;
}

.fighter--ally .repulsor {
  position: absolute;
  right: 8%;
  top: 38%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #fbbf24 45%, #f97316 100%);
  opacity: 0;
  box-shadow: 0 0 18px 8px rgba(251, 191, 36, 0.75);
}

.fighter--ally.ally-enter {
  animation: ally-enter 0.45s cubic-bezier(0.2, 0.85, 0.25, 1) forwards;
}

.fighter--ally.ally-shoot {
  animation: ally-shoot 0.35s ease;
}

.fighter--ally.ally-shoot .repulsor {
  animation: repulsor-blast 0.35s ease forwards;
}

.fighter--ally.ally-smash {
  animation: ally-smash 0.55s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.fighter--ally.ally-smash .smash-shock {
  animation: smash-shock 0.55s ease forwards;
}

.fighter--ally .smash-shock {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.9);
  opacity: 0;
  transform: translateX(-50%);
  box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.5);
}

.fighter--ally.ally-exit {
  animation: ally-exit 0.65s cubic-bezier(0.4, 0, 0.7, 0.2) forwards;
}

.fighter--ally.ally--hulk.ally-exit {
  animation: ally-exit-hulk 0.65s cubic-bezier(0.4, 0, 0.7, 0.2) forwards;
}

.ground-crack {
  position: absolute;
  left: 58%;
  top: 72%;
  width: 120px;
  height: 18px;
  margin-left: -60px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(15, 23, 42, 0.55), transparent 70%);
  box-shadow:
    -40px 0 0 -2px rgba(15, 23, 42, 0.35),
    45px 2px 0 -3px rgba(15, 23, 42, 0.3);
  animation: ground-crack 0.65s ease forwards;
  pointer-events: none;
  z-index: 5;
}

.fighter .hero-photo--play {
  width: 100%;
  height: 100%;
}

.fighter--hero.dash-punch {
  animation: dash-punch 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fighter--villain.get-hit {
  animation: goblin-hit 0.38s ease;
}

.fighter--villain.get-hit-squash {
  animation: goblin-squash 0.4s ease;
}

.fighter--villain.get-hit-spin {
  animation: goblin-spin-hit 0.45s ease;
}

.fighter--villain.get-hit-shake {
  animation: goblin-shake 0.4s ease;
}

.fighter--villain.fly-away {
  animation: goblin-fly 0.7s ease forwards;
}

.fighter--villain.defend {
  animation: goblin-defend 0.55s ease;
}

.fighter--villain.defend-break {
  animation: goblin-defend-break 0.5s cubic-bezier(0.2, 0.85, 0.25, 1);
}

@keyframes goblin-defend {
  0%,
  100% {
    transform: scaleX(-1) translate(0, 0) scale(1);
  }
  30% {
    transform: scaleX(-1) translate(6%, 2%) scale(0.92) rotate(4deg);
  }
  55% {
    transform: scaleX(-1) translate(4%, 0) scale(0.96);
  }
}

@keyframes goblin-defend-break {
  0% {
    transform: scaleX(-1) translate(0, 0) rotate(0) scale(1);
  }
  35% {
    transform: scaleX(-1) translate(-18%, -8%) rotate(18deg) scale(1.12);
  }
  100% {
    transform: scaleX(-1) translate(0, 0) rotate(0) scale(1);
  }
}

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

/* Stand in front of Goblin (right side) and guard */
.minion {
  position: absolute;
  right: 4%;
  bottom: 7%;
  width: min(28vw, 200px);
  height: min(40vh, 280px);
  transform-origin: center bottom;
  pointer-events: auto;
  cursor: pointer;
  z-index: 5;
  animation:
    minion-enter 0.4s cubic-bezier(0.2, 0.85, 0.25, 1),
    minion-guard-idle 1.2s ease-in-out 0.4s infinite;
}

.minion--a {
  right: 2%;
  bottom: 6%;
}

.minion--b {
  right: 18%;
  bottom: 10%;
  width: min(24vw, 170px);
  height: min(36vh, 240px);
  z-index: 4;
}

.minion img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35));
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.fighter--villain.is-guarded {
  filter: brightness(0.92);
  transform: scaleX(-1) translate(8%, 4%) scale(0.92);
}

.minion.blocking {
  animation: minion-block 0.55s ease;
  z-index: 6;
}

.minion.webbed {
  animation: minion-webbed 0.7s ease forwards;
  pointer-events: none;
}

@keyframes minion-guard-idle {
  0%,
  100% {
    transform: translate(0, 0) rotate(-4deg);
  }
  50% {
    transform: translate(-4%, -3%) rotate(3deg);
  }
}

@keyframes minion-block {
  0% {
    transform: translate(0, 0) scale(1) rotate(-4deg);
  }
  30% {
    transform: translate(-28%, -8%) scale(1.18) rotate(-12deg);
  }
  55% {
    transform: translate(-22%, -4%) scale(1.1) rotate(6deg);
  }
  100% {
    transform: translate(0, 0) scale(1) rotate(-4deg);
  }
}

/* Thor coaches from behind Spidey (left), not overlapping minions */
.fighter--ally.ally--thor {
  left: 6%;
  bottom: 22%;
  width: min(24vw, 190px);
  height: min(36vh, 250px);
  z-index: 2;
  transform: translate(0, 0);
}

.fighter--ally.ally--thor.ally-enter {
  animation: thor-enter 0.45s cubic-bezier(0.2, 0.85, 0.25, 1) forwards;
}

.fighter--ally.ally--thor.ally-exit {
  animation: thor-exit 0.65s cubic-bezier(0.4, 0, 0.7, 0.2) forwards;
}

@keyframes thor-enter {
  0% {
    transform: translate(-40%, 10%) scale(0.7) rotate(-8deg);
    opacity: 0;
  }
  100% {
    transform: translate(0, 0) scale(1) rotate(0);
    opacity: 1;
  }
}

@keyframes thor-exit {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-30%, -40%) scale(0.6) rotate(-12deg);
    opacity: 0;
  }
}

.minion .web-line {
  position: absolute;
  left: -80%;
  top: 35%;
  width: 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), #e2e8f0 40%, #fff);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  transform-origin: left center;
  opacity: 0;
}

.minion.webbed .web-line {
  animation: web-shoot 0.35s ease forwards;
}

.minion .web-wrap {
  position: absolute;
  inset: 8% 5%;
  border-radius: 45% 45% 40% 40%;
  border: 3px solid rgba(248, 250, 252, 0.85);
  box-shadow:
    inset 0 0 0 2px rgba(148, 163, 184, 0.55),
    0 0 12px rgba(255, 255, 255, 0.45);
  background:
    repeating-linear-gradient(
      45deg,
      transparent 0 10px,
      rgba(255, 255, 255, 0.35) 10px 12px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent 0 10px,
      rgba(226, 232, 240, 0.3) 10px 12px
    );
  opacity: 0;
  pointer-events: none;
}

.minion.webbed .web-wrap {
  animation: web-wrap-show 0.55s ease forwards;
}

@keyframes minion-enter {
  from {
    transform: translateY(30%) scale(0.6);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes web-shoot {
  0% {
    width: 0;
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    width: 160%;
    opacity: 1;
  }
}

@keyframes web-wrap-show {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  40% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 0.95;
    transform: scale(1);
  }
}

@keyframes minion-webbed {
  0% {
    transform: translateY(0) rotate(0) scale(1);
    opacity: 1;
  }
  35% {
    transform: translateY(-6%) rotate(-8deg) scale(1.05);
  }
  70% {
    transform: translateY(4%) rotate(12deg) scale(0.9);
  }
  100% {
    transform: translateY(20%) rotate(18deg) scale(0.55);
    opacity: 0;
  }
}

@keyframes dash-punch {
  0% {
    transform: translateX(0) scale(1);
  }
  35% {
    transform: translateX(38%) scale(1.08) rotate(4deg);
  }
  55% {
    transform: translateX(46%) scale(1.12) rotate(6deg);
  }
  100% {
    transform: translateX(0) scale(1) rotate(0);
  }
}

@keyframes ally-enter {
  0% {
    transform: translate(-50%, -60%) scale(0.6) rotate(-12deg);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, 0) scale(1) rotate(0);
    opacity: 1;
  }
}

@keyframes ally-shoot {
  0%,
  100% {
    transform: translate(-50%, 0) rotate(0);
  }
  40% {
    transform: translate(-42%, -4%) rotate(6deg) scale(1.05);
  }
}

@keyframes repulsor-blast {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  35% {
    opacity: 1;
    transform: scale(1.4) translateX(40px);
  }
  100% {
    opacity: 0;
    transform: scale(0.8) translateX(120px);
  }
}

@keyframes ally-exit {
  0% {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-10%, -70%) scale(0.55) rotate(18deg);
    opacity: 0;
  }
}

@keyframes ally-smash {
  0% {
    transform: translate(-50%, 0) scale(1);
  }
  28% {
    transform: translate(-50%, -28%) scale(1.08, 0.92) rotate(-6deg);
  }
  55% {
    transform: translate(-40%, 8%) scale(1.18, 0.82) rotate(4deg);
  }
  75% {
    transform: translate(-45%, 0) scale(1.05, 1.05);
  }
  100% {
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes smash-shock {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.4);
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.6);
  }
  40% {
    opacity: 1;
    transform: translateX(-50%) scale(1.6);
    box-shadow: 0 0 0 28px rgba(251, 191, 36, 0.25);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(2.4);
    box-shadow: 0 0 0 56px rgba(251, 191, 36, 0);
  }
}

@keyframes ally-exit-hulk {
  0% {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(30%, -55%) scale(0.6) rotate(-12deg);
    opacity: 0;
  }
}

@keyframes ground-crack {
  0% {
    opacity: 0;
    transform: scaleX(0.3);
  }
  35% {
    opacity: 1;
    transform: scaleX(1.1);
  }
  100% {
    opacity: 0;
    transform: scaleX(1.25);
  }
}

@keyframes goblin-hit {
  0%,
  100% {
    transform: scaleX(-1) translateX(0) rotate(0);
  }
  30% {
    transform: scaleX(-1) translateX(10%) rotate(-12deg) scale(1.05);
  }
  55% {
    transform: scaleX(-1) translateX(18%) rotate(-8deg);
  }
}

@keyframes goblin-squash {
  0%,
  100% {
    transform: scaleX(-1) translate(0, 0) scale(1, 1);
  }
  25% {
    transform: scaleX(-1) translate(8%, 6%) scale(1.2, 0.75);
  }
  55% {
    transform: scaleX(-1) translate(14%, -10%) scale(0.9, 1.15) rotate(-10deg);
  }
}

@keyframes goblin-spin-hit {
  0% {
    transform: scaleX(-1) rotate(0);
  }
  40% {
    transform: scaleX(-1) translateX(16%) rotate(-28deg) scale(1.08);
  }
  70% {
    transform: scaleX(-1) translateX(10%) rotate(16deg);
  }
  100% {
    transform: scaleX(-1) rotate(0);
  }
}

@keyframes goblin-shake {
  0%,
  100% {
    transform: scaleX(-1) translateX(0);
    filter: none;
  }
  20% {
    transform: scaleX(-1) translateX(8%) rotate(-8deg);
    filter: hue-rotate(-20deg) saturate(1.4);
  }
  40% {
    transform: scaleX(-1) translateX(14%) rotate(8deg);
    filter: brightness(1.25);
  }
  60% {
    transform: scaleX(-1) translateX(6%) rotate(-6deg);
    filter: hue-rotate(15deg);
  }
}

@keyframes goblin-fly {
  0% {
    transform: scaleX(-1) translate(0, 0) rotate(0);
    opacity: 1;
  }
  100% {
    transform: scaleX(-1) translate(40%, -35%) rotate(-28deg) scale(0.7);
    opacity: 0;
  }
}

.hit-flash {
  position: absolute;
  left: 52%;
  top: 42%;
  transform: translate(-50%, -50%) scale(0.4);
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 4px 0 #b45309, 0 8px 18px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.hit-flash.show {
  animation: hit-pop 0.35s ease;
}

@keyframes hit-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }
  40% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.25);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60%) scale(1);
  }
}

.combo {
  position: absolute;
  top: 10%;
  right: 4%;
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  color: #fde68a;
  font-size: clamp(1.1rem, 3.5vw, 1.6rem);
  font-weight: 900;
  z-index: 6;
}

.combo.pop-combo {
  animation: pop-combo 0.25s ease;
}

@keyframes pop-combo {
  from {
    transform: scale(0.8);
  }
  to {
    transform: scale(1);
  }
}

.speech {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  max-width: 88%;
  padding: 14px 22px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(1.2rem, 4.2vw, 2rem);
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  z-index: 4;
  text-align: center;
  animation: pop 0.25s ease;
}

@keyframes pop {
  from {
    transform: translateX(-50%) scale(0.7);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

.fx-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.spark {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  animation: spark 0.7s ease forwards;
}

@keyframes spark {
  to {
    transform: translate(var(--dx), var(--dy)) scale(0);
    opacity: 0;
  }
}

.tap-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px 18px calc(24px + var(--safe-bottom));
  background: rgba(11, 31, 92, 0.92);
  text-align: center;
  overflow: auto;
}

.gate-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.start-btn {
  border: 0;
  border-radius: 999px;
  padding: 22px 56px;
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  color: #7c2d12;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.gate-sub {
  margin: 0;
  font-size: 1.05rem;
  opacity: 0.95;
}

.gate-install-row {
  width: min(96vw, 760px);
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.gate-install {
  width: 100%;
  padding: 14px 16px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  text-align: left;
  color: #fff;
}

.gate-install strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
  color: #fde68a;
}

.gate-install ol {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
  line-height: 1.45;
}

.gate-install em {
  font-style: normal;
  font-weight: 800;
  color: #fbbf24;
}

@media (max-width: 700px) {
  .gate-install-row {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
  }

  .mode-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mode-card {
    min-height: 0;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 16px;
  }

  .mode-icon {
    width: 88px;
    height: 88px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .hello,
  .hint {
    display: none;
  }

  .hero-grid {
    gap: 10px;
  }

  .hero-card {
    border-radius: 20px;
    padding: 8px;
  }

  .mode-grid {
    gap: 12px;
  }

  .mode-card {
    min-height: 0;
    padding: 12px;
  }

  .mode-icon {
    width: 72px;
    height: 72px;
  }

  .play-hint {
    margin-top: 6px;
    font-size: 0.9rem;
  }
}
