/* ============================================
   Media Art Writer - Global Styles
   Premium Dark Theme with Glassmorphism
   ============================================ */

/* CSS Custom Properties */
:root {
  /* Colors */
  --color-bg-primary: #0a0a0f;
  --color-bg-secondary: #12121a;
  --color-bg-glass: rgba(18, 18, 26, 0.7);
  --color-text-primary: #f0f0f5;
  --color-text-secondary: #9090a0;
  --color-accent: #6366f1;
  --color-accent-glow: rgba(99, 102, 241, 0.4);

  /* Dynamic Colors (overwritten per artwork) */
  --color-dynamic-primary: #6366f1;
  --color-dynamic-secondary: #8b5cf6;
  --color-dynamic-bg: #0a0a0f;

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;

  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;

  /* Shadows */
  --shadow-glow: 0 0 40px var(--color-accent-glow);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: clamp(14px, 1vw + 0.5rem, 18px);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* iOS Safari fixes */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* Touch Device Optimizations */
@supports (-webkit-touch-callout: none) {
  /* iOS specific fixes */
  .page-wrapper {
    min-height: -webkit-fill-available;
  }

  .viewer-container {
    height: -webkit-fill-available;
  }
}

/* Improve touch targets */
@media (hover: none) and (pointer: coarse) {
  /* Touch devices - larger tap targets */
  .control-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .mode-btn,
  .variant-btn {
    min-height: 36px;
  }

  .artist-card {
    /* Active state for touch feedback */
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
  }

  .artist-card:active {
    transform: scale(0.98);
  }

  /* Disable hover effects on touch */
  .artist-card:hover {
    transform: none;
  }

  .artist-card:hover .artist-enter {
    opacity: 1;
    transform: translateX(0);
  }

  .btn-primary:hover {
    transform: none;
  }
}

#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 3rem);
}

h2 {
  font-size: clamp(1.25rem, 3vw, 2.25rem);
}

h3 {
  font-size: clamp(1rem, 2vw, 1.5rem);
}

/* Links */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-text-primary);
}

/* Glassmorphism Card */
.glass-card {
  background: var(--color-bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* Layout */
.page-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px 32px;
  overflow: hidden;
}

.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 var(--spacing-lg);
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  flex-shrink: 0;
  width: 100%;
}

.logo {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--color-accent), #8b5cf6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  width: 60%;
  height: 60%;
  fill: none;
  stroke: white;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-primary);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
}

/* Language Toggle */
.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 0.8rem;
  height: 32px;
}

.lang-divider {
  opacity: 0.3;
  margin: 0 4px;
}

.lang-text {
  opacity: 0.4;
  transition: opacity 0.2s;
}

.lang-text.active {
  opacity: 1;
  font-weight: 600;
  color: var(--color-accent);
}

/* Button Base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-dynamic-secondary));
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 60px var(--color-accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary);
}

/* ============================================
   Homepage - Artist Selection
   ============================================ */

.hero {
  text-align: center;
  padding: var(--spacing-xl) 0;
  position: relative;
  /* Flex styles from index.css */
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  /* from top: -50% to top: 50% for vertical center */
  left: 50%;
  transform: translate(-50%, -50%);
  /* changed from translateX */
  width: min(800px, 80vw);
  /* increased base */
  height: min(300px, 80vw);
  /* changed from square */
  background: radial-gradient(ellipse, var(--color-accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  opacity: 0.7;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.section-label::before,
.section-label::after {
  content: '';
  width: 50px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent));
}

.section-label::after {
  background: linear-gradient(90deg, var(--color-accent), transparent);
}

.hero h1 {
  background: linear-gradient(135deg, #ffffff 0%, var(--color-accent) 50%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.hero-subtitle strong {
  color: var(--color-accent);
  font-weight: 500;
}

.hero p {
  /* Deprecated in favor of hero-subtitle */
  color: var(--color-text-secondary);
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  max-width: min(600px, 90vw);
  margin: 0 auto;
}

/* Artist Section & Grid */
.artists-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0 16px;
  min-height: 0;
}

.artists-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Fixed to 3 cols */
  grid-template-rows: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 280px);
  /* Fit viewport logic */
  padding: 0;
  /* Remove padding from style.css var */
}

