:root {
  --main-pink: #f56aa3;
  --dark-pink: #e83f87;
  --soft-pink: #f9c7d9;
  --orange: #f5a33a;
  --dark-orange: #e88918;
  --cream: #fff8f1;
  --paper: #fffdf9;
  --text: #2c2c2c;
  --secondary: #70656b;
  --line: rgba(232, 63, 135, 0.15);
  --glass: rgba(255, 253, 249, 0.78);
  --shadow-soft: 0 24px 70px rgba(232, 63, 135, 0.14);
  --shadow-glow: 0 24px 80px rgba(245, 106, 163, 0.28);
  --radius-xl: 44px;
  --radius-lg: 30px;
  --radius-md: 22px;
  --max: 1180px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Baloo 2", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(249, 199, 217, 0.62), transparent 25rem),
    radial-gradient(circle at 95% 0%, rgba(245, 163, 58, 0.2), transparent 24rem),
    linear-gradient(180deg, var(--paper), #fff6fb 52%, var(--paper));
}

button { font: inherit; }

button:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(245, 163, 58, 0.45);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 18px;
  top: 14px;
  z-index: 999;
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--dark-pink);
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus { transform: translateY(0); }

.game-page {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(22px, 4vw, 54px) 0 clamp(36px, 6vw, 76px);
  isolation: isolate;
}

.game-page::before,
.game-page::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: min(55vw, 760px);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

.game-page::before {
  left: -28vw;
  top: 35%;
  border: clamp(28px, 5vw, 64px) solid rgba(245, 106, 163, 0.08);
}

.game-page::after {
  right: -28vw;
  top: -18vw;
  border: clamp(28px, 5vw, 64px) solid rgba(245, 163, 58, 0.09);
}

.game-shell {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(30px, 5vw, 54px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, #fff1f8);
  border: 1px solid rgba(232, 63, 135, 0.12);
  box-shadow: 0 16px 38px rgba(153, 67, 99, 0.13);
}

.brand-mark::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  height: 22px;
  border-radius: 5px 5px 11px 11px;
  background: repeating-linear-gradient(90deg, var(--main-pink) 0 7px, #fff 7px 14px);
  box-shadow: inset 0 -5px 0 rgba(232, 63, 135, 0.11);
}

.brand-mark i {
  position: absolute;
  z-index: 1;
  width: 17px;
  height: 15px;
  border-radius: 50% 50% 42% 48%;
  background: #fff8e7;
  border: 2px solid #f3dca6;
  box-shadow: inset 0 0 0 2px #fff;
}

.brand-mark i:nth-child(1) { left: 11px; top: 9px; transform: rotate(-18deg); }
.brand-mark i:nth-child(2) { left: 22px; top: 6px; }
.brand-mark i:nth-child(3) { right: 9px; top: 12px; transform: rotate(18deg); }

.brand-name,
.brand-subtitle { margin: 0; }

.brand-name {
  color: var(--dark-pink);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
}

.brand-subtitle {
  margin-top: 5px;
  color: var(--secondary);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(232, 63, 135, 0.13);
  border-radius: 999px;
  color: var(--dark-pink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 36px rgba(120, 53, 78, 0.09);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, color 0.22s ease;
}

.icon-button:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--main-pink), var(--dark-pink));
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-off { display: none; }
.icon-button[aria-pressed="true"] .sound-on { display: none; }
.icon-button[aria-pressed="true"] .sound-off { display: block; }

.title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.78fr);
  gap: clamp(28px, 6vw, 76px);
  align-items: end;
  margin-bottom: clamp(28px, 4vw, 42px);
}

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

.eyebrow {
  margin: 0 0 10px;
  color: var(--dark-pink);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
p { margin-top: 0; }

h1,
h2 {
  font-family: "Luckiest Guy", "Baloo 2", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.03em;
}

h1 {
  margin-bottom: 18px;
  color: var(--dark-pink);
  font-size: clamp(3.8rem, 8vw, 7rem);
  line-height: 0.79;
  text-transform: uppercase;
  text-shadow:
    0 6px 0 rgba(245, 163, 58, 0.18),
    0 24px 45px rgba(232, 63, 135, 0.16);
}

h1 span { color: var(--dark-orange); }

.title-copy > p:last-child {
  max-width: 570px;
  margin-bottom: 0;
  color: var(--secondary);
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  font-weight: 700;
  line-height: 1.55;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.score-card {
  min-height: 98px;
  display: grid;
  align-content: center;
  padding: 16px 20px;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(120, 53, 78, 0.08);
}

.score-card--main {
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 255, 255, 0.28), transparent 8rem),
    linear-gradient(135deg, var(--main-pink), var(--dark-pink));
  border-color: transparent;
  box-shadow: 0 20px 48px rgba(232, 63, 135, 0.25);
}

.score-card span {
  color: var(--secondary);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.score-card strong {
  margin-top: 3px;
  color: var(--dark-pink);
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1;
}

.score-card strong b { font-weight: inherit; }

.score-card--main span,
.score-card--main strong { color: #fff; }

.game-card {
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.08);
}

.game-topbar,
.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px clamp(18px, 3vw, 30px);
}

