* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg-1: #030414;
  --bg-2: #060b2e;
  --bg-3: #111a52;

  --primary: #5b8cff;
  --secondary: #7c5cff;
  --accent: #2ee6ff;
  --pink: #d85cff;
  --gold: #ffd54f;

  --text: #ffffff;
  --soft: #dce6ff;
  --thai-soft: #edf2ff;

  --danger: #ff5c8a;
  --success: #49ffb3;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Noto Sans Thai", Arial, Helvetica, sans-serif;
  background: var(--bg-1);
  color: var(--text);
  overflow-x: hidden;
}

.galaxy-bg {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background:
    radial-gradient(circle at 22% 12%, rgba(91, 140, 255, .34), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(46, 230, 255, .23), transparent 31%),
    radial-gradient(circle at 50% 108%, rgba(216, 92, 255, .2), transparent 34%),
    linear-gradient(155deg, var(--bg-1), var(--bg-2) 48%, var(--bg-3));
}

.stars,
.stars::before,
.stars::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(#ffffff 1px, transparent 1px),
    radial-gradient(rgba(46, 230, 255, .9) 1px, transparent 1px),
    radial-gradient(rgba(199, 210, 254, .7) 1px, transparent 1px);
  background-size: 42px 42px, 88px 88px, 145px 145px;
  background-position: 0 0, 24px 35px, 66px 102px;
  opacity: .38;
  animation: starMove 26s linear infinite;
}

.stars::before {
  opacity: .23;
  animation-duration: 40s;
}

.stars::after {
  opacity: .14;
  animation-duration: 58s;
}

@keyframes starMove {
  from { transform: translateY(0); }
  to { transform: translateY(170px); }
}

.aurora {
  position: fixed;
  border-radius: 999px;
  filter: blur(70px);
  opacity: .56;
  pointer-events: none;
}

.aurora-a {
  width: 340px;
  height: 340px;
  left: -135px;
  top: 7%;
  background: var(--primary);
}

.aurora-b {
  width: 380px;
  height: 380px;
  right: -150px;
  bottom: 4%;
  background: var(--pink);
}

.cosmic-ring {
  position: fixed;
  width: 190px;
  height: 190px;
  right: 7%;
  top: 9%;
  border-radius: 999px;
  border: 2px solid rgba(46, 230, 255, .28);
  box-shadow: 0 0 40px rgba(46, 230, 255, .2);
  transform: rotate(-24deg);
  pointer-events: none;
}

.cosmic-ring::after {
  content: "";
  position: absolute;
  inset: 38px;
  border-radius: inherit;
  border: 1px solid rgba(255, 213, 79, .22);
}

.shooting-star {
  position: fixed;
  top: 20%;
  right: 4%;
  width: 240px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #fff, var(--accent), var(--primary));
  box-shadow: 0 0 22px var(--accent);
  transform: rotate(-19deg);
  animation: shoot 3.2s ease-in-out infinite;
  opacity: .68;
  pointer-events: none;
}

@keyframes shoot {
  0%, 100% { transform: translate(45px, -12px) rotate(-19deg); opacity: .14; }
  50% { transform: translate(-92px, 42px) rotate(-19deg); opacity: .95; }
}

.game-card {
  position: relative;
  z-index: 2;
  width: min(97vw, 610px);
  padding: 19px;
  border-radius: 35px;
  background:
    linear-gradient(180deg, rgba(17, 26, 82, .78), rgba(3, 4, 20, .7));
  border: 1px solid rgba(255, 255, 255, .15);
  box-shadow:
    0 0 0 1px rgba(46, 230, 255, .15),
    0 0 58px rgba(91, 140, 255, .24),
    0 34px 92px rgba(0, 0, 0, .58);
  backdrop-filter: blur(20px);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.title-wrap {
  flex: 1;
}

.eyebrow,
h1,
.subtitle,
.mission-badge span,
.mission-badge b,
.stat-box span,
.stat-box b,
.modal-box h2 {
  font-family: "Orbitron", "Noto Sans Thai", sans-serif;
}

.eyebrow {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2.3px;
  color: var(--accent);
  text-shadow: 0 0 16px rgba(46, 230, 255, .82);
}

h1 {
  margin: 5px 0 0;
  font-size: clamp(31px, 7vw, 47px);
  line-height: .92;
  letter-spacing: -1px;
  background: linear-gradient(90deg, #fff, var(--accent), var(--primary), var(--secondary));
  -webkit-background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(46, 230, 255, .22));
}

.subtitle {
  display: inline-block;
  margin-top: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 1.6px;
  color: #030414;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  box-shadow: 0 0 18px rgba(255, 213, 79, .25);
}

.top-bar p {
  margin: 0;
  color: var(--thai-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: -.1px;
}

.intro-card {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}

.lead {
  font-size: 15px;
  font-weight: 800;
}

.support {
  margin-top: 7px;
  color: #c7d5ff;
  font-size: 13px;
  font-weight: 600;
}

.mission-badge {
  flex: 0 0 92px;
  min-width: 92px;
  padding: 12px;
  border-radius: 25px;
  text-align: center;
  background: linear-gradient(145deg, var(--primary), var(--secondary), var(--accent));
  border: 1px solid rgba(255, 255, 255, .27);
  box-shadow:
    0 0 28px rgba(46, 230, 255, .28),
    inset 0 1px 0 rgba(255, 255, 255, .25);
}

.mission-badge span {
  display: block;
  font-size: 10px;
  color: #fff;
  font-weight: 900;
}

.mission-badge b {
  display: block;
  font-size: 31px;
  margin-top: 2px;
}

.info-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 17px;
}

.stat-box {
  padding: 11px 9px;
  border-radius: 21px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,.095), rgba(255,255,255,.035));
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.11);
}