/* Artist Card */
.artist-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  background: var(--card-bg, rgba(20, 20, 30, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
}

.artist-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: var(--card-bg-hover, rgba(30, 30, 45, 0.95));
  transform: translateY(-4px);
  /* reduced movement */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.artist-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
      var(--card-color-1, var(--color-accent)) 0%,
      var(--card-color-2, var(--color-dynamic-secondary)) 100%);
  opacity: 0.15;
  transition: opacity var(--transition-normal);
  pointer-events: none;
}

.artist-card:hover::before {
  opacity: 0.25;
}

.card-preview-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

.artist-card:hover .card-preview-canvas {
  opacity: 0.8;
}

.artist-card-content {
  position: relative;
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  z-index: 1;
  overflow: hidden;
}

.artist-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.15;
  color: #ffffff;
}

.artist-theme {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 10px;
  align-self: flex-start;
}

.artist-theme-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
}

.artist-description {
  font-size: 14px;
  color: rgba(220, 220, 230, 0.9);
  line-height: 1.55;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.artist-colors {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.artist-enter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  border-radius: 50%;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease;
}

.artist-card:hover .artist-enter {
  opacity: 1;
  transform: translateX(0);
}

.artist-enter svg {
  width: 50%;
  height: 50%;
  fill: white;
  stroke: none;
}

.footer {
  display: none;
}

/* 3D Gallery Banner */
.gallery3d-banner {
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.gallery3d-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.08), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(0, 255, 170, 0.2);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text-primary);
  transition: all var(--transition-normal);
}

.gallery3d-link:hover {
  border-color: rgba(0, 255, 170, 0.5);
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.12), rgba(99, 102, 241, 0.12));
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 255, 170, 0.15);
}

.gallery3d-content {
  flex: 1;
}

.gallery3d-badge {
  display: inline-block;
  padding: 2px 10px;
  background: #00ffaa;
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.gallery3d-content h2 {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.gallery3d-content p {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.gallery3d-link svg {
  opacity: 0.5;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.gallery3d-link:hover svg {
  opacity: 1;
  transform: translateX(4px);
}

/* ============================================
   Viewer Styles
   ============================================ */

.viewer-container {
  position: fixed;
  inset: 0;
  background: var(--color-bg-primary);
  width: 100%;
  height: 100%;
}

.artwork-wrapper {
  position: absolute;
  inset: 0;
}

/* 배경 이미지 레이어 */
.artwork-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

#generativeCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.info-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 32px 32px;
  background: linear-gradient(to top, rgba(5, 5, 10, 0.98) 20%, rgba(10, 10, 15, 0.9) 60%, transparent 100%);
  z-index: 10;
  transition: opacity 0.5s ease;
  pointer-events: none;
  opacity: 0;
}

.viewer-container.show-controls .info-overlay {
  opacity: 1;
  pointer-events: auto;
}

.info-overlay>* {
  pointer-events: auto;
}

.artwork-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.artwork-title {
  font-size: clamp(0.95rem, 2vw, 1.4rem);
  margin-bottom: 0;
  line-height: 1.2;
}

/* Viewer Split Layout */
.info-split {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.info-left {
  flex: 1;
  max-width: 60%;
}

.info-right {
  flex: 0 0 auto;
  max-width: 35%;
  text-align: right;
}

.artist-profile-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0.8;
  align-items: flex-end;
}

.artist-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.artist-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-accent);
}

.artwork-description {
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
}

.artwork-description.daily {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.4);
  white-space: pre-wrap;
  line-height: 1.4;
  margin-bottom: 8px;
  width: 100%;
  transition: color 0.2s;
}

.artwork-description.daily:hover {
  color: rgba(255, 255, 255, 0.8);
}

.artwork-description.static {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  opacity: 0.9;
  text-align: right;
}

/* Viewer New Layout Styles */
.artist-section-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
  margin-bottom: 6px;
  display: block;
}

.artist-name-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 6px;
}

.artist-name-label {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: white;
}

