/*
 * CD Method Tamagotchi v5 - Styles
 * ================================
 * Complete styling for the interactive presentation
 */

/* ============================================
   FONT IMPORT
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  /* Primary LCD Green Palette */
  --cd-dark: #1a2e0a;
  --cd-mid: #3d5a1f;
  --cd-light: #6b8c3f;
  --cd-bg: #95ab83;
  --cd-screen: #a6b698;
  --cd-highlight: #c3d4ab;
  
  /* Device Colors */
  --cd-device-light: #e8e4dc;
  --cd-device-dark: #d8d4cc;
  --cd-bezel-dark: #1a1a18;
  --cd-bezel-light: #2a2a28;
  
  /* Accent Colors */
  --cd-orange: #ff6600;
  --cd-yellow: #ffcc00;
  --cd-text-gray: #606060;
  --cd-muted: #8a8a80;
  
  /* Typography */
  --cd-font: "Press Start 2P", monospace;
  
  /* Dimensions */
  --cd-container-width: min(90vw, 1100px);
  --cd-container-min: 420px;
  --cd-screen-height: clamp(400px, 60vh, 600px);
  --cd-border-radius: 40px;
  --cd-screen-radius: 16px;

  /* Keycap Light — cream mechanical key */
  --keycap-gradient: linear-gradient(180deg,
    #faf8f4 0%, #f5f2ec 10%, #ede9e2 40%, #e5e1da 70%, #ddd9d2 100%);
  --keycap-gradient-hover: linear-gradient(180deg,
    #ffffff 0%, #faf8f4 10%, #f2efe8 40%, #eae6df 70%, #e2ded7 100%);
  --keycap-gradient-active: linear-gradient(180deg,
    #e8e4dc 0%, #ebe7e0 20%, #f0ece5 60%, #ede9e2 100%);
  --keycap-gradient-held: linear-gradient(180deg,
    #e5e1da 0%, #ebe7e0 15%, #f0ece5 50%, #e8e4dd 100%);
  --keycap-gradient-held-hover: linear-gradient(180deg,
    #eae6df 0%, #efebe4 15%, #f4f0e9 50%, #ece8e1 100%);
  --keycap-shadow: inset 0 1px 0 rgba(255,255,255,1),
    inset 0 2px 2px rgba(255,255,255,0.5),
    inset 0 -1px 2px rgba(0,0,0,0.03),
    0 4px 0 #c9c5be, 0 5px 0 #bab6af, 0 6px 0 #a8a49d,
    0 7px 3px rgba(0,0,0,0.15), 0 8px 8px rgba(0,0,0,0.08);
  --keycap-shadow-active: inset 0 1px 2px rgba(0,0,0,0.08),
    inset 0 2px 4px rgba(0,0,0,0.05),
    0 1px 0 #c9c5be, 0 2px 0 #bab6af, 0 2px 2px rgba(0,0,0,0.1);
  --keycap-shadow-held: inset 0 1px 2px rgba(0,0,0,0.06),
    0 2px 0 #c9c5be, 0 3px 0 #bab6af, 0 4px 0 #a8a49d,
    0 4px 2px rgba(0,0,0,0.12), 0 5px 5px rgba(0,0,0,0.06);

  /* Keycap Mobile — shorter 3D height */
  --keycap-shadow-mobile: inset 0 1px 0 rgba(255,255,255,1),
    inset 0 2px 2px rgba(255,255,255,0.5),
    0 3px 0 #c9c5be, 0 4px 0 #bab6af,
    0 5px 2px rgba(0,0,0,0.12), 0 5px 6px rgba(0,0,0,0.06);
  --keycap-shadow-mobile-active: inset 0 1px 2px rgba(0,0,0,0.08),
    0 1px 0 #c9c5be, 0 1px 2px rgba(0,0,0,0.1);
  --keycap-shadow-mobile-held: inset 0 1px 2px rgba(0,0,0,0.06),
    0 2px 0 #c9c5be, 0 3px 0 #bab6af, 0 3px 2px rgba(0,0,0,0.1);

  /* Keycap Dark — black key variant */
  --keycap-dark-gradient: linear-gradient(180deg,
    #3a3a38 0%, #2e2e2c 10%, #242422 40%, #1c1c1a 70%, #141412 100%);
  --keycap-dark-gradient-hover: linear-gradient(180deg,
    #4a4a48 0%, #3e3e3c 10%, #343432 40%, #2c2c2a 70%, #242422 100%);
  --keycap-dark-gradient-active: linear-gradient(180deg,
    #1c1c1a 0%, #202020 20%, #262624 60%, #222220 100%);
  --keycap-dark-shadow: inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 2px 2px rgba(255,255,255,0.06),
    inset 0 -1px 2px rgba(0,0,0,0.2),
    0 4px 0 #4a4a48, 0 5px 0 #3a3a38, 0 6px 0 #2a2a28,
    0 7px 3px rgba(0,0,0,0.2), 0 8px 8px rgba(0,0,0,0.1);
  --keycap-dark-shadow-active: inset 0 1px 3px rgba(0,0,0,0.4),
    inset 0 2px 4px rgba(0,0,0,0.2),
    0 1px 0 #4a4a48, 0 2px 0 #3a3a38, 0 2px 2px rgba(0,0,0,0.15);
  --keycap-dark-shadow-mobile: inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 2px 2px rgba(255,255,255,0.06),
    0 3px 0 #4a4a48, 0 4px 0 #3a3a38,
    0 5px 2px rgba(0,0,0,0.15), 0 5px 6px rgba(0,0,0,0.08);
  --keycap-dark-shadow-mobile-active: inset 0 1px 3px rgba(0,0,0,0.4),
    0 1px 0 #4a4a48, 0 1px 2px rgba(0,0,0,0.15);
}

/* ============================================
   BASE RESET & CONTAINER
   ============================================ */
.cd-method-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  background: linear-gradient(145deg, var(--cd-device-light) 0%, var(--cd-device-dark) 100%);
  font-family: var(--cd-font);
}

.cd-method-container * {
  box-sizing: border-box;
}

/* ============================================
   DEVICE SHELL (now full-page layout wrapper)
   ============================================ */
.cd-device {
  position: relative;
  width: 92%;
  max-width: 1100px;
  padding: 3vh 0 2rem;
}

/* ============================================
   SCREWS
   ============================================ */
.cd-screw {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b0b0a8 0%, #909088 100%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.cd-screw::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 1px;
  background: #606058;
}

.cd-screw--top-left { top: 12px; left: 12px; display: none; }
.cd-screw--top-right { top: 12px; right: 12px; display: none; }
.cd-screw--bottom-left { bottom: 12px; left: 12px; display: none; }
.cd-screw--bottom-right { bottom: 12px; right: 12px; display: none; }

/* ============================================
   SOUND TOGGLE — LED in beveled pill
   ============================================ */
.cd-sound-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  z-index: 20;
  flex-shrink: 0;
  transition: all 0.1s ease;

  /* Recessed pill — inset into the beige surface */
  background: linear-gradient(180deg,
    #d4d0c8 0%,
    #ddd9d2 40%,
    #e5e1da 100%
  );
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.12),
    inset 0 1px 1px rgba(0,0,0,0.08),
    0 1px 0 rgba(255,255,255,0.6);
}

.cd-sound-toggle:hover {
  background: linear-gradient(180deg,
    #d0ccc4 0%,
    #d8d4cc 40%,
    #e0dcd4 100%
  );
}

.cd-sound-toggle:active {
  box-shadow:
    inset 0 3px 6px rgba(0,0,0,0.15),
    inset 0 1px 2px rgba(0,0,0,0.1);
}

/* LED dot */
.cd-sound-led {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.25s ease;
  border: 1.5px solid rgba(0,0,0,0.1);
}

/* Label */
.cd-sound-label {
  font-size: 8px;
  letter-spacing: 1px;
  line-height: 1;
  transition: color 0.2s ease;
  color: #606060;
}

/* === ON state: green glow === */
.cd-sound-toggle--on .cd-sound-led {
  background: radial-gradient(circle at 35% 35%,
    #88ff88 0%,
    #44dd44 35%,
    #22aa22 65%,
    #0e880e 100%
  );
  border-color: rgba(34,170,34,0.25);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.35),
    0 0 5px rgba(68, 221, 68, 0.5),
    0 0 14px rgba(68, 221, 68, 0.25),
    0 0 28px rgba(68, 221, 68, 0.08);
}

/* === OFF state: dim red === */
.cd-sound-toggle--off .cd-sound-led {
  background: radial-gradient(circle at 35% 35%,
    #bb4040 0%,
    #883020 50%,
    #552018 100%
  );
  border-color: rgba(0,0,0,0.12);
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.25),
    0 0 3px rgba(180, 60, 60, 0.2);
}

.cd-sound-toggle--off .cd-sound-label {
  color: #999;
}

@media (max-width: 480px) {
  .cd-sound-toggle {
    gap: 8px;
    padding: 8px 14px;
  }
  .cd-sound-led {
    width: 10px;
    height: 10px;
  }
  .cd-sound-label {
    font-size: 7px;
  }
}

@media (max-width: 380px) {
  .cd-sound-label {
    display: none;
  }
}

/* ============================================
   SCREEN BEZEL
   ============================================ */
.cd-bezel {
  border-radius: var(--cd-screen-radius);
  padding: 10px;
  margin-bottom: 12px;
  background: linear-gradient(145deg, var(--cd-bezel-dark), var(--cd-bezel-light));
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.7);
}

/* ============================================
   LCD SCREEN
   ============================================ */
.cd-screen {
  position: relative;
  height: var(--cd-screen-height);
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--cd-screen) 0%, #9aac8a 100%);
  color: var(--cd-dark);
  touch-action: manipulation;
}

