/* ============================================================
   MiniGames.css — All styles for Mini Games Hub + individual games
   Relies on CSS variables from styles.css (--bg, --text, --border, etc.)
   ============================================================ */

/* ─── Shared Game Overlay ─────────────────────────────────────────────────── */

.mgames-overlay-wrap {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--sidebar-width, 260px);
  z-index: 800;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

/* Shared UI Elements */
.game-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s;
  flex-shrink: 0;
}

.game-reset-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-faint);
}

.game-reset-btn:active {
  transform: scale(0.9);
}

.game-reset-btn svg {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-reset-btn:hover svg {
  transform: rotate(-180deg);
}

/* ─── Mini Games Hub ────────────────────────────────────────────────────────── */

.mgames-root {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--sidebar-width, 260px);
  z-index: 800;
  background: var(--bg-elevated);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: mgames-backdrop-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-collapsed .mgames-root,
body.sidebar-collapsed .astrodle-v4-root {
  left: var(--sidebar-rail-width, 56px);
}

@media (max-width: 1023px) {
  .mgames-root,
  .wordly-root,
  .bingo-root,
  .astrodle-v4-root,
  .mgames-overlay-wrap {
    left: 0 !important;
    right: 0;
    width: 100vw;
    z-index: 8000000 !important;
  }
}

@keyframes mgames-backdrop-in {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(40px); }
}

@keyframes mgames-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes mgames-card-in {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Starfield */
.mgames-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.mgames-star {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  animation: mgames-star-twinkle 3s ease-in-out infinite;
}

@keyframes mgames-star-twinkle {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1;   }
}

/* Header */
.mgames-header {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
}

.mgames-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mgames-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s;
  flex-shrink: 0;
}

.mgames-back-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: translateX(-2px);
}

.mgames-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.mgames-header-divider {
  color: var(--border);
  font-size: 14px;
}

.mgames-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Game Grid */
.mgames-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Game Card - Square & Glassmorphic */
.mgame-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.mgame-card:hover {
  transform: translateY(-12px) scale(1.03);
  border-color: color-mix(in srgb, var(--game-accent) 60%, transparent);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--game-accent) 8%, transparent),
    rgba(255, 255, 255, 0.03)
  );
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.5),
    0 0 30px color-mix(in srgb, var(--game-accent) 25%, transparent);
}

/* Mouse follow glow */
.mgame-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    color-mix(in srgb, var(--game-accent) 25%, transparent),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
  z-index: 0;
}

.mgame-card:hover::after {
  opacity: 1;
}

.mgame-card-soon {
  opacity: 0.6;
  filter: grayscale(0.5);
  cursor: default;
}

.mgame-card-soon:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.mgame-card-glow {
  position: absolute;
  top: -20%;
  right: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--game-accent) 12%, transparent) 0%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  transition: opacity 0.4s;
}

.mgame-card:hover .mgame-card-glow {
  opacity: 1;
}

/* Override hover effects for wallpaper-style cards */
.mgame-card-astrodle:hover,
.mgame-card-cosmic-runner:hover {
  box-shadow: none !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.mgame-card-astrodle::after,
.mgame-card-cosmic-runner::after,
.mgame-card-astrodle .mgame-card-glow,
.mgame-card-cosmic-runner .mgame-card-glow {
  display: none !important;
}

.mgame-card-astrodle {
  background:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.4),
      rgba(0, 0, 0, 0.7)
    ),
    url('/game-assets/astrodle-wallpaper.png') center/cover no-repeat;
  border-color: color-mix(in srgb, var(--game-accent) 50%, transparent);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.mgame-card-astrodle:hover {
  background:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.32),
      rgba(0, 0, 0, 0.62)
    ),
    url('/game-assets/astrodle-wallpaper.png') center/cover no-repeat;
}

.mgame-card-cosmic-runner {
  background:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.4),
      rgba(0, 0, 0, 0.7)
    ),
    url('/game-assets/cosmic_runner_cover.png') top/cover no-repeat;
  border-color: color-mix(in srgb, var(--game-accent) 50%, transparent);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
background-position: top !important;
}

.mgame-card-cosmic-runner:hover {
  background:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.32),
      rgba(0, 0, 0, 0.62)
    ),
    url('/game-assets/cosmic_runner_cover.png') center/cover no-repeat;
    background-position: top;
}

[data-theme="light"] .mgame-card-astrodle {
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.2),
      rgba(255, 255, 255, 0.5)
    ),
    url('/game-assets/astrodle-wallpaper.png') center/cover no-repeat;
}

[data-theme="light"] .mgame-card-astrodle:hover {
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.15),
      rgba(255, 255, 255, 0.38)
    ),
    url('/game-assets/astrodle-wallpaper.png') center/cover no-repeat;
}

[data-theme="light"] .mgame-card-cosmic-runner {
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.2),
      rgba(255, 255, 255, 0.5)
    ),
    url('/game-assets/cosmic_runner_cover.png') center/cover no-repeat;
    background-position: top !important;
}

[data-theme="light"] .mgame-card-cosmic-runner:hover {
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.15),
      rgba(255, 255, 255, 0.38)
    ),
    url('/game-assets/cosmic_runner_cover.png') center/cover no-repeat;
    background-position: top !important;
}

/* Astrodle, Graha Yuddha & Cosmic Runner card: wallpaper + streak + play button only */
.mgame-card-astrodle .mgame-card-top,
.mgame-card-graha_yuddha .mgame-card-top,
.mgame-card-cosmic-runner .mgame-card-top {
  display: block;
  width: 100%;
  min-height: 0;
}

.mgame-card-astrodle .mgame-emoji,
.mgame-card-graha_yuddha .mgame-emoji,
.mgame-card-cosmic-runner .mgame-emoji,
.mgame-card-astrodle .mgame-card-body,
.mgame-card-graha_yuddha .mgame-card-body,
.mgame-card-cosmic-runner .mgame-card-body,
.mgame-card-astrodle .mgame-tagline,
.mgame-card-graha_yuddha .mgame-tagline,
.mgame-card-cosmic-runner .mgame-tagline,
.mgame-card-astrodle .mgame-name,
.mgame-card-graha_yuddha .mgame-name,
.mgame-card-cosmic-runner .mgame-name,
.mgame-card-astrodle .mgame-description,
.mgame-card-graha_yuddha .mgame-description,
.mgame-card-cosmic-runner .mgame-description {
  display: none !important;
}

.mgame-card-astrodle .mgame-card-footer,
.mgame-card-graha_yuddha .mgame-card-footer,
.mgame-card-cosmic-runner .mgame-card-footer {
  position: relative;
  z-index: 3;
  margin-top: auto;
  margin-bottom: 6px;
}

