:root {
  --pink: #ff4fa3;
  --purple: #7257f3;
  --blue: #2f8df3;
  --cyan: #34c6df;
  --green: #25c48c;
  --yellow: #ffd84d;
  --orange: #ff8b3d;
  --red: #ef4444;
  --ink: #2b2554;
  --muted: #68627d;
  --paper: #fffaf3;
  --shadow: 0 18px 36px rgba(69, 49, 122, 0.2);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.seo-content,
.ad-slot-game-end {
  width: min(820px, 100%);
  margin: 22px auto 0;
}

.seo-content {
  padding: 20px;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 28px rgba(42, 28, 92, 0.1);
}

.seo-content h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.35rem;
}

.seo-content p {
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.seo-content p:last-child {
  margin-bottom: 0;
}

.seo-content ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.related-card {
  display: grid;
  gap: 5px;
  min-height: 118px;
  padding: 14px;
  border: 3px solid #ffffff;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #fff0c7);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 7px 0 rgba(82, 57, 130, 0.12);
}

.related-card span {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.related-card strong,
.related-card small {
  display: block;
}

.related-card small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.25;
}

.seo-content a,
.legal-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.5rem;
  color: var(--purple);
  font-weight: 900;
  text-decoration: none;
}

.seo-content a:hover,
.legal-footer a:hover {
  text-decoration: underline;
}

.ad-slot-game-end {
  min-height: 90px;
  border: 3px dashed rgba(109, 76, 255, 0.26);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.42);
}

.ad-slot {
  display: none;
}

body.ads-enabled .ad-slot {
  display: block;
}

.legal-footer {
  width: min(820px, 100%);
  margin: 22px auto 0;
  padding: 18px;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  text-align: center;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(42, 28, 92, 0.1);
}

.legal-footer strong {
  color: var(--ink);
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  margin-top: 10px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, system-ui, sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    radial-gradient(circle at 12% 16%, rgba(255, 216, 77, 0.55) 0 9%, transparent 10%),
    radial-gradient(circle at 86% 18%, rgba(52, 198, 223, 0.42) 0 10%, transparent 11%),
    linear-gradient(135deg, #fff3b7 0%, #ffd7eb 43%, #c8f3ff 100%);
  background-size: 34px 34px, 34px 34px, 100% 100%, 100% 100%, 100% 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 22% 78%, rgba(37, 196, 140, 0.22), transparent 26%),
    radial-gradient(circle at 78% 72%, rgba(114, 87, 243, 0.2), transparent 24%);
  pointer-events: none;
}

button,
input {
  -webkit-tap-highlight-color: transparent;
  font: inherit;
}

a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 4px solid rgba(114, 87, 243, 0.55);
  outline-offset: 4px;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 34px);
}

.start-screen,
.game-screen {
  width: 100%;
  border: 6px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  background: rgba(255, 250, 243, 0.92);
  box-shadow: var(--shadow);
}

.start-screen {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(22px, 5vw, 44px);
  text-align: center;
}

.hero-panel {
  position: relative;
  isolation: isolate;
  margin: 0 auto 24px;
  padding: clamp(18px, 4vw, 34px);
  border: 4px solid #ffffff;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.42)),
    linear-gradient(110deg, rgba(255, 79, 163, 0.22), rgba(255, 216, 77, 0.24), rgba(47, 141, 243, 0.2));
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: -45% -20%;
  z-index: -1;
  background: conic-gradient(
    from 90deg,
    rgba(255, 79, 163, 0.18),
    rgba(255, 216, 77, 0.2),
    rgba(37, 196, 140, 0.16),
    rgba(47, 141, 243, 0.18),
    rgba(114, 87, 243, 0.18),
    rgba(255, 79, 163, 0.18)
  );
  animation: heroGlow 9s linear infinite;
}

.game-screen {
  padding: clamp(16px, 3vw, 30px);
}

.is-hidden {
  display: none !important;
}