.stat-box span {
  display: block;
  color: #dbe4ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
}

.stat-box b {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.stat-box small {
  display: block;
  margin-top: 2px;
  color: #b9c7ff;
  font-size: 11px;
  font-weight: 700;
}

.danger b {
  color: #ffc0d0;
  text-shadow: 0 0 14px rgba(255, 92, 138, .58);
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.game-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.game-footer .toolbar {
  margin-top: 0;
}

.btn {
  position: relative;
  min-height: 62px;
  border: 1px solid rgba(255,255,255,.18);
  padding: 10px 9px;
  border-radius: 23px;
  color: #fff;
  font-family: "Noto Sans Thai", sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  overflow: hidden;
  box-shadow:
    inset 0 2px 2px rgba(255,255,255,.24),
    inset 0 -8px 18px rgba(0,0,0,.2),
    0 12px 25px rgba(0,0,0,.36);
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 21px;
  background: linear-gradient(180deg, rgba(255,255,255,.22), transparent 48%);
  pointer-events: none;
}

.btn.scan {
  background: linear-gradient(145deg, var(--success), var(--accent), var(--primary));
  box-shadow:
    inset 0 2px 2px rgba(255,255,255,.24),
    0 0 20px rgba(73,255,179,.25),
    0 12px 25px rgba(0,0,0,.36);
}

.btn.retry {
  background: linear-gradient(145deg, #4d5b8c, #1a214b);
}

.btn.next {
  background: linear-gradient(145deg, var(--gold), var(--primary), var(--secondary));
  box-shadow:
    inset 0 2px 2px rgba(255,255,255,.24),
    0 0 20px rgba(91,140,255,.28),
    0 12px 25px rgba(0,0,0,.36);
}

.btn.full {
  width: 100%;
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-2px) scale(1.015);
}

.btn:active {
  transform: scale(.96);
}

.btn-icon {
  position: relative;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 18px;
  background: rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.26), 0 0 14px rgba(255,255,255,.16);
}

.btn-text {
  position: relative;
  z-index: 2;
  display: grid;
  text-align: left;
  line-height: 1.05;
}

.btn-text b {
  font-family: "Orbitron", "Noto Sans Thai", sans-serif;
  font-size: 12px;
  letter-spacing: .4px;
}

.btn-text small {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(255,255,255,.88);
  letter-spacing: -.15px;
}

.message {
  min-height: 26px;
  margin: 14px 0;
  padding: 10px 14px;
  border-radius: 16px;
  text-align: center;
  color: #e7eeff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.15px;
  text-shadow: 0 0 12px rgba(91, 140, 255, .4);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}

.message.error { color: var(--danger); }
.message.success { color: var(--success); }
.message.warn { color: var(--gold); }

.board-frame {
  padding: 2px;
  border-radius: 32px;
  background: linear-gradient(135deg, var(--gold), var(--primary), var(--secondary), var(--accent));
  box-shadow:
    0 0 35px rgba(91, 140, 255, .25),
    0 0 48px rgba(46, 230, 255, .15);
}

.board-inner {
  padding: 10px;
  border-radius: 30px;
  background: rgba(3, 4, 20, .74);
}

.board {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 48%, rgba(91, 140, 255, .18), transparent 30%),
    radial-gradient(circle at 18% 22%, rgba(255, 213, 79, .11), transparent 27%),
    radial-gradient(circle at 80% 74%, rgba(46, 230, 255, .16), transparent 31%),
    linear-gradient(rgba(3,4,20,.36), rgba(3,4,20,.36)),
    url("https://images.unsplash.com/photo-1462331940025-496dfbfc7564") center/cover;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.18),
    inset 0 0 58px rgba(91, 140, 255, .18),
    0 20px 42px rgba(0,0,0,.42);
}

.board::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(199, 210, 254, .15) 1px, transparent 1px),
    linear-gradient(180deg, rgba(46, 230, 255, .13) 1px, transparent 1px);
  background-size: calc(100% / 6) calc(100% / 6);
  pointer-events: none;
  opacity: .6;
}

.block {
  position: absolute;
  z-index: 2;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.62);
  background:
    radial-gradient(circle at 28% 17%, rgba(255,255,255,.72), transparent 17%),
    linear-gradient(145deg, #46e3ff, #2b78ff 36%, #5b5cff 68%, #7c5cff);
  color: #fff;
  font-size: clamp(25px, 7.3vw, 39px);
  font-weight: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,.26),
    inset 0 -12px 18px rgba(0,0,0,.22),
    0 0 22px rgba(46,216,255,.34),
    0 13px 19px rgba(0,0,0,.38);
  transition:
    transform .36s cubic-bezier(.2,.95,.2,1.22),
    opacity .36s ease,
    filter .18s ease,
    background .18s ease;
}

.block::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,.26), transparent 56%);
  pointer-events: none;
}

.block span {
  position: relative;
  z-index: 2;
  font-family: "Orbitron", "Noto Sans Thai", sans-serif;
  line-height: 1;
  text-shadow:
    0 0 10px #fff,
    0 0 25px var(--accent),
    0 0 40px var(--primary),
    0 3px 8px rgba(0,0,0,.48);
}

.block:hover {
  filter: brightness(1.17) saturate(1.18);
}

.block.removed {
  opacity: 0;
  pointer-events: none;
}

