/* ==========================================================================
   🎨 DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  color-scheme: light;
  /* Colors */
  --primary: #FF0000;           /* YouTube Red */
  --primary-hover: #E60000;
  --primary-active: #C80000;
  --primary-light: #FFF0F0;
  --primary-gradient: linear-gradient(135deg, #FF3333 0%, #FF0000 100%);
  
  --secondary: #333333;
  --secondary-hover: #1A1A1A;
  --secondary-light: #F2F2F2;

  --accent: #FF5E5E;
  --success: #2ECC71;
  --success-hover: #27AE60;
  --success-light: #E8F8F0;

  --background: #F9F7F6;        /* Warm background */
  --surface: #FFFFFF;
  --border: #FFE5E5;
  --border-focus: #FF8888;
  
  --text: #1F1F1F;              /* Soft dark text */
  --text-muted: #706F6F;
  --text-light: #FFFFFF;

  /* Typography */
  --font-family: 'Outfit', 'M PLUS 1p', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Spacing & Borders */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition-fast: 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* bouncy */
  --transition-normal: 0.3s ease;
  --easing-bouncy: cubic-bezier(0.175, 0.885, 0.32, 1.275); /* animation 短縮表記用（delay 誤解釈を避けるため timing-function 単体） */

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(255, 0, 0, 0.03);
  --shadow-md: 0 12px 32px rgba(255, 0, 0, 0.06);
  --shadow-lg: 0 20px 48px rgba(255, 0, 0, 0.1);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  
  --link-color: #065FD4;        /* YouTube standard link blue */
  
  /* Layout */
  --max-width: 680px;

  /* 初回表示: ロゴ内アニメ（delay-motion ≒ 490ms）に合わせた入場タイミング */
  --page-intro-tagline-delay: 340ms;
  --page-intro-tagline-duration: 420ms;
  --page-intro-form-delay: 500ms;
  --page-intro-form-duration: 520ms;
}

/* タイムライン進行率 0→1（赤バー clip とドット位置の単一ソース・数値補間で滑らか） */
@property --timeline-travel {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

/* ==========================================================================
   🌙 DARK THEME VARIABLES
   ========================================================================== */
[data-theme="dark"] {
  color-scheme: dark;
  --background: #121212;        /* YouTube Dark background */
  --surface: #1E1E1E;
  --border: #332B2B;
  --border-focus: #CC0000;
  
  --secondary: #F1F1F1;         /* White borders for pop art in dark mode */
  --secondary-hover: #FFFFFF;
  --secondary-light: #2A2A2A;

  --text: #F1F1F1;              /* Soft light text */
  --text-muted: #AAAAAA;
  
  --link-color: #3EA6FF;        /* YouTube dark theme link blue */
  
  /* Pop box shadow adjust for dark mode */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   ✨ BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--background);
}

html,
body {
  transition: none;
}

body {
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  padding: 20px;
}

/* ==========================================================================
   🎈 BACKGROUND DECORATION BUBBLES
   ========================================================================== */
.bubble {
  position: fixed;
  border-radius: 50%;
  filter: blur(40px);
  z-index: -1;
  opacity: 0.4;
  will-change: transform;
  animation: float 20s infinite alternate ease-in-out;
}

.bubble-1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,0,0,0.2) 0%, rgba(255,255,255,0) 70%);
  top: -50px;
  left: -100px;
}

.bubble-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,94,94,0.15) 0%, rgba(255,255,255,0) 70%);
  bottom: 10%;
  right: -150px;
  animation-delay: -5s;
}

.bubble-3 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(255,0,0,0.1) 0%, rgba(255,255,255,0) 70%);
  top: 40%;
  left: 20%;
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-30px) scale(1.1); }
}

/* ==========================================================================
   🏛️ LAYOUT & HEADER
   ========================================================================== */
.app-header {
  text-align: center;
  margin-top: 0;
  margin-bottom: 22px;
  max-width: var(--max-width);
  width: 100%;
  position: relative;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.header-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 52px 0 clamp(-22px, -3.5vw, -12px);
}

.logoRoot.siteLogo {
  --logo-width: min(540px, 92vw);
}