.mgame-card-astrodle .mgame-play-btn,
.mgame-card-graha_yuddha .mgame-play-btn,
.mgame-card-cosmic-runner .mgame-play-btn {
  background: linear-gradient(180deg, #f9cf67 0%, #e8a926 100%);
  color: #4f3200;
  border: 1px solid rgba(122, 79, 6, 0.45);
  box-shadow:
    0 8px 20px rgba(166, 107, 9, 0.38),
    inset 0 1px 0 rgba(255, 245, 214, 0.9);
}

.mgame-card-astrodle .mgame-play-btn:hover,
.mgame-card-graha_yuddha .mgame-play-btn:hover,
.mgame-card-cosmic-runner .mgame-play-btn:hover {
  background: linear-gradient(180deg, #ffd979 0%, #efb73c 100%);
  color: #3f2600;
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 12px 26px rgba(166, 107, 9, 0.42),
    inset 0 1px 0 rgba(255, 245, 214, 0.95);
}

/* Card top section */
.mgame-card-top {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.mgame-emoji {
  font-size: 56px;
  line-height: 1;
  filter: drop-shadow(0 8px 16px color-mix(in srgb, var(--game-accent) 40%, transparent));
  margin-bottom: 8px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mgame-card:hover .mgame-emoji {
  transform: scale(1.15) translateY(-5px);
}

.mgame-streak {
  position: absolute;
  top: -12px;
  right: -12px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(45deg, #f97316, #fb923c);
  border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
  z-index: 3;
}

.mgame-streak-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.mgame-soon-badge {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Card body */
.mgame-card-body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.mgame-name {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.mgame-tagline {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--game-accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.mgame-description {
  margin: 0 auto;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 240px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s;
}

.mgame-card:hover .mgame-description {
  color: var(--text);
}

/* Card footer */
.mgame-card-footer {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.mgame-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  border-radius: 12px;
  background: #fff;
  color: #000;
  font-size: 14px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.mgame-btn-astrodle {
  width: 156px;
  height: 48px;
  border-radius: 24px;
  font-size: 18px;
  letter-spacing: 1px;
}

.mgame-play-btn:hover {
  background: var(--game-accent);
  color: #000;
  transform: scale(1.05);
  box-shadow: 0 8px 25px color-mix(in srgb, var(--game-accent) 50%, transparent);
}

.mgame-play-btn:active {
  transform: scale(0.95);
}

.mgame-coming-soon-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Footer */
.mgames-footer {
  position: relative;
  z-index: 1;
  padding: 20px 28px 32px;
  text-align: center;
}

.mgames-footer-text {
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,0.28);
}

/* ─── Sidebar Nav Button ─────────────────────────────────────────────────────── */

.sidebar-item.sidebar-minigames-btn {
  position: relative;
}

.sidebar-minigames-glow {
  position: absolute;
  inset: 0;
  border-radius: 8px;
 
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.sidebar-item.sidebar-minigames-btn:hover .sidebar-minigames-glow {
  opacity: 1;
}

/* ─── Cosmic Runner v2 ─────────────────────────────────────────────────── */

/* ─── Cosmic Runner v2 ─────────────────────────────────────────────────── */

.cr2-root {
  position: fixed; top: 0; right: 0; bottom: 0; left: var(--sidebar-width, 260px);
  z-index: 1000000; background: #03030b; color: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; overflow: hidden;
  user-select: none;
}
body.sidebar-collapsed .cr2-root { left: var(--sidebar-rail-width, 56px); }

@media (max-width: 1023px) { 
  .cr2-root { left: 0 !important; z-index: 10000000 !important; }
  .cr2-header { padding: 0 16px; height: 56px; }
  .cr2-title { font-size: 12px; }
  .cr2-subtitle { display: none; }
}

.cr2-game-area { position: relative; width: 100%; height: 100%; overflow: hidden; }
.cr2-canvas { display: block; width: 100%; height: 100%; touch-action: none; position: absolute; z-index: 1; }

.cr2-ui-layer {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 50; pointer-events: none;
  display: flex; flex-direction: column;
}
.cr2-ui-layer > * { pointer-events: auto; }

/* Global Header */
.cr2-header {
  position: absolute; top: 0; left: 0; right: 0; height: 64px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 24px; z-index: 1200; pointer-events: none;
  background: linear-gradient(to bottom, rgba(3,3,11,0.8), transparent);
}
.cr2-header-left { display: flex; align-items: center; gap: 16px; pointer-events: auto; }
.cr2-back-btn, .cr2-pause-btn {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  width: 36px; height: 36px; border-radius: 10px; color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: auto;
  backdrop-filter: blur(8px);
}
.cr2-back-btn:hover, .cr2-pause-btn:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); transform: scale(1.1); }
.cr2-title-wrap { display: flex; flex-direction: column; }
.cr2-title { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #ffe1a3; }
.cr2-subtitle { font-size: 10px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1.5px; margin-top: 2px; }

/* HUD */
.cr2-hud {
  position: absolute; top: 24px; left: 0; right: 0;
  display: flex; justify-content: center; z-index: 60; pointer-events: none;
  animation: cr2-hud-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@media (max-width: 640px) {
  .cr2-hud { top: auto; bottom: 24px; padding: 0 12px; }
  @keyframes cr2-hud-in { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
}
.cr2-hud-pill {
  display: flex; gap: 24px; background: rgba(3,3,11,0.6); backdrop-filter: blur(16px);
  padding: 10px 24px; border-radius: 100px; border: 1px solid rgba(145,255,227,0.2);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.1);
}
.cr2-hud-stat { display: flex; flex-direction: column; align-items: center; width: 80px; flex-shrink: 0; }
.cr2-hud-stat b { font-size: clamp(15px, 4.5vw, 20px); font-weight: 950; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cr2-hud-stat span { font-size: 8px; font-weight: 800; color: #91ffe3; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; margin-top: 2px; }
.cr2-hud-sep { width: 1px; height: 24px; background: rgba(145,255,227,0.15); align-self: center; }
.cr2-hud-combo b { color: #ffd978; text-shadow: 0 0 10px rgba(255,217,120,0.3); }

@media (max-width: 480px) {
  .cr2-hud-pill { gap: 12px; padding: 6px 12px; min-width: 280px; justify-content: center; }
  .cr2-hud-stat { min-width: 72px; }
  .cr2-hud-sep { display: none; }
}

/* Cosmic Bg */
.cr2-cosmic-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: radial-gradient(circle at center, rgba(16,16,36,0.8), #03030b 70%); }
.cr2-nebula { position: absolute; filter: blur(60px); border-radius: 50%; opacity: 0.4; mix-blend-mode: screen; }
.cr2-nebula-a { width: 60vh; height: 60vh; top: -10vh; left: -10vw; background: radial-gradient(circle, rgba(145,255,227,0.15), transparent 70%); animation: cr2-nebula-drift 20s infinite alternate; }
.cr2-nebula-b { width: 70vh; height: 70vh; bottom: -20vh; right: -10vw; background: radial-gradient(circle, rgba(214,169,74,0.1), transparent 70%); animation: cr2-nebula-drift 25s infinite alternate-reverse; }
.cr2-nebula-c { width: 50vh; height: 50vh; top: 40%; left: 50%; transform: translate(-50%,-50%); background: radial-gradient(circle, rgba(116,84,255,0.1), transparent 70%); animation: cr2-nebula-pulse 15s infinite alternate; }
.cr2-nebula-d { width: 45vh; height: 45vh; bottom: 10%; left: 10%; background: radial-gradient(circle, rgba(145,255,227,0.1), transparent 70%); animation: cr2-nebula-drift 18s infinite alternate-reverse 2s; }
.cr2-light-beam { position: absolute; top: 0; left: 50%; width: 100vw; height: 100vh; transform: translateX(-50%); background: radial-gradient(ellipse 50% 100% at top, rgba(255,255,255,0.03), transparent 70%); pointer-events: none; }
.cr2-character-aura { position: absolute; top: 45%; left: 50%; width: 400px; height: 400px; transform: translate(-50%,-50%); background: radial-gradient(circle, rgba(214,169,74,0.08) 0%, transparent 70%); filter: blur(50px); pointer-events: none; animation: cr2-aura-pulse 6s ease-in-out infinite; z-index: -1; }

@keyframes cr2-nebula-drift { 
  0% { transform: translate(0,0) scale(1); } 
  100% { transform: translate(50px, 30px) scale(1.1); } 
}
@keyframes cr2-nebula-pulse { 
  0%, 100% { opacity: 0.2; transform: translate(-50%,-50%) scale(1); } 
  50% { opacity: 0.5; transform: translate(-50%,-50%) scale(1.2); } 
}
@keyframes cr2-aura-pulse { 
  0%, 100% { opacity: 0.3; transform: translate(-50%,-50%) scale(1); } 
  50% { opacity: 0.7; transform: translate(-50%,-50%) scale(1.15); } 
}

/* Screens Base */
.cr2-menu-screen, .cr2-char-screen, .cr2-result-screen {
  position: absolute; inset: 0; display: flex; z-index: 100;
}
.cr2-menu-screen { align-items: center; justify-content: center; backdrop-filter: blur(8px); }

/* Main Menu */
.cr2-menu-body {
  position: relative; z-index: 10; text-align: center;
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 600px; padding: 20px;
  opacity: 0; transform: translateY(20px); transition: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.cr2-menu-screen--in .cr2-menu-body { opacity: 1; transform: translateY(0); }

.cr2-menu-eyebrow { 
  display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 800; color: #91ffe3; 
  letter-spacing: 5px; margin-bottom: 16px; text-shadow: 0 0 15px rgba(145,255,227,0.5);
  animation: cr2-fade-in 1s ease both 0.2s;
}
.cr2-eyebrow-dot { width: 5px; height: 5px; background: #91ffe3; border-radius: 50%; box-shadow: 0 0 10px #91ffe3; }

.cr2-menu-title-wrap { position: relative; margin-bottom: 20px; animation: cr2-title-in 1s cubic-bezier(0.16, 1, 0.3, 1) both 0.3s; }
@keyframes cr2-title-in { from { transform: scale(1.1); opacity: 0; filter: blur(10px); } }

.cr2-menu-title { 
  font-size: clamp(48px, 12vw, 84px); font-weight: 950; line-height: 0.85; margin: 0; letter-spacing: -3px; 
  display: flex; flex-direction: column; 
}
.cr2-title-line { 
  background: linear-gradient(180deg, #fff 0%, #ffe1a3 50%, #d6a94a 100%); 
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; 
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}
.cr2-menu-title-ghost { 
  position: absolute; inset: 0; font-size: clamp(48px, 12vw, 84px); font-weight: 950; line-height: 0.85; 
  letter-spacing: -3px; color: transparent; -webkit-text-stroke: 1px rgba(255,225,163,0.25); 
  filter: blur(8px); pointer-events: none; opacity: 0.5;
}

.cr2-menu-tagline { 
  font-size: clamp(10px, 2.5vw, 13px); color: rgba(255,255,255,0.5); letter-spacing: 3px; 
  text-transform: uppercase; margin-bottom: 32px; opacity: 0; animation: cr2-fade-in 1s ease both 0.5s;
}

.cr2-menu-stats-bar { 
  display: flex; align-items: center; gap: 32px; background: rgba(255,255,255,0.02); 
  backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.06); padding: 16px 40px; 
  border-radius: 100px; margin-bottom: 40px; box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  animation: cr2-fade-in 1s ease both 0.6s;
}
@media (max-width: 480px) { .cr2-menu-stats-bar { gap: 16px; padding: 12px 24px; flex-wrap: wrap; justify-content: center; border-radius: 20px; } }

.cr2-menu-stat-item { display: flex; flex-direction: column; align-items: center; }
.cr2-menu-stat-val { font-size: clamp(16px, 4vw, 20px); font-weight: 900; color: #fff; text-shadow: 0 0 15px rgba(255,255,255,0.2); }
.cr2-menu-stat-lbl { font-size: 8px; font-weight: 800; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1.5px; margin-top: 2px; }
.cr2-menu-stat-sep { width: 1px; height: 28px; background: rgba(255,255,255,0.1); }
@media (max-width: 480px) { .cr2-menu-stat-sep { display: none; } }

/* Action Buttons */
.cr2-menu-actions { 
  display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 380px;
  animation: cr2-actions-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both 0.7s;
}
@keyframes cr2-actions-in { from { transform: translateY(20px); opacity: 0; } }

.cr2-btn-start {
  position: relative; width: 100%; padding: 20px; border-radius: 16px; border: none;
  background: linear-gradient(180deg, #ffe1a3 0%, #d6a94a 100%); color: #03030b;
  font-size: 16px; font-weight: 900; letter-spacing: 2px; cursor: pointer; overflow: hidden;
  box-shadow: 0 10px 30px rgba(214,169,74,0.3), inset 0 1px 0 rgba(255,255,255,0.4); 
  transition: 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}
.cr2-btn-start:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 20px 50px rgba(214,169,74,0.5); }
.cr2-btn-start:active { transform: translateY(-1px) scale(0.98); }

.cr2-btn-start-content { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 12px; }
.cr2-btn-start-glow { position: absolute; inset: 0; background: radial-gradient(circle at top, rgba(255,255,255,0.5), transparent 70%); opacity: 0; transition: 0.4s; }
.cr2-btn-start:hover .cr2-btn-start-glow { opacity: 1; }

.cr2-btn-start-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: translateX(-100%);
  animation: cr2-shimmer 3s infinite;
}
@keyframes cr2-shimmer { 100% { transform: translateX(100%); } }

.cr2-menu-sub-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cr2-btn-sub {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  padding: 16px; border-radius: 14px; color: #fff;
  font-size: 13px; font-weight: 800; letter-spacing: 1px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  backdrop-filter: blur(10px);
}
.cr2-btn-sub:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25); transform: translateY(-3px); }
.cr2-btn-sub svg { opacity: 0.7; transition: 0.3s; }
.cr2-btn-sub:hover svg { opacity: 1; transform: scale(1.1); }

@keyframes cr2-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Character Screen (Flat layout) */
.cr2-char-screen { pointer-events: none; }
.cr2-char-left-fade { position: absolute; inset: 0; background: linear-gradient(to right, rgba(3,3,11,1) 0%, rgba(3,3,11,0.95) 20%, transparent 50%); z-index: 1; pointer-events: none; }
.cr2-char-panel { 
  position: absolute; left: 0; top: 0; bottom: 0; width: 45%; min-width: 380px; 
  padding: 100px 60px 100px; z-index: 10; pointer-events: none; display: flex; align-items: flex-start; 
  animation: cr2-char-in 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  overflow-y: auto; scrollbar-width: none; /* Hide scrollbar but keep functionality */
}
.cr2-char-panel::-webkit-scrollbar { display: none; }
.cr2-char-right-space { 
  position: absolute; right: 0; top: 0; bottom: 0; width: 55%; 
  z-index: 5; pointer-events: none; 
}
@keyframes cr2-char-in { from { transform: translateX(-40px); opacity: 0; } }
@media (max-width: 1023px) { .cr2-char-panel { padding: 60px 40px; min-width: 340px; } }

.cr2-char-panel-inner { width: 100%; display: flex; flex-direction: column; align-items: flex-start; pointer-events: none; }
.cr2-char-panel-inner > * { pointer-events: auto; }
.cr2-char-trait { font-size: 10px; font-weight: 800; color: #91ffe3; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 12px; padding: 6px 16px; background: rgba(145,255,227,0.08); border: 1px solid rgba(145,255,227,0.2); border-radius: 100px; box-shadow: 0 0 15px rgba(145,255,227,0.1); }
.cr2-char-name { font-size: clamp(32px, 8vw, 56px); font-weight: 950; color: #ffe1a3; margin: 0 0 20px; letter-spacing: -2px; text-shadow: 0 10px 20px rgba(0,0,0,0.4); }
.cr2-char-divider { width: 48px; height: 3px; background: linear-gradient(90deg, #d6a94a, transparent); margin-bottom: 20px; border-radius: 2px; }
.cr2-char-bio { font-size: clamp(13px, 2vw, 15px); color: rgba(255,255,255,0.55); line-height: 1.7; margin-bottom: 32px; max-width: 420px; }
.cr2-char-header-mobile-target { width: 100%; display: flex; flex-direction: column; align-items: flex-start; cursor: default; }
@media (max-width: 800px) {
  .cr2-char-header-mobile-target { cursor: pointer; }
}
.cr2-char-attrs { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 420px; margin-bottom: 40px; }
.cr2-char-attr { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 18px; }
.cr2-attr-label { font-size: 10px; font-weight: 800; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 1.5px; }
.cr2-attr-val { font-size: 15px; font-weight: 900; color: #fff; text-align: right; letter-spacing: 0.5px; }
.cr2-stat-pips { display: flex; gap: 6px; }
.cr2-pip { width: 28px; height: 6px; background: rgba(255,255,255,0.08); border-radius: 100px; transform: skewX(-15deg); transition: 0.3s; }
.cr2-pip--on { background: linear-gradient(90deg, #ffe1a3, #d6a94a); box-shadow: 0 0 12px rgba(255,225,163,0.4); }
.cr2-char-back-btn { 
  position: relative; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); 
  border-radius: 12px; padding: 14px 24px; color: #fff; font-size: 12px; font-weight: 800; 
  display: flex; align-items: center; gap: 10px; cursor: pointer; transition: 0.3s cubic-bezier(0.23, 1, 0.32, 1); 
  text-transform: uppercase; letter-spacing: 2px; backdrop-filter: blur(10px); 
  overflow: hidden;
}
.cr2-char-back-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.cr2-char-back-btn:active { transform: translateY(-1px); }

/* Expandable logic */
.cr2-char-mobile-indicator {
  display: none; align-items: center; justify-content: center; gap: 8px;
  font-size: 10px; font-weight: 800; color: #91ffe3; text-transform: uppercase;
  letter-spacing: 1.5px; margin: 12px 0 20px; opacity: 0.6;
}
.cr2-char-mobile-indicator svg { transition: 0.3s; }
.cr2-rotated { transform: rotate(180deg); }
.cr2-char-hint { position: absolute; top: 120px; right: 60px; background: rgba(3,3,11,0.6); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.15); padding: 12px 24px; border-radius: 100px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 10px; z-index: 20; animation: cr2-pulse 2s infinite; pointer-events: none; color: #91ffe3; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
@media (max-width: 800px) {
  .cr2-char-hint { display: none !important; }
}
@media (max-width: 800px) {
  .cr2-char-left-fade { 
    background: linear-gradient(to top, rgba(3,3,11,1) 0%, rgba(3,3,11,0.4) 50%, transparent 100%); 
    z-index: 5;
  }
  .cr2-char-panel { 
    width: 100%; top: auto; bottom: 0; 
    max-height: 85vh;
    padding: 32px 24px 40px; min-width: 0; 
    background: rgba(3,3,11,0.75);
    backdrop-filter: blur(32px);
    border-top: 1px solid rgba(255,255,255,0.15);
    border-radius: 32px 32px 0 0;
    box-shadow: 0 -10px 50px rgba(0,0,0,0.6);
    cursor: default;
    transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    scrollbar-width: none;
    pointer-events: auto;
  }
  .cr2-char-panel::-webkit-scrollbar { display: none; }
  .cr2-char-panel--expanded {
    background: rgba(3,3,11,0.85);
    padding-bottom: 48px;
  }
  .cr2-char-name { font-size: 28px; margin-bottom: 8px; }
  .cr2-char-trait { margin-bottom: 8px; }
  
  .cr2-char-expandable {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: 0.3s;
  }
  .cr2-char-panel--expanded .cr2-char-expandable {
    display: block;
    opacity: 1;
    transform: translateY(0);
    margin-top: 24px;
    animation: cr2-fade-in 0.4s ease both;
  }
  
  .cr2-char-mobile-indicator { display: flex; }
  .cr2-char-bio { margin-bottom: 32px; font-size: 13px; }
  .cr2-char-attrs { gap: 14px; margin-bottom: 40px; }
  .cr2-char-attr { padding-bottom: 12px; }
  .cr2-char-back-btn { width: 100%; justify-content: center; padding: 16px; margin-top: 32px; }
}

/* Pause Screen */
.cr2-pause-overlay { position: absolute; inset: 0; background: rgba(3,3,11,0.6); backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: center; z-index: 200; animation: cr2-fade-in 0.3s ease both; }
.cr2-pause-card { 
  background: #080812; border: 1px solid rgba(255,255,255,0.1); border-radius: 28px; padding: 32px 24px; 
  width: 90%; max-width: 380px; text-align: center; box-shadow: 0 40px 100px rgba(0,0,0,0.8), inset 0 1px 1px rgba(255,255,255,0.05); 
  animation: cr2-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1); 
}
@keyframes cr2-pop { from { transform: scale(0.9) translateY(20px); opacity: 0; } }
.cr2-pause-icon { font-size: 32px; margin-bottom: 16px; filter: drop-shadow(0 0 10px rgba(255,255,255,0.3)); }
.cr2-pause-title { font-size: 32px; font-weight: 950; margin: 0 0 10px; letter-spacing: 4px; color: #fff; text-shadow: 0 0 20px rgba(255,255,255,0.2); }
.cr2-pause-sub { font-size: 13px; color: rgba(255,255,255,0.4); margin-bottom: 24px; letter-spacing: 1px; }
.cr2-pause-stats { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.02); padding: 16px; border-radius: 20px; margin-bottom: 24px; border: 1px solid rgba(255,255,255,0.05); }
.cr2-pause-stat { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.cr2-pause-stat-val { font-size: clamp(16px, 5vw, 22px); font-weight: 950; color: #ffe1a3; font-variant-numeric: tabular-nums; }
.cr2-pause-stat-lbl { font-size: 8px; font-weight: 800; color: rgba(255,255,255,0.4); text-transform: uppercase; margin-top: 4px; letter-spacing: 1px; }
.cr2-pause-sep { width: 1px; height: 28px; background: rgba(255,255,255,0.08); }
.cr2-pause-actions { display: flex; flex-direction: column; gap: 12px; }
.cr2-btn-resume { 
  position: relative; width: 100%; padding: 20px; border-radius: 16px; border: none;
  background: linear-gradient(180deg, #ffe1a3 0%, #d6a94a 100%); color: #03030b;
  font-size: 16px; font-weight: 900; letter-spacing: 2px; cursor: pointer; overflow: hidden;
  box-shadow: 0 10px 30px rgba(214,169,74,0.3), inset 0 1px 0 rgba(255,255,255,0.4); 
  transition: 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}
.cr2-btn-resume:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 20px 50px rgba(214,169,74,0.5); }
.cr2-btn-resume:hover .cr2-btn-start-glow { opacity: 1; }
.cr2-btn-resume:active { transform: translateY(-1px) scale(0.98); }
.cr2-pause-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cr2-btn-pause-action { 
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); 
  color: #fff; padding: 16px; border-radius: 14px; font-size: 13px; font-weight: 800; 
  display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; 
  transition: 0.3s; backdrop-filter: blur(8px);
}
.cr2-btn-pause-action:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); transform: translateY(-2px); }
.cr2-btn-quit:hover { background: rgba(255,80,80,0.08); border-color: rgba(255,80,80,0.25); color: #ff8080; }

/* Result Screen */
.cr2-result-screen { 
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; 
  overflow-y: auto; overflow-x: hidden;
  background: radial-gradient(circle at center, rgba(16,16,36,0.92), rgba(3,3,11,0.99)); 
  backdrop-filter: blur(28px); 
  z-index: 2000;
}
.cr2-result-glow { position: absolute; inset: 0; background: radial-gradient(ellipse 70% 70% at 50% 40%, var(--rg), transparent 80%); opacity: 0.4; pointer-events: none; }

.cr2-result-body { 
  position: relative; z-index: 10; width: 100%; max-width: 500px; text-align: center; 
  padding: 60px 24px; margin: auto 0;
  opacity: 0; transform: translateY(40px) scale(0.92); transition: 1s cubic-bezier(0.16, 1, 0.3, 1); 
}
.cr2-result-screen--in .cr2-result-body { opacity: 1; transform: translateY(0) scale(1); }

.cr2-result-top { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 16px; }
.cr2-result-mode-chip { font-size: 10px; font-weight: 800; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 2px; padding: 6px 18px; border: 1px solid rgba(255,255,255,0.12); border-radius: 100px; background: rgba(255,255,255,0.03); }
.cr2-result-newbest { font-size: 10px; font-weight: 900; color: #000; background: #ffd978; padding: 6px 18px; border-radius: 100px; box-shadow: 0 0 20px rgba(255,217,120,0.5); animation: cr2-nb-pop 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both; }

.cr2-result-cause { font-size: 14px; color: rgba(255,255,255,0.5); margin-bottom: 24px; font-style: italic; opacity: 0.8; }

.cr2-result-rank { 
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 32px; border: 1.5px solid var(--rc); 
  border-radius: 100px; background: rgba(0,0,0,0.3); box-shadow: 0 0 30px var(--rg); margin-bottom: 24px;
  animation: cr2-rank-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both 0.4s;
}
@keyframes cr2-rank-in { from { transform: scale(0.8); opacity: 0; } }
.cr2-result-rank-icon { font-size: 20px; color: var(--rc); text-shadow: 0 0 15px var(--rg); }
.cr2-result-rank-label { font-size: 15px; font-weight: 950; color: var(--rc); letter-spacing: 4px; text-shadow: 0 0 15px var(--rg); text-align: center; }

.cr2-result-score-block { display: flex; flex-direction: column; align-items: center; margin-bottom: 32px; }
.cr2-result-score { 
  font-size: clamp(56px, 18vw, 100px); 
  font-weight: 950; 
  line-height: 0.85; 
  color: #fff; 
  letter-spacing: -3px; 
  text-shadow: 0 15px 40px rgba(0,0,0,0.6); 
  animation: cr2-score-in 1s cubic-bezier(0.16, 1, 0.3, 1) both 0.5s; 
}
@media (max-width: 480px) {
  .cr2-result-score { letter-spacing: -2px; }
}
@keyframes cr2-score-in { from { transform: scale(1.2); opacity: 0; filter: blur(15px); } }
.cr2-result-score-sub { font-size: 11px; font-weight: 800; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 4px; margin-top: 8px; }

.cr2-result-stats { 
  display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap;
  background: rgba(255,255,255,0.03); 
  border: 1px solid rgba(255,255,255,0.06); padding: 16px 32px; border-radius: 20px; margin-bottom: 24px; 
  animation: cr2-fade-in 1s ease both 0.7s;
}
@media (max-width: 480px) { 
  .cr2-result-stats { padding: 16px; border-radius: 16px; gap: 12px; justify-content: center; } 
  .cr2-result-stat { min-width: 85px; flex: 0 1 auto; }
  .cr2-result-stat-line { display: none; }
}
@media (max-height: 660px) {
  .cr2-result-body { padding: 20px 24px; }
  .cr2-result-score { font-size: 56px; margin-bottom: 20px; }
  .cr2-result-stats { margin-bottom: 12px; padding: 10px 20px; }
  .cr2-result-rank { margin-bottom: 12px; padding: 8px 24px; }
  .cr2-result-cause { margin-bottom: 16px; font-size: 13px; }
  .cr2-result-pb { margin-bottom: 24px; padding: 12px 20px; }
  .cr2-result-actions { gap: 10px; }
  .cr2-btn-replay, .cr2-btn-result-menu { padding: 14px; }
}

.cr2-result-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-width: 80px; }
.cr2-result-stat-icon { font-size: 18px; margin-bottom: 2px; opacity: 0.9; }
.cr2-result-stat-val { font-size: clamp(18px, 5vw, 24px); font-weight: 950; color: #fff; font-variant-numeric: tabular-nums; }
.cr2-result-stat-label { font-size: 8px; font-weight: 800; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1.2px; }
.cr2-result-stat-line { width: 1px; height: 36px; background: rgba(255,255,255,0.1); }

.cr2-result-pb { 
  display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; 
  background: rgba(214,169,74,0.08); border: 1px solid rgba(214,169,74,0.25); border-radius: 14px; 
  margin-bottom: 48px; animation: cr2-fade-in 1s ease both 0.8s;
}
.cr2-result-pb-label { font-size: 10px; font-weight: 800; color: rgba(255,225,163,0.6); text-transform: uppercase; letter-spacing: 1.5px; }
.cr2-result-pb-val { font-size: 16px; font-weight: 950; color: #ffe1a3; font-variant-numeric: tabular-nums; }

.cr2-result-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 380px; margin: 0 auto; animation: cr2-fade-in 1s ease both 0.9s; }
.cr2-btn-replay { 
  position: relative; width: 100%; padding: 20px; border-radius: 16px; border: none;
  background: linear-gradient(180deg, #ffe1a3 0%, #d6a94a 100%); color: #03030b;
  font-size: 16px; font-weight: 900; letter-spacing: 2px; cursor: pointer; overflow: hidden;
  box-shadow: 0 10px 30px rgba(214,169,74,0.3), inset 0 1px 0 rgba(255,255,255,0.4); 
  transition: 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}
.cr2-btn-replay:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 20px 50px rgba(214,169,74,0.5); }
.cr2-btn-replay:hover .cr2-btn-start-glow { opacity: 1; }
.cr2-btn-replay:active { transform: translateY(-1px) scale(0.98); }

.cr2-btn-result-menu { 
  position: relative; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); 
  color: #fff; padding: 18px; border-radius: 16px; backdrop-filter: blur(10px);
  font-size: 13px; font-weight: 800; cursor: pointer; transition: 0.3s cubic-bezier(0.23, 1, 0.32, 1); letter-spacing: 2px; 
  overflow: hidden;
}
.cr2-btn-result-menu:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); transform: translateY(-2px); }
.cr2-btn-result-menu-content { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; }

/* Confetti Rain */
.cr2-sparkle-rain { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.cr2-sparkle-drop { position: absolute; top: -10px; left: var(--sx); width: var(--sz); height: var(--sz); background: var(--sc); border-radius: 50%; box-shadow: 0 0 10px var(--sc); animation: cr2-rain var(--dur) var(--sd) linear infinite; }
@keyframes cr2-rain { 0% { transform: translateY(0) scale(1); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(100vh) scale(0); opacity: 0; } }



/* ─────────────────────────────────────────────────────────────────────────────
   ASTRODLE v4 — Midnight Celestial
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Root & CSS Variables ─────────────────────────────────────────────────── */

.astrodle-v4-root {
  /* ─── Color tokens ─── */
  --av4-bg:          #0B0A12;
  --av4-surface:     #14121F;
  --av4-surface-2:   #1C1A2B;
  --av4-surface-3:   #241F38;
  --av4-border:      #25203A;
  --av4-border-lit:  #38305A;
  --av4-text:        #EAE5FA;
  --av4-text-dim:    #958FB5;
  --av4-text-faint:  #c1c1c1;
  --av4-correct-bg:  #112B20;
  --av4-correct:     #2ED47A;
  --av4-present-bg:  #2B1E0C;
  --av4-present:     #F0A240;
  --av4-absent-bg:   #17152A;
  --av4-absent:      #3A3558;
  --av4-gold:        #C9A428;
  --av4-gold-dark:   #8A6B10;
  --av4-gold-light:  #F2CC6C;
  --av4-violet:      #7B5CF5;
  --av4-error:       #EF4444;

  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--sidebar-width, 260px);
  background:
    radial-gradient(120% 90% at 50% -25%, rgba(123, 92, 245, 0.16), transparent 58%),
    radial-gradient(90% 80% at 15% 110%, rgba(34, 29, 59, 0.7), transparent 70%),
    var(--av4-bg);
  color: var(--av4-text);
  z-index: 800;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.astrodle-v4-root.av4-game-active .av4-cosmic-bg {
  filter: brightness(0.75) blur(1.5px);
  transition: filter 0.8s ease;
}

.astrodle-v4-root.av4-game-active .av4-orbit-system {
  opacity: 0.65;
  transform: translate(-50%, -46%) scale(0.95);
  transition: all 0.8s ease;
}

.astrodle-v4-root.av4-game-active .av4-horizon-glow-container {
  opacity: 0.95;
  z-index: 20;
  transition: all 0.8s ease;
}

/* ── Cosmic background layers ──────────────────────────────────────────────── */

.av4-cosmic-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.av4-nebula-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.av4-nebula-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(54px);
  opacity: 0.24;
}

.av4-nebula-orb-a {
  width: 340px;
  height: 240px;
  top: -72px;
  left: -88px;
  background: radial-gradient(circle at 35% 45%, rgba(126, 92, 245, 0.44), rgba(126, 92, 245, 0));
}

.av4-nebula-orb-b {
  width: 380px;
  height: 280px;
  top: -84px;
  right: -120px;
  background: radial-gradient(circle at 55% 45%, rgba(201, 164, 40, 0.24), rgba(201, 164, 40, 0));
}

.av4-nebula-orb-c {
  width: 300px;
  height: 220px;
  bottom: -64px;
  left: 22%;
  background: radial-gradient(circle at 50% 50%, rgba(70, 55, 128, 0.34), rgba(70, 55, 128, 0));
}

.av4-orbit-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.36;
  overflow: visible;
}

.av4-constellation-layer {
  transform-origin: 600px 352px;
}

.av4-constellation-layer path {
  fill: none;
  stroke: rgba(242, 204, 108, 0.28);
  stroke-width: 1.1;
}

.av4-constellation-layer circle {
  fill: rgba(255, 236, 183, 0.9);
  filter: drop-shadow(0 0 4px rgba(255, 217, 133, 0.65));
}

.av4-orbit-rotor {
  transform-origin: 600px 352px;
  transform-box: fill-box;
}

.av4-orbit-rotor ellipse {
  fill: none;
  stroke: rgba(212, 180, 117, 0.16);
  stroke-width: 1.2px;
}

.av4-grid-pulse {
  position: absolute;
  left: 50%;
  top: 352px;
  width: 500px;
  height: 500px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(123, 92, 245, 0.08) 0%, rgba(123, 92, 245, 0) 70%);
  pointer-events: none;
  z-index: 0;
  animation: av4-grid-pulse 8s ease-in-out infinite;
}

@keyframes av4-grid-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
  50% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.6; }
}

.av4-orbit-rotor circle {
  opacity: 0.92;
}

.av4-glyph-ring {
  transform-origin: 600px 352px;
  transform-box: fill-box;
}

.av4-orbit-sigil {
  fill: none;
  stroke: rgba(231, 193, 118, 0.62);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgba(201, 164, 40, 0.32));
}

.av4-starfield {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.av4-starfield::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 62% 36% at 50% -4%, rgba(180, 120, 30, 0.1), transparent 70%);
}

.av4-star {
  position: absolute;
  border-radius: 50%;
  background: var(--av4-text);
  box-shadow: 0 0 8px rgba(234, 229, 250, 0.55);
  will-change: transform, opacity;
}

.av4-dust {
  position: absolute;
  border-radius: 50%;
  background: rgba(190, 176, 236, 0.92);
  will-change: transform, opacity;
}

.av4-shooting-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
}

.av4-shooting-star {
  position: absolute;
  width: var(--shoot-size, 130px);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(242, 204, 108, 0), rgba(242, 204, 108, 0.95), rgba(255, 255, 255, 0));
  transform: translate3d(0, 0, 0) rotate(-24deg);
  opacity: 0;
  filter: drop-shadow(0 0 8px rgba(242, 204, 108, 0.5));
  will-change: transform, opacity;
}

.av4-shooting-star::before {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 245, 196, 0.95);
  transform: translateY(-50%);
  box-shadow: 0 0 12px rgba(255, 230, 140, 0.66);
}

.av4-horizon-glow-container::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(123, 92, 245, 0.12), rgba(120, 90, 240, 0.05) 30%, transparent 70%);
  filter: blur(20px);
}

.av4-horizon-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.av4-flare {
  position: absolute;
  left: 50%;
  top: 0;
  width: 240px;
  height: 60px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 1) 0%, rgba(162, 142, 238, 0.6) 30%, rgba(123, 92, 245, 0.2) 60%, transparent 100%);
  filter: blur(4px);
  z-index: 1;
}

.av4-cosmic-noise {
  position: absolute;
  inset: -20%;
  z-index: 4;
  opacity: 0.055;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.8) 0.4px, transparent 0.8px),
    radial-gradient(circle at 70% 40%, rgba(255, 255, 255, 0.7) 0.3px, transparent 0.7px),
    radial-gradient(circle at 40% 70%, rgba(255, 255, 255, 0.65) 0.4px, transparent 0.8px);
  background-size: 130px 130px, 180px 180px, 220px 220px;
  will-change: transform, opacity;
}

/* ── Screen layer ───────────────────────────────────────────────────────────── */

.av4-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  z-index: 8000001;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  will-change: transform, opacity, filter;
}

