:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: #12315a;
  background: #dff3ff;
  font-synthesis: none;
}

* { box-sizing: border-box; }
button, a { font: inherit; }
button { touch-action: manipulation; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 0%, rgb(255 255 255 / 88%) 0 8%, transparent 24%),
    linear-gradient(145deg, #dff5ff 0%, #f5fbff 46%, #fff4dc 100%);
}

#app { position: relative; min-height: 100vh; padding: 22px; isolation: isolate; }
.sky-orb { position: fixed; z-index: -1; border-radius: 50%; filter: blur(2px); opacity: .75; }
.sky-orb-one { width: 260px; height: 260px; right: -70px; top: -80px; background: #ffe264; }
.sky-orb-two { width: 190px; height: 190px; left: -70px; bottom: 4vh; background: #ff8b78; }

.game-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgb(255 255 255 / 92%);
  border-radius: 32px;
  background: rgb(255 255 255 / 82%);
  box-shadow: 0 28px 70px rgb(31 96 138 / 18%);
  backdrop-filter: blur(18px);
}

.game-header, .brand-lockup, .mode-tabs, .status-strip, .game-actions { display: flex; align-items: center; }
.game-header { justify-content: space-between; gap: 16px; }
.brand-lockup { gap: 14px; }

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 19px;
  color: #fff;
  background: #2b7fff;
  box-shadow: 0 8px 0 #155cc5;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -1px;
  transform: rotate(-4deg);
}