/* Theme Switch Toggle */
.theme-switch-container {
  display: flex;
  justify-content: flex-start;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

/* Language Switch Toggle */
.lang-switch-container {
  display: flex;
  justify-content: flex-end;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
}

.btn-lang-toggle {
  background-color: var(--surface);
  border: 2px solid var(--secondary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 3px 3px 0 var(--secondary);
  transition: all var(--transition-fast);
  outline: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text);
}

.btn-lang-toggle:hover {
  transform: translate(-1px, -1px) scale(1.05);
  box-shadow: 4px 4px 0 var(--secondary);
}

.btn-lang-toggle:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--secondary);
}

.lang-label {
  display: block;
  pointer-events: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 54px auto 6px;
  padding: 0 58px;
}

.site-nav a,
.footer-nav a {
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  line-height: 1.35;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.site-nav a:hover,
.footer-nav a:hover,
.site-nav a[aria-current="page"],
.footer-nav a[aria-current="page"] {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.btn-theme-toggle {
  background-color: var(--surface);
  border: 2px solid var(--secondary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 3px 3px 0 var(--secondary);
  transition: all var(--transition-fast);
  outline: none;
}

.btn-theme-toggle:hover {
  transform: translate(-1px, -1px) rotate(15deg);
  box-shadow: 4px 4px 0 var(--secondary);
}

.btn-theme-toggle:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--secondary);
}

.theme-icon {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.tagline {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 700;
  padding: 0 15px;
  animation: introContentIn var(--page-intro-tagline-duration) ease-out var(--page-intro-tagline-delay) both;
}

.logoRoot {
  --logo-width: min(760px, 92vw);
  --timeline-start-position: 11.8%;
  --timeline-stop-position: 41.4%;
  --duration-intro: 185ms;
  --duration-progress: 1200ms;
  --duration-dot-start: 200ms;
  --duration-dot-settle: 200ms;
  --duration-click: 180ms;
  --duration-pop: 360ms;
  --delay-timeline: 90ms;
  --delay-progress: 230ms;
  --delay-motion-gap: 70ms;
  --delay-motion: calc(var(--delay-progress) + var(--duration-dot-start) + var(--delay-motion-gap));
  --delay-click: calc(var(--delay-motion) + var(--duration-progress));
  --delay-pop: calc(var(--delay-click) + 110ms);
  --ease-progress: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.24, 1.42, 0.36, 1);
  --play-press-scale: 0.94;
  --play-click-scale: 1.18;
  --dot-start-scale: 0.96;
  --dot-start-pop-scale: 1.04;
  --dot-stop-scale: 0.92;
  --jump-pop-distance: 20px;
  --jump-pop-scale: 1.1;
  --trail-scale: 1.14;
  --trail-opacity: 0.22;

  --timeline-travel: 0;
  animation: timelineTravel var(--duration-progress) var(--delay-motion) var(--ease-progress) forwards;

  display: block;
  inline-size: var(--logo-width);
  max-inline-size: 100%;
}

.logoStage {
  position: relative;
  inline-size: 100%;
  aspect-ratio: 2000 / 600;
  overflow: visible;
  isolation: isolate;
}

.logoStage > svg {
  position: absolute;
  inset: 0;
  display: block;
  inline-size: 100%;
  block-size: 100%;
  overflow: visible;
  transform-box: border-box;
  transform-origin: center;
  pointer-events: none;
}

.textBlack,
.textRed,
.timelineBase,
.timelineProgress,
.timelineDot,
.timelineDotCircle,
.playIconTrail,
.jumpIconTrail,
.playIcon,
.jumpIcon {
  fill: currentColor;
  will-change: clip-path, opacity, transform;
}

.textBlack {
  color: var(--text);
  opacity: 0;
  animation: logoPartFade var(--duration-intro) ease-out forwards;
}

.textRed {
  color: #d5412d;
  clip-path: inset(0 100% 0 0);
  animation: logoTextReveal var(--duration-progress) var(--delay-motion) var(--ease-progress) forwards;
}

.timelineBase {
  color: #cacccb;
  opacity: 0;
  animation: logoPartFade var(--duration-intro) var(--delay-timeline) ease-out forwards;
}

.timelineProgress {
  color: #d5412e;
  clip-path: inset(0 calc(100% - (var(--timeline-start-position) + (var(--timeline-stop-position) - var(--timeline-start-position)) * var(--timeline-travel))) 0 0);
}

.timelineDot {
  color: #fff;
  stroke: #d5432f;
  stroke-miterlimit: 10;
  stroke-width: 12px;
  transform: translate3d(calc((var(--timeline-stop-position) - var(--timeline-start-position)) * var(--timeline-travel)), 0, 0);
  backface-visibility: hidden;
  will-change: transform;
}

.timelineDotCircle {
  transform-box: fill-box;
  transform-origin: center;
  animation:
    dotStartKick var(--duration-dot-start) var(--delay-progress) ease-out both,
    dotStopSettle var(--duration-dot-settle) calc(var(--delay-motion) + var(--duration-progress)) ease-out forwards;
}

.playIcon,
.playIconTrail {
  color: #d5412d;
  transform-box: fill-box;
  transform-origin: center;
}

.jumpIcon,
.jumpIconTrail {
  color: #d5412d;
  transform-box: fill-box;
  transform-origin: center;
}

.playIcon {
  animation: playScale var(--duration-click) var(--delay-click) ease-out both;
}

.jumpIcon {
  animation: jumpScale var(--duration-pop) var(--delay-pop) var(--ease-pop) both;
}

.playIconTrail {
  opacity: 0;
  animation: playButtonTrail var(--duration-click) var(--delay-click) ease-out both;
}

.jumpIconTrail {
  opacity: 0;
  animation: iconTrail var(--duration-pop) var(--delay-pop) ease-out both;
}

@keyframes logoPartFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes logoTextReveal {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0 calc(100% - var(--timeline-stop-position)) 0 0);
  }
}