.av4-screen-enter {
  animation: av4-screen-enter 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.av4-screen-exit {
  animation: av4-screen-exit 240ms ease-in forwards;
  pointer-events: none;
}

@keyframes av4-screen-enter {
  from {
    opacity: 0;
    transform: scale(1.02);
    filter: blur(12px) brightness(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0) brightness(1);
  }
}

@keyframes av4-screen-exit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: translateY(-12px) scale(0.993);
    filter: blur(3px);
  }
}

/* ─── Responsive adjustments ─────────────────────────────────────────────── */

@media (max-width: 640px) {
  .mgames-header {
    padding: 16px 18px;
  }

  .mgames-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 18px 14px;
  }

  .mgame-description {
    display: none; /* Too cramped on very small screens */
  }


}

@media (max-width: 400px) {
  .mgames-grid {
    grid-template-columns: 1fr;
  }


}

/* Transition overlay */
.av4-transition-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.av4-scan-line {
  position: absolute;
  top: 28%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--av4-gold);
  opacity: 0.42;
  transform-origin: left;
  animation: av4-scan-sweep 260ms cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

.av4-scan-glow {
  position: absolute;
  top: 24%;
  left: 0;
  right: 0;
  height: 14px;
  background: linear-gradient(90deg, rgba(201, 164, 40, 0), rgba(201, 164, 40, 0.22), rgba(201, 164, 40, 0));
  filter: blur(10px);
  opacity: 0;
  transform-origin: left;
  animation: av4-scan-glow 320ms ease-out forwards;
}