.eyebrow { margin: 0 0 2px; color: #2b7fff; font-size: 14px; font-weight: 800; letter-spacing: .14em; }
h1 { margin: 0; color: #12315a; font-size: clamp(27px, 4vw, 40px); line-height: 1.1; }

.icon-button, .mode-tab, .secondary-button, .primary-button {
  min-height: 44px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 800;
}

.icon-button { display: inline-flex; gap: 7px; align-items: center; padding: 0 16px; color: #12315a; background: #eaf4ff; }
.mode-tabs { width: fit-content; margin: 24px auto 18px; padding: 5px; border-radius: 18px; background: #eaf2f8; }
.mode-tab { padding: 9px 18px; color: #5d7089; background: transparent; }
.mode-tab.active { color: #fff; background: #2b7fff; box-shadow: 0 7px 15px rgb(43 127 255 / 24%); }

.status-strip { justify-content: center; gap: 10px; }
.status-item { min-width: 92px; padding: 10px 17px; border: 1px solid #dcebf6; border-radius: 18px; text-align: center; background: #fff; }
.status-item span { display: block; color: #718399; font-size: 14px; font-weight: 700; }
.status-item strong { display: block; margin-top: 1px; color: #12315a; font-size: 23px; line-height: 1.15; }
.target-card { min-width: 112px; border-color: #ffcb49; background: #fff6ce; }
.target-card strong { color: #e35242; font-size: 30px; }
.helper-line { min-height: 28px; margin: 13px 0 9px; text-align: center; color: #536a85; font-size: 16px; }
.board-wrap { position: relative; }

.game-board {
  position: relative;
  width: 100%;
  height: clamp(360px, 52vh, 520px);
  overflow: hidden;
  border: 2px solid rgb(255 255 255 / 90%);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 20%, #fff 0 4px, transparent 5px),
    radial-gradient(circle at 77% 72%, #fff 0 5px, transparent 6px),
    linear-gradient(160deg, #bcecff 0%, #e8f9ff 55%, #fff0bf 100%);
  box-shadow: inset 0 0 36px rgb(24 117 174 / 10%);
}

.number-bubble {
  position: absolute;
  display: grid;
  place-items: center;
  border: 3px solid rgb(255 255 255 / 92%);
  border-radius: 50%;
  color: #12315a;
  box-shadow: 0 8px 0 rgb(18 49 90 / 13%), 0 14px 22px rgb(33 99 142 / 15%);
  font-size: clamp(19px, 3.5vw, 27px);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 150ms ease, opacity 180ms ease, filter 150ms ease;
  animation: float 3.8s ease-in-out infinite alternate;
}

.number-bubble:nth-child(2n) { animation-delay: -1.4s; }
.number-bubble:nth-child(3n) { animation-delay: -2.5s; }
.bubble-blue { background: #61b8ff; }
.bubble-yellow { background: #ffe264; }
.bubble-coral { background: #ff917f; }
.bubble-mint { background: #72dfc2; }
.bubble-purple { background: #c5a4ff; }

.number-bubble:hover:not(:disabled), .number-bubble:focus-visible {
  outline: 4px solid rgb(43 127 255 / 24%);
  outline-offset: 3px;
  filter: brightness(1.05);
  transform: translate(-50%, -50%) scale(1.08);
}
.number-bubble.popped { pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(1.35); }
.number-bubble.wrong { animation: shake 320ms ease; }
.number-bubble.hinted { animation: hint-pulse 700ms ease-in-out 3; }

.pause-cover, .celebration, .challenge-cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: rgb(20 56 92 / 34%);
  backdrop-filter: blur(8px);
}
.pause-cover[hidden], .celebration[hidden], .challenge-cover[hidden] { display: none; }

.pause-card, .celebration-card, .challenge-card {
  width: min(330px, calc(100% - 36px));
  padding: 28px;
  border: 2px solid #fff;
  border-radius: 26px;
  text-align: center;
  background: #fff;
  box-shadow: 0 22px 50px rgb(17 54 85 / 25%);
}
.pause-card h2, .celebration-card h2, .challenge-card h2 { margin: 7px 0 6px; font-size: 27px; }
.pause-card p, .celebration-card p, .challenge-card > p { margin: 0 0 18px; color: #60758c; font-size: 16px; }
.pause-icon, .celebration-stars { color: #2b7fff; font-size: 30px; font-weight: 900; }
.celebration-stars { color: #ffb51f; letter-spacing: 8px; }
.challenge-cover { background: rgb(18 49 90 / 42%); }
.challenge-card .primary-button { width: 100%; margin-top: 4px; }
.text-button { margin-top: 15px; border: 0; color: #536a85; background: transparent; cursor: pointer; font-weight: 800; }
.challenge-summary { display: grid; margin: 12px 0 17px; padding: 14px; border-radius: 18px; background: #fff6ce; }
.challenge-summary[hidden] { display: none; }
.challenge-summary strong { color: #e35242; font-size: 42px; line-height: 1; }
.challenge-summary span { margin-top: 4px; font-weight: 800; }
.challenge-summary small { margin-top: 5px; color: #667b92; font-size: 14px; }

.game-actions { justify-content: center; gap: 10px; margin-top: 15px; }
.secondary-button, .primary-button { padding: 11px 18px; }
.secondary-button { color: #23496f; background: #e8f3fb; }
.secondary-button:hover, .secondary-button:focus-visible, .icon-button:hover, .icon-button:focus-visible { outline: 3px solid rgb(43 127 255 / 22%); background: #dcefff; }
.primary-button { color: #fff; background: #2b7fff; box-shadow: 0 7px 0 #155cc5; }
.gentle-note { margin: 14px 0 0; color: #75869a; text-align: center; font-size: 14px; }

.ad-section {
  width: min(980px, calc(100% - 44px));
  min-height: 118px;
  margin: 24px auto 0;
  padding: 24px 14px 16px;
  overflow: hidden;
  border: 1px solid rgb(92 126 157 / 20%);
  border-radius: 22px;
  background: rgb(255 255 255 / 68%);
  text-align: center;
}
.ad-label { display: block; margin-bottom: 10px; color: #72859a; font-size: 12px; letter-spacing: .14em; }
.ad-placeholder { margin: 12px 0; color: #72859a; font-size: 14px; }
.site-footer { display: flex; justify-content: center; gap: 20px; padding: 18px 16px 28px; }
.site-footer a, .back-link { color: #315e8c; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.info-page { padding: 24px; }
.info-card {
  width: min(780px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid rgb(255 255 255 / 92%);
  border-radius: 30px;
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 28px 70px rgb(31 96 138 / 16%);
}
.info-card .back-link { display: inline-block; margin-bottom: 30px; }
.info-card h1 { margin-bottom: 16px; }
.info-card h2 { margin: 30px 0 8px; color: #173b63; font-size: 22px; }
.info-card p { color: #526b84; font-size: 16px; line-height: 1.8; }
.info-lead { padding: 16px 18px; border-radius: 18px; background: #edf7ff; font-size: 18px !important; }

@keyframes float { from { margin-top: -2px; } to { margin-top: 3px; } }
@keyframes shake { 0%, 100% { margin-left: 0; } 25% { margin-left: -7px; } 75% { margin-left: 7px; } }
@keyframes hint-pulse {
  0%, 100% { box-shadow: 0 8px 0 rgb(18 49 90 / 13%), 0 0 0 0 rgb(255 181 31 / 0%); }
  50% { box-shadow: 0 8px 0 rgb(18 49 90 / 13%), 0 0 0 13px rgb(255 181 31 / 38%); }
}

@media (max-width: 620px) {
  #app { padding: 10px; }
  .game-shell { padding: 15px 12px 16px; border-radius: 24px; }
  .brand-mark { width: 48px; height: 48px; border-radius: 16px; font-size: 14px; }
  .eyebrow { font-size: 12px; }
  h1 { font-size: 26px; }
  .button-label { display: none; }
  .icon-button { width: 44px; padding: 0; justify-content: center; }
  .mode-tabs { width: 100%; margin-top: 18px; }
  .mode-tab { flex: 1; padding-inline: 8px; }
  .status-strip { gap: 6px; }
  .status-item { min-width: 0; flex: 1; padding: 8px 6px; }
  .target-card { flex: 1.12; }
  .game-board { height: clamp(390px, 57vh, 520px); border-radius: 23px; }
  .game-actions { gap: 6px; }
  .secondary-button { flex: 1; padding: 11px 6px; font-size: 14px; }
  .ad-section { width: calc(100% - 20px); min-height: 104px; margin-top: 24px; }
  .site-footer { flex-direction: column; align-items: center; gap: 10px; }
  .info-page { padding: 10px; }
  .info-card { padding: 24px 18px 30px; border-radius: 24px; }
}

@media (max-width: 350px) {
  .brand-lockup { gap: 9px; }
  h1 { font-size: 23px; }
  .secondary-button span { display: none; }
}

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