@keyframes timelineTravel {
  from {
    --timeline-travel: 0;
  }

  to {
    --timeline-travel: 1;
  }
}

@keyframes dotStartKick {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(var(--dot-start-scale));
  }
}

@keyframes dotStopSettle {
  0% {
    transform: scale(1);
  }

  48% {
    transform: scale(var(--dot-stop-scale));
  }

  100% {
    transform: scale(1);
  }
}

@keyframes playScale {
  0% {
    transform: scale(1);
  }

  28% {
    transform: scale(var(--play-press-scale));
  }

  64% {
    transform: scale(var(--play-click-scale));
  }

  100% {
    transform: scale(1);
  }
}

@keyframes playButtonTrail {
  0%,
  30% {
    opacity: 0;
    transform: scale(1);
  }

  64% {
    opacity: var(--trail-opacity);
    transform: scale(var(--play-click-scale));
  }

  100% {
    opacity: 0;
    transform: scale(var(--play-click-scale));
  }
}

@keyframes jumpScale {
  0%,
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }

  34% {
    transform: translateY(4px) scale(0.98) rotate(0deg);
  }

  62% {
    transform: translateY(calc(0px - var(--jump-pop-distance))) scale(var(--jump-pop-scale)) rotate(-5deg);
  }
}

@keyframes iconTrail {
  0% {
    opacity: 0;
    transform: scale(1);
  }

  36% {
    opacity: var(--trail-opacity);
  }

  100% {
    opacity: 0;
    transform: scale(var(--trail-scale));
  }
}

