/*
 * 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;
}

/* ============================================
   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;
  margin-top: 8px;
  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);
}

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

/* ============================================
   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);
}

/* ============================================
   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;

  /* Keycap top surface - cream/ivory mechanical key look */
  background: linear-gradient(180deg,
    #faf8f4 0%,
    #f5f2ec 10%,
    #ede9e2 40%,
    #e5e1da 70%,
    #ddd9d2 100%
  );

  /* THE MAGIC: Mechanical keyboard 3D effect */
  box-shadow:
    /* Inner top highlight - light catching the edge */
    inset 0 1px 0 rgba(255,255,255,1),
    inset 0 2px 2px rgba(255,255,255,0.5),
    /* Subtle inner bottom shadow for convex surface */
    inset 0 -1px 2px rgba(0,0,0,0.03),
    /* THE KEY HEIGHT - solid color "sides" of the keycap */
    0 4px 0 #c9c5be,
    0 5px 0 #bab6af,
    0 6px 0 #a8a49d,
    /* Drop shadow on the plate */
    0 7px 3px rgba(0,0,0,0.15),
    0 8px 8px rgba(0,0,0,0.08);

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

.cd-section-button:hover {
  /* Brighter on hover */
  background: linear-gradient(180deg,
    #ffffff 0%,
    #faf8f4 10%,
    #f2efe8 40%,
    #eae6df 70%,
    #e2ded7 100%
  );
  color: #2a2a2a;
}

.cd-section-button:active {
  /* PRESSED DOWN - keycap bottoms out */
  background: linear-gradient(180deg,
    #e8e4dc 0%,
    #ebe7e0 20%,
    #f0ece5 60%,
    #ede9e2 100%
  );

  box-shadow:
    /* Pressed surface lighting */
    inset 0 1px 2px rgba(0,0,0,0.08),
    inset 0 2px 4px rgba(0,0,0,0.05),
    /* Height collapses */
    0 1px 0 #c9c5be,
    0 2px 0 #bab6af,
    /* Minimal shadow */
    0 2px 2px rgba(0,0,0,0.1);

  /* Physical press down movement */
  transform: translateY(4px);
}

.cd-section-button--active {
  color: #1a1a18;
  font-weight: normal;

  /* Active = held down slightly */
  background: linear-gradient(180deg,
    #e5e1da 0%,
    #ebe7e0 15%,
    #f0ece5 50%,
    #e8e4dd 100%
  );

  box-shadow:
    /* Slightly pressed in */
    inset 0 1px 2px rgba(0,0,0,0.06),
    /* Reduced height */
    0 2px 0 #c9c5be,
    0 3px 0 #bab6af,
    0 4px 0 #a8a49d,
    /* Shadow */
    0 4px 2px rgba(0,0,0,0.12),
    0 5px 5px rgba(0,0,0,0.06);

  transform: translateY(2px);
}

.cd-section-button--active:hover {
  background: linear-gradient(180deg,
    #eae6df 0%,
    #efebe4 15%,
    #f4f0e9 50%,
    #ece8e1 100%
  );
}

.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-section-bar {
    padding: 8px 6px 6px;
  }

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

  .cd-section-button {
    padding: 8px 3px 6px;
    border-radius: 6px;

    /* Shorter 3D height on mobile */
    box-shadow:
      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);
  }

  .cd-section-button:active {
    box-shadow:
      inset 0 1px 2px rgba(0,0,0,0.08),
      0 1px 0 #c9c5be,
      0 1px 2px rgba(0,0,0,0.1);
    transform: translateY(3px);
  }

  .cd-section-button--active {
    box-shadow:
      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);
    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;
  margin-bottom: 8px;
}

.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: flex-end;
  align-items: center;
  padding: 0 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: 16px 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;
}

/* ============================================
   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;

  /* Keycap surface */
  background: linear-gradient(180deg,
    #faf8f4 0%,
    #f5f2ec 10%,
    #ede9e2 40%,
    #e5e1da 70%,
    #ddd9d2 100%
  );

  /* 3D keycap effect */
  box-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);

  transform: translateY(0);
}

.cd-quickjump-btn:hover {
  background: linear-gradient(180deg,
    #ffffff 0%,
    #faf8f4 10%,
    #f2efe8 40%,
    #eae6df 70%,
    #e2ded7 100%
  );
}

.cd-quickjump-btn:active {
  background: linear-gradient(180deg,
    #e8e4dc 0%,
    #ebe7e0 20%,
    #f0ece5 60%,
    #ede9e2 100%
  );
  box-shadow:
    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);
  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: linear-gradient(180deg,
    #3a3a38 0%, #2e2e2c 10%, #242422 40%, #1c1c1a 70%, #141412 100%);
  border: none;
  box-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);
}

.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: linear-gradient(180deg,
    #4a4a48 0%, #3e3e3c 10%, #343432 40%, #2c2c2a 70%, #242422 100%);
}

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

.cd-quickjump-btn--primary:active {
  background: linear-gradient(180deg,
    #1c1c1a 0%, #202020 20%, #262624 60%, #222220 100%);
  box-shadow:
    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);
  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:
      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);
  }

  .cd-quickjump-btn:active {
    box-shadow:
      inset 0 1px 2px rgba(0,0,0,0.08),
      0 1px 0 #c9c5be,
      0 1px 2px rgba(0,0,0,0.1);
    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:
      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);
  }

  .cd-quickjump-btn--primary:active {
    box-shadow:
      inset 0 1px 3px rgba(0,0,0,0.4),
      0 1px 0 #4a4a48, 0 1px 2px rgba(0,0,0,0.15);
  }
}

/* ============================================
   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; }

/* ============================================
   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
   ============================================ */

/* Base mobile first */
.cd-speech-intro-text {
  font-size: 12px !important;
  line-height: 1.8 !important;
}

/* Larger mobile */
@media (min-width: 400px) {
  .cd-speech-intro-text {
    font-size: 14px !important;
  }
}

/* Tablet */
@media (min-width: 600px) {
  .cd-speech-intro-text {
    font-size: 20px !important;
    line-height: 1.6 !important;
  }
}

/* Desktop */
@media (min-width: 768px) {
  .cd-speech-intro-text {
    font-size: 24px !important;
  }
}

/* Large desktop */
@media (min-width: 1024px) {
  .cd-speech-intro-text {
    font-size: 28px !important;
  }
}

/* ============================================
   COVER TAGLINE - Frame 3 hero text
   ============================================ */

/* Base mobile - bigger! */
.cd-cover-tagline {
  font-size: 14px !important;
  line-height: 1.8 !important;
}

/* Larger mobile */
@media (min-width: 400px) {
  .cd-cover-tagline {
    font-size: 16px !important;
  }
}

/* Tablet */
@media (min-width: 600px) {
  .cd-cover-tagline {
    font-size: 18px !important;
    line-height: 1.7 !important;
  }
}

/* Desktop */
@media (min-width: 768px) {
  .cd-cover-tagline {
    font-size: 22px !important;
  }
}

/* Large desktop */
@media (min-width: 1024px) {
  .cd-cover-tagline {
    font-size: 26px !important;
    line-height: 1.6 !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: 5px !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;
}

/* ============================================
   DEVICE HEADER (logo + SND)
   ============================================ */
.cd-device-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 8px;
  margin-bottom: 8px;
}

/* ============================================
   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: 56px;
  }
  .cd-device-header {
    padding: 0 10px 0 4px;
    margin-bottom: 6px;
  }
}

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

/* ============================================
   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;
  }
}