@keyframes av4-scan-sweep {
  from { transform: scaleX(0); opacity: 0.8; }
  to   { transform: scaleX(1); opacity: 0; }
}

@keyframes av4-scan-glow {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }
  45% {
    transform: scaleX(1);
    opacity: 0.9;
  }
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

/* ── Toast ──────────────────────────────────────────────────────────────────── */

.av4-toast {
  position: absolute;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--av4-surface-2);
  color: var(--av4-text);
  border: 1px solid var(--av4-border-lit);
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  animation: av4-toast-enter 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.av4-header {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 100;
}

.av4-header-left, .av4-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.av4-toast-exit {
  animation: av4-toast-out 180ms ease-in forwards;
}

@keyframes av4-toast-enter {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.94); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes av4-toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-6px); }
}

/* ── Shared header ──────────────────────────────────────────────────────────── */

.av4-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--av4-border);
  background: rgba(11,10,18,0.88);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 10;
}

.av4-header-back {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--av4-border);
  background: var(--av4-surface-2);
  color: var(--av4-text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 120ms, background 120ms, color 120ms;
}

.av4-header-back:hover {
  background: var(--av4-surface-3);
  color: var(--av4-text);
  transform: translateX(-2px);
}

.av4-header-back:active {
  transform: translateX(-2px) scale(0.9);
}