@media (prefers-reduced-motion: reduce) {
  .logoRoot {
    animation: none;
    --timeline-travel: 1;
  }

  .textBlack,
  .textRed,
  .timelineBase,
  .timelineProgress,
  .timelineDot,
  .timelineDotCircle,
  .playIconTrail,
  .jumpIconTrail,
  .playIcon,
  .jumpIcon {
    animation: none;
    will-change: auto;
  }

  .tagline,
  .input-card {
    animation: none;
  }

  .textBlack,
  .timelineBase {
    opacity: 1;
  }

  .textRed,
  .timelineProgress {
    clip-path: inset(0 calc(100% - var(--timeline-stop-position)) 0 0);
  }

  .timelineDot {
    transform: translate3d(calc(var(--timeline-stop-position) - var(--timeline-start-position)), 0, 0);
  }

  .timelineDotCircle {
    transform: scale(1);
  }

  .playIconTrail,
  .jumpIconTrail {
    opacity: 0;
  }

  .playIcon,
  .jumpIcon {
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

.app-main {
  max-width: var(--max-width);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-grow: 1;
}

.content-section {
  background-color: color-mix(in srgb, var(--surface) 82%, var(--background));
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
}

.content-section h2 {
  color: var(--secondary);
  font-size: 1.32rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 14px;
}

.content-section h3 {
  color: var(--secondary);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 8px;
}

.content-section p,
.content-section li {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.content-section p + p {
  margin-top: 12px;
}

.content-kicker {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.info-panel {
  border-left: 4px solid var(--primary);
  padding-left: 14px;
}

.content-section details {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}

.content-section details:first-of-type {
  border-top: none;
}

.content-section summary {
  color: var(--secondary);
  cursor: pointer;
  font-weight: 800;
  line-height: 1.45;
}

.content-section details p {
  margin-top: 8px;
}

/* ==========================================================================
   📦 CARDS (POP NEOMORPHISM LIGHT STYLE)
   ========================================================================== */
.card {
  background-color: var(--surface);
  border: 3px solid var(--secondary);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 6px 6px 0px var(--secondary); /* Pop 3D flat shadow */
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.input-card {
  animation: introContentIn var(--page-intro-form-duration) ease-out var(--page-intro-form-delay) both;
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0px var(--secondary);
}

.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   📝 FORM & INPUTS
   ========================================================================== */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row {
  display: flex;
  gap: 20px;
}

@media (max-width: 500px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

.flex-1 {
  flex: 1;
}

label {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-card label {
  flex-wrap: wrap;
  color: var(--secondary);
  line-height: 1.35;
}

.label-hint {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

input[type="url"],
input[type="text"] {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  font-family: var(--font-family);
  font-weight: 600;
  background-color: var(--background);
  border: 2px solid var(--secondary);
  border-radius: var(--radius-md);
  color: var(--text);
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

input[type="url"] {
  padding-right: 45px; /* space for clear button */
}

input[type="url"]::placeholder,
input[type="text"]::placeholder {
  color: #A0A0A0;
  font-weight: 500;
}

input[type="url"]:focus,
input[type="text"]:focus {
  background-color: var(--surface);
  border-color: var(--primary);
  box-shadow: var(--shadow-inner);
}

.btn-clear {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.btn-clear:hover {
  color: var(--primary);
}

.error-message {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  animation: shake 0.4s ease;
}

.time-preview {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 2px;
  background-color: var(--primary-light);
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-block;
  align-self: flex-start;
  border: 1px solid rgba(255, 0, 0, 0.15);
  animation: pulseLight 2s infinite ease-in-out;
}

/* Chips & Presets */
.quick-presets,
.comment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.chip-preset,
.chip-comment {
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 12px;
  background-color: var(--surface);
  border: 2px solid var(--secondary);
  border-radius: 30px;
  color: var(--secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 2px 2px 0 var(--secondary);
}

.chip-preset:hover,
.chip-comment:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--primary);
}

.chip-preset:active,
.chip-comment:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--primary);
}

/* ==========================================================================
   ⏱️ TIME STEPPER (Microwave-style display & buttons)
   ========================================================================== */
input.start-time-display {
  text-align: center;
  font-family: 'Outfit', var(--font-family);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 18px 18px;
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

input.start-time-display::placeholder {
  color: var(--primary);
  opacity: 0.35;
  font-weight: 800;
  letter-spacing: 2px;
}

input.start-time-display:focus {
  background-color: var(--surface);
  border-color: var(--primary);
}

.time-stepper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.time-stepper-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.35;
  margin-bottom: 2px;
}

.time-stepper-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.chip-stepper {
  min-width: 0;
  font-family: var(--font-family);
  font-size: clamp(0.78rem, 2.8vw, 0.9rem);
  font-weight: 800;
  padding: 10px clamp(8px, 2vw, 12px);
  background-color: var(--surface);
  border: 2px solid var(--secondary);
  border-radius: var(--radius-md);
  color: var(--secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 2px 2px 0 var(--secondary);
}

.chip-stepper:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--primary);
}

.chip-stepper:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--primary);
}

.chip-stepper-minus {
  background-color: var(--secondary-light);
}

.chip-stepper-reset {
  grid-column: span 2;
  background-color: var(--surface);
  border-style: dashed;
  color: var(--text-muted);
}

.chip-stepper-reset:hover {
  border-style: solid;
  background-color: var(--secondary-light);
  border-color: var(--secondary);
  color: var(--secondary);
  box-shadow: 3px 3px 0 var(--secondary);
}

.chip-stepper-reset:active {
  box-shadow: 1px 1px 0 var(--secondary);
}

/* ==========================================================================
   🔘 BUTTONS (POP 3D STYLE)
   ========================================================================== */
.btn {
  font-family: var(--font-family);
  font-size: 1.05rem;
  font-weight: 800;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  border: 3px solid var(--secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  text-decoration: none;
  outline: none;
}

.btn-svg-icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  object-fit: contain;
  flex: 0 0 auto;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-primary {
  background: var(--primary-gradient);
  color: var(--text-light);
  box-shadow: 4px 4px 0 var(--secondary);
}

.btn-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--secondary);
}

.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--secondary);
}

.btn-success {
  background-color: var(--success);
  color: var(--text-light);
  box-shadow: 4px 4px 0 var(--secondary);
}

.btn-success:hover {
  background-color: var(--success-hover);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--secondary);
}