.cd-screen-content {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
}

.cd-screen-content button,
.cd-screen-content [onclick],
.cd-screen-content [role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ============================================
   LCD OVERLAY EFFECTS
   ============================================ */
.cd-lcd-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0, 0, 0, 0.08) 3px,
      rgba(0, 0, 0, 0.08) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 3px,
      rgba(0, 0, 0, 0.06) 3px,
      rgba(0, 0, 0, 0.06) 4px
    );
}

.cd-lcd-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    rgba(0,0,0,0.08) 100%
  );
}

/* LCD-styled images - makes black appear as LCD dark green */
.cd-lcd-image {
  /* Sepia base + hue shift to green + adjust brightness */
  filter:
    sepia(100%)
    saturate(300%)
    hue-rotate(50deg)
    brightness(0.4)
    contrast(1.2);
  opacity: 0.9;
}

/* ============================================
   NAVIGATION CONTROLS
   ============================================ */
.cd-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  margin-bottom: 12px;
}

.cd-nav-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--cd-bezel-light), var(--cd-bezel-dark));
  box-shadow:
    3px 3px 6px rgba(0,0,0,0.25),
    inset 0 1px 1px rgba(255,255,255,0.1);
  transition: transform 0.2s;
}

.cd-nav-arrow {
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
}

.cd-nav-arrow--left {
  border-width: 8px 12px 8px 0;
  border-color: transparent var(--cd-text-gray) transparent transparent;
  margin-right: 2px;
}