.block.wrong {
  background:
    radial-gradient(circle at 28% 17%, rgba(255,255,255,.58), transparent 17%),
    linear-gradient(145deg, #ff8aad, #ff5c8a, #9f1239);
  box-shadow:
    0 0 32px rgba(255,92,138,.55),
    0 13px 19px rgba(0,0,0,.38);
  animation: shake .28s ease;
}

.block.hint {
  background:
    radial-gradient(circle at 28% 17%, rgba(255,255,255,.62), transparent 17%),
    linear-gradient(145deg, var(--success), var(--accent), var(--primary));
  box-shadow:
    0 0 36px rgba(73,255,179,.62),
    0 13px 19px rgba(0,0,0,.38);
  animation: pulse .56s ease-in-out infinite alternate;
}

@keyframes shake {
  0% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-9px) rotate(-3deg); }
  40% { transform: translateX(9px) rotate(3deg); }
  60% { transform: translateX(-6px) rotate(-2deg); }
  80% { transform: translateX(6px) rotate(2deg); }
  100% { transform: translateX(0) rotate(0); }
}

@keyframes pulse {
  from { filter: brightness(1); transform: scale(1); }
  to { filter: brightness(1.38); transform: scale(1.045); }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3,4,20,.78);
  backdrop-filter: blur(10px);
}

.modal.hidden {
  display: none;
}

.modal-box {
  width: min(88vw, 345px);
  padding: 29px;
  border-radius: 31px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(circle at top, rgba(46,216,255,.28), transparent 40%),
    linear-gradient(180deg, #111a52, #030414);
  border: 1px solid rgba(255,255,255,.2);
  box-shadow:
    0 0 52px rgba(46,216,255,.25),
    0 32px 80px rgba(0,0,0,.58);
}

.win-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 12px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 42px;
  background: linear-gradient(145deg, var(--gold), var(--primary), var(--accent));
  box-shadow: 0 0 34px rgba(46,216,255,.52);
}

.modal-box h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.modal-box p {
  color: var(--soft);
  font-size: 15px;
  font-weight: 700;
}

@media (max-width: 430px) {
  .galaxy-bg {
    padding: 8px;
    align-items: flex-start;
  }

  .game-card {
    padding: 13px;
    border-radius: 27px;
  }

  .top-bar {
    gap: 10px;
  }

  .title-wrap {
    min-width: 0;
  }

  .mission-badge {
    flex-basis: 78px;
    min-width: 78px;
    padding: 10px 8px;
    border-radius: 22px;
  }

  .mission-badge span {
    font-size: 9px;
  }

  .mission-badge b {
    font-size: 27px;
  }

  .intro-card {
    padding: 12px 13px;
  }

  .info-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .toolbar {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .btn {
    min-height: 58px;
    padding: 9px 6px;
    gap: 5px;
  }

  .btn-icon {
    width: 24px;
    height: 24px;
    font-size: 15px;
  }

  .btn-text b {
    font-size: 10px;
  }

  .btn-text small {
    font-size: 10px;
  }

  .message {
    font-size: 14px;
  }

  .board-inner {
    padding: 7px;
  }

  .block {
    border-radius: 16px;
  }

  .top-bar p {
    font-size: 13px;
  }
}


/* ===== Button + Arrow Upgrade ===== */

.toolbar {
  gap: 11px;
}

.btn {
  min-height: 66px;
  border-radius: 999px;
  padding: 9px 11px;
  justify-content: flex-start;
  isolation: isolate;
  border: 1px solid rgba(255,255,255,.24);
  transform-style: preserve-3d;
}

.btn::before {
  inset: 2px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,.06) 48%, rgba(0,0,0,.08));
  z-index: 0;
}

.btn::after {
  content: "";
  position: absolute;
  inset: auto 14px 6px 14px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  filter: blur(8px);
  opacity: .85;
  z-index: 0;
}