.av4-header-wordmark {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--av4-text);
  text-transform: uppercase;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.av4-header-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.av4-game-header {
  justify-content: space-between;
  padding: 0 20px;
  height: 66px;
}

.av4-game-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.av4-game-header-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.av4-game-title {
  font-family: inherit;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  color: var(--av4-text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.av4-game-title-mark {
  color: var(--av4-gold);
  display: inline-flex;
  align-items: center;
}

.av4-game-subtitle {
  font-size: 13px;
  color: var(--av4-text-dim);
  margin-top: 2px;
  line-height: 1.2;
  white-space: nowrap;
}

.av4-streak-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(20, 24, 38, 0.88);
  border: 1px solid rgba(250, 219, 124, 0.26);
  border-radius: 999px;
  padding: 6px 12px;
}

.av4-streak-icon {
  display: flex;
  align-items: center;
  color: var(--av4-gold);
}

.av4-streak-count {
  font-size: 13px;
  font-weight: 800;
  color: var(--av4-gold);
}

.av4-intro-corner-star {
  color: var(--av4-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  opacity: 0.8;
  animation: av4-corner-star-pulse 2.4s ease-in-out infinite;
}

@keyframes av4-corner-star-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1); }
}

.av4-word-len-badge {
  font-size: 12px;
  font-weight: 800;
  color: rgba(235, 230, 248, 0.85);
  background: rgba(24, 27, 42, 0.9);
  border: 1px solid rgba(130, 136, 170, 0.24);
  border-radius: 999px;
  padding: 6px 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}