.cd-nav-arrow--right {
  border-width: 8px 0 8px 12px;
  border-color: transparent transparent transparent var(--cd-text-gray);
  margin-left: 2px;
}

.cd-nav-button:hover:not(:disabled) {
  transform: scale(1.05);
}

.cd-nav-button:active:not(:disabled) {
  transform: scale(0.95);
}

.cd-nav-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cd-nav-button:disabled .cd-nav-arrow--left {
  border-color: transparent var(--cd-text-gray) transparent transparent;
}

.cd-nav-button:disabled .cd-nav-arrow--right {
  border-color: transparent transparent transparent var(--cd-text-gray);
}

/* ============================================
   BATTLE UI
   ============================================ */
.cd-battle-action-card {
  position: absolute;
  top: 52%;
  left: 50%;
  z-index: 9;
  min-width: 170px;
  padding: 8px 10px;
  background: var(--cd-bg);
  border: 3px solid var(--cd-dark);
  box-shadow: 4px 4px 0 var(--cd-dark);
  text-align: center;
  transform: translate(-50%, -50%);
}

.cd-battle-action-card--won,
.cd-battle-action-card--lost {
  min-width: 180px;
}

.cd-battle-action-card--compact {
  min-width: auto;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.cd-battle-action-title {
  margin-bottom: 8px;
  font-family: var(--cd-font);
  font-size: 7px;
  color: var(--cd-dark);
  line-height: 1.8;
}

.cd-battle-action-btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 3px solid var(--cd-dark);
  background: var(--cd-dark);
  box-shadow: 4px 4px 0 var(--cd-mid);
  color: var(--cd-screen);
  cursor: pointer;
  font-family: var(--cd-font);
  font-size: 10px;
  line-height: 1.6;
  text-transform: uppercase;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.cd-battle-action-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--cd-mid);
}

.cd-battle-action-btn--light {
  background: var(--cd-screen);
  color: var(--cd-dark);
}

.cd-battle-action-hint {
  min-height: 12px;
  margin-top: 7px;
  font-family: var(--cd-font);
  font-size: 6px;
  color: var(--cd-dark);
  line-height: 1.8;
}

.cd-battle-result-card {
  padding: 10px 12px;
  border: 3px solid var(--cd-dark);
  background: var(--cd-dark);
  color: var(--cd-screen);
  font-family: var(--cd-font);
  font-size: 9px;
  line-height: 1.8;
}

.cd-battle-hit-flash {
  animation: cd-battle-hit-flash 0.16s steps(2);
}

.cd-battle-shake {
  animation: cd-battle-shake 0.16s steps(2);
}

@keyframes cd-battle-hit-flash {
  0%, 100% { background: var(--cd-bg); }
  50% { background: var(--cd-highlight); }
}

@keyframes cd-battle-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.cd-battle-field {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.cd-battle-field--muted {
  filter: brightness(0.48);
}

.cd-battle-stage-card {
  min-width: 196px;
}

.cd-battle-banner-wrap {
  position: absolute;
  top: 18%;
  left: 50%;
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  transform: translateX(-50%);
}

.cd-battle-banner {
  padding: 8px 12px;
  border: 3px solid var(--cd-dark);
  background: var(--cd-dark);
  box-shadow: 4px 4px 0 var(--cd-mid);
  color: var(--cd-screen);
  font-family: var(--cd-font);
  font-size: 7px;
  line-height: 1.8;
  text-align: center;
  white-space: nowrap;
}

.cd-battle-banner--subtle {
  background: var(--cd-screen);
  color: var(--cd-dark);
}

.cd-battle-monster--down {
  transform: translateY(8px);
}

.cd-battle-monster--down .cd-sprite-float {
  animation: none;
}

.cd-battle-monster--revived {
  animation: cd-battle-revive 0.28s steps(2) 2;
}

@keyframes cd-battle-revive {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.cd-battle-stage2-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

.cd-battle-ads-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  touch-action: manipulation;
}

.cd-battle-ad {
  position: absolute;
  width: 56px;
  height: 56px;
  padding: 8px;
  border: 3px solid var(--cd-dark);
  background: var(--cd-screen);
  box-shadow: 4px 4px 0 var(--cd-dark);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.cd-battle-ad img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.cd-battle-ad--hit {
  animation: cd-battle-ad-pop 0.12s steps(2) forwards;
  pointer-events: none;
}

.cd-battle-ad--miss {
  animation: cd-battle-ad-miss 0.12s steps(2) forwards;
  pointer-events: none;
}

@keyframes cd-battle-ad-pop {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.42) rotate(-12deg);
  }
}

@keyframes cd-battle-ad-miss {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 12px)) scale(1.08);
  }
}

.cd-battle-loss-screen {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  background: rgba(14, 22, 8, 0.92);
}

.cd-battle-loss-copy {
  width: min(260px, 100%);
  padding: 14px 12px;
  border: 3px solid var(--cd-screen);
  background: var(--cd-dark);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
  text-align: center;
}