.btn-success:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--secondary);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--secondary);
  box-shadow: 4px 4px 0 var(--secondary);
}

.btn-secondary:hover {
  background-color: var(--secondary-light);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--secondary);
}

.btn-secondary:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--secondary);
}

.btn-outline {
  background-color: transparent;
  color: var(--secondary);
  border-style: dashed;
  box-shadow: none;
}

.btn-outline:hover {
  border-style: solid;
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* ==========================================================================
   🖼️ THUMBNAIL PREVIEW
   ========================================================================== */
.preview-card {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: center;
  padding: 16px;
  background-color: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 4px 4px 0 var(--primary);
}

.preview-card:hover {
  box-shadow: 6px 6px 0 var(--primary);
}

@media (max-width: 500px) {
  .preview-card {
    flex-direction: column;
    text-align: center;
  }
}

.thumbnail-wrapper {
  position: relative;
  width: 160px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--secondary);
  flex-shrink: 0;
  box-shadow: 3px 3px 0 var(--secondary);
}

#thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 0, 0, 0.9);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  border: 2px solid white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  pointer-events: none;
}

.preview-details {
  flex-grow: 1;
}

.preview-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 4px;
}

.preview-desc {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Live Comment Customize inside Result Card */
.customize-box {
  background-color: var(--background);
  border: 2px solid var(--secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-inner);
}

.customize-box label {
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.customize-box input[type="text"] {
  padding: 10px 14px;
  font-size: 0.9rem;
}

/* Test Play Box & Clickable Blue Timestamp Link */
.test-play-box {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.test-play-link {
  font-family: var(--font-family);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 2px dashed var(--link-color);
  padding-bottom: 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.test-play-link:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
  border-bottom-style: solid;
  transform: scale(1.05);
}

.test-play-link:active {
  transform: scale(0.95);
}

/* ==========================================================================
   🎉 RESULT DISPLAY
   ========================================================================== */
.result-card {
  border-color: var(--success);
  box-shadow: 6px 6px 0 var(--success);
}

.result-card:hover {
  box-shadow: 8px 8px 0 var(--success);
}

.badge-success {
  background-color: var(--success-light);
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 30px;
  border: 2px solid var(--success);
  display: inline-block;
  margin-bottom: 20px;
  box-shadow: 2px 2px 0 var(--success);
}

.result-box {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

textarea#result-text {
  width: 100%;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 14px;
  border: 2.5px solid var(--secondary);
  border-radius: var(--radius-md);
  background-color: var(--background);
  resize: none;
  outline: none;
  color: var(--secondary);
  box-shadow: var(--shadow-inner);
}

.button-group {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 480px) {
  .button-group {
    flex-direction: column;
    gap: 12px;
  }
}

/* SNS Sharing Grid */
.share-sns-container {
  border-top: 2px dashed var(--border);
  padding-top: 20px;
  margin-bottom: 20px;
}

.share-label {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.share-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 480px) {
  .share-buttons {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.btn-sns {
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid var(--secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: white;
  box-shadow: 2px 2px 0 var(--secondary);
}

.btn-x {
  background-color: #000000;
}

.btn-x:hover {
  background-color: #222;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--secondary);
}

.btn-x:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--secondary);
}

.btn-line {
  background-color: #06C755;
}

.btn-line:hover {
  background-color: #05B04B;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--secondary);
}

.btn-line:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--secondary);
}

.btn-os {
  background-color: var(--surface);
  color: var(--secondary);
}

.btn-os:hover {
  background-color: var(--secondary-light);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--secondary);
}

.btn-os:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--secondary);
}