/* ════════════════════════════════════════════════════════════════════════════
   SCREEN 1 — INTRO
   ════════════════════════════════════════════════════════════════════════════ */

.av4-intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.av4-intro-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 36px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  position: relative;
}

.av4-intro-body::before {
  display: none;
}

@keyframes av4-intro-ambient {
  from { transform: translateY(0) scale(1); opacity: 0.4; }
  to { transform: translateY(10px) scale(1.06); opacity: 0.66; }
}

/* Hero block: emblem + title */
.av4-intro-hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.av4-intro-hero svg {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.av4-intro-text-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

/* Orbit group rotates around SVG center (36,36) */
.av4-orbit-group {
  transform-origin: 36px 36px;
  animation: av4-orbit-spin 8s linear infinite;
}

@keyframes av4-orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.av4-intro-title {
  font-family: "Söhne", "Sohne", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #FFFFFF 0%, #7B5CF5 45%, #5D45C2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  line-height: 1.2;
  margin: 0;
  filter: drop-shadow(0 4px 12px rgba(253, 216, 53, 0.25));
  text-transform: uppercase;
}

.av4-intro-subtitle {
  font-size: 13px;
  color: var(--av4-text-dim);
  text-align: center;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 6px 0 0;
  opacity: 0.8;
}

/* Story clue card */
.av4-story-card {
  width: 100%;
  max-width: 620px;
  background: rgba(18, 14, 34, 0.72);
  backdrop-filter: blur(48px) saturate(160%);
  -webkit-backdrop-filter: blur(48px) saturate(160%);
  border-radius: 28px;
  padding: 40px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  overflow: hidden;
}

.av4-story-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 10%, 
    rgba(253, 216, 53, 0.4) 30%, 
    rgba(253, 216, 53, 0.4) 70%, 
    transparent 90%
  );
  z-index: 2;
}

.av4-story-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% -20%, rgba(253, 216, 53, 0.1), transparent 60%);
  pointer-events: none;
}

.av4-story-card-glow {
  position: absolute;
  top: -40%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle at 50% 30%, rgba(253, 216, 53, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.av4-story-card-sparkle {
  z-index: 1;
  filter: drop-shadow(0 0 6px currentColor);
}

.av4-story-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  background: linear-gradient(135deg, 
    rgba(253, 216, 53, 0.6) 0%, 
    rgba(253, 216, 53, 0) 30%, 
    rgba(253, 216, 53, 0) 70%, 
    rgba(123, 92, 245, 0.6) 100%
  );
  -webkit-mask: 
     linear-gradient(#fff 0 0) content-box, 
     linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.8;
  animation: av4-card-border-flow 10s linear infinite;
}

@keyframes av4-card-border-flow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.av4-story-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  mix-blend-mode: overlay;
}



.av4-story-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--av4-gold);
  margin-bottom: 32px;
}

.av4-story-label::before, .av4-story-label::after {
  content: "";
  width: 24px;
  height: 1px;
  background: rgba(253, 216, 53, 0.3);
}

.av4-story-label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--av4-gold);
  opacity: 0.9;
  flex-shrink: 0;
}

.av4-story-text {
  margin: 0;
  width: 100%;
}

.av4-nebula-text {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35em;
  width: 100%;
}

.av4-nebula-word {
  display: inline-block;
  font-size: 14.5px;
  line-height: 1.75;
  color: #FFFFFF;
  font-weight: 450;
  text-wrap: pretty;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
  transition: text-shadow 0.5s ease;
}



/* Word length hint */
.av4-word-len-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(46, 212, 122, 0.85);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.av4-word-dots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.av4-story-separator {
  margin: 32px 0 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.av4-story-points {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.av4-story-point {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(214, 207, 241, 0.9);
  font-size: 15px;
  line-height: 1.4;
}

.av4-story-point-icon {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(42, 35, 68, 0.88);
  color: var(--av4-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.av4-story-point-text strong {
  color: rgba(244, 240, 252, 0.98);
}

/* How to play */
.av4-howto {
  width: 100%;
  border: 1px solid var(--av4-border);
  border-radius: 14px;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 1;
}

.av4-howto-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--av4-border);
  background: var(--av4-surface);
  opacity: 0;
  animation: av4-howto-row-in 280ms cubic-bezier(0.16, 1, 0.3, 1) var(--row-delay, 0.5s) forwards;
  transition: background 160ms ease, transform 160ms ease;
}

.av4-howto-row:last-child {
  border-bottom: none;
}

.av4-howto-row:hover {
  background: var(--av4-surface-2);
  transform: translateX(2px);
}

@keyframes av4-howto-row-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.av4-howto-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--av4-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.av4-howto-text {
  font-size: 13px;
  color: var(--av4-text-dim);
  line-height: 1.4;
}

.av4-howto-text strong {
  font-weight: 700;
  color: var(--av4-text);
}

/* Intro footer — CTA */
.av4-intro-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.av4-intro-meta {
  font-size: 10px;
  color: var(--av4-text-faint);
  text-align: center;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 8px;
}

/* ─── CosmicButton — 3D physical press ─────────────────────────────────────── */

.av4-cosmic-btn {
  position: relative;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  max-width: 280px;
  animation: av4-btn-breathe 2.4s ease-in-out infinite;
  touch-action: manipulation;
  perspective: 1000px;
}

.av4-cosmic-btn:hover { animation-play-state: paused; }
.av4-cosmic-btn:focus-visible { outline: none; }

@keyframes av4-btn-breathe {
  0%, 100% { filter: drop-shadow(0 0 0px rgba(201,164,40,0)); }
  50%       { filter: drop-shadow(0 0 10px rgba(201,164,40,0.22)); }
}

.av4-cosmic-btn--gold .av4-cosmic-btn-face {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(180deg, #FDD835 0%, #F9A825 100%);
  color: #3E2723;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 5px 0 #B26A00,
    0 15px 35px rgba(253, 216, 53, 0.3);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  pointer-events: none;
}

.av4-cosmic-btn--gold .av4-cosmic-btn-face::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0), rgba(255, 248, 209, 0.32), rgba(255, 255, 255, 0));
  transform: translateX(-130%);
  animation: av4-btn-glint 4.8s ease-in-out 1.6s infinite;
}

@keyframes av4-btn-glint {
  0%, 62% { transform: translateX(-130%); }
  75% { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}

.av4-cosmic-btn.av4-btn-pressed .av4-cosmic-btn-face {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255,242,160,0.35),
    0 1px 0 var(--av4-gold-dark),
    0 3px 8px rgba(0,0,0,0.35);
}

.av4-cosmic-btn:focus-visible .av4-cosmic-btn-face {
  box-shadow:
    inset 0 1.5px 0 rgba(255,242,160,0.55),
    0 4px 0 var(--av4-gold-dark),
    0 0 0 3px rgba(201,164,40,0.4);
}


/* ════════════════════════════════════════════════════════════════════════════
   SCREEN 2 — GAME   (3D key treatment arrives in Task 7)
   ════════════════════════════════════════════════════════════════════════════ */

.av4-game {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.av4-game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  padding: 8px 22px 18px;
  gap: 10px;
}

.av4-stage-shell {
  width: min(920px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  padding-top: 0;
}

.av4-game-prompt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 15;
  color: var(--av4-gold-light, #F3DB98);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
  pointer-events: none;
}

.av4-game-stage {
  position: relative;
  width: min(860px, 100%);
  min-height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  padding: 20px 0;
}

.av4-orbit-system {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(800px, 92vw);
  aspect-ratio: 1;
  transform: translate(-50%, -46%);
  pointer-events: none;
  mask-image: linear-gradient(to bottom, black 70%, transparent 95%);
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 95%);
  z-index: 1;
}

