/* ==========================================================================
   REEL STORM MINI-GAME STYLES
   "Catch Madam Ji's Reels!" — Aayu & Mayu Special Arcade
   Matches: Plum (#1A0F18), Blush Pink (#F4A7B9), Warm Gold (#FFD6BA / #F7E7A6), Cream (#FFF8F5)
   ========================================================================== */

/* --- Section Container --- */
.reelstorm-section {
  position: relative;
  background: radial-gradient(circle at 50% 20%, rgba(61, 32, 64, 0.6) 0%, rgba(26, 15, 24, 0.95) 70%, #120911 100%);
  padding: clamp(3rem, 7vh, 5rem) 0 clamp(5rem, 10vh, 7rem) 0;
  overflow: hidden;
  color: var(--cream, #FFF8F5);
}

/* Ambient glow orbs in background */
.reelstorm-section::before,
.reelstorm-section::after {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.25;
  z-index: 0;
}

.reelstorm-section::before {
  top: 10%;
  left: -50px;
  background: radial-gradient(circle, var(--rose, #F4A7B9), transparent 70%);
}

.reelstorm-section::after {
  bottom: 10%;
  right: -50px;
  background: radial-gradient(circle, var(--gold, #F7E7A6), transparent 70%);
}

.reelstorm-section .container {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Header & Badges --- */
.reelstorm-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.reelstorm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(244, 167, 185, 0.12);
  border: 1px solid rgba(247, 231, 166, 0.35);
  color: var(--gold, #F7E7A6);
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 16px rgba(244, 167, 185, 0.15);
}

.reelstorm-subtitle {
  font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
  font-size: clamp(1.1rem, 2.8vw, 1.35rem);
  color: rgba(255, 248, 245, 0.8);
  font-style: italic;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

/* --- HUD (Heads Up Display) --- */
.reelstorm-hud-wrapper {
  max-width: 960px;
  margin: 0 auto 1.25rem auto;
}

.reelstorm-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(45, 27, 46, 0.75);
  border: 1px solid rgba(244, 167, 185, 0.25);
  border-radius: 18px;
  padding: 0.75rem 1.25rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.hud-label {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 248, 245, 0.6);
  margin-bottom: 0.15rem;
}

.hud-value {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold, #F7E7A6);
  line-height: 1.1;
  text-shadow: 0 0 12px rgba(247, 231, 166, 0.3);
}

/* Score animation on points */
.score-pulse {
  animation: rs-score-bump 0.25s ease-out;
}

@keyframes rs-score-bump {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); color: #fff; text-shadow: 0 0 20px #FFD700; }
  100% { transform: scale(1); }
}

/* Timer box with mini progress bar */
.timer-box {
  min-width: 110px;
}

.timer-display {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.hud-unit {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.85rem;
  color: rgba(255, 248, 245, 0.5);
}

.timer-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  margin-top: 4px;
  overflow: hidden;
}

.timer-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--rose, #F4A7B9), var(--gold, #F7E7A6));
  border-radius: 4px;
  transition: width 0.15s linear, background 0.3s;
}

.timer-box.urgent .hud-value {
  color: #FF5E7E !important;
  animation: rs-urgent-blink 0.6s infinite alternate;
}

.timer-box.urgent .timer-progress-bar {
  background: #FF5E7E !important;
}

@keyframes rs-urgent-blink {
  from { opacity: 1; transform: scale(1); text-shadow: 0 0 8px #FF5E7E; }
  to { opacity: 0.65; transform: scale(1.08); text-shadow: 0 0 18px #FF0055; }
}

/* HUD Buttons */
.hud-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.rs-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(244, 167, 185, 0.25);
  color: var(--cream, #FFF8F5);
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-body, 'Lato', sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  user-select: none;
}

.rs-btn-icon:hover {
  background: rgba(244, 167, 185, 0.2);
  border-color: var(--rose, #F4A7B9);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(244, 167, 185, 0.25);
}

.rs-btn-icon:active {
  transform: translateY(0);
}

.rs-btn-icon:focus-visible {
  outline: 2px solid var(--gold, #F7E7A6);
  outline-offset: 2px;
}

/* --- Game Container & Canvas --- */
.reelstorm-game-container {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  background: #170C15;
  border: 1.5px solid rgba(247, 231, 166, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), 0 0 35px rgba(244, 167, 185, 0.15);
  touch-action: none; /* Prevents mobile scrolling while dragging */
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.reelstorm-game-container.reveal.visible {
  transform: none !important;
}

body.rs-gameover-open {
  overflow: hidden !important;
}

#reelstorm-canvas {
  width: 100%;
  height: clamp(480px, 64vh, 580px);
  display: block;
  cursor: grab;
  touch-action: none;
}

#reelstorm-canvas:active {
  cursor: grabbing;
}

/* --- FULLSCREEN ARCADE MODE --- */
.reelstorm-game-container.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  z-index: 999999 !important;
  background: radial-gradient(circle at 50% 20%, #2A1325 0%, #150A14 80%, #0D050C 100%) !important;
  box-shadow: none !important;
}

.reelstorm-game-container.is-fullscreen #reelstorm-canvas {
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
}

/* Floating Exit Fullscreen Button */
.rs-exit-fullscreen-btn {
  display: none;
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 25;
  background: rgba(26, 15, 24, 0.88);
  border: 1.5px solid var(--rose, #F4A7B9);
  color: #FFF8F5;
  font-family: var(--font-body, 'Lato', sans-serif);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 16px rgba(244, 167, 185, 0.35);
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  user-select: none;
}

.reelstorm-game-container.is-fullscreen .rs-exit-fullscreen-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.rs-exit-fullscreen-btn:hover {
  background: var(--rose, #F4A7B9);
  color: #1A0F18;
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(244, 167, 185, 0.6);
}

/* --- Frenzy Mode Floating Banner --- */
.rs-frenzy-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: linear-gradient(90deg, #FF1361, #FFF800, #00FFCC, #FF1361);
  background-size: 300% 100%;
  color: #1A0F18;
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 0.45rem 1.35rem;
  border-radius: 999px;
  box-shadow: 0 0 25px rgba(255, 235, 59, 0.8), 0 4px 15px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 12;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
  animation: rs-rainbow-scroll 3s linear infinite;
}

.rs-frenzy-banner.active {
  transform: translateX(-50%) translateY(0);
}

@keyframes rs-rainbow-scroll {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* --- Milestone Toast --- */
.rs-milestone-toast {
  position: absolute;
  top: 65px;
  left: 50%;
  transform: translateX(-50%) scale(0.6);
  background: linear-gradient(135deg, rgba(247, 231, 166, 0.96), rgba(255, 214, 186, 0.96));
  color: #2D1B2E;
  font-family: var(--font-heading, 'Cormorant Garamond', serif);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.5rem 1.4rem;
  border-radius: 999px;
  border: 1.5px solid #FFF8F5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 25px rgba(247, 231, 166, 0.6);
  pointer-events: none;
  z-index: 14;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
}

.rs-milestone-toast.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* --- Overlays (Start, Pause, Game Over) --- */
.rs-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 12, 21, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 20;
  padding: 1.25rem;
  animation: rs-fade-in 0.25s ease-out;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

/* Dedicated Game Over Fullscreen Overlay */
.rs-gameover-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 100000 !important;
  background: rgba(18, 9, 17, 0.94) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  padding: max(1rem, env(safe-area-inset-top, 1rem)) max(0.75rem, env(safe-area-inset-right, 0.75rem)) max(1rem, env(safe-area-inset-bottom, 1rem)) max(0.75rem, env(safe-area-inset-left, 0.75rem)) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y !important;
}

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

.rs-overlay-card {
  max-width: 480px;
  width: 95%;
  background: linear-gradient(150deg, rgba(45, 27, 46, 0.96), rgba(26, 15, 24, 0.98));
  border: 1.5px solid rgba(247, 231, 166, 0.35);
  border-radius: 22px;
  padding: 1.6rem 1.4rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(244, 167, 185, 0.2);
  color: var(--cream, #FFF8F5);
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 167, 185, 0.4) transparent;
}

.rs-gameover-card {
  position: relative;
  max-width: 440px;
  width: 100%;
  max-height: calc(100dvh - 2.5rem);
  margin: auto;
  padding: 1.4rem 1.25rem 1.5rem 1.25rem;
}

/* Close/Dismiss Button on Game Over Card */
.rs-gameover-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(247, 231, 166, 0.35);
  color: var(--gold, #F7E7A6);
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.rs-gameover-close:hover {
  background: rgba(244, 167, 185, 0.35);
  color: #fff;
  transform: scale(1.08);
}

.rs-gameover-close:focus-visible {
  outline: 2px solid var(--gold, #F7E7A6);
  outline-offset: 2px;
}

.rs-overlay-card::-webkit-scrollbar {
  width: 5px;
}

.rs-overlay-card::-webkit-scrollbar-track {
  background: transparent;
}

.rs-overlay-card::-webkit-scrollbar-thumb {
  background: rgba(244, 167, 185, 0.4);
  border-radius: 999px;
}

.rs-crown-hero,
.rs-trophy-hero,
.rs-pause-icon-big {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 14px rgba(255, 215, 0, 0.4));
  animation: rs-float 3s ease-in-out infinite;
}

@keyframes rs-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.rs-card-title {
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  color: var(--gold, #F7E7A6);
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.rs-card-desc {
  font-family: var(--font-body, 'Lato', sans-serif);
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(255, 248, 245, 0.85);
  margin-bottom: 1.15rem;
}

/* Legend Grid on Start Screen */
.rs-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.rs-legend-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(244, 167, 185, 0.18);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  font-size: 0.76rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rs-legend-item span {
  color: rgba(255, 248, 245, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rs-legend-item strong {
  font-family: var(--font-mono, 'DM Mono', monospace);
  color: var(--gold, #F7E7A6);
  font-size: 0.82rem;
  margin-top: 2px;
}

.rs-legend-item.danger {
  border-color: rgba(255, 94, 126, 0.35);
  background: rgba(255, 94, 126, 0.08);
}

.rs-legend-item.danger strong {
  color: #FF5E7E;
}

/* Primary and Secondary Action Buttons */
.rs-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background: linear-gradient(135deg, var(--rose, #F4A7B9), #e8809a);
  color: #1A0F18;
  font-family: var(--font-body, 'Lato', sans-serif);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.8rem 1.4rem;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(244, 167, 185, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.rs-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(244, 167, 185, 0.6);
  background: linear-gradient(135deg, #f7b7c5, #ea8ea5);
}

.rs-btn-primary:active {
  transform: translateY(0);
}

.rs-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream, #FFF8F5);
  font-family: var(--font-body, 'Lato', sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(247, 231, 166, 0.35);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  margin-top: 0.5rem;
}

.rs-btn-secondary:hover {
  background: rgba(247, 231, 166, 0.18);
  border-color: var(--gold, #F7E7A6);
  transform: translateY(-1.5px);
}

.rs-hint {
  font-size: 0.78rem;
  color: rgba(255, 248, 245, 0.55);
  margin-top: 0.85rem;
  letter-spacing: 0.02em;
}

/* --- Game Over Specifics --- */
.rs-rank-badge {
  display: inline-block;
  background: linear-gradient(90deg, rgba(247, 231, 166, 0.2), rgba(244, 167, 185, 0.2));
  border: 1.5px solid var(--gold, #F7E7A6);
  color: var(--gold, #F7E7A6);
  font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.35rem 1.1rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 15px rgba(247, 231, 166, 0.3);
}

.rs-score-summary {
  margin-bottom: 1.15rem;
}

.rs-final-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rs-summary-label {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 248, 245, 0.6);
}

.rs-summary-score {
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold, #F7E7A6);
  line-height: 1;
  margin-top: 0.15rem;
  text-shadow: 0 0 20px rgba(247, 231, 166, 0.4);
}

.rs-new-record-pill {
  display: inline-block;
  background: linear-gradient(90deg, #FF1361, #FFF800);
  color: #1A0F18;
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-top: 0.4rem;
  animation: rs-score-bump 0.8s infinite alternate;
}

/* Stats Breakdown Grid */
.rs-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.rs-stat-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(244, 167, 185, 0.18);
  border-radius: 12px;
  padding: 0.45rem 0.25rem;
}

.rs-stat-pill-icon {
  font-size: 1.1rem;
  line-height: 1;
  margin-bottom: 2px;
}

.rs-stat-pill-count {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cream, #FFF8F5);
}

.rs-stat-pill-name {
  font-size: 0.68rem;
  color: rgba(255, 248, 245, 0.6);
  margin-top: 1px;
}

/* --- Photo Scorecard Preview Card --- */
.rs-photo-card-wrap {
  margin: 1.1rem auto 1.15rem auto;
  max-width: 290px;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 0 25px rgba(247, 231, 166, 0.3);
  border: 2px solid rgba(247, 231, 166, 0.45);
  background: radial-gradient(circle at 50% 30%, #2A1325 0%, #150A14 100%);
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease;
  position: relative;
}

.rs-photo-card-wrap:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.8), 0 0 35px rgba(247, 231, 166, 0.45);
}

.rs-photo-loading-text {
  padding: 2.2rem 1rem;
  font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
  font-size: 1.1rem;
  color: var(--gold, #F7E7A6);
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rs-photo-card-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Photo Action Buttons */
.rs-photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.rs-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0;
}

.rs-action-buttons .rs-btn-secondary {
  margin-top: 0;
}

.rs-btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
  color: #1A0F18;
  font-family: var(--font-body, 'Lato', sans-serif);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.rs-btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(255, 215, 0, 0.65);
  background: linear-gradient(135deg, #FFE033 0%, #FFB300 100%);
}

.rs-btn-gold:active {
  transform: translateY(0);
}

.rs-btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background: linear-gradient(135deg, #E1306C 0%, #C13584 50%, #833AB4 100%);
  color: #FFF8F5;
  font-family: var(--font-body, 'Lato', sans-serif);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(225, 48, 108, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.rs-btn-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(225, 48, 108, 0.58);
  filter: brightness(1.08);
}

.rs-btn-share:active {
  transform: translateY(0);
}

.rs-copy-toast {
  font-family: var(--font-body, 'Lato', sans-serif);
  font-size: 0.82rem;
  color: var(--gold, #F7E7A6);
  margin-top: 0.5rem;
  min-height: 1.2rem;
  transition: opacity 0.3s;
}

/* --- Responsive Adjustments --- */
@media (max-width: 640px) {
  #reelstorm-canvas {
    height: 420px;
  }

  .reelstorm-hud {
    padding: 0.65rem 0.85rem;
    gap: 0.4rem;
  }

  .hud-value {
    font-size: 1.25rem;
  }

  .rs-btn-icon .rs-btn-text {
    display: none; /* Icon-only on narrow mobile */
  }

  .rs-overlay-card {
    padding: 1.35rem 1.1rem;
  }

  .rs-legend {
    grid-template-columns: repeat(2, 1fr);
  }

  .rs-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
  }

  .rs-summary-score {
    font-size: 2.4rem;
  }
}

/* Phone screen optimization: Compact end screen so it fits neatly in viewport without double scrolling */
@media (max-width: 480px) {
  .rs-gameover-overlay {
    padding: max(0.6rem, env(safe-area-inset-top, 0.6rem)) max(0.5rem, env(safe-area-inset-right, 0.5rem)) max(0.6rem, env(safe-area-inset-bottom, 0.6rem)) max(0.5rem, env(safe-area-inset-left, 0.5rem)) !important;
  }

  .rs-gameover-card {
    padding: 1.1rem 0.85rem 1.15rem 0.85rem;
    max-height: calc(100dvh - 1.5rem);
    border-radius: 18px;
  }

  .rs-gameover-close {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .rs-gameover-card .rs-trophy-hero {
    font-size: 2rem;
    margin-bottom: 0.2rem;
  }

  .rs-gameover-card .rs-rank-badge {
    font-size: 0.82rem;
    padding: 0.22rem 0.75rem;
    margin-bottom: 0.35rem;
  }

  .rs-gameover-card .rs-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.2rem;
  }

  .rs-gameover-card .rs-score-summary {
    margin-bottom: 0.45rem;
  }

  .rs-gameover-card .rs-summary-label {
    font-size: 0.66rem;
    letter-spacing: 0.08em;
  }

  .rs-gameover-card .rs-summary-score {
    font-size: 2.1rem;
    margin-top: 0;
    line-height: 1;
  }

  .rs-gameover-card .rs-new-record-pill {
    font-size: 0.64rem;
    padding: 0.18rem 0.5rem;
    margin-top: 0.15rem;
  }

  .rs-gameover-card .rs-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
    margin-bottom: 0.45rem;
  }

  .rs-stat-pill {
    padding: 0.25rem 0.15rem;
    border-radius: 8px;
  }

  .rs-stat-pill-icon {
    font-size: 0.95rem;
    margin-bottom: 1px;
  }

  .rs-stat-pill-count {
    font-size: 0.85rem;
  }

  .rs-stat-pill-name {
    font-size: 0.6rem;
  }

  .rs-photo-card-wrap {
    max-width: clamp(140px, 38vw, 185px);
    margin: 0.45rem auto;
    border-radius: 12px;
  }

  .rs-photo-loading-text {
    padding: 1.2rem 0.5rem;
    font-size: 0.95rem;
  }

  .rs-photo-actions {
    gap: 0.4rem;
    margin-bottom: 0.4rem;
  }

  .rs-action-buttons {
    gap: 0.4rem;
  }

  .rs-btn-gold,
  .rs-btn-share,
  .rs-btn-primary,
  .rs-btn-secondary {
    padding: 0.62rem 0.45rem;
    font-size: 0.8rem;
    border-radius: 10px;
    gap: 0.25rem;
    white-space: nowrap;
  }

  .rs-copy-toast {
    font-size: 0.74rem;
    min-height: 1rem;
    margin-top: 0.35rem;
  }
}

@media (max-height: 680px) {
  .rs-gameover-card .rs-trophy-hero {
    display: none;
  }
  .rs-photo-card-wrap {
    max-width: 140px;
    margin: 0.35rem auto;
  }
}

@media (max-height: 700px) and (orientation: landscape) {
  #reelstorm-canvas {
    height: 320px;
  }
}