.btn.scan {
  background:
    radial-gradient(circle at 20% 12%, rgba(255,255,255,.45), transparent 18%),
    linear-gradient(145deg, #7cffdf 0%, #2ee6ff 42%, #5b8cff 100%);
}

.btn.retry {
  background:
    radial-gradient(circle at 20% 12%, rgba(255,255,255,.28), transparent 18%),
    linear-gradient(145deg, #6373ad 0%, #293064 48%, #141936 100%);
}

.btn.next {
  background:
    radial-gradient(circle at 20% 12%, rgba(255,255,255,.48), transparent 18%),
    linear-gradient(145deg, #ffe26b 0%, #5b8cff 43%, #7c5cff 72%, #2ee6ff 100%);
}

.btn:hover {
  transform: translateY(-3px) scale(1.025);
  box-shadow:
    inset 0 2px 2px rgba(255,255,255,.3),
    inset 0 -10px 18px rgba(0,0,0,.18),
    0 17px 28px rgba(0,0,0,.4),
    0 0 30px rgba(46,230,255,.34);
}

.btn:active {
  transform: translateY(1px) scale(.96);
}

.btn-icon {
  width: 38px;
  height: 38px;
  font-size: 22px;
  color: #071022;
  background:
    radial-gradient(circle at 35% 25%, #fff 0%, #eaf7ff 34%, #a5f3fc 100%);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,.7),
    inset 0 -5px 8px rgba(0,0,0,.13),
    0 0 18px rgba(255,255,255,.26),
    0 0 18px rgba(46,230,255,.36);
}

.btn-icon.rocket {
  font-size: 25px;
  color: #050816;
  transform: rotate(-8deg);
}

.btn-text b {
  font-size: 13px;
}

.btn-text small {
  font-size: 12px;
  font-weight: 900;
}

/* บล็อกลูกศรแบบชัดขึ้น */
.block {
  border-radius: 22px;
  background:
    radial-gradient(circle at 28% 16%, rgba(255,255,255,.86), transparent 18%),
    linear-gradient(145deg, #75f3ff 0%, #347dff 33%, #5b5cff 62%, #9068ff 100%);
}

.block span {
  width: 58%;
  height: 58%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: "Orbitron", "Noto Sans Thai", sans-serif;
  font-size: .82em;
  line-height: 1;
  color: #ffffff;
  background:
    radial-gradient(circle at 36% 28%, rgba(255,255,255,.3), rgba(255,255,255,.05) 48%, rgba(0,0,0,.16));
  border: 1px solid rgba(255,255,255,.34);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.24),
    0 0 10px rgba(255,255,255,.28),
    0 0 24px var(--accent),
    0 0 40px rgba(91,140,255,.55);
  text-shadow:
    0 0 8px #fff,
    0 0 18px var(--accent),
    0 2px 7px rgba(0,0,0,.48);
}

.block:hover span {
  transform: scale(1.14);
  transition: transform .2s ease;
}

.block.hint span {
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.24),
    0 0 14px rgba(255,255,255,.35),
    0 0 28px var(--success),
    0 0 45px rgba(73,255,179,.55);
}

.block.wrong span {
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.24),
    0 0 16px rgba(255,255,255,.25),
    0 0 28px var(--danger),
    0 0 45px rgba(255,92,138,.55);
}

@media (max-width: 430px) {
  .toolbar {
    gap: 7px;
  }

  .btn {
    min-height: 61px;
    padding: 8px 7px;
  }

  .btn-icon {
    width: 30px;
    height: 30px;
    font-size: 17px;
  }

  .btn-icon.rocket {
    font-size: 20px;
  }

  .btn-text b {
    font-size: 10px;
  }

  .btn-text small {
    font-size: 10px;
  }
}


/* ===== Final polish: Short name + symmetric arrows ===== */

.title-wrap h1,
h1 {
  letter-spacing: -1.4px;
}

.subtitle {
  letter-spacing: 2px;
}

/* ทำลูกศรเป็น badge กลมเท่ากันทุกทิศ */
.block span {
  width: 62%;
  height: 62%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  font-size: .72em;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  transform: none;
}

/* แก้ optical alignment ของ Unicode arrow แต่ละตัวให้สมมาตร */
.block.dir-up span {
  padding-bottom: .06em;
}

.block.dir-down span {
  padding-top: .06em;
}

.block.dir-left span {
  padding-left: .04em;
}

.block.dir-right span {
  padding-right: .04em;
}

/* ให้ hover ไม่ทับการจัดตำแหน่ง */
.block:hover span {
  transform: scale(1.12);
}

/* ปรับบล็อกให้ดูนิ่งและสมมาตรขึ้น */
.block {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ปุ่มชื่อสั้นขึ้น แต่ยังสื่อความหมาย */
.btn-text {
  text-align: left;
}

@media (max-width: 430px) {
  .block span {
    width: 60%;
    height: 60%;
    font-size: .68em;
  }
}


/* ===== NovaTab Arrow Symmetry Fix =====
   ไม่ใช้ Unicode arrow แล้ว เพราะแต่ละตัวมี bounding box ไม่เท่ากัน
   ใช้ CSS triangle จึงกึ่งกลางจริงทุกทิศ
*/

.block {
  display: flex;
  align-items: center;
  justify-content: center;
}

.block span {
  position: relative;
  width: 62%;
  height: 62%;
  aspect-ratio: 1 / 1;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  overflow: visible;
  transform: none;
}

.block span::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  filter:
    drop-shadow(0 0 6px rgba(255,255,255,.9))
    drop-shadow(0 0 14px var(--accent))
    drop-shadow(0 0 22px var(--primary));
}

/* Up */
.block.dir-up span::before {
  border-left: 0.22em solid transparent;
  border-right: 0.22em solid transparent;
  border-bottom: 0.38em solid #fff;
  margin-top: -0.025em;
}

/* Down */
.block.dir-down span::before {
  border-left: 0.22em solid transparent;
  border-right: 0.22em solid transparent;
  border-top: 0.38em solid #fff;
  margin-top: 0.025em;
}

/* Left */
.block.dir-left span::before {
  border-top: 0.22em solid transparent;
  border-bottom: 0.22em solid transparent;
  border-right: 0.38em solid #fff;
  margin-left: -0.025em;
}

/* Right */
.block.dir-right span::before {
  border-top: 0.22em solid transparent;
  border-bottom: 0.22em solid transparent;
  border-left: 0.38em solid #fff;
  margin-left: 0.025em;
}

.block:hover span {
  transform: scale(1.12);
  transition: transform .18s ease;
}

.block:hover span::before {
  filter:
    drop-shadow(0 0 8px rgba(255,255,255,1))
    drop-shadow(0 0 18px var(--accent))
    drop-shadow(0 0 30px var(--primary));
}

@media (max-width: 430px) {
  .block span {
    width: 60%;
    height: 60%;
  }
}


/* ===== NovaTab SVG Arrow Final Fix ===== */
/* ใช้ SVG แทน Unicode/CSS Triangle เพื่อไม่ให้ลูกศรหาย และจัดกลางสมมาตรทุกทิศ */

.block {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.block span {
  position: relative !important;
  width: 64% !important;
  height: 64% !important;
  aspect-ratio: 1 / 1 !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  border-radius: 999px !important;
  overflow: visible !important;
  font-size: 0 !important;
  line-height: 0 !important;
  color: inherit !important;
  transform: none;
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,.34), rgba(255,255,255,.08) 48%, rgba(0,0,0,.16));
  border: 1px solid rgba(255,255,255,.34);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.24),
    0 0 10px rgba(255,255,255,.28),
    0 0 24px var(--accent),
    0 0 40px rgba(91,140,255,.55);
}