.icon-sns {
  width: 18px;
  height: 18px;
}

/* QR Code Display Box */
.qr-container {
  border-top: 2px dashed var(--border);
  padding-top: 20px;
}

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  background-color: var(--background);
  border-radius: var(--radius-md);
  border: 2px solid var(--secondary);
  animation: slideDown 0.4s var(--easing-bouncy);
}

#qrcode {
  padding: 10px;
  background-color: white;
  border-radius: 8px;
  border: 1.5px solid var(--secondary);
}

#qrcode img,
#qrcode canvas {
  display: block;
}

.qr-download-button {
  width: 100%;
  max-width: 220px;
  padding: 10px 14px;
  font-size: 0.85rem;
}

.qr-desc {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  max-width: 280px;
}

/* ==========================================================================
   🍞 TOAST NOTIFICATION
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--secondary);
  color: white;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: 30px;
  border: 2px solid white;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 9999;
  animation: popUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ==========================================================================
   🏛️ FOOTER
   ========================================================================== */
.app-footer {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.6;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  margin-bottom: 12px;
}

/* ==========================================================================
   📄 STATIC CONTENT PAGES
   ========================================================================== */
.static-header {
  max-width: 840px;
  width: 100%;
  text-align: center;
  padding-top: 18px;
}

.static-header .site-nav {
  margin: 18px auto 0;
  padding: 0;
}

.brand-link {
  color: var(--secondary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', var(--font-family);
  font-size: 1.6rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  color: var(--primary);
}

.static-main {
  max-width: 840px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex-grow: 1;
}

.static-hero {
  padding: 30px 0 4px;
}

.static-hero h1 {
  color: var(--secondary);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 12px;
}

.static-hero p {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 700;
  max-width: 660px;
  margin: 0 auto;
}

.static-section {
  background-color: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
}

.static-section h2 {
  color: var(--secondary);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 12px;
}

.static-section h3 {
  color: var(--secondary);
  font-size: 1rem;
  font-weight: 800;
  margin: 16px 0 8px;
}

.static-section p,
.static-section li {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.static-section p + p {
  margin-top: 12px;
}

.static-section ul,
.static-section ol {
  padding-left: 1.25rem;
}

.static-section li + li {
  margin-top: 8px;
}

.plain-link {
  color: var(--link-color);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.note-box {
  background-color: var(--primary-light);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  color: var(--secondary);
  font-weight: 800;
  padding: 16px;
}

.notice-list {
  display: grid;
  gap: 14px;
}

.notice-list > div {
  border-left: 4px solid var(--primary);
  padding-left: 14px;
}

.notice-list h3 {
  margin-top: 0;
}

@media (max-width: 640px) {
  body {
    padding: 16px;
  }

  .site-nav {
    margin-top: 58px;
    padding: 0 4px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .content-section,
  .static-section {
    padding: 20px;
  }
}

/* ==========================================================================
   🎬 ANIMATIONS
   ========================================================================== */
@keyframes introContentIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  0% { opacity: 0; transform: translateY(-20px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes scaleIn {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes slideDown {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes popUp {
  0% { opacity: 0; transform: translate(-50%, 20px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes pulseLight {
  0% { opacity: 1; }
  50% { opacity: 0.85; }
  100% { opacity: 1; }
}

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

/* Utility Hidden state */
.hidden {
  display: none !important;
}

/* テーマ切替の瞬間だけトランジションを殺し、要素ごとの色変化タイミングのズレを抑える */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition: none !important;
}

/* 背景 bubble の blur アニメーションが html/body の再描画を遅らせないよう、切替中は一時停止 */
.theme-transitioning .bubble {
  animation-play-state: paused !important;
}

/* 視差効果を減らす設定のユーザーへの配慮 (A11y / WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
