.play-page-body {
  min-height: 100vh;
  color: #e8f1ff;
  font-family: "Nunito Sans", "Poppins", sans-serif;
  background:
    radial-gradient(1000px 420px at 75% -10%, rgba(46, 130, 255, 0.24), transparent 64%),
    radial-gradient(720px 380px at 8% 90%, rgba(60, 210, 120, 0.14), transparent 70%),
    #020917;
}

.play-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: radial-gradient(900px 500px at 50% 20%, rgba(36, 118, 236, 0.2), transparent 60%), #020815;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-loading-card {
  width: min(560px, 90vw);
  border: 1px solid rgba(93, 145, 244, 0.4);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(8, 19, 43, 0.94), rgba(5, 13, 30, 0.98));
  padding: 20px;
  text-align: center;
}

.play-loading-card h2 { margin: 0; color: #f2f7ff; }
.play-loading-card p { margin: 8px 0 14px; color: #b7d2fa; }
.play-loading-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.24);
  overflow: hidden;
}
.play-loading-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #55d274, #2b8ddb, #7c4dff);
  box-shadow: 0 0 14px rgba(70, 137, 255, 0.5);
  transition: width .25s ease;
}
.play-ready .play-loading-overlay { display: none; }

.medugo-dash-header {
  background: rgba(4, 10, 24, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0;
}
.medugo-dash-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 64px;
  gap: 12px;
}
.medugo-dash-nav > .logo { order: 1; justify-self: start; }
.medugo-dash-nav > .medugo-dash-links { order: 2; justify-self: center; }
.medugo-dash-nav > .medugo-dash-actions { order: 3; justify-self: end; }
.hamburger { display: none !important; }
.medugo-mobile-row-wrap { display: none; }
.medugo-dash-nav .logo > span { color: #fff; }
.medugo-dash-nav .logo .logo-go {
  background: linear-gradient(90deg, var(--primary-color), #60a5fa, #f43f5e, var(--primary-color));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: logoFlow 4s linear infinite;
}
@keyframes logoFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: -150% 50%; }
}

.play-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 18px;
}
.play-links a {
  color: #b7cfff;
  text-decoration: none;
  font-weight: 600;
}
.play-links a.active,
.play-links a:hover { color: #fff; }

.medugo-dash-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dash-coin-chip,
.dash-account-chip {
  text-decoration: none;
  color: #dbeafe;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(10, 20, 42, 0.8);
  border-radius: 999px;
  min-height: 38px;
  padding: 6px 10px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.coin-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.avatar-head {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,255,255,.3);
}
.avatar-head.avatar-lg { width: 74px; height: 74px; }
.head-layer {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: translateY(-7%) scale(2.05) !important;
  transform-origin: 50% 14% !important;
  object-fit: contain !important;
  object-position: center !important;
}
.head-layer[src=""], .head-layer:not([src]) { display: none; }

.avatar-live {
  --avatar-look-x: 0px;
  --avatar-look-y: 0px;
  --avatar-look-tilt: 0deg;
  --avatar-bob-delay: 0s;
  --avatar-eye-shift: 0px;
  animation: avatarLiveBob 3.4s ease-in-out infinite;
  animation-delay: var(--avatar-bob-delay);
  will-change: transform;
}
.avatar-live::after {
  content: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at calc(42% + var(--avatar-eye-shift)) 40%, rgba(12,16,22,.96) 0 1.45%, transparent 2.05%),
    radial-gradient(ellipse at calc(58% + var(--avatar-eye-shift)) 40%, rgba(12,16,22,.96) 0 1.45%, transparent 2.05%);
  opacity: .86;
  animation: avatarLiveBlink 5.6s ease-in-out infinite;
}

.avatar-head.avatar-live {
  animation: none;
}
@keyframes avatarLiveBob {
  0%, 100% { transform: translate3d(var(--avatar-look-x), 0, 0) rotate(var(--avatar-look-tilt)) scale(1); }
  45% { transform: translate3d(var(--avatar-look-x), -4px, 0) rotate(var(--avatar-look-tilt)) scale(1.012, .992); }
  70% { transform: translate3d(var(--avatar-look-x), -2px, 0) rotate(var(--avatar-look-tilt)) scale(.998, 1.006); }
}
@keyframes avatarAccessoryFloat {
  0%, 100% { transform: translateY(0) rotate(0); }
  48% { transform: translateY(-2px) rotate(-.8deg); }
}
@keyframes avatarLiveBlink {
  0%, 88%, 93%, 100% { transform: scaleY(1); opacity: .58; }
  90%, 91% { transform: scaleY(.08); opacity: .18; }
}
@media (prefers-reduced-motion: reduce) {
  .avatar-live,
  .avatar-live::after,
  .avatar-live .head-layer[id$="-hat"] {
    animation: none !important;
  }
}