/* ปิด CSS triangle เก่าทั้งหมด */
.block span::before {
  content: none !important;
  display: none !important;
  border: 0 !important;
}

.arrow-svg {
  width: 72%;
  height: 72%;
  display: block;
  overflow: visible;
}

.arrow-glow {
  fill: rgba(46,230,255,.95);
  filter:
    drop-shadow(0 0 8px rgba(255,255,255,.75))
    drop-shadow(0 0 16px rgba(46,230,255,.95))
    drop-shadow(0 0 24px rgba(91,140,255,.75));
  opacity: .55;
}

.arrow-main {
  fill: #ffffff;
  stroke: rgba(255,255,255,.78);
  stroke-width: 2;
  stroke-linejoin: round;
  filter:
    drop-shadow(0 0 7px rgba(255,255,255,.95))
    drop-shadow(0 0 14px rgba(46,230,255,.85));
}

.arrow-shine {
  fill: rgba(255,255,255,.42);
}

.block:hover span {
  transform: scale(1.12);
  transition: transform .18s ease;
}

.block:hover .arrow-main {
  filter:
    drop-shadow(0 0 9px rgba(255,255,255,1))
    drop-shadow(0 0 18px rgba(46,230,255,1))
    drop-shadow(0 0 28px rgba(91,140,255,.9));
}

.block.hint span {
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.24),
    0 0 14px rgba(255,255,255,.35),
    0 0 28px var(--success),
    0 0 45px rgba(73,255,179,.55);
}

.block.wrong span {
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.24),
    0 0 16px rgba(255,255,255,.25),
    0 0 28px var(--danger),
    0 0 45px rgba(255,92,138,.55);
}

@media (max-width: 430px) {
  .block span {
    width: 62% !important;
    height: 62% !important;
  }

  .arrow-svg {
    width: 74%;
    height: 74%;
  }
}


/* ===== Sound Button ===== */
.toolbar-sound {
  grid-template-columns: 1fr 1fr 1.2fr .95fr;
}

.btn.sound {
  background:
    radial-gradient(circle at 20% 12%, rgba(255,255,255,.42), transparent 18%),
    linear-gradient(145deg, #ffd54f, #5b8cff 50%, #2ee6ff 100%);
}

.btn.sound.muted {
  background:
    radial-gradient(circle at 20% 12%, rgba(255,255,255,.22), transparent 18%),
    linear-gradient(145deg, #64748b, #334155, #111827);
  opacity: .86;
}

.btn.sound.muted .btn-icon {
  color: #fff;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.35), rgba(255,255,255,.08));
}

@media (max-width: 520px) {
  .toolbar-sound {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar-sound .btn {
    min-height: 58px;
  }
}

@media (max-width: 430px) {
  .toolbar-sound {
    grid-template-columns: 1fr 1fr;
  }
}


/* ===== Mission Failed / Max Wrong 5 ===== */
.board-failed {
  animation: boardFailShake .48s ease;
  box-shadow:
    inset 0 0 0 2px rgba(255,92,138,.6),
    inset 0 0 70px rgba(255,92,138,.28),
    0 0 42px rgba(255,92,138,.35) !important;
}

@keyframes boardFailShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-10px); }
  30% { transform: translateX(10px); }
  45% { transform: translateX(-8px); }
  60% { transform: translateX(8px); }
  75% { transform: translateX(-5px); }
}

.screen-danger::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background: radial-gradient(circle, transparent 45%, rgba(255,92,138,.28));
  animation: dangerFlash .55s ease;
}

@keyframes dangerFlash {
  from { opacity: 0; }
  35% { opacity: 1; }
  to { opacity: 0; }
}

.fail-box {
  background:
    radial-gradient(circle at top, rgba(255,92,138,.35), transparent 42%),
    linear-gradient(180deg, #4c0519, #030414) !important;
}

.fail-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 12px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 900;
  background: linear-gradient(145deg, #ff8aad, #ff5c8a, #9f1239);
  box-shadow: 0 0 34px rgba(255,92,138,.52);
}


/* ===== Space Sound polish ===== */
.btn.sound .btn-icon {
  font-family: "Orbitron", "Noto Sans Thai", sans-serif;
  font-weight: 900;
}

.btn.sound:not(.muted) .btn-icon {
  animation: audioPulse 1.4s ease-in-out infinite alternate;
}

@keyframes audioPulse {
  from {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.28),
      0 0 12px rgba(255,255,255,.2),
      0 0 18px rgba(46,230,255,.28);
  }
  to {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.32),
      0 0 16px rgba(255,255,255,.28),
      0 0 28px rgba(46,230,255,.55);
  }
}


/* ===== Mission Failed Retry Button ===== */
.fail-box .btn {
  margin-top: 16px;
  justify-content: center;
}

.fail-box .btn-text {
  text-align: left;
}