.artist-colors-inline {
  display: flex;
  gap: 4px;
}

.artist-colors-inline .color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.prompt-section {
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.prompt-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-text-secondary);
  opacity: 0.5;
  flex-shrink: 0;
}

.divider {
  width: 100%;
  max-width: 40px;
  height: 1px;
  background: linear-gradient(90deg, var(--color-accent), transparent);
  margin: 20px 0;
  opacity: 0.4;
}

.meta-info {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  align-items: center;
  margin-bottom: 12px;
}

.meta-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: transparent;
  padding: 2px 0;
  color: var(--color-text-secondary);
  border: none;
  opacity: 0.6;
}

.prompt-details {
  margin-top: 8px;
  padding: 0;
  background: transparent;
  border: none;
  max-width: 100%;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  padding-left: 12px;
}

.prompt-details h3 {
  display: none;
  /* Hide header */
}

.prompt-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: pre-wrap;
  line-height: 1.4;
  transition: color 0.2s;
}

.prompt-text:hover {
  color: rgba(255, 255, 255, 0.8);
}

.controls {
  position: absolute;
  top: 32px;
  right: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.viewer-container.show-controls .controls {
  opacity: 1;
  pointer-events: auto;
}

/* Top Controls Container (Date + Animation) */
.top-controls {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.viewer-container.show-controls .top-controls {
  opacity: 1;
  pointer-events: auto;
}

.top-controls.hidden {
  display: none !important;
}

/* Heartbeat Animation */
@keyframes heartbeat {
  0%, 100% { background: rgba(255, 255, 255, 0.1); }
  15% { background: rgba(255, 255, 255, 0.25); }
  30% { background: rgba(255, 255, 255, 0.1); }
  45% { background: rgba(255, 255, 255, 0.2); }
  60% { background: rgba(255, 255, 255, 0.1); }
}

/* Date Controls */
.date-controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: rgba(20, 20, 30, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.date-nav-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.date-nav-btn:hover:not(:disabled) {
  color: white;
  animation: heartbeat 0.8s ease-in-out infinite;
}

.date-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.date-nav-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.date-picker-wrapper {
  position: static;
}

.date-picker-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: white;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.date-picker-btn:hover {
  animation: heartbeat 0.8s ease-in-out infinite;
}

.date-picker-btn svg {
  width: 14px;
  height: 14px;
  stroke: var(--color-text-secondary);
  stroke-width: 2;
  fill: none;
}

/* Date input positioned at center of date controls area */
#datePicker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1px;
  height: 1px;
  opacity: 0;
  border: none;
  padding: 0;
}

/* Ensure date-controls is the positioning context */
.date-controls {
  position: relative;
}

/* Animation Controls (2 Row Layout) */
.animation-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: rgba(20, 20, 30, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.mode-buttons,
.variant-buttons {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.variant-buttons {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 6px;
}


.mode-btn {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 50px;
}

.mode-btn:hover,
.mode-btn.active:hover {
  color: white;
  animation: heartbeat 0.8s ease-in-out infinite;
}

.mode-btn.active {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 0 15px var(--color-accent-glow);
}

.mode-btn.active:hover {
  background: var(--color-accent);
}

.variant-btn {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 40px;
}

.variant-btn:hover,
.variant-btn.active:hover {
  color: white;
  animation: heartbeat 0.8s ease-in-out infinite;
}

.variant-btn.active {
  background: rgba(139, 92, 246, 0.3);
  color: white;
  border: 1px solid var(--color-accent);
}

.variant-btn.active:hover {
  background: rgba(139, 92, 246, 0.3);
}

.control-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--color-text-primary);
  cursor: pointer;
}

.control-btn:hover {
  animation: heartbeat 0.8s ease-in-out infinite;
}

.control-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.back-btn {
  position: absolute;
  top: 32px;
  left: 32px;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.viewer-container.show-controls .back-btn {
  opacity: 1;
  pointer-events: auto;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--color-bg-primary);
  z-index: 100;
  transition: opacity 0.5s;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.35s ease forwards;
  opacity: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

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

/* ============================================
   Responsive Design - Tablet & Mobile
   ============================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
  :root {
    --spacing-lg: 1.5rem;
    --spacing-xl: 2.5rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  /* Page Layout */
  .page-wrapper {
    padding: 12px 16px;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .container {
    padding: 0 var(--spacing-sm);
  }

  /* Header */
  .header {
    height: 44px;
  }

  .logo {
    font-size: 16px;
    gap: 8px;
  }

  .logo-icon {
    width: 28px;
    height: 28px;
  }

  /* Hero */
  .hero {
    height: auto;
    min-height: 120px;
    padding: var(--spacing-lg) 0;
  }

  .section-label {
    font-size: 10px;
  }

  .section-label::before,
  .section-label::after {
    width: 30px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  /* Artists Grid - 2 columns on tablet */
  .artists-section {
    padding: 8px 0 16px;
  }

  .artists-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    gap: 10px;
    max-height: none;
    height: auto;
  }

  /* Artist Card */
  .artist-card {
    border-radius: 12px;
    min-height: 140px;
  }

  .artist-card-content {
    padding: 12px;
  }

  .artist-name {
    font-size: 20px;
    margin-bottom: 6px;
  }

  .artist-theme-badge {
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    font-size: 9px;
  }

  .artist-description {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }

  .artist-colors {
    gap: 4px;
    padding-top: 8px;
  }

  .color-dot {
    width: 12px;
    height: 12px;
  }

  .artist-enter {
    width: 28px;
    height: 28px;
    bottom: 10px;
    right: 10px;
  }

  /* Viewer Page */
  .controls {
    top: 16px;
    right: 16px;
    gap: 6px;
  }

  .control-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .control-btn svg {
    width: 18px;
    height: 18px;
  }

  .back-btn {
    top: 16px;
    left: 16px;
  }

  /* Top Controls */
  .top-controls {
    top: 16px;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .date-controls {
    padding: 5px;
    border-radius: 8px;
  }

  .date-nav-btn {
    width: 28px;
    height: 28px;
  }

  .date-nav-btn svg {
    width: 14px;
    height: 14px;
  }

  .date-picker-btn {
    font-size: 0.7rem;
    padding: 4px 10px;
    gap: 6px;
  }

  .date-picker-btn svg {
    width: 12px;
    height: 12px;
  }

  /* Animation Controls */
  .animation-controls {
    padding: 6px;
    border-radius: 10px;
    max-width: calc(100vw - 140px);
  }

  .mode-buttons,
  .variant-buttons {
    gap: 4px;
    flex-wrap: wrap;
  }

  .mode-btn {
    font-size: 0.65rem;
    padding: 5px 8px;
    min-width: 40px;
    border-radius: 6px;
  }

  .variant-btn {
    font-size: 0.6rem;
    padding: 3px 8px;
    min-width: 32px;
  }

  /* Info Overlay */
  .info-overlay {
    padding: 40px 20px 24px;
  }

  .info-split {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .info-left {
    max-width: 100%;
  }

  .info-right {
    max-width: 100%;
    text-align: left;
    width: 100%;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .artist-profile-group {
    align-items: flex-start;
  }

  .artist-name-row {
    justify-content: flex-start;
  }

  .artwork-description.static {
    text-align: left;
  }

  .artwork-title {
    font-size: 1.1rem;
  }

  .artwork-description.daily {
    font-size: 0.7rem;
  }

  .meta-info {
    margin-top: 16px;
    flex-wrap: wrap;
  }

  .meta-tag {
    font-size: 0.65rem;
  }

  .prompt-section {
    margin-top: 10px;
    flex-direction: column;
    gap: 4px;
  }

  .prompt-text {
    font-size: 0.7rem;
  }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
  :root {
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  /* Page Layout */
  .page-wrapper {
    padding: 10px 12px;
  }

  .container {
    padding: 0;
  }

  /* Header */
  .header {
    height: 40px;
  }

  .logo {
    font-size: 14px;
    gap: 6px;
  }

  .logo-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
  }

  .btn-sm {
    padding: 3px 10px;
    font-size: 0.75rem;
    height: 28px;
  }

  /* Hero */
  .hero {
    min-height: 100px;
    padding: var(--spacing-md) 0;
  }

  .section-label {
    font-size: 9px;
    gap: 6px;
  }

  .section-label::before,
  .section-label::after {
    width: 20px;
  }

  .hero h1 {
    margin-bottom: 10px;
  }

  .hero-subtitle {
    font-size: 13px;
  }

  /* Artists Grid - 1 column on mobile */
  .artists-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Artist Card */
  .artist-card {
    min-height: 120px;
    border-radius: 10px;
  }

  .artist-card-content {
    padding: 10px;
  }

  .artist-name {
    font-size: 18px;
  }

  .artist-theme-badge {
    padding: 2px 6px;
    font-size: 8px;
  }

  .artist-description {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }

  .color-dot {
    width: 10px;
    height: 10px;
  }

  .artist-enter {
    width: 26px;
    height: 26px;
  }

  /* Viewer Page */
  .controls {
    top: 12px;
    right: 12px;
    gap: 5px;
    flex-direction: column;
    align-items: flex-end;
  }

  .control-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .control-btn svg {
    width: 16px;
    height: 16px;
  }

  .back-btn {
    top: 12px;
    left: 12px;
  }

  /* Sound Controls */
  .sound-controls {
    padding: 4px 6px;
    border-radius: 6px;
  }

  .volume-slider {
    width: 45px;
    height: 3px;
  }

  .volume-value {
    font-size: 0.55rem;
    min-width: 22px;
  }

  /* Top Controls - Compact mobile layout */
  .top-controls {
    top: 12px;
    gap: 6px;
  }

  .date-controls {
    padding: 4px;
    gap: 2px;
  }

  .date-nav-btn {
    width: 26px;
    height: 26px;
  }

  .date-picker-btn {
    font-size: 0.65rem;
    padding: 4px 8px;
    gap: 4px;
  }

  /* Animation Controls - Compact mobile layout */
  .animation-controls {
    max-width: calc(100vw - 120px);
    padding: 5px;
    border-radius: 8px;
  }

  .mode-buttons {
    gap: 3px;
  }

  .mode-btn {
    font-size: 0.6rem;
    padding: 4px 6px;
    min-width: 36px;
    border-radius: 5px;
  }

  .variant-buttons {
    padding-top: 4px;
    gap: 3px;
  }

  .variant-btn {
    font-size: 0.55rem;
    padding: 3px 6px;
    min-width: 28px;
    border-radius: 4px;
  }

  .info-overlay {
    padding: 60px 16px 20px;
    background: linear-gradient(to top, rgba(5, 5, 10, 0.98) 40%, rgba(10, 10, 15, 0.9) 80%, transparent 100%);
  }

  .info-split {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .artwork-title {
    font-size: 1rem;
  }

  .artwork-description.daily {
    font-size: 0.65rem;
    margin-bottom: 6px;
  }

  .meta-info {
    margin-top: 12px;
    margin-bottom: 8px;
    gap: 8px;
  }

  .meta-tag {
    font-size: 0.6rem;
  }

  .prompt-label {
    font-size: 0.6rem;
  }

  .prompt-text {
    font-size: 0.65rem;
  }

  .info-right {
    padding-top: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .artist-section-title {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.8);
  }

  .artist-name-label {
    font-size: 0.85rem;
    color: #fff;
  }

  .artist-colors-inline .color-dot {
    width: 8px;
    height: 8px;
  }

  .artwork-description.static {
    font-size: 0.7rem;
  }

  /* Loading overlay */
  .loading-overlay p {
    font-size: 0.75rem;
  }

  .loading-spinner {
    width: 32px;
    height: 32px;
  }
}

/* Extra small mobile (360px and below) */
@media (max-width: 360px) {
  .hero h1 {
    font-size: 1.25rem;
  }

  .hero-subtitle {
    font-size: 12px;
  }

  .artist-name {
    font-size: 16px;
  }

  .artist-description {
    font-size: 10px;
  }

  .animation-controls {
    max-width: calc(100vw - 100px);
  }

  .mode-btn {
    font-size: 0.55rem;
    padding: 3px 5px;
    min-width: 32px;
  }

  .variant-btn {
    font-size: 0.5rem;
    padding: 2px 5px;
    min-width: 24px;
  }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .page-wrapper {
    height: auto;
    min-height: 100vh;
  }

  .hero {
    min-height: 80px;
    padding: var(--spacing-sm) 0;
  }

  .artists-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .artist-card {
    min-height: 100px;
  }

  .info-overlay {
    padding: 20px 16px 16px;
  }

  .info-split {
    flex-direction: row;
    align-items: flex-end;
  }

  .info-left {
    max-width: 55%;
  }

  .info-right {
    max-width: 40%;
    text-align: right;
    border-top: none;
    padding-top: 0;
  }

  .artist-profile-group {
    align-items: flex-end;
  }

  .artist-name-row {
    justify-content: flex-end;
  }

  .artwork-description.static {
    text-align: right;
  }
}

/* ============================================
   Swipe Hint & Transition
   ============================================ */

.swipe-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 30;
}

.swipe-hint.show {
  opacity: 1;
}

.swipe-arrows {
  position: relative;
  width: 80px;
  height: 80px;
}

.swipe-arrows .arrow {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0.6;
}

.swipe-arrows .arrow.up {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 12px solid var(--color-text-primary);
  animation: pulseUp 1.5s ease-in-out infinite;
}

.swipe-arrows .arrow.down {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid var(--color-text-primary);
  animation: pulseDown 1.5s ease-in-out infinite;
}

.swipe-arrows .arrow.left {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 12px solid var(--color-text-primary);
  animation: pulseLeft 1.5s ease-in-out infinite;
}

.swipe-arrows .arrow.right {
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid var(--color-text-primary);
  animation: pulseRight 1.5s ease-in-out infinite;
}

@keyframes pulseUp {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
  50% { transform: translateX(-50%) translateY(-5px); opacity: 1; }
}

@keyframes pulseDown {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
  50% { transform: translateX(-50%) translateY(5px); opacity: 1; }
}

@keyframes pulseLeft {
  0%, 100% { transform: translateY(-50%) translateX(0); opacity: 0.6; }
  50% { transform: translateY(-50%) translateX(-5px); opacity: 1; }
}

@keyframes pulseRight {
  0%, 100% { transform: translateY(-50%) translateX(0); opacity: 0.6; }
  50% { transform: translateY(-50%) translateX(5px); opacity: 1; }
}

.swipe-labels {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-text-secondary);
}

/* Transition Overlay */
.transition-overlay {
  position: absolute;
  inset: 0;
  background: var(--color-bg-primary);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.3s ease;
}

.transition-overlay.active {
  opacity: 1;
}

/* Slide Animations */
@keyframes slideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-30px); opacity: 0; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(30px); opacity: 0; }
}

@keyframes slideOutUp {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-30px); opacity: 0; }
}