.play-main { padding-top: 12px; padding-bottom: 18px; max-width: 1220px; margin: 0 auto; }

.play-top-shell {
  border: 0;
  border-radius: 16px;
  position: relative;
  background: #020917;
  overflow: hidden;
}
.play-top-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../assets/play-extracted/top-bg.webp?v=20260602a");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: saturate(1.04) contrast(1.02);
  z-index: 1;
  pointer-events: none;
}
.play-top-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #020917 0%, rgba(2, 9, 23, 0) 14%, rgba(2, 9, 23, 0) 86%, #020917 100%),
    linear-gradient(180deg, #020917 0%, rgba(2, 9, 23, 0) 18%, rgba(2, 9, 23, 0) 82%, #020917 100%),
    linear-gradient(90deg, rgba(2, 12, 26, 0.62), rgba(2, 12, 26, 0.2));
  z-index: 1;
  pointer-events: none;
}
.play-top-shell > * {
  position: relative;
  z-index: 2;
}
.play-top-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 10px;
  padding: 10px;
}
.play-level-card,
.modes-block,
.progress-card {
  border: 1px solid rgba(88, 138, 232, 0.34);
  background: linear-gradient(180deg, rgba(8, 19, 43, 0.92), rgba(5, 13, 30, 0.96));
  border-radius: 16px;
}
.play-level-card { padding: 14px; }
.play-level-head { display: flex; gap: 10px; align-items: center; }
.level-title { margin: 0; font-size: 32px; font-weight: 800; line-height: 1.04; }
.level-subtitle { margin: 1px 0 0; color: #9cd36a; line-height: 1.1; }
.xp-row { margin-top: 14px; display: flex; justify-content: space-between; color: #ccdefc; }
.xp-track { height: 14px; margin-top: 8px; border-radius: 999px; background: rgba(148, 163, 184, 0.2); overflow: hidden; }
.xp-fill { width: 0; height: 100%; background: linear-gradient(90deg, #78d84c, #2eaf4d); }

.play-hero-banner {
  min-height: 176px;
  padding: 14px 20px;
  background: transparent;
  border: 0;
}
.play-hero-banner h1 {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 0.92;
  font-weight: 800;
  letter-spacing: .08em;
  background: linear-gradient(90deg, #7ee8ff 0%, #89f7b0 26%, #fff16a 49%, #ff8ec4 73%, #8fb6ff 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 0 24px rgba(124, 202, 255, 0.36);
  transform: skewX(-4deg);
  animation: playGlow 5.4s ease-in-out infinite;
}
.hero-line-1 { margin: 10px 0 0; font-size: clamp(20px, 1.4vw, 28px); color: #f5f9ff; font-weight: 300; }
.hero-line-2 { margin: 2px 0 0; font-size: clamp(17px, 1.2vw, 24px); color: #d8e8ff; font-weight: 300; }
@keyframes playGlow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(120, 187, 255, 0.24)); background-position: 0% 50%; }
  50% { filter: drop-shadow(0 0 16px rgba(158, 246, 197, 0.45)); background-position: 100% 50%; }
}

.play-stat-strip {
  margin-top: 0;
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 1fr);
  gap: 8px;
  border-top: 1px solid rgba(100, 160, 255, 0.2);
  background: rgba(2, 9, 22, 0.28);
}
.stat-group-pill {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  background: rgba(6, 15, 36, 0.8);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}
.stat-pill {
  min-height: 74px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 0;
  background: transparent;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
}
.stat-pill img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 9px rgba(120,174,255,.35)); }
.stat-pill .fire { color: #ff8f29; font-size: 30px; text-shadow: 0 0 12px rgba(255,143,41,.45); }
.stat-link .material-symbols-outlined {
  font-size: 30px;
  line-height: 1;
  color: #8bd0ff;
  text-shadow: 0 0 10px rgba(96, 165, 250, 0.45);
}
.stat-pill strong { display: block; color: #fff; font-size: 17px; line-height: 1.05; }
.stat-pill span { color: #c3d8ff; font-size: 10px; line-height: 1.08; }
.stat-pill strong + span { margin-top: 1px; display: block; }
.stat-link { text-decoration: none; color: inherit; }
.play-stat-strip > .stat-link {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(6, 15, 36, 0.8);
}

.progress-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.progress-card { padding: 12px; }
.progress-card h3 { margin: 0 0 10px; font-size: clamp(16px, 1.8vw, 23px); color: #f4f8ff; }
.progress-inner { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: center; }
.ring-wrap p { margin: 8px 0 0; color: #b9d4ff; text-align: center; font-size: 14px; }
.ring {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: conic-gradient(#73c844 0deg, #73c844 0deg, rgba(148, 163, 184, 0.2) 0deg);
}
.ring span {
  width: 90px;
  height: 90px;
  border-radius: 999px;
  background: #071833;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
}
.progress-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.progress-list li {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(8, 19, 40, 0.7);
  padding: 8px;
  display: flex;
  justify-content: space-between;
  color: #c4dcff;
  font-size: 13px;
}
.achievements-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.achievements-list li {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  background: rgba(8, 19, 40, 0.75);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.top-rewards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.top-rewards > div {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(8, 19, 40, 0.75);
  padding: 12px 8px;
  text-align: center;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
}
.top-rewards img { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(120,174,255,.4)); }
.top-rewards p { margin: 0; color: #e9f2ff; font-size: 17px; font-weight: 700; text-align: center; }

.modes-block { margin-top: 12px; padding: 12px; }
.modes-block h2 {
  margin: 0 0 10px;
  font-size: clamp(17px, 1.8vw, 22px);
  display: flex;
  gap: 10px;
  align-items: center;
  color: #f4f8ff;
  letter-spacing: .02em;
  font-weight: 600;
}
.modes-block h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.35);
}
.modes-block h2 img { width: 30px; height: 30px; filter: drop-shadow(0 0 12px rgba(111,255,209,.45)); }
.mode-grid {
  display: grid;
  gap: 14px;
}
.mode-group {
  display: grid;
  gap: 10px;
}
.mode-group-title {
  margin: 0;
  font-size: clamp(15px, 1.4vw, 18px);
  color: #bed8ff;
  letter-spacing: .02em;
  font-weight: 700;
}
.mode-group-track {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}
.mode-group-track-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.mode-card {
  border: 1px solid rgba(93, 145, 244, 0.42);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(4, 13, 30, 0.88);
  display: grid;
  grid-template-rows: 200px auto auto;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, filter .22s ease;
  position: relative;
  animation: cardPulse 2.8s ease-in-out infinite;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}
.mode-card:visited,
.mode-card:hover,
.mode-card:active,
.mode-card:focus {
  color: inherit;
  text-decoration: none;
}
.mode-card.large { grid-column: span 3; }
.mode-card.small { grid-column: span 4; grid-template-rows: 168px auto auto; }
.mode-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  opacity: .75;
  pointer-events: none;
  z-index: 3;
}
.mode-card.tone-green { border-color: rgba(120, 216, 76, 0.7); }
.mode-card.tone-purple { border-color: rgba(139, 107, 255, 0.7); }
.mode-card.tone-teal { border-color: rgba(94, 214, 191, 0.7); }
.mode-card.tone-blue { border-color: rgba(105, 177, 255, 0.7); }
.mode-card.tone-orange { border-color: rgba(255, 187, 86, 0.7); }
.mode-card.tone-green::before { box-shadow: 0 0 0 1px rgba(120, 216, 76, 0.52), 0 0 15px rgba(120, 216, 76, 0.35); animation: outlinePulseGreen var(--shine-duration, 2.8s) ease-in-out infinite; }
.mode-card.tone-purple::before { box-shadow: 0 0 0 1px rgba(139, 107, 255, 0.52), 0 0 15px rgba(139, 107, 255, 0.35); animation: outlinePulsePurple var(--shine-duration, 2.8s) ease-in-out infinite; }
.mode-card.tone-teal::before { box-shadow: 0 0 0 1px rgba(94, 214, 191, 0.52), 0 0 15px rgba(94, 214, 191, 0.35); animation: outlinePulseTeal var(--shine-duration, 2.8s) ease-in-out infinite; }
.mode-card.tone-blue::before { box-shadow: 0 0 0 1px rgba(105, 177, 255, 0.52), 0 0 15px rgba(105, 177, 255, 0.35); animation: outlinePulseBlue var(--shine-duration, 2.8s) ease-in-out infinite; }
.mode-card.tone-orange::before { box-shadow: 0 0 0 1px rgba(255, 187, 86, 0.52), 0 0 15px rgba(255, 187, 86, 0.35); animation: outlinePulseOrange var(--shine-duration, 2.8s) ease-in-out infinite; }
@keyframes outlinePulseGreen { 0%,100%{opacity:.45}50%{opacity:.95} }
@keyframes outlinePulsePurple { 0%,100%{opacity:.45}50%{opacity:.95} }
@keyframes outlinePulseTeal { 0%,100%{opacity:.45}50%{opacity:.95} }
@keyframes outlinePulseBlue { 0%,100%{opacity:.45}50%{opacity:.95} }
@keyframes outlinePulseOrange { 0%,100%{opacity:.45}50%{opacity:.95} }
@keyframes cardPulse { 0%,100%{filter:brightness(1)}50%{filter:brightness(1.05)} }

.mode-image {
  position: relative;
  background-size: cover;
  background-position: center;
  animation: imageBob var(--bob-duration, 3.4s) ease-in-out infinite;
  animation-delay: var(--bob-delay, 0s);
  transform: translateZ(0);
  backface-visibility: hidden;
}
.mode-image::before {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 -40px 50px rgba(2, 8, 22, 0.62), inset 0 8px 24px rgba(2, 8, 22, 0.35);
  z-index: 1;
}
.mode-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 10, 25, 0.08), rgba(3, 10, 25, 0.75));
  z-index: 2;
}
@keyframes imageBob { 0%,100%{transform:translateY(0)}50%{transform:translateY(var(--bob-offset, -4px))} }

.mode-text { padding: 12px; }
.mode-text { text-align: center; }
.mode-text h3 { margin: 0; font-size: clamp(19px, 1.7vw, 27px); color: #f4f8ff; font-weight: 700; }
.mode-text p { margin: 6px 0 0; color: #deebff; min-height: 72px; font-size: clamp(13px, 1.1vw, 17px); line-height: 1.4; font-weight: 400; }
.mode-btn {
  margin: 0 12px 12px;
  min-height: 46px;
  height: 46px;
  width: calc(100% - 24px);
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 0 12px;
  text-decoration: none;
  color: #fff;
}
.mode-btn:visited,
.mode-btn:hover,
.mode-btn:active,
.mode-btn:focus {
  color: #fff;
  text-decoration: none;
}
.mode-btn.green { background: linear-gradient(90deg, #75b733, #558d20); border-color: #9bd962; box-shadow: 0 0 14px rgba(120, 216, 76, 0.34); }
.mode-btn.purple { background: linear-gradient(90deg, #5f3ccf, #4c2ca8); border-color: #8b6bff; box-shadow: 0 0 14px rgba(139, 107, 255, 0.34); }
.mode-btn.teal { background: linear-gradient(90deg, #2f9f8c, #217564); border-color: #5ed6bf; box-shadow: 0 0 14px rgba(94, 214, 191, 0.34); }
.mode-btn.blue { background: linear-gradient(90deg, #2a77cb, #1a5ca0); border-color: #69b1ff; box-shadow: 0 0 14px rgba(105, 177, 255, 0.34); }
.mode-btn.orange { background: linear-gradient(90deg, #c37a1f, #91540d); border-color: #ffbb56; box-shadow: 0 0 14px rgba(255, 187, 86, 0.34); }
.mode-btn { animation: buttonGlow var(--glow-duration, 2.8s) ease-in-out infinite; }
.mode-btn .material-symbols-outlined { font-size: 18px; line-height: 1; }
.mode-btn { box-shadow: 0 8px 16px rgba(0,0,0,.32), var(--btn-glow, 0 0 14px rgba(82,154,255,.25)); }
.mode-btn.green { --btn-glow: 0 0 14px rgba(120,216,76,.34); }
.mode-btn.purple { --btn-glow: 0 0 14px rgba(139,107,255,.34); }
.mode-btn.teal { --btn-glow: 0 0 14px rgba(94,214,191,.34); }
.mode-btn.blue { --btn-glow: 0 0 14px rgba(105,177,255,.34); }
.mode-btn.orange { --btn-glow: 0 0 14px rgba(255,187,86,.34); }
@keyframes buttonGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.13); }
}

.stat-pill,
.progress-card,
.quest-card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease; }
.mode-card:hover,
.mode-card:focus-visible,
.progress-card:hover,
.quest-card:hover {
  transform: translateY(-2px);
  border-color: rgba(132, 180, 255, 0.62);
  box-shadow: 0 0 0 1px rgba(111, 169, 255, 0.25) inset, 0 12px 24px rgba(3, 10, 26, 0.58);
}
.mode-card:focus-visible {
  outline: 2px solid rgba(120, 216, 76, 0.9);
  outline-offset: 4px;
}
.mode-card.is-locked {
  filter: grayscale(1) saturate(.2) brightness(.65);
  opacity: .72;
  cursor: default;
  pointer-events: none;
}
.mode-card.is-locked::before {
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.4), 0 0 12px rgba(71, 85, 105, 0.32) !important;
  animation: none !important;
}
.mode-card.is-locked .mode-image::after {
  background: linear-gradient(180deg, rgba(3, 10, 25, 0.34), rgba(3, 10, 25, 0.86));
}
.mode-card.is-locked .mode-btn {
  background: linear-gradient(90deg, #4b5563, #374151) !important;
  border-color: #94a3b8 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  animation: none !important;
}
.mode-card.is-locked .mode-text h3,
.mode-card.is-locked .mode-text p {
  color: #cbd5e1;
}
.stat-pill:hover {
  transform: none;
  border-color: rgba(132, 180, 255, 0.62);
  box-shadow: 0 0 0 1px rgba(111, 169, 255, 0.25) inset, 0 0 16px rgba(3, 10, 26, 0.4);
}
.mode-btn:hover,
.subject-btn:hover,
.quest-link:hover,
.dash-account-chip:hover,
.dash-coin-chip:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 0 1px rgba(150, 197, 255, 0.35) inset, 0 0 16px rgba(82, 154, 255, 0.32);
}
.stat-pill img,
.stat-pill .fire,
.top-rewards img,
.modes-block h2 img {
  animation: iconBob var(--icon-bob-duration, 3.1s) ease-in-out infinite;
}
@keyframes iconBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.play-modal.hidden { display: none; }
.play-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 20, 0.75);
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.play-modal-card {
  width: min(980px, 94vw);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid rgba(88, 138, 232, 0.38);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(7, 18, 42, 0.96), rgba(4, 12, 30, 0.98));
  padding: 14px;
}
.play-modal-card h3 { margin: 0 0 10px; font-size: 29px; }
.close-modal-btn {
  float: right;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.8);
  color: #dbeafe;
}
.subject-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.subject-btn {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(10, 18, 36, 0.8);
  color: #e2e8f0;
  font-weight: 700;
}
.subject-game-panel { margin-top: 12px; }
.quest-card {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 10px;
  background: rgba(8, 19, 40, 0.72);
  padding: 10px;
  margin-bottom: 8px;
}
.quest-card h4 { margin: 0 0 6px; font-size: 24px; }
.quest-card p { margin: 0 0 8px; color: #c1d6fb; font-size: 17px; }
.quest-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.quest-link {
  text-decoration: none;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #fff;
  background: rgba(37, 99, 235, 0.7);
}

@media (max-width: 1080px) {
  .play-top-grid { grid-template-columns: 1fr; }
  .mode-group-track,
  .mode-group-track-grid { grid-template-columns: 1fr 1fr; }
  .mode-card.large, .mode-card.small { grid-column: span 1; }
  .progress-row { grid-template-columns: 1fr; }
  .subject-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .play-links { display: none; }
  .medugo-dash-nav { grid-template-columns: auto 1fr auto; }
  .medugo-dash-actions { justify-self: end; }
  .medugo-dash-actions { display: none; }
  .hamburger { display: inline-flex !important; width: 42px; height: 42px; justify-self: end; align-items: center; justify-content: center; background: rgba(15,23,42,.72); border: 1px solid rgba(148,163,184,.35); border-radius: 10px; }
  .hamburger span { width: 18px; height: 2px; background: #dbeafe; display: block; margin: 2px 0; }
  .medugo-mobile-row-wrap { display: block; max-height: 0; overflow: hidden; transition: max-height .25s ease; background: rgba(8,14,28,.96); }
  .medugo-mobile-row-wrap.is-open { max-height: 190px; }
  .medugo-mobile-row { display: flex; justify-content: center; gap: 8px; padding: 8px 10px; margin: 0; list-style: none; }
  .medugo-mobile-row li { flex: 0 0 auto; }
  .medugo-mobile-row a { min-width: 78px; border-radius: 10px; background: rgba(15,23,42,.45); padding: 8px 10px; text-decoration: none; color: #c7d2fe; }
  .medugo-mobile-row a.active, .medugo-mobile-row a:hover { color: #fff; }
  .medugo-mobile-auth-row { display: flex; justify-content: center; gap: 8px; padding: 0 10px 10px; }
  .medugo-mobile-auth-row .dash-account-chip, .medugo-mobile-auth-row .dash-coin-chip { min-height: 34px; padding: 4px 9px; }
  .medugo-mobile-auth-row .dash-account-chip span:last-child { display: inline; }
  .dash-account-chip span:last-child { display: none; }
  .dash-coin-chip { min-width: 64px; justify-content: center; }
  .play-top-shell::before { background-size: cover; background-position: center center; }
  .play-stat-strip { grid-template-columns: 1fr; }
  .stat-group-pill { grid-template-columns: 1fr 1fr; }
  .stat-pill { min-height: 60px; }
  .stat-pill strong { font-size: 15px; }
  .stat-pill span { font-size: 10px; }
  .mode-card { max-width: 420px; width: 100%; margin: 0 auto; }
  .mode-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: auto;
  }
  .mode-group-title {
    font-size: 13px;
    text-transform: uppercase;
    color: #9fc7ff;
    letter-spacing: .08em;
    padding: 0 4px;
  }
  .mode-group-track,
  .mode-group-track-grid {
    grid-template-columns: 1fr;
  }
  .mode-swiper-track {
    display: flex;
    overflow-x: auto;
    overflow-y: visible;
    gap: 10px;
    padding: 8px 6vw 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: relative;
    cursor: grab;
  }
  .mode-swiper-track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
  }
  .mode-swiper-track::-webkit-scrollbar { display: none; }
  .mode-swiper-track::before,
  .mode-swiper-track::after {
    content: "";
    position: sticky;
    top: 0;
    width: 18px;
    height: 100%;
    pointer-events: none;
    z-index: 4;
  }
  .mode-swiper-track::before {
    left: 0;
    background: linear-gradient(90deg, rgba(2, 9, 22, 0.92), rgba(2, 9, 22, 0));
  }
  .mode-swiper-track::after {
    right: 0;
    margin-left: auto;
    background: linear-gradient(270deg, rgba(2, 9, 22, 0.92), rgba(2, 9, 22, 0));
  }
  .mode-swiper-track .mode-card {
    flex: 0 0 84%;
    max-width: 84%;
    margin: 0;
    scroll-snap-align: center;
    transition: transform .28s ease, filter .28s ease, opacity .28s ease;
  }
  .mode-swiper-track .mode-card.is-active {
    transform: scale(1);
    opacity: 1;
    filter: saturate(1) blur(0);
  }
  .mode-swiper-track .mode-card.is-prev,
  .mode-swiper-track .mode-card.is-next {
    transform: scale(.94);
    opacity: .74;
    filter: blur(1.6px) saturate(.82) brightness(.9);
  }
  .mode-swiper-track .mode-card.is-far {
    transform: scale(.9);
    opacity: .52;
    filter: blur(2.8px) saturate(.7) brightness(.75);
  }
  .mode-group-extra .mode-group-track-grid .mode-card {
    max-width: 100%;
    width: 100%;
  }
  .subject-grid { grid-template-columns: 1fr; }
}
