/* ==========================================================================
   TOMODACHI V16 — CANONICAL DESIGN SYSTEM & THEME
   Obsidian Dark Neon Aesthetic (Japanese Manga & Cyber-Clean Fusion)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Zen+Maru+Gothic:wght@500;700;900&display=swap');

:root {
  /* Core Obsidian Dark Palette */
  --bg-main: #0a0b10;
  --bg-surface: #12131e;
  --bg-surface-elevated: #1a1b2a;
  --bg-card: rgba(22, 24, 38, 0.85);
  --bg-card-hover: rgba(28, 31, 50, 0.95);
  --border-subtle: rgba(124, 58, 237, 0.18);
  --border-glass: rgba(255, 255, 255, 0.08);

  /* Vivid Neon Accent Tokens */
  --neon-lime: #ccff00;
  --neon-lime-glow: rgba(204, 255, 0, 0.35);
  --neon-lime-text: #000000;
  
  --neon-purple: #8b5cf6;
  --neon-purple-glow: rgba(139, 92, 246, 0.35);
  --neon-purple-dark: #6d28d9;

  --neon-pink: #ec4899;
  --neon-pink-glow: rgba(236, 72, 153, 0.35);

  --neon-cyan: #06b6d4;
  --neon-cyan-glow: rgba(6, 182, 212, 0.35);

  --neon-amber: #f59e0b;
  --neon-amber-glow: rgba(245, 158, 11, 0.35);

  --neon-emerald: #10b981;
  --neon-emerald-glow: rgba(16, 185, 129, 0.35);

  /* Typography & Neutral Colors */
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0a0b10;

  /* Spacing & Radii */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Elevation & Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-neon-lime: 0 6px 20px rgba(204, 255, 0, 0.4);
  --shadow-neon-purple: 0 6px 24px rgba(139, 92, 246, 0.45);

  /* Safe Area Mobile */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: -webkit-fill-available;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(236, 72, 153, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(204, 255, 0, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(85px + var(--sab));
  padding-top: var(--sat);
}

.view {
  flex: 1;
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.22s ease-out;
}

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

/* Typography */
.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.brush-heading {
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 40%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.4rem;
}

.japanese-char {
  font-family: 'Zen Maru Gothic', 'Hiragino Kaku Gothic ProN', sans-serif;
}

/* Mascot Hero Card */
.mascot-hero-card {
  position: relative;
  background: linear-gradient(145deg, rgba(30, 27, 60, 0.7) 0%, rgba(18, 19, 30, 0.9) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.mascot-hero-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.45) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.mascot-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--neon-lime);
  box-shadow: var(--shadow-neon-lime);
  object-fit: cover;
  background: #1e1b4b;
}

.speech-bubble {
  position: relative;
  background: var(--neon-cyan);
  color: #000000;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 4px 14px var(--neon-cyan-glow);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  left: 18px;
  bottom: -6px;
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: var(--neon-cyan) transparent transparent transparent;
}

/* Tactile Cards */
.card-tactile {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}

.card-tactile:active {
  transform: scale(0.985);
}

/* Goal Picker */
.goal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin: 1rem 0;
}