.game-topbar { border-bottom: 1px solid var(--line); }
.game-footer { border-top: 1px solid var(--line); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--dark-pink);
  background: rgba(245, 106, 163, 0.1);
  border: 1px solid rgba(245, 106, 163, 0.15);
  font-size: 0.88rem;
  font-weight: 900;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--main-pink);
  box-shadow: 0 0 0 5px rgba(245, 106, 163, 0.13);
}

.status-pill.is-live .status-dot {
  background: #35c98b;
  box-shadow: 0 0 0 5px rgba(53, 201, 139, 0.14);
  animation: pulseDot 1.2s ease-in-out infinite;
}

.power-wrap {
  display: grid;
  grid-template-columns: auto minmax(110px, 180px);
  gap: 10px;
  align-items: center;
  color: var(--secondary);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.power-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f4e6ed;
  box-shadow: inset 0 2px 5px rgba(120, 53, 78, 0.08);
}

.power-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--main-pink), var(--orange));
  transition: width 0.08s linear;
}

.canvas-wrap {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 62%, rgba(255, 255, 255, 0.82) 0 8%, rgba(255, 255, 255, 0.18) 31%, transparent 55%),
    linear-gradient(145deg, #ffd6e9, #ff94cc 55%, #ffc47c);
  isolation: isolate;
  touch-action: none;
  user-select: none;
}

.canvas-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.48;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 22%, rgba(255,255,255,.68) 0 4px, transparent 5px),
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.48) 0 3px, transparent 4px),
    radial-gradient(circle at 72% 76%, rgba(255,255,255,.35) 0 5px, transparent 6px);
  background-size: 88px 88px, 116px 116px, 138px 138px;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 590px;
  cursor: grab;
}

#gameCanvas.is-aiming { cursor: grabbing; }

.start-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: min(520px, calc(100% - 34px));
  padding: clamp(26px, 5vw, 42px);
  border-radius: 36px;
  text-align: center;
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 28px 80px rgba(122, 24, 83, 0.24);
  backdrop-filter: blur(20px) saturate(1.2);
  transform: translate(-50%, -50%);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}

.start-panel.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -47%) scale(0.97);
}

.start-popcorn {
  position: relative;
  width: 92px;
  height: 72px;
  margin: 0 auto 12px;
}

.start-popcorn::before {
  content: "";
  position: absolute;
  left: 19px;
  right: 19px;
  bottom: 0;
  height: 48px;
  border-radius: 7px 7px 18px 18px;
  background: repeating-linear-gradient(90deg, var(--main-pink) 0 11px, #fff 11px 22px);
  box-shadow: 0 14px 24px rgba(232, 63, 135, 0.2);
}

.start-popcorn i {
  position: absolute;
  z-index: 1;
  width: 30px;
  height: 27px;
  border-radius: 52% 48% 46% 54%;
  background: #fff8df;
  border: 3px solid #efd596;
  box-shadow: inset 0 0 0 3px #fff;
}

.start-popcorn i:nth-child(1) { left: 9px; top: 10px; transform: rotate(-20deg); }
.start-popcorn i:nth-child(2) { left: 27px; top: 1px; transform: rotate(8deg); }
.start-popcorn i:nth-child(3) { right: 7px; top: 12px; transform: rotate(22deg); }
.start-popcorn i:nth-child(4) { left: 29px; top: 22px; transform: rotate(-12deg); }
.start-popcorn i:nth-child(5) { right: 25px; top: 2px; transform: rotate(13deg); }

.panel-kicker {
  margin: 0 0 7px;
  color: var(--dark-orange);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.start-panel h2 {
  margin-bottom: 12px;
  color: var(--dark-pink);
  font-size: clamp(2.1rem, 6vw, 3.5rem);
  line-height: 0.96;
}

.start-panel > p:not(.panel-kicker):not(.control-note) {
  max-width: 410px;
  margin: 0 auto 24px;
  color: var(--secondary);
  font-weight: 700;
  line-height: 1.55;
}

.primary-button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 25px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--main-pink), var(--dark-pink));
  box-shadow: 0 18px 38px rgba(245, 106, 163, 0.3);
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.primary-button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.primary-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.control-note {
  margin: 13px 0 0;
  color: #9a8a91;
  font-size: 0.82rem;
  font-weight: 800;
}

.toast {
  position: absolute;
  left: 50%;
  top: 18%;
  z-index: 7;
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--dark-pink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 36px rgba(120, 53, 78, 0.16);
  font-family: "Luckiest Guy", "Baloo 2", sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px) scale(0.92);
}

.toast.is-visible { animation: toastPop 0.85s ease both; }

.game-footer p {
  margin: 0;
  color: var(--secondary);
  font-size: 0.9rem;
  font-weight: 700;
}

.game-footer strong { color: var(--dark-pink); }