.av4-svg-rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.av4-orbital-track {
  position: absolute;
  inset: 0;
}

.av4-stage-planet {
  position: absolute;
  border-radius: 50%;
}

.av4-stage-planet-gas {
  width: 45px;
  height: 45px;
  top: 180px;
  left: 240px;
  background: radial-gradient(circle at 30% 30%, #d5b8ff 0%, #6e4ebb 40%, #1c103f 90%);
  box-shadow: inset -8px -8px 15px rgba(0, 0, 0, 0.9), 0 0 15px rgba(188, 160, 255, 0.36);
}

.av4-stage-planet-rocky {
  width: 32px;
  height: 32px;
  bottom: 160px;
  right: 280px;
  background: radial-gradient(circle at 25% 25%, #ffebc2 0%, #d4b475 40%, #5e4315 90%);
  box-shadow: inset -6px -6px 12px rgba(0, 0, 0, 0.9), 0 0 20px rgba(212, 180, 117, 0.28);
}

.av4-stage-planet-moon {
  width: 14px;
  height: 14px;
  top: 300px;
  right: 140px;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #9094a0 60%, #111 100%);
  box-shadow: inset -3px -3px 6px rgba(0, 0, 0, 0.9);
}

.av4-sign-coin {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(212, 180, 117, 0.98);
  background: rgba(18, 20, 32, 0.62);
  border: 1px solid rgba(212, 180, 117, 0.42);
  box-shadow:
    inset 0 2px 10px rgba(255, 255, 255, 0.1),
    0 8px 20px rgba(0, 0, 0, 0.36),
    0 0 14px rgba(212, 180, 117, 0.12);
  backdrop-filter: blur(8px);
}

.av4-sign-coin svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(212, 180, 117, 0.55));
}

.av4-sign-pos-pisces {
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
}

.av4-sign-pos-taurus {
  top: 180px;
  right: 120px;
}

.av4-sign-pos-scorpio {
  bottom: 250px;
  left: 100px;
}

.av4-sign-pos-sagittarius {
  bottom: 180px;
  right: 150px;
}

.av4-game-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 30;
  min-height: 0;
}

.av4-game-grid-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
}

.av4-game-grid-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -24px;
  width: 220px;
  height: 140px;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at center, rgba(255, 240, 210, 0.22) 0%, rgba(212, 180, 117, 0.12) 34%, rgba(212, 180, 117, 0) 78%),
    radial-gradient(ellipse at center, rgba(123, 92, 245, 0.16) 0%, rgba(123, 92, 245, 0) 75%);
  filter: blur(8px);
  pointer-events: none;
}

.av4-game-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.av4-game-row {
  display: grid;
  grid-template-columns: repeat(var(--word-len, 5), 1fr);
  gap: 10px;
}

.av4-game-prompt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  color: rgba(243, 219, 152, 0.94);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: 0.03em;
  text-shadow: 0 0 15px rgba(255, 231, 167, 0.12);
}

.av4-game-prompt-icon {
  display: inline-flex;
  color: rgba(243, 219, 152, 0.96);
}

.av4-clue-panel { display: none; }

.av4-clue-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.av4-clue-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(247, 222, 150, 0.98);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.av4-clue-star {
  display: inline-flex;
}