.cd-battle-loss-screen--enter .cd-battle-loss-copy {
  animation: cd-battle-loss-enter 0.42s steps(4) both;
}

.cd-battle-loss-screen--exit .cd-battle-loss-copy {
  animation: cd-battle-loss-exit 0.36s steps(4) both;
}

.cd-battle-loss-monster {
  margin-bottom: 8px;
}

.cd-battle-loss-monster .cd-sprite-float {
  animation: none;
}

.cd-battle-loss-title {
  margin-bottom: 8px;
  color: var(--cd-screen);
  font-family: var(--cd-font);
  font-size: 10px;
  line-height: 1.8;
}

.cd-battle-loss-line {
  margin-bottom: 12px;
  color: var(--cd-highlight);
  font-family: var(--cd-font);
  font-size: 7px;
  line-height: 1.8;
}

.cd-battle-loss-actions {
  display: flex;
  justify-content: center;
}

.cd-battle-loss-actions .cd-battle-action-btn {
  width: auto;
  min-width: 150px;
}

@keyframes cd-battle-loss-enter {
  0% {
    opacity: 0.2;
    transform: translate(18%, -14%) scale(0.58);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes cd-battle-loss-exit {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0.2;
    transform: translate(18%, -14%) scale(0.58);
  }
}

.cd-battle-celebration {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 16px 12px 12px;
  text-align: center;
}

.cd-battle-celebration-flash {
  position: absolute;
  inset: 12px;
  border: 3px solid var(--cd-dark);
  background: var(--cd-highlight);
  opacity: 0;
}

.cd-battle-celebration-flash.is-visible {
  animation: cd-battle-celebrate-flash 0.2s steps(2) both;
}

@keyframes cd-battle-celebrate-flash {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}

.cd-battle-celebration-badge,
.cd-battle-celebration-hero,
.cd-battle-celebration-support,
.cd-battle-celebration-card {
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.12s steps(2);
}

.cd-battle-celebration-badge.is-visible,
.cd-battle-celebration-hero.is-visible,
.cd-battle-celebration-support.is-visible,
.cd-battle-celebration-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cd-battle-celebration-badge {
  position: relative;
  z-index: 1;
  padding: 8px 22px;
  border: 3px solid var(--cd-screen);
  background: var(--cd-dark);
  box-shadow: 6px 6px 0 var(--cd-mid);
  color: var(--cd-screen);
  font-family: var(--cd-font);
  font-size: 16px;
  line-height: 1.6;
}

.cd-battle-celebration-hero {
  position: relative;
  z-index: 1;
  min-height: 180px;
}

.cd-battle-celebration-prop {
  position: absolute;
}

.cd-battle-celebration-prop img {
  display: block;
  width: 44px;
  height: auto;
  image-rendering: pixelated;
  mix-blend-mode: multiply;
}

.cd-battle-celebration-prop--crown {
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
}

.cd-battle-celebration-prop--award-left {
  bottom: 8px;
  left: -10px;
}

.cd-battle-celebration-prop--award-right {
  bottom: 8px;
  right: -10px;
}

.cd-battle-celebration-prop--star-left {
  top: 18px;
  left: -4px;
}

.cd-battle-celebration-prop--star-right {
  top: 28px;
  right: -4px;
}

.cd-battle-celebration-support {
  position: relative;
  z-index: 1;
  padding: 6px 12px;
  border: 3px solid var(--cd-dark);
  background: var(--cd-screen);
  color: var(--cd-dark);
  font-family: var(--cd-font);
  font-size: 7px;
  line-height: 1.8;
}

.cd-battle-celebration-statuses {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  width: min(260px, 100%);
}

.cd-battle-celebration-card {
  padding: 7px 10px;
  border: 3px solid var(--cd-dark);
  background: var(--cd-dark);
  color: var(--cd-screen);
  font-family: var(--cd-font);
  font-size: 7px;
  line-height: 1.7;
}

/* ============================================
   PROGRESS DOTS
   ============================================ */
.cd-progress-dots {
  display: flex;
  gap: 6px;
}

.cd-progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  background: linear-gradient(145deg, #c8c4bc, #b8b4ac);
  box-shadow: 1px 1px 2px rgba(0,0,0,0.08);
}

.cd-progress-dot:hover {
  transform: scale(1.25);
}

.cd-progress-dot--active {
  background: linear-gradient(145deg, #3a3a38, #2a2a28);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
  transform: scale(1.4);
}

.cd-progress-dot--filled {
  background: linear-gradient(145deg, #3a3a38, #2a2a28);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
}

/* ============================================
   SECTION SELECTOR BAR - Mechanical Keyboard Style
   ============================================ */
.cd-section-bar {
  margin: 0 0 12px;
  padding: 10px 10px 8px;
  border-radius: 12px;
  /* Keyboard plate / mounting surface */
  background: linear-gradient(180deg,
    #d4d0c8 0%,
    #e0dcd4 10%,
    #e8e4dc 90%,
    #d8d4cc 100%
  );
  box-shadow:
    inset 0 3px 6px rgba(0,0,0,0.12),
    inset 0 -1px 2px rgba(255,255,255,0.6),
    0 2px 0 rgba(255,255,255,0.4);
}

.cd-section-buttons {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.cd-section-button {
  flex: 1;
  padding: 10px 4px 8px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--cd-font);
  font-size: 4px;
  color: #404040;
  transition: all 0.08s ease;
  position: relative;

  background: var(--keycap-gradient);
  box-shadow: var(--keycap-shadow);

  /* Keycap sits up */
  transform: translateY(0);
}

.cd-section-button:hover {
  background: var(--keycap-gradient-hover);
  color: #2a2a2a;
}

.cd-section-button:active {
  background: var(--keycap-gradient-active);
  box-shadow: var(--keycap-shadow-active);
  transform: translateY(4px);
}

.cd-section-button--active {
  color: #1a1a18;
  font-weight: normal;
  background: var(--keycap-gradient-held);
  box-shadow: var(--keycap-shadow-held);
  transform: translateY(2px);
}

.cd-section-button--active:hover {
  background: var(--keycap-gradient-held-hover);
}

.cd-section-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.cd-section-button:disabled:hover {
  background: var(--keycap-gradient);
  color: #404040;
}

.cd-section-button:disabled:active {
  box-shadow: var(--keycap-shadow);
  transform: translateY(0);
}

.cd-section-icon {
  font-size: 10px;
  margin-bottom: 2px;
}

.cd-section-label {
  display: block;
}

/* Touch optimization - remove tap delay */
.cd-section-button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Mobile: Smaller buttons, hide labels */
@media (max-width: 480px) {
  .cd-battle-action-card {
    top: 48%;
    min-width: 154px;
    padding: 7px 8px;
  }

  .cd-battle-action-card--compact {
    min-width: auto;
    padding: 0;
  }

  .cd-battle-action-title {
    margin-bottom: 7px;
    font-size: 6px;
  }

  .cd-battle-action-btn {
    min-height: 40px;
    padding: 9px 10px;
    font-size: 9px;
  }

  .cd-battle-action-hint {
    font-size: 5px;
  }

  .cd-battle-result-card {
    font-size: 8px;
  }

  .cd-battle-stage-card {
    min-width: 168px;
  }

  .cd-battle-banner-wrap {
    top: 14%;
    gap: 4px;
  }

  .cd-battle-banner {
    padding: 6px 10px;
    font-size: 6px;
  }

  .cd-battle-ad {
    width: 48px;
    height: 48px;
    padding: 6px;
  }

  .cd-battle-loss-copy {
    width: min(220px, 100%);
    padding: 12px 10px;
  }

  .cd-battle-loss-title {
    font-size: 9px;
  }

  .cd-battle-loss-line {
    font-size: 6px;
  }

  .cd-battle-celebration-badge {
    padding: 8px 16px;
    font-size: 12px;
  }

  .cd-battle-celebration-hero {
    min-height: 150px;
  }

  .cd-battle-celebration-prop img {
    width: 34px;
  }

  .cd-battle-celebration-support,
  .cd-battle-celebration-card {
    font-size: 6px;
  }

  .cd-section-bar {
    padding: 8px 6px 6px;
  }

  .cd-section-buttons {
    gap: 5px;
  }

  .cd-section-button {
    padding: 8px 3px 6px;
    border-radius: 6px;
    box-shadow: var(--keycap-shadow-mobile);
  }

  .cd-section-button:active {
    box-shadow: var(--keycap-shadow-mobile-active);
    transform: translateY(3px);
  }

  .cd-section-button--active {
    box-shadow: var(--keycap-shadow-mobile-held);
    transform: translateY(1px);
  }

  .cd-section-icon {
    font-size: 8px;
  }

  .cd-section-label {
    display: none;
  }

  .cd-section-hotkey {
    display: block;
    font-size: 6px;
  }
}

/* Very small screens - even more compact */
@media (max-width: 360px) {
  .cd-section-buttons {
    gap: 4px;
  }

  .cd-section-button {
    padding: 6px 2px 5px;
  }

  .cd-section-icon {
    font-size: 7px;
  }
}

@media (min-width: 481px) {
  .cd-section-hotkey {
    display: none;
  }
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.cd-progress-bar {
  height: 4px;
  margin: 8px 4px 0;
  border-radius: 2px;
  background: #3a3a38;
  overflow: hidden;
}

.cd-progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--cd-screen);
  transition: width 0.3s ease;
}

.cd-progress-text {
  text-align: center;
  margin-top: 6px;
  font-family: var(--cd-font);
  font-size: 6px;
  color: var(--cd-text-gray);
  letter-spacing: 0.5px;
}

/* ============================================
   SPEAKER
   ============================================ */
.cd-speaker {
  display: flex;
  justify-content: center;
}

.cd-speaker-grille {
  display: flex;
  gap: 2px;
  padding: 6px 24px;
  border-radius: 999px;
  background: linear-gradient(145deg, #d0ccc4, #c0bcb4);
}

.cd-speaker-slot {
  width: 2px;
  height: 8px;
  border-radius: 1px;
  background: linear-gradient(180deg, #a0a098, #808078);
}

/* ============================================
   BRANDING
   ============================================ */
.cd-branding {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 12px 12px;
}

.cd-branding-logo {
  height: 54px;
  width: auto;
  image-rendering: pixelated;
}

/* Footer links below device */
.cd-device-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 32px 0 20px;
}

.cd-device-footer-link {
  font-family: var(--cd-font);
  font-size: 9px;
  color: #999;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.15s;
}

.cd-device-footer-link:hover {
  color: #FF00FF;
}

.cd-device-footer-sep {
  color: #ccc;
  font-size: 12px;
  user-select: none;
}

/* ============================================
   SHARED SITE FOOTER (all pages)
   ============================================ */
.cd-site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0 4px;
}

.cd-site-footer-logo {
  display: flex;
  justify-content: center;
}

.cd-site-footer-logo img {
  height: 48px;
  width: auto;
  image-rendering: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

@media (max-width: 480px) {
  .cd-site-footer-logo img {
    height: 40px;
  }
}

/* ============================================
   QUICK JUMP BUTTONS
   ============================================ */
.cd-quickjump {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid rgba(0,0,0,0.08);
}

.cd-quickjump-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--cd-font);
  text-align: left;
  transition: all 0.08s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;

  background: var(--keycap-gradient);
  box-shadow: var(--keycap-shadow);
  transform: translateY(0);
}

.cd-quickjump-btn:hover {
  background: var(--keycap-gradient-hover);
}

.cd-quickjump-btn:active {
  background: var(--keycap-gradient-active);
  box-shadow: var(--keycap-shadow-active);
  transform: translateY(4px);
}

.cd-quickjump-num {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--cd-screen);
  background: var(--cd-bezel-dark);
  border-radius: 6px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

.cd-quickjump-label {
  font-size: 11px;
  color: #404040;
  line-height: 1.6;
  letter-spacing: 0.5px;
}

/* Primary quickjump variant (black keycap) */
.cd-quickjump-btn--primary {
  background: var(--keycap-dark-gradient);
  border: none;
  box-shadow: var(--keycap-dark-shadow);
}

.cd-quickjump-btn--primary .cd-quickjump-num {
  background: rgba(255,255,255,0.15);
  color: #d0ccc4;
}

.cd-quickjump-btn--primary .cd-quickjump-label {
  color: #d0ccc4;
}

.cd-quickjump-btn--primary:hover {
  background: var(--keycap-dark-gradient-hover);
}

.cd-quickjump-btn--primary:hover .cd-quickjump-label {
  color: #e8e4dc;
}

.cd-quickjump-btn--primary:active {
  background: var(--keycap-dark-gradient-active);
  box-shadow: var(--keycap-dark-shadow-active);
  transform: translateY(4px);
}

/* Mobile quickjump */
@media (max-width: 480px) {
  .cd-quickjump {
    gap: 14px;
    margin-top: 20px;
    padding-top: 20px;
  }

  .cd-quickjump-btn {
    padding: 14px 16px;
    gap: 14px;
    border-radius: 8px;
    box-shadow: var(--keycap-shadow-mobile);
  }

  .cd-quickjump-btn:active {
    box-shadow: var(--keycap-shadow-mobile-active);
    transform: translateY(3px);
  }

  .cd-quickjump-num {
    width: 32px;
    height: 32px;
    font-size: 9px;
  }

  .cd-quickjump-label {
    font-size: 8px;
    line-height: 1.8;
  }

  .cd-quickjump-btn--primary {
    box-shadow: var(--keycap-dark-shadow-mobile);
  }

  .cd-quickjump-btn--primary:active {
    box-shadow: var(--keycap-dark-shadow-mobile-active);
  }
}

/* ============================================
   SCENE TYPOGRAPHY
   ============================================ */
.cd-text-xs { font-size: 4px; }
.cd-text-sm { font-size: 5px; }
.cd-text-base { font-size: 6px; }
.cd-text-md { font-size: 8px; }
.cd-text-lg { font-size: 10px; }
.cd-text-xl { font-size: 12px; }
.cd-text-2xl { font-size: 14px; }
.cd-text-hero { font-size: 48px; }

/* ============================================
   SCENE ELEMENTS
   ============================================ */
.cd-box {
  border: 2px solid var(--cd-dark);
  padding: 8px;
  background: var(--cd-bg);
}

.cd-highlight {
  background: var(--cd-dark);
  color: var(--cd-screen);
  padding: 2px 4px;
}

.cd-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--cd-dark);
  color: var(--cd-screen);
  font-family: var(--cd-font);
}