.fail-box .btn.retry {
  background:
    radial-gradient(circle at 20% 12%, rgba(255,255,255,.28), transparent 18%),
    linear-gradient(145deg, #ff8aad, #ff5c8a 45%, #7c5cff 100%);
  box-shadow:
    inset 0 2px 2px rgba(255,255,255,.24),
    0 0 24px rgba(255,92,138,.32),
    0 12px 25px rgba(0,0,0,.36);
}


/* ===== Equal Button Height ===== */
.toolbar,
.toolbar-sound{
    align-items:stretch;
}

.toolbar .btn,
.toolbar-sound .btn{
    height:72px;
    min-height:72px;
    display:flex;
    align-items:center;
    justify-content:flex-start;
}

.btn-icon{
    width:40px;
    height:40px;
    flex:0 0 40px;
}

.btn-text{
    display:flex;
    flex-direction:column;
    justify-content:center;
    min-height:40px;
}

.btn-text b{
    line-height:1.1;
}

.btn-text small{
    line-height:1.1;
    margin-top:4px;
}

@media (max-width:430px){
    .toolbar .btn,
    .toolbar-sound .btn{
        height:64px;
        min-height:64px;
    }

    .btn-icon{
        width:34px;
        height:34px;
        flex-basis:34px;
    }
}


/* ===== Ready Play Button Visibility Fix ===== */
.toolbar,
.toolbar-sound {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  align-items: stretch !important;
  margin-top: 14px !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 5 !important;
}

.toolbar .btn,
.toolbar-sound .btn {
  height: 72px !important;
  min-height: 72px !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 9px !important;
  padding: 10px 9px !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 6 !important;
}

.btn-icon {
  width: 38px !important;
  height: 38px !important;
  flex: 0 0 38px !important;
}

.btn-text {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  min-width: 0 !important;
  text-align: left !important;
}

.btn-text b,
.btn-text small {
  display: block !important;
  white-space: nowrap !important;
}

.no-js-note {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 999;
  padding: 12px;
  border-radius: 14px;
  background: #ff5c8a;
  color: #fff;
  text-align: center;
  font-weight: 800;
}

@media (max-width: 560px) {
  .toolbar,
  .toolbar-sound {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .toolbar .btn,
  .toolbar-sound .btn {
    height: 64px !important;
    min-height: 64px !important;
  }
}

@media (max-width: 360px) {
  .toolbar .btn,
  .toolbar-sound .btn {
    gap: 6px !important;
    padding: 8px 7px !important;
  }

  .btn-icon {
    width: 32px !important;
    height: 32px !important;
    flex-basis: 32px !important;
  }

  .btn-text b {
    font-size: 10px !important;
  }

  .btn-text small {
    font-size: 9px !important;
  }
}


/* ===== Align TARGET / SCANNER / COLLISION ===== */
.stats{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:12px!important;
  width:100%;
}

.stat-box{
  min-height:74px!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  text-align:center!important;
}

.stat-box span,
.stat-box small{
  white-space:nowrap;
}

.stat-box b{
  line-height:1;
}

@media (max-width:560px){
  .stats{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px!important;
  }
  .stat-box{
    min-height:66px!important;
  }
}


/* ===== Force TARGET / SCANNER / COLLISION / GRID into one row ===== */
.info-row,
.stats,
.status-bar,
.info-bar {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  align-items: stretch !important;
  flex-wrap: nowrap !important;
}

.info-row .stat-box,
.stats .stat-box,
.status-bar .stat-box,
.info-bar .stat-box,
.stat-box {
  min-width: 0 !important;
  width: 100% !important;
  min-height: 96px !important;
  padding: 14px 8px !important;
  border-radius: 24px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
}

.stat-box span {
  font-size: 11px !important;
  letter-spacing: 1.1px !important;
  white-space: nowrap !important;
}

.stat-box b {
  font-size: 28px !important;
  line-height: 1 !important;
  margin: 7px 0 5px !important;
  white-space: nowrap !important;
}

.stat-box small {
  font-size: 11px !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
}

/* Tablet / small desktop */
@media (max-width: 720px) {
  .info-row,
  .stats,
  .status-bar,
  .info-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .stat-box {
    min-height: 82px !important;
    padding: 10px 5px !important;
    border-radius: 18px !important;
  }

  .stat-box span {
    font-size: 9px !important;
    letter-spacing: .7px !important;
  }

  .stat-box b {
    font-size: 21px !important;
    margin: 5px 0 4px !important;
  }

  .stat-box small {
    font-size: 9px !important;
  }
}

/* Very small mobile: still keep 4 in one row */
@media (max-width: 430px) {
  .info-row,
  .stats,
  .status-bar,
  .info-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  .stat-box {
    min-height: 72px !important;
    padding: 8px 3px !important;
    border-radius: 15px !important;
  }

  .stat-box span {
    font-size: 7.5px !important;
    letter-spacing: .45px !important;
  }

  .stat-box b {
    font-size: 17px !important;
  }

  .stat-box small {
    font-size: 7.5px !important;
  }
}


/* ===== Ready-to-play block visibility fix ===== */
.board {
  position: relative !important;
}

.board::after {
  z-index: 1 !important;
  pointer-events: none !important;
}

.block {
  position: absolute !important;
  z-index: 5 !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.block.removed {
  opacity: 0 !important;
  pointer-events: none !important;
}

.arrow-wrap {
  position: relative !important;
  width: 64% !important;
  height: 64% !important;
  aspect-ratio: 1 / 1 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  overflow: visible !important;
  font-size: 0 !important;
  line-height: 0 !important;
  color: inherit !important;
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,.34), rgba(255,255,255,.08) 48%, rgba(0,0,0,.16));
  border: 1px solid rgba(255,255,255,.34);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.24),
    0 0 10px rgba(255,255,255,.28),
    0 0 24px var(--accent),
    0 0 40px rgba(91,140,255,.55);
}