.av4-tile {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Söhne", "Sohne", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 12, 28, 0.6);
  color: var(--av4-text-faint, #47426A);
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: var(--tile-font, 1.58rem);
  position: relative;
  z-index: 2;
}

.av4-game-active .av4-tile {
  background: rgba(20, 18, 38, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.av4-clue-planet {
  color: rgba(245, 212, 134, 0.9);
  margin-top: -2px;
}

.av4-clue-story {
  margin: 10px 0 0;
  color: rgba(236, 230, 250, 0.95);
  font-size: 15px;
  line-height: 1.34;
}

.av4-clue-separator {
  margin: 15px 0 13px;
  height: 1px;
  background: linear-gradient(90deg, rgba(242, 204, 108, 0), rgba(242, 204, 108, 0.78), rgba(242, 204, 108, 0));
}

.av4-clue-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.av4-clue-point {
  display: flex;
  gap: 11px;
  color: rgba(232, 226, 247, 0.9);
  font-size: 14px;
  line-height: 1.33;
}

.av4-clue-point-icon {
  width: 34px;
  min-width: 34px;
  height: 34px;
  color: rgba(245, 224, 159, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

@keyframes av4-row-shake {
  0%   { transform: translateX(0);    }
  12%  { transform: translateX(-6px); }
  28%  { transform: translateX(6px);  }
  44%  { transform: translateX(-4px); }
  60%  { transform: translateX(4px);  }
  76%  { transform: translateX(-2px); }
  92%  { transform: translateX(2px);  }
  100% { transform: translateX(0);    }
}

.av4-game-row-shake {
  animation: av4-row-shake 480ms cubic-bezier(.36,.07,.19,.97);
}

@keyframes av4-row-bounce {
  0%   { transform: translateY(0); }
  20%  { transform: translateY(-10px); }
  40%  { transform: translateY(2px); }
  60%  { transform: translateY(-5px); }
  80%  { transform: translateY(1px); }
  100% { transform: translateY(0); }
}

.av4-game-row-bounce .av4-tile-correct,
.av4-game-row-bounce .av4-tile-present,
.av4-game-row-bounce .av4-tile-absent {
  animation: av4-row-bounce 680ms ease;
  animation-delay: calc(var(--tile-idx, 0) * 60ms);
}

/* Tiles */
.av4-tile {
  width: var(--tile-size, 52px);
  height: var(--tile-size, 52px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--tile-font, 1.6rem);
  font-family: inherit;
  font-weight: 900;
  text-transform: uppercase;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 12, 28, 0.6);
  color: var(--av4-text-faint, #47426A);
  line-height: 1;
  padding: 0;
  user-select: none;
  transition: all 0.2s;
}

.av4-tile-tbd {
  border-color: var(--av4-border-lit, #38305A);
  background: var(--av4-surface-3, #241F38);
  color: var(--av4-text, #EAE5FA);
  box-shadow: 0 0 0 2px rgba(123, 92, 245, 0.25);
  animation: av4-tile-pop 120ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes av4-tile-pop {
  0%   { transform: scale(1);    }
  45%  { transform: scale(1.10); }
  75%  { transform: scale(0.97); }
  100% { transform: scale(1);    }
}

.av4-tile-correct {
  background: var(--av4-correct-bg);
  border-color: rgba(46, 212, 122, 0.6);
  color: var(--av4-correct);
  box-shadow: 0 0 14px rgba(46, 212, 122, 0.2);
}

.av4-tile-present {
  background: var(--av4-present-bg);
  border-color: rgba(240, 162, 64, 0.6);
  color: var(--av4-present);
  box-shadow: 0 0 14px rgba(240, 162, 64, 0.18);
}

.av4-tile-absent {
  background: var(--av4-absent-bg);
  border-color: var(--av4-border);
  color: var(--av4-absent);
}

.av4-tile-error {
  border-color: var(--av4-error) !important;
  box-shadow: 0 0 8px rgba(239,68,68,0.25) !important;
}

/* Tile flip reveal */
.av4-tile-reveal {
  animation: av4-tile-flip 500ms ease forwards;
}

@keyframes av4-tile-flip {
  0%   { transform: scaleY(1); }
  48%  { transform: scaleY(0); }
  52%  { transform: scaleY(0); }
  100% { transform: scaleY(1); }
}

/* Keyboard */
.av4-result-actions {
  position: relative;
  margin: 30px 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 20;
  padding: 0 20px;
  width: 100%;
}

.av4-bottom-controls {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 0 8px;
  margin-top: auto;
  isolation: isolate;
}

.av4-bottom-controls::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: min(780px, 138%);
  height: 220px;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at center, rgba(255, 244, 212, 0.14) 0%, rgba(212, 180, 117, 0.1) 28%, rgba(123, 92, 245, 0.08) 44%, rgba(123, 92, 245, 0) 70%);
  filter: blur(22px);
  pointer-events: none;
  z-index: 0;
}

.av4-keyboard {
  position: relative;
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  padding: 12px 8px 24px;
  z-index: 10;
}

.av4-keyboard::before,
.av4-keyboard::after {
  display: none;
}

.av4-kb-row {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin: 0 auto;
  z-index: 1;
}

.av4-kb-row:nth-child(2) {
  width: 92%;
}

.av4-horizon-glow-container {
  position: absolute;
  left: 50%;
  bottom: 60px;
  width: min(1300px, 150vw);
  height: 300px;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
}

.av4-game-prompt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 15;
  color: var(--av4-gold-light, #F3DB98);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(243, 219, 152, 0.3));
}

.av4-keyboard {
  position: relative;
  width: min(600px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  padding: 12px 12px 24px;
  z-index: 10;
}

.av4-key {
  flex: 1;
  height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, #2a2844 0%, #1a182c 100%);
  color: #fff;
  font-family: "Söhne", "Sohne", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  box-shadow: 
    0 3px 0 #0d0c1a,
    0 6px 10px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  top: 0;
}

.av4-key:hover {
  top: -1px;
  background: linear-gradient(180deg, #322f52 0%, #1e1b36 100%);
  box-shadow: 
    0 4px 0 #0d0c1a,
    0 8px 15px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.av4-key:active {
  top: 2px;
  box-shadow: 
    0 1px 0 #0d0c1a,
    0 2px 4px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.av4-key-wide {
  flex: 1.4;
  font-size: 13px;
}

.av4-key-wide {
  flex: 1.55 1 0;
  max-width: 68px;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.av4-key-enter,
.av4-key-delete {
  color: rgba(241, 225, 170, 0.95);
}

.av4-key-sparkle svg {
  fill: currentColor;
  stroke: none;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.4));
}

.av4-key-correct {
  background: var(--av4-correct-bg);
  color: var(--av4-correct);
  border-color: color-mix(in srgb, var(--av4-correct) 40%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 4px 12px rgba(0,0,0,0.3),
    0 0 10px rgba(46,212,122,0.12);
}

.av4-key-present {
  background: var(--av4-present-bg);
  color: var(--av4-present);
  border-color: color-mix(in srgb, var(--av4-present) 40%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 4px 12px rgba(0,0,0,0.3),
    0 0 10px rgba(240,162,64,0.12);
}

.av4-key-absent {
  background: var(--av4-surface);
  color: var(--av4-text-faint);
  border-color: var(--av4-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 3px 8px rgba(0,0,0,0.26);
  opacity: 0.65;
}


/* ════════════════════════════════════════════════════════════════════════════
   SCREEN 3 — RESULT
   ════════════════════════════════════════════════════════════════════════════ */

.av4-result {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.av4-result-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 36px;
  gap: 18px;
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  animation: av4-screen-enter 350ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.av4-result-status {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.av4-result-won-text {
  font-family: inherit;
  font-size: 24px;
  font-weight: 800;
  color: var(--av4-correct);
  letter-spacing: 0.04em;
}

.av4-result-attempts {
  font-size: 13px;
  color: var(--av4-text-dim);
}

.av4-result-lost-text {
  font-size: 14px;
  color: var(--av4-text-dim);
}

.av4-result-answer {
  font-family: inherit;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--av4-text);
  text-align: center;
}

/* Meaning card */
.av4-meaning-card {
  width: 100%;
  background: var(--av4-surface-2);
  border: 1px solid var(--av4-border);
  border-left: 2px solid var(--av4-violet);
  border-radius: 14px;
  padding: 18px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.av4-meaning-word {
  font-family: inherit;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--av4-gold);
}

.av4-meaning-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--av4-text-dim);
}


/* ── Creative Result Overlay ────────────────────────────────────────── */
.av4-result-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 11, 26, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9000000;
  display: flex;
  flex-direction: column;
  padding: 60px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.av4-result-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(165deg, rgba(35, 30, 65, 0.98) 0%, rgba(20, 18, 40, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 32px;
  padding: 40px 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 28px;
  text-align: center;
  position: relative;
  overflow: visible;
  margin: auto;
}

.av4-result-card::before {
  content: '';
  position: absolute;
  top: -100px;
  left: -100px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.av4-result-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.av4-result-won-text {
  color: var(--av4-correct);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.15em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.av4-status-spark {
  color: var(--av4-correct);
  opacity: 0.8;
}

.av4-result-lost-text {
  color: var(--av4-absent);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.12em;
  opacity: 0.9;
}

.av4-result-answer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}

.av4-answer-label {
  font-size: 11px;
  color: var(--av4-text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.av4-answer-text {
  font-size: 38px;
  font-weight: 950;
  color: #fff;
  letter-spacing: 0.2em;
  text-shadow: 0 0 25px rgba(255, 255, 255, 0.25);
}

.av4-result-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 24px;
}

.av4-stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.av4-stat-val {
  font-size: 32px;
  font-weight: 900;
  color: var(--av4-gold);
}

.av4-stat-label {
  font-size: 10px;
  color: var(--av4-text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.av4-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
}

.av4-result-meaning {
  max-height: 120px;
  overflow-y: auto;
  padding-right: 8px;
}

.av4-result-meaning::-webkit-scrollbar {
  width: 4px;
}

.av4-result-meaning::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

.av4-meaning-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--av4-text-dim);
  margin: 0;
  font-weight: 400;
}

.av4-result-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.av4-cuspal-btn {
  width: 100%;
  padding: 18px;
  background: var(--av4-gold);
  color: #000;
  border: none;
  border-radius: 20px;
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(201, 164, 40, 0.25);
  transition: all 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.av4-cuspal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(201, 164, 40, 0.35);
  filter: brightness(1.1);
}

.av4-close-result-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 8px;
  cursor: pointer;
  transition: color 0.2s;
}

.av4-close-result-btn:hover {
  color: #fff;
}


.av4-streak-msg {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--av4-gold);
  padding: 11px 16px;
  background: rgba(201,164,40,0.08);
  border: 1px solid rgba(201,164,40,0.18);
  border-radius: 12px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Letter stagger on win */
.av4-answer-letter {
  display: inline-block;
  opacity: 0;
  animation: av4-letter-drop 300ms cubic-bezier(0.34, 1.56, 0.64, 1) var(--letter-delay, 0ms) forwards;
}

@keyframes av4-letter-drop {
  from { opacity: 0; transform: translateY(-12px) scale(0.8); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}


/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1120px) {
  .av4-header, .av4-game-header {
    padding: 16px 20px;
  }

  .av4-game-title {
    font-size: 23px;
  }

  .av4-stage-shell {
    width: min(840px, 100%);
  }

  .av4-game-stage {
    min-height: 450px;
  }
}

@media (max-width: 600px) {
  .av4-header-left, .av4-game-header-left {
    gap: 10px;
  }

  .av4-game-title {
    font-size: 20px;
  }

  .av4-game-subtitle {
    display: none;
  }

  .av4-horizon-glow {
    width: 144vw;
    height: 340px;
    bottom: -190px;
  }

  .av4-intro-body,
  .av4-result-body {
    padding: 16px 14px 28px;
    gap: 14px;
  }

  .av4-story-card {
    padding: 18px 18px;
    border-radius: 18px;
  }

  .av4-intro-title { font-size: 26px; }

  .av4-story-text {
    font-size: 15px;
    line-height: 1.7;
  }

  .av4-story-point {
    gap: 12px;
    font-size: 13px;
  }

  .av4-story-point-icon {
    width: 30px;
    min-width: 30px;
    height: 30px;
  }

  .av4-cosmic-btn { max-width: 100%; }

  .av4-game-body {
    padding: 8px 10px 12px;
    gap: 12px;
  }

  .av4-stage-shell {
    gap: 10px;
    padding-top: 0;
  }

  .av4-game-stage {
    min-height: 400px;
  }

  .av4-orbit-system {
    width: 132vw;
    max-width: 680px;
    transform: translate(-50%, -47%);
  }

  .av4-horizon-glow-container {
    bottom: 0;
  }

  .av4-game-prompt {
    font-size: 11px;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    margin-bottom: 8px;
  }

  .av4-game-grid { 
    grid-template-columns: repeat(5, 52px);
    gap: 8px; 
  }
  .av4-game-row { gap: 8px; }

  .av4-tile {
    font-size: 1.6rem;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    border-width: 2.5px;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(25, 22, 45, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  }

  .av4-key {
    height: 48px;
    max-width: none;
    font-size: clamp(10px, 4vw, 14px);
    padding: 0 2px;
    gap: 4px;
  }

  .av4-key-wide {
    flex: 1.8 1 0;
    font-size: clamp(9px, 3vw, 11px);
    letter-spacing: 0;
  }

  .av4-kb-row {
    gap: 4px;
  }
}

@media (max-width: 380px) {
  .av4-horizon-glow {
    width: 155vw;
    height: 300px;
    bottom: -170px;
  }

  .av4-game-title {
    font-size: 26px;
  }

  .av4-game-stage {
    min-height: 360px;
  }

  .av4-orbit-system {
    width: 146vw;
  }

  .av4-key {
    max-width: 32px;
    height: 32px;
    border-radius: 7px;
  }

  .av4-key-wide { max-width: 46px; }
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .av4-star,
  .av4-dust,
  .av4-nebula-orb,
  .av4-shooting-star,
  .av4-cosmic-noise,
  .av4-constellation-layer,
  .av4-orbit-rotor,
  .av4-glyph-ring,
  .av4-orbit-group,
  .av4-screen-enter,
  .av4-screen-exit,
  .av4-scan-line,
  .av4-scan-glow,
  .av4-cosmic-btn,
  .av4-cosmic-btn--gold .av4-cosmic-btn-face::after,
  .av4-howto-row,
  .av4-intro-corner-star,
  .av4-intro-hero,
  .av4-intro-footer,
  .av4-intro-body::before,
  .av4-story-card,
  .av4-story-card::after,
  .av4-game-row-shake,
  .av4-game-row-bounce,
  .av4-tile-reveal,
  .av4-answer-letter {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ── Legacy stubs ───────────────────────────────────────────────────────── */

.astrodle-game-root  { display: none; }
.astrodle-entry-root { display: none; }

/* ── Missing class stubs (classes used in JSX but not yet styled) ── */

.av4-card-interactive-wrapper {
  width: 100%;
  cursor: default;
}

.av4-story-hint-text {
  font-size: 12px;
  color: var(--av4-text-dim);
  line-height: 1.5;
  margin: 0;
}