/* ============================================
   LOADING BAR
   ============================================ */
.cd-loading-bar {
  border: 2px solid var(--cd-dark);
  background: var(--cd-bg);
  padding: 1px;
}

.cd-loading-bar-fill {
  height: 100%;
  background: var(--cd-dark);
  transition: width 0.1s linear;
}

/* ============================================
   CHAPTER TRANSITIONS
   ============================================ */
.cd-chapter-fade {
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes cd-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes cd-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes cd-ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.cd-animate-pulse {
  animation: cd-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.cd-animate-bounce {
  animation: cd-bounce 1s infinite;
}

/* Floating award animations */
@keyframes cd-float-1 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes cd-float-2 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes cd-float-3 {
  0%, 100% { transform: translateY(-5px); }
  50% { transform: translateY(7px); }
}

/* Sprite frame animation — cycles through 4 frames in a row */
@keyframes cd-sprite-play {
  0%, 24.9%   { background-position-x: 0%; }
  25%, 49.9%  { background-position-x: 33.333%; }
  50%, 74.9%  { background-position-x: 66.666%; }
  75%, 100%   { background-position-x: 100%; }
}

/* Optional floating motion for sprites */
.cd-sprite-float {
  animation: cd-sprite-float 3s ease-in-out infinite;
}

@keyframes cd-sprite-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.cd-flex { display: flex; }
.cd-flex-col { flex-direction: column; }
.cd-items-center { align-items: center; }
.cd-justify-center { justify-content: center; }
.cd-justify-between { justify-content: space-between; }
.cd-gap-1 { gap: 4px; }
.cd-gap-2 { gap: 8px; }
.cd-gap-3 { gap: 12px; }
.cd-text-center { text-align: center; }
.cd-w-full { width: 100%; }
.cd-h-full { height: 100%; }
.cd-p-2 { padding: 8px; }
.cd-p-3 { padding: 12px; }
.cd-p-4 { padding: 16px; }
.cd-mt-2 { margin-top: 8px; }
.cd-mt-4 { margin-top: 16px; }
.cd-mb-2 { margin-bottom: 8px; }
.cd-mb-4 { margin-bottom: 16px; }
.cd-opacity-50 { opacity: 0.5; }
.cd-opacity-70 { opacity: 0.7; }

/* ============================================
   SCENE UTILITY CLASSES
   Used by scene JS files to replace inline styles.
   See docs/_TO-DO/19-EXTRACT-INLINE-STYLES/
   ============================================ */

/* Layout */
.cd-fill   { width: 100%; height: 100%; }
.cd-col    { display: flex; flex-direction: column; }
.cd-center { display: flex; align-items: center; justify-content: center; }
.cd-clip   { overflow: hidden; }
.cd-box    { box-sizing: border-box; }

/* Typography */
.cd-pixel  { font-family: 'Press Start 2P', monospace; }
.cd-pixel button,
.cd-pixel input,
.cd-pixel select,
.cd-pixel textarea { font-family: inherit; }
.cd-tc     { text-align: center; }

/* Rendering */
.cd-crisp  { image-rendering: pixelated; }
.cd-no-ptr { pointer-events: none; }

/* ============================================
   SPEECH BUBBLE STYLES
   ============================================ */
.cd-speech-bubble {
  position: relative;
  background: var(--cd-bg);
  border: 3px solid var(--cd-dark);
  padding: 16px 20px;
  box-shadow: 4px 4px 0 var(--cd-dark);
}

.cd-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 16px solid var(--cd-dark);
}

.cd-speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 12px solid var(--cd-bg);
  z-index: 1;
}