.text-button {
  flex: 0 0 auto;
  padding: 8px 0;
  border: 0;
  color: var(--dark-pink);
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.text-button:hover { color: var(--dark-orange); }

body.is-embedded {
  min-height: 100svh;
  background: transparent;
}

body.is-embedded .skip-link,
body.is-embedded .game-header {
  display: none;
}

body.is-embedded .game-page {
  min-height: 100svh;
  padding: 0;
}

body.is-embedded .game-shell {
  width: 100%;
  min-height: 100svh;
}

body.is-embedded .title-row {
  grid-template-columns: minmax(0, 0.9fr) minmax(250px, 0.72fr);
  gap: clamp(14px, 2.4vw, 24px);
  align-items: end;
  margin: 0;
  padding: clamp(18px, 3vw, 28px) clamp(16px, 3vw, 28px) clamp(12px, 2vw, 18px);
}

body.is-embedded .eyebrow {
  margin-bottom: 6px;
  font-size: 0.68rem;
}

body.is-embedded h1 {
  margin-bottom: 8px;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  text-shadow:
    0 4px 0 rgba(245, 163, 58, 0.18),
    0 14px 34px rgba(232, 63, 135, 0.14);
}

body.is-embedded .title-copy > p:last-child {
  font-size: 0.92rem;
  line-height: 1.35;
}

body.is-embedded .scoreboard {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.is-embedded .score-card {
  min-height: 72px;
  padding: 11px 14px;
  border-radius: 18px;
}

body.is-embedded .score-card span {
  font-size: 0.66rem;
}

body.is-embedded .score-card strong {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
}

body.is-embedded .game-card {
  border-radius: 0;
  box-shadow: none;
}

body.is-embedded .game-topbar,
body.is-embedded .game-footer {
  padding: 12px clamp(14px, 2.6vw, 22px);
}

body.is-embedded .canvas-wrap {
  min-height: clamp(420px, 58svh, 620px);
}

body.is-embedded #gameCanvas {
  height: clamp(420px, 58svh, 620px);
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

@keyframes toastPop {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(0.9); }
  20%, 70% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -18px) scale(0.98); }
}

@media (max-width: 900px) {
  .title-row { grid-template-columns: 1fr; }
  .scoreboard { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .score-card { min-height: 82px; padding: 13px 15px; }
}

@media (max-width: 680px) {
  .game-page { padding-top: 18px; }
  .game-shell { width: min(100% - 20px, var(--max)); }
  .game-header { margin-bottom: 28px; }
  .brand-mark { width: 48px; height: 48px; border-radius: 16px; }
  .brand-subtitle { display: none; }

  h1 {
    font-size: clamp(3.15rem, 16vw, 5rem);
    margin-bottom: 14px;
  }

  .title-row { gap: 22px; margin-bottom: 22px; }
  .title-copy > p:last-child { font-size: 0.98rem; }
  .scoreboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-card { border-radius: 30px; }

  .game-topbar {
    align-items: flex-start;
    padding: 14px 15px;
  }

  .status-pill { font-size: 0.8rem; }
  .power-wrap { grid-template-columns: 1fr; gap: 5px; width: 112px; }
  .power-wrap > span { display: none; }
  .canvas-wrap { min-height: 520px; }
  #gameCanvas { height: 520px; }

  .start-panel {
    padding: 25px 20px;
    border-radius: 29px;
  }

  .start-popcorn { transform: scale(0.88); margin-bottom: 5px; }
  .start-panel h2 { font-size: clamp(2rem, 10vw, 2.8rem); }
  .start-panel > p:not(.panel-kicker):not(.control-note) { font-size: 0.94rem; }

  .game-footer {
    align-items: flex-start;
    padding: 14px 17px;
  }

  .game-footer p { max-width: 73%; line-height: 1.35; }

  body.is-embedded .game-page {
    padding-top: 0;
  }

  body.is-embedded .game-shell {
    width: 100%;
  }

  body.is-embedded .title-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 15px 14px 12px;
  }

  body.is-embedded .title-copy > p:last-child {
    display: none;
  }

  body.is-embedded .scoreboard {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  body.is-embedded .score-card {
    min-height: 58px;
    padding: 8px 9px;
    border-radius: 15px;
  }

  body.is-embedded .score-card span {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
  }

  body.is-embedded .score-card strong {
    font-size: 1.16rem;
  }

  body.is-embedded .canvas-wrap,
  body.is-embedded #gameCanvas {
    min-height: 460px;
    height: 460px;
  }

  body.is-embedded .game-footer p {
    max-width: none;
  }
}

@media (max-width: 390px) {
  .brand-name { font-size: 0.95rem; }
  .score-card { min-height: 75px; padding: 12px 13px; border-radius: 21px; }
  .score-card strong { font-size: 1.5rem; }
  .canvas-wrap { min-height: 490px; }
  #gameCanvas { height: 490px; }

  body.is-embedded .canvas-wrap,
  body.is-embedded #gameCanvas {
    min-height: 430px;
    height: 430px;
  }
}

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