.arrow-wrap::before {
  content: none !important;
  display: none !important;
}

.arrow-svg {
  width: 72% !important;
  height: 72% !important;
  display: block !important;
  overflow: visible !important;
}

.arrow-glow {
  fill: rgba(46,230,255,.95);
  opacity: .55;
  filter:
    drop-shadow(0 0 8px rgba(255,255,255,.75))
    drop-shadow(0 0 16px rgba(46,230,255,.95))
    drop-shadow(0 0 24px rgba(91,140,255,.75));
}

.arrow-main {
  fill: #ffffff;
  stroke: rgba(255,255,255,.78);
  stroke-width: 2;
  stroke-linejoin: round;
  filter:
    drop-shadow(0 0 7px rgba(255,255,255,.95))
    drop-shadow(0 0 14px rgba(46,230,255,.85));
}

.arrow-shine {
  fill: rgba(255,255,255,.42);
}


/* ===== FINAL FORCE: Blocks visible and playable ===== */
.board {
  position: relative !important;
}

.board::after {
  z-index: 1 !important;
  pointer-events: none !important;
}

.block {
  position: absolute !important;
  z-index: 20 !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: auto !important;
}

.block.removed {
  opacity: 0 !important;
  pointer-events: none !important;
}

.arrow-wrap {
  position: relative !important;
  width: 64% !important;
  height: 64% !important;
  aspect-ratio: 1 / 1 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  overflow: visible !important;
  font-size: 0 !important;
  line-height: 0 !important;
  color: inherit !important;
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,.34), rgba(255,255,255,.08) 48%, rgba(0,0,0,.16));
  border: 1px solid rgba(255,255,255,.34);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.24),
    0 0 10px rgba(255,255,255,.28),
    0 0 24px var(--accent),
    0 0 40px rgba(91,140,255,.55);
}

.arrow-wrap::before {
  content: none !important;
  display: none !important;
}

.arrow-svg {
  width: 72% !important;
  height: 72% !important;
  display: block !important;
  overflow: visible !important;
}

.arrow-glow {
  fill: rgba(46,230,255,.95) !important;
  opacity: .55 !important;
  filter:
    drop-shadow(0 0 8px rgba(255,255,255,.75))
    drop-shadow(0 0 16px rgba(46,230,255,.95))
    drop-shadow(0 0 24px rgba(91,140,255,.75));
}

.arrow-main {
  fill: #ffffff !important;
  stroke: rgba(255,255,255,.78) !important;
  stroke-width: 2 !important;
  stroke-linejoin: round !important;
  filter:
    drop-shadow(0 0 7px rgba(255,255,255,.95))
    drop-shadow(0 0 14px rgba(46,230,255,.85));
}

.arrow-shine {
  fill: rgba(255,255,255,.42) !important;
}

/* 4 stats always same row */
.info-row,
.stats {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
}

.stat-box {
  min-width: 0 !important;
}


/* ===== Lock Next Mission Until Clear ===== */
.btn.locked,
.btn:disabled {
  opacity: .55 !important;
  filter: grayscale(.25) brightness(.82) !important;
  cursor: not-allowed !important;
  pointer-events: auto !important;
}

.btn.locked .btn-icon,
.btn:disabled .btn-icon {
  opacity: .75;
}

.btn.locked::after,
.btn:disabled::after {
  opacity: .35;
}

/* Button font polish */
.btn-text b {
  font-size: 13px !important;
  line-height: 1.05 !important;
}

.btn-text small {
  font-size: 10px !important;
  line-height: 1.15 !important;
  margin-top: 3px !important;
}

@media (max-width: 430px) {
  .btn-text b {
    font-size: 10px !important;
  }

  .btn-text small {
    font-size: 9px !important;
  }
}

/* ===== Compact One-Screen Layout ===== */
.galaxy-bg {
  padding: 6px !important;
}

.game-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  padding: 12px !important;
  border-radius: 24px !important;
}

.top-bar {
  gap: 10px !important;
}

.eyebrow {
  font-size: 10px !important;
  letter-spacing: 1.8px !important;
}

h1 {
  margin-top: 2px !important;
  font-size: clamp(26px, 5.5vw, 39px) !important;
}

.subtitle {
  margin-top: 4px !important;
  padding: 3px 10px !important;
  font-size: 11px !important;
}

.intro-card {
  margin-top: 8px !important;
  padding: 9px 12px !important;
  border-radius: 15px !important;
}

.lead {
  font-size: 14px !important;
}

.mission-badge {
  flex: 0 0 84px !important;
  min-width: 84px !important;
  padding: 9px 8px !important;
  border-radius: 20px !important;
}

.mission-badge b {
  font-size: 27px !important;
}

.info-row,
.stats {
  gap: 8px !important;
  margin-top: 6px !important;
}

.stat-box {
  padding: 8px 6px !important;
  border-radius: 16px !important;
}

.stat-box b {
  margin-top: 2px !important;
  font-size: 18px !important;
}

.stat-box small {
  font-size: 10px !important;
}

.message {
  min-height: 0 !important;
  margin: 0 !important;
  padding: 7px 10px !important;
  font-size: 13px !important;
  border-radius: 12px !important;
}

.board-frame {
  border-radius: 22px !important;
}

.board-inner {
  padding: 6px !important;
  border-radius: 20px !important;
}

.board {
  border-radius: 18px !important;
  max-height: min(40vh, 390px) !important;
}