/* ============================================
   INTRO SPEECH BUBBLE - Big bold style
   ============================================ */
.cd-speech-intro-text {
  /* 12px at 320px → 28px at 1024px */
  font-size: clamp(12px, 1.5vw + 7px, 28px) !important;
  line-height: clamp(1.6, 1.8 - 0.2 * 1, 1.8) !important;
}

/* ============================================
   COVER TAGLINE - Frame 3 hero text
   ============================================ */
.cd-cover-tagline {
  /* 18px on small mobile → 28px on desktop */
  font-size: clamp(18px, 2vw + 12px, 28px) !important;
  line-height: 1.5 !important;
}

/* ============================================
   MOBILE RESPONSIVE - BOOT & INTRO SCREENS
   ============================================ */
@media (max-width: 480px) {
  /* Smaller text for mobile on these key screens */
  .cd-screen-content [style*="font-size:20px"] {
    font-size: 14px !important;
  }

  .cd-screen-content [style*="font-size:12px"] {
    font-size: 10px !important;
  }

  .cd-screen-content [style*="font-size:10px"] {
    font-size: 8px !important;
  }

  .cd-screen-content [style*="font-size:8px"] {
    font-size: 6px !important;
  }

  .cd-screen-content [style*="font-size:7px"] {
    font-size: 6px !important;
  }

  /* Adjust padding for mobile */
  .cd-screen-content [style*="padding:24px 20px"] {
    padding: 16px 12px !important;
  }

  .cd-screen-content [style*="padding:20px 16px"] {
    padding: 12px 10px !important;
  }
}