.brand-badge {
  display: grid;
  width: 94px;
  height: 94px;
  place-items: center;
  margin: 0 auto 14px;
  border: 6px solid #ffffff;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #ffffff 0 12%, transparent 13%),
    conic-gradient(var(--pink), var(--yellow), var(--green), var(--blue), var(--purple), var(--pink));
  color: #ffffff;
  font-size: 0;
  box-shadow: 0 12px 0 rgba(72, 45, 130, 0.16);
  animation: badgeFloat 2.8s ease-in-out infinite;
}

.eyebrow,
.modal-kicker {
  display: inline-block;
  margin: 0 0 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--yellow);
  color: #704400;
  font-size: 0.95rem;
  font-weight: 900;
}

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

h1 {
  max-width: 840px;
  margin: 0 auto 10px;
  font-size: clamp(2.25rem, 7vw, 5rem);
  line-height: 0.98;
  color: transparent;
  background: linear-gradient(135deg, #2b2554, #7257f3 38%, #ff4fa3 72%, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  overflow-wrap: anywhere;
  word-break: break-word;
}

h1 span {
  display: inline;
}

.subtitle {
  max-width: 760px;
  margin: 0 auto 12px;
  color: #3f3a68;
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.hook {
  max-width: 720px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.18rem);
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.welcome-lights {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 22px auto 0;
}

.welcome-lights span {
  width: clamp(28px, 6vw, 44px);
  height: clamp(28px, 6vw, 44px);
  border: 4px solid #ffffff;
  border-radius: 50%;
  box-shadow:
    0 8px 0 rgba(69, 49, 122, 0.14),
    0 0 24px rgba(255, 255, 255, 0.8);
  animation: welcomeBlink 1.8s ease-in-out infinite;
}

.welcome-lights span:nth-child(2) {
  animation-delay: 0.16s;
}

.welcome-lights span:nth-child(3) {
  animation-delay: 0.32s;
}

.welcome-lights span:nth-child(4) {
  animation-delay: 0.48s;
}

.welcome-lights span:nth-child(5) {
  animation-delay: 0.64s;
}

.welcome-lights span:nth-child(6) {
  animation-delay: 0.8s;
}

.setup-panel {
  display: grid;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto 20px;
}

.name-field {
  display: grid;
  gap: 8px;
  text-align: left;
}

.name-field span,
.level-selector legend {
  color: #3f3a68;
  font-weight: 900;
}

.name-field input {
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border: 3px solid #ffffff;
  border-radius: 18px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  outline: none;
  box-shadow: 0 8px 18px rgba(69, 49, 122, 0.09);
}

.name-field input:focus {
  border-color: var(--pink);
  box-shadow:
    0 8px 18px rgba(69, 49, 122, 0.09),
    0 0 0 4px rgba(255, 79, 163, 0.16);
}

.level-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.level-selector legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  text-align: left;
}

.level-selector label {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 96px;
  padding: 14px;
  border: 3px solid #ffffff;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #fff0c7);
  text-align: left;
  font-weight: 900;
  box-shadow: 0 7px 0 rgba(82, 57, 130, 0.12);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.level-selector label:has(input:checked) {
  border-color: rgba(255, 79, 163, 0.9);
  box-shadow:
    0 7px 0 rgba(82, 57, 130, 0.12),
    0 0 0 5px rgba(255, 79, 163, 0.12);
}

.level-selector label:hover {
  transform: translateY(-2px);
}

.level-selector label span {
  display: grid;
  gap: 8px;
}

.level-selector input {
  width: 18px;
  height: 18px;
  accent-color: var(--pink);
}

.level-selector strong {
  display: block;
  font-size: 1.02rem;
}

.level-selector small {
  display: flex;
  gap: 5px;
}

.dot {
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 3px 7px rgba(43, 37, 84, 0.18);
}

.red {
  background: linear-gradient(145deg, #ff6b6b, #e22f4f);
}

.blue {
  background: linear-gradient(145deg, #5bbcff, #2467e8);
}

.green {
  background: linear-gradient(145deg, #57dda3, #169b6b);
}

.yellow {
  background: linear-gradient(145deg, #ffe56c, #f1a600);
}

.purple {
  background: linear-gradient(145deg, #a58cff, #6944df);
}

.orange {
  background: linear-gradient(145deg, #ffb05f, #f05a28);
}

.menu-button,
.primary-button,
.secondary-button,
.subscribe-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  font-weight: 900;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.primary-button {
  position: relative;
  isolation: isolate;
  background: linear-gradient(135deg, var(--green), var(--blue), var(--purple));
  overflow: hidden;
  box-shadow:
    0 9px 0 rgba(62, 67, 153, 0.32),
    0 16px 28px rgba(47, 141, 243, 0.22);
}

.primary-button::before {
  content: "";
  position: absolute;
  inset: -55% auto -55% -45%;
  z-index: -1;
  width: 38%;
  transform: rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  animation: buttonShine 2.6s ease-in-out infinite;
}

.setup-panel .primary-button {
  min-height: 66px;
  font-size: clamp(1.08rem, 3vw, 1.35rem);
}

.menu-button {
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 8px 0 rgba(39, 135, 217, 0.28);
}

.secondary-button {
  background: linear-gradient(135deg, var(--orange), var(--pink));
  box-shadow: 0 8px 0 rgba(177, 49, 108, 0.25);
}

.subscribe-button {
  position: relative;
  isolation: isolate;
  width: min(100%, 410px);
  min-height: 64px;
  padding: 14px 22px;
  border: 5px solid #ffffff;
  background: linear-gradient(135deg, #ff001f 0%, var(--pink) 48%, var(--purple) 100%);
  overflow: hidden;
  box-shadow:
    0 10px 0 #b6004b,
    0 16px 30px rgba(255, 0, 80, 0.34);
  animation: subscribePulse 1.45s ease-in-out infinite;
}

.subscribe-button::before {
  content: "";
  position: absolute;
  inset: -45% auto -45% -55%;
  z-index: -1;
  width: 44%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.78), transparent);
  animation: subscribeShine 2.1s ease-in-out infinite;
}

.subscribe-button::after {
  content: "▶";
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-left: 10px;
  border-radius: 50%;
  background: #ffffff;
  color: #ff001f;
  font-size: 0.85em;
  line-height: 1;
}

.menu-button:hover,
.primary-button:hover,
.secondary-button:hover,
.subscribe-button:hover {
  transform: translateY(-3px);
  filter: saturate(1.08);
}

.primary-button:disabled,
.secondary-button:disabled,
.color-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.35);
  opacity: 0.68;
}

.start-actions,
.game-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.game-header h2 {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 3.6rem);
}

.compact {
  width: auto;
  min-height: 48px;
  border-width: 3px;
  padding: 10px 14px;
  font-size: 0.95rem;
  box-shadow:
    0 7px 0 #b6004b,
    0 12px 22px rgba(255, 0, 80, 0.28);
}

.score-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.score-panel div {
  position: relative;
  min-height: 76px;
  padding: 12px 12px 12px 48px;
  border: 3px solid #ffffff;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fff0c2);
  text-align: center;
}

.score-panel div::before {
  position: absolute;
  left: 12px;
  top: 50%;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

.player-stat::before {
  content: "★";
  color: var(--pink);
}

.level-stat::before {
  content: "◆";
  color: var(--blue);
}

.score-stat::before {
  content: "✓";
  color: var(--green);
}

.record-stat::before {
  content: "🏆";
}

.score-stat strong {
  color: #087f5b;
}

.record-stat strong {
  color: #9a6700;
}

.score-panel span {
  display: block;
  margin-bottom: 5px;
  color: #766c8f;
  font-size: 0.88rem;
  font-weight: 900;
}

.score-panel strong {
  display: block;
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  line-height: 1.1;
}

.game-message {
  min-height: 54px;
  margin: 0 auto 18px;
  padding: 13px 16px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  background: #ffffff;
  text-align: center;
  font-size: clamp(1.02rem, 2.5vw, 1.18rem);
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(69, 49, 122, 0.08);
}

.game-message.success {
  background: #e7fff5;
}

.game-message.error {
  background: #fff0f0;
}

.game-message.record {
  background: #fff5c7;
}

.color-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 16px);
  width: min(100%, 600px);
  margin: 0 auto 20px;
}

.color-board.colors-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 460px);
}

.color-button {
  display: grid;
  aspect-ratio: 1 / 1;
  min-height: 108px;
  place-items: center;
  border: 6px solid rgba(255, 255, 255, 0.85);
  border-radius: clamp(22px, 4vw, 34px);
  color: #ffffff;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  box-shadow:
    inset 0 -10px 22px rgba(0, 0, 0, 0.12),
    0 12px 0 rgba(42, 32, 85, 0.18),
    0 18px 28px rgba(42, 32, 85, 0.16);
  transition:
    transform 140ms ease,
    filter 140ms ease,
    box-shadow 140ms ease;
}

.color-button::before {
  content: attr(data-symbol);
  display: grid;
  width: clamp(42px, 9vw, 62px);
  height: clamp(42px, 9vw, 62px);
  place-items: center;
  margin-bottom: 8px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.color-button:not(:disabled):hover {
  transform: translateY(-3px);
  filter: brightness(1.06) saturate(1.1);
}

.color-button.is-lit {
  transform: translateY(5px) scale(1.04);
  filter: brightness(1.35) saturate(1.35);
  box-shadow:
    inset 0 0 24px rgba(255, 255, 255, 0.42),
    0 0 0 8px rgba(255, 255, 255, 0.58),
    0 0 34px rgba(255, 255, 255, 0.9);
}

.color-button.is-lit:disabled {
  opacity: 1;
  filter: brightness(1.35) saturate(1.35);
}

.color-board.is-your-turn .color-button:not(:disabled) {
  animation: playerTurnPulse 1.5s ease-in-out infinite;
}

.color-button.red {
  background: linear-gradient(145deg, #ff6b6b, #e22f4f);
}

.color-button.blue {
  background: linear-gradient(145deg, #5bbcff, #2467e8);
}

.color-button.green {
  background: linear-gradient(145deg, #57dda3, #169b6b);
}

.color-button.yellow {
  background: linear-gradient(145deg, #ffe56c, #f1a600);
}

.color-button.purple {
  background: linear-gradient(145deg, #a58cff, #6944df);
}

.color-button.orange {
  background: linear-gradient(145deg, #ffb05f, #f05a28);
}

.game-screen.positive {
  animation: positiveFlash 520ms ease;
}

.game-screen.mistake {
  animation: mistakeShake 360ms ease;
}

.success-burst {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.success-burst span {
  position: absolute;
  top: 48%;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: burstOut 760ms ease-out forwards;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(33, 27, 56, 0.66);
}

.modal-card {
  width: min(600px, 100%);
  max-height: min(88vh, 780px);
  overflow-y: auto;
  padding: clamp(22px, 5vw, 34px);
  border: 6px solid #ffffff;
  border-radius: 28px;
  background: linear-gradient(145deg, #ffffff, #fff1ce);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: modalIn 240ms ease-out;
}

.modal-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1.05;
}

.final-score,
.record-message {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 900;
}

.record-message.is-record {
  color: #8a5b00;
  text-shadow: 0 0 16px rgba(255, 216, 77, 0.6);
}

.podium-card {
  width: min(920px, 100%);
}

.podium-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
  text-align: left;
}

.podium-section {
  padding: 14px;
  border: 3px solid #ffffff;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(69, 49, 122, 0.08);
}

.podium-section h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.1rem;
}

.podium-section:nth-child(1) {
  background: linear-gradient(145deg, #ffffff, #fff3c4);
}

.podium-section:nth-child(2) {
  background: linear-gradient(145deg, #ffffff, #e9f9ff);
}

.podium-section:nth-child(3) {
  background: linear-gradient(145deg, #ffffff, #f0eaff);
}

.podium-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style-position: inside;
}

.podium-list li {
  padding: 9px;
  border-radius: 12px;
  background: #fff6d8;
  font-weight: 800;
}

.podium-list li:first-child {
  background: linear-gradient(135deg, #fff0a8, #ffffff);
  box-shadow: 0 0 0 3px rgba(255, 216, 77, 0.28);
}

.podium-medal {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin-right: 6px;
  border-radius: 50%;
  background: #ffffff;
}

.podium-list span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.empty-podium {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

@keyframes subscribePulse {
  0%,
  100% {
    filter: saturate(1);
  }

  50% {
    filter: saturate(1.25) brightness(1.08);
  }
}

@keyframes subscribeShine {
  0% {
    left: -55%;
  }

  55%,
  100% {
    left: 120%;
  }
}

@keyframes heroGlow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes badgeFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes welcomeBlink {
  0%,
  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }

  45% {
    transform: translateY(-8px) scale(1.12);
    filter: brightness(1.28) saturate(1.25);
  }
}

@keyframes buttonShine {
  0% {
    left: -45%;
  }

  55%,
  100% {
    left: 118%;
  }
}

@keyframes playerTurnPulse {
  0%,
  100% {
    box-shadow:
      inset 0 -10px 22px rgba(0, 0, 0, 0.12),
      0 12px 0 rgba(42, 32, 85, 0.18),
      0 18px 28px rgba(42, 32, 85, 0.16);
  }

  50% {
    box-shadow:
      inset 0 -10px 22px rgba(0, 0, 0, 0.12),
      0 12px 0 rgba(42, 32, 85, 0.18),
      0 0 0 7px rgba(255, 255, 255, 0.45),
      0 20px 36px rgba(42, 32, 85, 0.18);
  }
}

@keyframes burstOut {
  to {
    transform: translate(var(--x), var(--y)) scale(0.3);
    opacity: 0;
  }
}

@keyframes positiveFlash {
  0%,
  100% {
    box-shadow: var(--shadow);
  }

  45% {
    box-shadow:
      var(--shadow),
      0 0 0 8px rgba(37, 196, 140, 0.22);
  }
}

@keyframes mistakeShake {
  0%,
  100% {
    transform: translateX(0);
  }

  30% {
    transform: translateX(-8px);
  }

  60% {
    transform: translateX(8px);
  }
}

@keyframes modalIn {
  from {
    transform: translateY(16px) scale(0.96);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 880px) {
  .game-header {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }

  .score-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .podium-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 10px;
  }

  .start-screen,
  .game-screen {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 14px;
    border-width: 4px;
    border-radius: 22px;
  }

  .start-screen > *,
  .game-screen > *,
  .hero-panel,
  .setup-panel,
  .level-selector,
  .start-actions,
  .game-actions {
    min-width: 0;
    max-width: 100%;
  }

  .hero-panel {
    padding: 16px 12px;
    border-radius: 22px;
  }

  h1 {
    max-width: 250px;
    margin-right: auto;
    margin-left: auto;
    font-size: clamp(1.08rem, 5.1vw, 1.25rem);
    line-height: 1.12;
    word-break: normal;
  }

  h1 span {
    display: block;
    font-size: 0.72em;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .subtitle,
  .hook {
    max-width: 250px;
    font-size: 0.92rem;
    word-break: break-word;
  }

  .level-selector {
    grid-template-columns: 1fr;
  }

  .start-actions,
  .game-actions,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .menu-button,
  .primary-button,
  .secondary-button,
  .subscribe-button,
  .compact {
    width: 100%;
    max-width: 100%;
  }

  .score-panel {
    grid-template-columns: 1fr;
  }

  .color-board,
  .color-board.colors-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .color-button {
    min-height: 118px;
    border-width: 4px;
    border-radius: 22px;
    font-size: 1rem;
  }

  .game-message {
    font-size: 1.05rem;
  }
}