@keyframes slideOutDown {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(30px); opacity: 0; }
}

.slide-out-left { animation: slideOutLeft 0.3s ease forwards; }
.slide-out-right { animation: slideOutRight 0.3s ease forwards; }
.slide-out-up { animation: slideOutUp 0.3s ease forwards; }
.slide-out-down { animation: slideOutDown 0.3s ease forwards; }

/* ============================================
   Sound Controls
   ============================================ */

/* Sound Toggle Button Active State */
.control-btn#soundToggleBtn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 15px var(--color-accent-glow);
}

.control-btn#soundToggleBtn.active svg {
  stroke: white;
}

/* Sound Controls Container - .controls 자식으로 배치 */
.sound-controls {
  position: relative;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(20, 20, 30, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* Show volume controls only when sound is enabled */
.viewer-container.sound-enabled .sound-controls {
  display: flex;
}

/* Volume Control */
.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Volume Slider */
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--color-accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--color-accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* Volume Value Display */
.volume-value {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  min-width: 35px;
  text-align: right;
}

/* Responsive: Tablet */
@media (max-width: 768px) {
  .sound-controls {
    padding: 6px 10px;
  }

  .volume-slider {
    width: 60px;
  }

  .volume-value {
    font-size: 0.65rem;
    min-width: 30px;
  }
}