/* Mobile: device takes more width */
@media (max-width: 480px) {
  .cd-device {
    width: 96%;
    padding-top: 2vh;
  }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 767px) {
  .cd-device {
    width: 94%;
    padding-top: 2vh;
  }
}

/* Larger screens get enhanced sizing */
@media (min-width: 768px) {
  .cd-screen-content [style*="font-size:20px"] {
    font-size: 24px !important;
  }

  .cd-screen-content [style*="max-width:400px"] {
    max-width: 500px !important;
  }

  .cd-screen-content [style*="max-width:320px"] {
    max-width: 400px !important;
  }
}

/* ============================================
   OLD MAC PLASTIC TEXTURE & BEVEL
   ============================================ */

/* Noise grain overlay for plastic texture */
.cd-method-container::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* All direct children above the noise layer */
.cd-method-container > * {
  position: relative;
  z-index: 1;
}

/* ============================================
   CASE LOGO (inside device case, above bezel)
   ============================================ */
.cd-case-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 8px;
}

.cd-header-logo {
  height: auto;
  max-height: 36px;
  width: auto;
  max-width: 70%;
  image-rendering: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* ============================================
   LOGO
   ============================================ */
.cd-logo {
  display: flex;
  align-items: center;
}

.cd-logo img {
  height: 80px;
  width: auto;
  image-rendering: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

@media (max-width: 480px) {
  .cd-logo img {
    height: 72px;
  }
  .cd-speaker-grille {
    gap: 1.5px;
    padding: 4px 12px;
  }
  .cd-speaker-slot {
    width: 1.5px;
    height: 6px;
  }
  .cd-header-logo {
    max-height: 32px;
    max-width: 95%;
  }
  .cd-case-top {
    padding: 2px 8px 6px;
  }
}

@media (min-width: 768px) {
  .cd-logo img {
    height: 96px;
  }
}

/* ============================================
   VIEW TRIGGERS BUTTON (header pill)
   ============================================ */
.cd-view-triggers-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--cd-font);
  transition: all 0.08s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  flex-shrink: 0;

  background: var(--keycap-dark-gradient);
  box-shadow: var(--keycap-dark-shadow);
  transform: translateY(0);
}