.game-footer {
  margin-top: 8px !important;
  padding-top: 14px !important;
  padding: 16px 8px 2px !important;
  border-top: 1px solid rgba(255, 255, 255, .08) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)) !important;
  border-radius: 18px !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 -8px 24px rgba(3, 4, 20, .18) !important;
}

.toolbar,
.game-footer .toolbar {
  margin-top: 0 !important;
  gap: 7px !important;
}

.game-footer .toolbar {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-items: stretch !important;
}

.btn,
.toolbar-sound .btn {
  min-height: 52px !important;
  padding: 6px 8px !important;
}

.game-footer .btn {
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 11px 4px 8px !important;
  min-height: 80px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    inset 0 -8px 14px rgba(0,0,0,.12),
    0 10px 18px rgba(0,0,0,.18) !important;
  overflow: hidden !important;
}

.game-footer .btn-text {
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.game-footer .btn-text b {
  font-size: 10px !important;
  letter-spacing: .3px !important;
}

.game-footer .btn-text small {
  margin-top: 1px !important;
  font-size: 8px !important;
  color: rgba(255,255,255,.72) !important;
}

.btn-icon {
  width: 28px !important;
  height: 28px !important;
  font-size: 16px !important;
}

.game-footer .btn-icon {
  width: 48px !important;
  height: 48px !important;
  color: #05111f !important;
  background:
    radial-gradient(circle at 35% 25%, #ffffff 0%, #f3fbff 38%, #9af5ff 100%) !important;
  display: grid !important;
  place-items: center !important;
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,.82),
    inset 0 -3px 6px rgba(0,0,0,.1),
    0 0 14px rgba(255,255,255,.28),
    0 0 22px rgba(46,230,255,.34) !important;
}

.game-footer .btn-icon i {
  width: 1.25em !important;
  font-size: 24px !important;
  line-height: 1 !important;
  text-align: center !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  filter: drop-shadow(0 0 10px rgba(255,255,255,.22));
}

.game-footer .btn.scan .btn-icon i,
.game-footer .btn.retry .btn-icon i,
.game-footer .btn.next .btn-icon i,
.game-footer .btn.sound .btn-icon i {
  transform: scale(1);
}

.game-footer .btn.next .btn-icon i {
  transform: translateX(1px) scale(.94);
}

.game-footer .btn.sound .btn-icon i {
  transform: scale(.92);
}

.game-footer .btn.scan .btn-icon i {
  filter: drop-shadow(0 0 8px rgba(73,255,179,.35));
}

.game-footer .btn.retry .btn-icon i {
  filter: drop-shadow(0 0 8px rgba(160,184,255,.32));
}

.game-footer .btn.next .btn-icon i {
  filter: drop-shadow(0 0 10px rgba(255,226,107,.34));
}

.game-footer .btn.sound .btn-icon i {
  filter: drop-shadow(0 0 8px rgba(46,230,255,.34));
}

.game-footer .btn.scan {
  background:
    radial-gradient(circle at 50% 0%, rgba(124,255,223,.2), transparent 65%),
    linear-gradient(180deg, rgba(73,255,179,.18), rgba(22,36,74,.88)) !important;
}

.game-footer .btn.retry {
  background:
    radial-gradient(circle at 50% 0%, rgba(160,184,255,.18), transparent 65%),
    linear-gradient(180deg, rgba(95,110,176,.2), rgba(24,29,58,.88)) !important;
}

.game-footer .btn.next {
  background:
    radial-gradient(circle at 50% 0%, rgba(255,226,107,.24), transparent 65%),
    linear-gradient(180deg, rgba(123,92,255,.18), rgba(20,32,76,.9)) !important;
}

.game-footer .btn.sound {
  background:
    radial-gradient(circle at 50% 0%, rgba(46,230,255,.22), transparent 65%),
    linear-gradient(180deg, rgba(46,230,255,.16), rgba(16,35,68,.88)) !important;
}

.game-footer .btn:hover {
  transform: translateY(-2px) scale(1.01) !important;
}

.btn-icon.rocket {
  font-size: 18px !important;
}

@media (max-width: 430px) {
  .galaxy-bg {
    padding: 4px !important;
  }

  .game-card {
    padding: 10px !important;
    gap: 7px !important;
  }

  .game-footer {
    padding: 12px 6px 2px !important;
    border-radius: 16px !important;
  }

  .top-bar {
    gap: 8px !important;
  }

  .mission-badge {
    flex-basis: 74px !important;
    min-width: 74px !important;
    padding: 8px 6px !important;
  }

  .mission-badge span {
    font-size: 8px !important;
  }

  .mission-badge b {
    font-size: 24px !important;
  }

  .info-row,
  .stats {
    gap: 6px !important;
  }

  .stat-box {
    padding: 7px 5px !important;
  }

  .stat-box b {
    font-size: 16px !important;
  }

  .board {
    max-height: min(36vh, 320px) !important;
  }

  .btn,
  .toolbar-sound .btn {
    min-height: 46px !important;
    padding: 5px 6px !important;
  }

  .game-footer .toolbar {
    gap: 5px !important;
  }

  .game-footer .btn {
    min-height: 62px !important;
    padding: 8px 3px 5px !important;
    gap: 4px !important;
    border-radius: 15px !important;
  }

  .btn-icon {
    width: 24px !important;
    height: 24px !important;
    font-size: 14px !important;
  }

  .game-footer .btn-icon {
    width: 40px !important;
    height: 40px !important;
  }

  .game-footer .btn-icon i {
    font-size: 20px !important;
    width: 1.2em !important;
  }

  .btn-text b {
    font-size: 9px !important;
  }

  .btn-text small {
    font-size: 8px !important;
  }
}