.goal-card {
  background: rgba(20, 22, 36, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.9rem 0.5rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.goal-card.active, .goal-card:hover {
  border-color: var(--neon-lime);
  background: rgba(35, 40, 25, 0.7);
  box-shadow: 0 0 16px var(--neon-lime-glow);
}

.goal-card .goal-icon {
  font-size: 1.75rem;
  margin-bottom: 0.2rem;
}

.goal-card .goal-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: #ffffff;
}

.goal-card .goal-desc {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.25;
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.category-card {
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.category-card:active {
  transform: scale(0.975);
}

.category-card.purple {
  background: linear-gradient(145deg, rgba(67, 28, 140, 0.6) 0%, rgba(24, 18, 48, 0.8) 100%);
  border-color: rgba(139, 92, 246, 0.35);
}
.category-card.pink {
  background: linear-gradient(145deg, rgba(131, 24, 67, 0.6) 0%, rgba(38, 16, 26, 0.8) 100%);
  border-color: rgba(236, 72, 153, 0.35);
}
.category-card.green {
  background: linear-gradient(145deg, rgba(20, 83, 45, 0.6) 0%, rgba(15, 30, 22, 0.8) 100%);
  border-color: rgba(204, 255, 0, 0.35);
}
.category-card.blue {
  background: linear-gradient(145deg, rgba(14, 60, 105, 0.6) 0%, rgba(12, 25, 40, 0.8) 100%);
  border-color: rgba(6, 182, 212, 0.35);
}
.category-card.amber {
  background: linear-gradient(145deg, rgba(120, 53, 15, 0.6) 0%, rgba(35, 20, 10, 0.8) 100%);
  border-color: rgba(245, 158, 11, 0.35);
  grid-column: span 2;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.category-name {
  font-weight: 800;
  font-size: 0.98rem;
}

.category-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  line-height: 1.35;
}

.category-arrow {
  align-self: flex-end;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  margin-top: 0.5rem;
}

/* Buttons */
.btn-neon-lime {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  background: var(--neon-lime);
  color: var(--neon-lime-text);
  font-weight: 900;
  font-size: 1.05rem;
  padding: 0.95rem 1.5rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-neon-lime);
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-neon-lime:active {
  transform: scale(0.98);
  filter: brightness(0.95);
}

.btn-secondary-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  cursor: pointer;
}

/* Roadmap */
.journey-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  margin: 1.25rem 0;
}

.journey-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.journey-node.active-pin {
  border-color: var(--neon-lime);
  box-shadow: 0 0 20px var(--neon-lime-glow);
  background: rgba(25, 30, 20, 0.9);
}

.journey-badge-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.journey-node.active-pin .journey-badge-number {
  background: var(--neon-lime);
  color: #000000;
  border-color: var(--neon-lime);
  box-shadow: var(--shadow-neon-lime);
}

.journey-content {
  flex: 1;
}

.journey-title {
  font-weight: 800;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.journey-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.journey-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.journey-progress-fill {
  height: 100%;
  background: var(--neon-lime);
  border-radius: 3px;
}

/* Waveform & Mic */
.waveform-box {
  width: 100%;
  height: 70px;
  background: rgba(20, 18, 38, 0.85);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 1rem;
}

.wave-bar {
  width: 4px;
  height: 12px;
  background: var(--neon-purple);
  border-radius: 2px;
  transition: height 0.1s ease;
}

.wave-bar.active {
  animation: wavePulse 0.8s infinite ease-in-out alternate;
}

@keyframes wavePulse {
  0% { height: 8px; background: var(--neon-purple); }
  50% { height: 42px; background: var(--neon-pink); }
  100% { height: 18px; background: var(--neon-lime); }
}

.mic-action-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0;
}

.mic-pulse-ring {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid var(--neon-purple);
  animation: pulseRing 1.8s infinite ease-out;
  pointer-events: none;
}

@keyframes pulseRing {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.45); opacity: 0; }
}

.btn-mic-main {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--neon-lime);
  color: #000000;
  border: 3px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  box-shadow: 0 0 30px var(--neon-lime-glow);
  transition: transform 0.15s ease;
}

.btn-mic-main:active {
  transform: scale(0.92);
}

/* ==========================================================================
   CUSTOM SVG ICONS STYLING (PREMIUM VECTOR GRAPHICS)
   ========================================================================== */
.svg-nav {
  width: 24px;
  height: 24px;
  display: block;
  transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.22s ease;
}

.svg-cat {
  width: 28px;
  height: 28px;
  display: block;
}

.svg-icon-logo {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 10px rgba(204, 255, 0, 0.45));
}

#nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11, 12, 19, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: var(--sab);
}

#nav .inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 64px;
  padding: 0 0.5rem;
}

#nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  transition: color 0.15s ease;
  flex: 1;
}

#nav a.active {
  color: var(--neon-lime);
}

#nav a.active .svg-nav {
  transform: scale(1.22);
  filter: drop-shadow(0 0 10px rgba(204, 255, 0, 0.6));
  stroke: var(--neon-lime);
  color: var(--neon-lime);
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(75px + var(--sab));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--neon-lime);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