.cd-view-triggers-btn:hover {
  background: var(--keycap-dark-gradient-hover);
}

.cd-view-triggers-btn:active {
  background: var(--keycap-dark-gradient-active);
  box-shadow: var(--keycap-dark-shadow-active);
  transform: translateY(4px);
}

.cd-view-triggers-label {
  font-size: 10px;
  color: #d0ccc4;
  letter-spacing: 1px;
  line-height: 1;
}

.cd-view-triggers-btn:hover .cd-view-triggers-label {
  color: #e8e4dc;
}

@media (max-width: 480px) {
  .cd-view-triggers-btn {
    padding: 12px 20px;
    box-shadow: var(--keycap-dark-shadow-mobile);
  }
  .cd-view-triggers-btn:active {
    box-shadow: var(--keycap-dark-shadow-mobile-active);
    transform: translateY(3px);
  }
  .cd-view-triggers-label {
    font-size: 8px;
  }
}

/* ============================================
   DEVICE CASE — old Mac bevel wrapper
   Light source: top-left (classic Mac lighting)
   ============================================ */
.cd-device-case {
  position: relative;
  border-radius: 16px;
  padding: 16px 16px 12px;

  /* Surface: very subtle lighter top to darker bottom */
  background: linear-gradient(180deg,
    rgba(255,255,255,0.06) 0%,
    transparent 40%,
    rgba(0,0,0,0.03) 100%
  );

  /* Thin border for edge definition — lighter top/left, darker bottom/right */
  border: 1px solid;
  border-color:
    rgba(255,255,255,0.55)   /* top - bright catchline */
    rgba(0,0,0,0.06)         /* right - subtle dark */
    rgba(0,0,0,0.12)         /* bottom - darker crease */
    rgba(255,255,255,0.35);  /* left - softer highlight */

  box-shadow:
    /* === TOP BEVEL: bright highlight flowing across === */
    inset 0 2px 1px rgba(255,255,255,0.7),
    inset 0 5px 10px rgba(255,255,255,0.2),

    /* === LEFT BEVEL: softer light === */
    inset 2px 0 1px rgba(255,255,255,0.4),
    inset 5px 0 8px rgba(255,255,255,0.08),

    /* === BOTTOM BEVEL: shadow/crease === */
    inset 0 -2px 1px rgba(0,0,0,0.1),
    inset 0 -5px 10px rgba(0,0,0,0.06),

    /* === RIGHT BEVEL: medium shadow === */
    inset -2px 0 1px rgba(0,0,0,0.07),
    inset -4px 0 8px rgba(0,0,0,0.04),

    /* === OUTER: shadow cast onto background surface === */
    /* Soft diffuse shadow beneath */
    0 12px 30px -4px rgba(0,0,0,0.14),
    0 6px 12px -2px rgba(0,0,0,0.08),
    /* Tight contact shadow at bottom edge */
    0 3px 4px rgba(0,0,0,0.06),
    /* Right-side ambient */
    3px 4px 10px rgba(0,0,0,0.04);
}

/* Top edge: bright light catchline spill above the case */
.cd-device-case::before {
  content: '';
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,255,255,0.6) 20%,
    rgba(255,255,255,0.8) 50%,
    rgba(255,255,255,0.6) 80%,
    transparent
  );
  pointer-events: none;
  z-index: 5;
}

/* Bottom edge: darker shadow line beneath the case */
.cd-device-case::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 4%;
  right: 4%;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(0,0,0,0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}

@media (max-width: 480px) {
  .cd-device-case {
    border-radius: 12px;
    padding: 10px 8px 8px;
  }
}

/* ============================================
   MOBILE TOUCH TARGETS (Task 05)
   Ensure minimum touch target sizes on mobile
   ============================================ */
@media (max-width: 480px) {
  /* Section buttons — ensure min height for touch */
  .cd-section-button {
    min-height: 44px;
    padding: 10px 3px 8px;
  }

  /* Progress dots — visual only, not interactive on mobile */
  .cd-progress-dot {
    cursor: default;
    pointer-events: none;
  }

  /* Sound toggle — ensure minimum tappable size */
  .cd-sound-toggle {
    min-height: 40px;
    min-width: 56px;
  }
}

@media (max-width: 360px) {
  .cd-section-button {
    min-height: 40px;
    padding: 8px 2px 6px;
  }
}

/* ============================================
   MOBILE FONT READABILITY (Task 06)
   Ensure minimum font sizes for legibility
   ============================================ */
@media (max-width: 480px) {
  /* Bump smallest text classes above readability floor */
  .cd-text-xs { font-size: 5px; }
  .cd-text-sm { font-size: 6px; }
  .cd-text-base { font-size: 6px; }

  /* Fix aggressive inline style overrides that push text below 6px */
  .cd-screen-content [style*="font-size:7px"] {
    font-size: 6px !important;
  }

  .cd-screen-content [style*="font-size:8px"] {
    font-size: 7px !important;
  }
}
