/**
 * BlueCat RPG — Modern Stylesheet Architecture
 * Using CSS Cascade Layers, Custom Properties (Tokens), BEM Naming,
 * GPU Hardware Acceleration, and Mobile-First Responsive Design.
 */

@layer reset, tokens, base, layout, components, states, utilities;

@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  button, input, select, textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.15;
    background: none;
    border: none;
    color: inherit;
  }

  /* Mobile Safari 16px input font-size invariant to avoid involuntary auto-zoom */
  @media (max-width: 768px) {
    select, input, textarea {
      font-size: 16px !important;
    }
  }

  select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem !important;
  }
}

@layer tokens {
  :root {
    /* Color Palette (Deep Sapphire & Luminous Cyan) */
    --color-abyss: #030712;
    --color-night: #050813;
    --color-surface: rgba(11, 19, 41, 0.75);
    --color-surface-hover: rgba(15, 23, 42, 0.88);
    --color-surface-card: rgba(15, 23, 42, 0.92);
    --color-surface-border: rgba(56, 189, 248, 0.22);
    --color-surface-border-strong: rgba(56, 189, 248, 0.55);

    --color-primary: #38bdf8;
    --color-primary-dark: #0284c7;
    --color-accent: #60a5fa;
    --color-glow: rgba(56, 189, 248, 0.35);

    --color-text-main: #f8fafc;
    --color-text-muted: #94a3b8;
    --color-text-accent: #7dd3fc;

    --color-stat-hunger: #38bdf8;
    --color-stat-energy: #fbbf24;
    --color-stat-mood: #f43f5e;
    --color-stat-bond: #a855f7;
    --color-stat-curiosity: #34d399;
    --color-stat-chaos: #ec4899;

    /* Spacing & Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* Shadows & Filters */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 25px var(--color-glow);
    --shadow-dialog: 0 20px 40px rgba(0, 0, 0, 0.7);

    /* Durations */
    --trans-fast: 160ms cubic-bezier(0.4, 0, 0.2, 1);
    --trans-normal: 280ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Dynamic Class & Mood Theme Overrides */
  body[data-class="gremlin"] {
    --color-glow: rgba(244, 63, 94, 0.4);
    --color-primary: #f43f5e;
    --color-surface-border: rgba(244, 63, 94, 0.3);
  }

  body[data-class="cosmic"], body[data-class="void"] {
    --color-glow: rgba(168, 85, 247, 0.45);
    --color-primary: #c084fc;
    --color-accent: #e879f9;
    --color-surface-border: rgba(192, 132, 252, 0.35);
  }

  body[data-class="sage"] {
    --color-glow: rgba(251, 191, 36, 0.4);
    --color-primary: #38bdf8;
    --color-accent: #fcd34d;
  }
}

@layer base {
  body {
    background-color: var(--color-night);
    color: var(--color-text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    position: relative;
  }

  /* Keyboard Focus Indicators */
  :focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
  }
}

@layer layout {
  #app-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    position: relative;
    overflow: hidden;
  }

  #bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
  }

  /* Stage Area with Sidebar Grid on Desktop */
  #main-stage-layout {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 1.5rem;
  }

  @media (min-width: 900px) {
    #main-stage-layout {
      grid-template-columns: 1fr 340px;
      gap: 2rem;
      padding: 0 3rem;
    }
  }

  #cat-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    cursor: default;
    position: relative;
  }

  #cat-wrapper {
    width: min(85vw, 420px);
    height: min(85vw, 420px);
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 15px 30px rgba(2, 6, 23, 0.7));
  }

  #cat-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
  }
}

@layer components {
  /* --- TOP HUD BAR --- */
  #top-bar {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--color-surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--color-surface-border);
    flex-wrap: wrap;
  }

  .brand-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .brand-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-primary) 20%, var(--color-primary-dark) 90%);
    box-shadow: 0 0 10px var(--color-primary);
  }

  .brand-title {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 40%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  /* RPG Level & XP Meter in Header */
  .hud-progression {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(15, 23, 42, 0.65);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-surface-border);
  }

  .level-badge {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--color-primary);
  }

  .xp-bar-container {
    width: 90px;
    height: 8px;
    background: rgba(2, 6, 23, 0.8);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
  }

  .xp-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    border-radius: 4px;
    transition: width var(--trans-normal);
  }

  .xp-text {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
  }

  .coins-display {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fde047;
    background: rgba(234, 179, 8, 0.12);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(234, 179, 8, 0.3);
  }

  .hud-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  .top-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--color-surface-border);
    color: var(--color-text-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
  }

  .top-btn:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-surface-border-strong);
    transform: translateY(-1px);
  }

  .top-btn.active {
    background: rgba(56, 189, 248, 0.18);
    border-color: var(--color-primary);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
  }

  /* Audio visualizer wave bars */
  .audio-waves {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
  }

  .wave-bar {
    width: 2.5px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 1px;
    transition: height 0.1s ease;
  }

  .top-btn.active .wave-bar:nth-child(1) { animation: wavePulse 0.7s infinite alternate ease-in-out; }
  .top-btn.active .wave-bar:nth-child(2) { animation: wavePulse 0.5s infinite alternate ease-in-out 0.15s; }
  .top-btn.active .wave-bar:nth-child(3) { animation: wavePulse 0.8s infinite alternate ease-in-out 0.3s; }
  .top-btn.active .wave-bar:nth-child(4) { animation: wavePulse 0.6s infinite alternate ease-in-out 0.2s; }

  @keyframes wavePulse {
    0% { height: 3px; }
    100% { height: 12px; }
  }

  /* --- STATS PANEL --- */
  #stats-panel {
    background: var(--color-surface-card);
    border: 1px solid var(--color-surface-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    z-index: 10;
  }

  @media (max-width: 899px) {
    #stats-panel {
      position: absolute;
      top: 4.5rem;
      left: 1rem;
      right: 1rem;
      max-height: calc(100vh - 12rem);
      overflow-y: auto;
      transform: translateY(-120%);
      opacity: 0;
      pointer-events: none;
      transition: all var(--trans-normal);
    }

    #stats-panel.mobile-open {
      transform: translateY(0);
      opacity: 1;
      pointer-events: auto;
    }
  }

  .stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--color-surface-border);
  }

  .class-badge, .status-chip {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-surface-border);
    background: rgba(2, 6, 23, 0.6);
  }

  .stat-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .stat-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-muted);
  }

  .stat-val {
    font-variant-numeric: tabular-nums;
    color: var(--color-text-main);
  }

  .stat-track {
    width: 100%;
    height: 7px;
    background: rgba(2, 6, 23, 0.7);
    border-radius: 4px;
    overflow: hidden;
  }

  .stat-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width var(--trans-normal);
  }

  #meter-hunger-fill { background: linear-gradient(90deg, #0284c7, var(--color-stat-hunger)); }
  #meter-energy-fill { background: linear-gradient(90deg, #d97706, var(--color-stat-energy)); }
  #meter-mood-fill { background: linear-gradient(90deg, #e11d48, var(--color-stat-mood)); }
  #meter-bond-fill { background: linear-gradient(90deg, #9333ea, var(--color-stat-bond)); }
  #meter-curiosity-fill { background: linear-gradient(90deg, #059669, var(--color-stat-curiosity)); }
  #meter-chaos-fill { background: linear-gradient(90deg, #db2777, var(--color-stat-chaos)); }

  .stat-fill.meter-low {
    filter: brightness(1.2);
  }

  .stat-fill.meter-critical {
    animation: meterBlink 1s infinite alternate ease-in-out;
  }

  @keyframes meterBlink {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
  }

  /* --- BOTTOM INTERACTIVE ACTION DOCK --- */
  #action-dock {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: var(--color-surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--color-surface-border);
    flex-wrap: wrap;
  }

  .dock-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--color-surface-border);
    color: var(--color-text-main);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
  }

  .dock-btn:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-surface-border-strong);
    transform: translateY(-2px);
  }

  .dock-btn.active {
    background: rgba(56, 189, 248, 0.22);
    border-color: var(--color-primary);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
  }

  .dock-btn-special {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(168, 85, 247, 0.35));
    border-color: rgba(168, 85, 247, 0.5);
  }

  .dock-btn-special:hover {
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.4);
  }

  .dock-icon {
    font-size: 1.25rem;
  }

  /* --- DIALOGS (NATIVE <dialog>) --- */
  dialog {
    margin: auto;
    background: rgba(11, 19, 41, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-surface-border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-dialog);
    color: var(--color-text-main);
    padding: 1.5rem;
    max-width: min(90vw, 540px);
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    outline: none;
  }

  dialog::backdrop {
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(6px);
  }

  .dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-surface-border);
  }

  .dialog-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-primary);
  }

  .dialog-close-btn {
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
  }

  .dialog-close-btn:hover {
    color: var(--color-text-main);
    background: rgba(255, 255, 255, 0.1);
  }

  /* Encounter specifics */
  .encounter-art {
    font-size: 3.5rem;
    text-align: center;
    margin: 0.5rem 0;
  }

  .encounter-narrative {
    font-size: 1rem;
    line-height: 1.5;
    color: #e2e8f0;
    margin-bottom: 1.25rem;
    text-align: center;
  }

  .choices-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }

  .choice-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--color-surface-border);
    cursor: pointer;
    text-align: left;
    transition: all var(--trans-fast);
  }

  .choice-btn:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.18);
    border-color: var(--color-primary);
    transform: translateX(4px);
  }

  .choice-key-badge {
    background: rgba(56, 189, 248, 0.2);
    color: var(--color-primary);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 800;
  }

  .choice-label {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
  }

  .choice-locked {
    opacity: 0.6;
    cursor: not-allowed;
  }

  .choice-lock-badge {
    font-size: 0.75rem;
    color: #f87171;
  }

  .outcome-box {
    text-align: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-surface-border);
  }

  .outcome-rare-badge {
    display: inline-block;
    color: #fde047;
    font-weight: 900;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
    animation: pulse 1s infinite alternate;
  }

  .outcome-narrative {
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 1rem;
  }

  .outcome-fx-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
  }

  .fx-pill {
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
  }

  .fx-pos { background: rgba(52, 211, 153, 0.2); color: #34d399; }
  .fx-neg { background: rgba(244, 63, 94, 0.2); color: #f43f5e; }

  .dialog-primary-btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
    transition: transform var(--trans-fast);
  }

  .dialog-primary-btn:hover {
    transform: scale(1.04);
  }

  /* Wardrobe Grid */
  .wardrobe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
  }

  .wardrobe-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
  }

  .wardrobe-card.equipped {
    border-color: var(--color-primary);
    background: rgba(56, 189, 248, 0.15);
  }

  .wardrobe-item-icon { font-size: 2.2rem; }
  .wardrobe-item-name { font-weight: 700; font-size: 0.85rem; }
  .wardrobe-item-slot { font-size: 0.7rem; color: var(--color-text-muted); }

  .wardrobe-action-btn {
    margin-top: 0.4rem;
    width: 100%;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(56, 189, 248, 0.2);
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
  }

  .wardrobe-action-btn:hover:not(:disabled) {
    background: var(--color-primary);
    color: #020617;
  }

  .wardrobe-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  /* Journal Lists */
  .journal-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
  }

  .journal-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--color-surface-border);
  }

  .journal-card-icon { font-size: 1.5rem; }
  .journal-card-name { font-weight: 700; font-size: 0.9rem; }
  .journal-card-meta { font-size: 0.75rem; color: var(--color-text-muted); }

  /* Endings cards */
  .ending-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    margin-bottom: 0.6rem;
  }

  .ending-card.unlocked {
    border-color: #fde047;
    box-shadow: 0 0 15px rgba(253, 224, 71, 0.2);
  }

  .ending-icon { font-size: 1.75rem; margin-right: 0.4rem; }
  .ending-title { font-weight: 800; font-size: 1rem; color: #fde047; margin-bottom: 0.25rem; }
  .ending-desc { font-size: 0.85rem; color: #cbd5e1; line-height: 1.4; }

  /* Settings Controls */
  .settings-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
  }

  .settings-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text-muted);
  }

  .settings-select, .settings-input, .settings-textarea {
    width: 100%;
    padding: 0.55rem 0.8rem;
    background: rgba(2, 6, 23, 0.8);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-md);
    color: var(--color-text-main);
  }

  .settings-textarea {
    height: 70px;
    font-family: monospace;
    font-size: 0.75rem;
    resize: none;
  }

  .btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fca5a5;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
  }

  .btn-danger:hover {
    background: #ef4444;
    color: #ffffff;
  }

  /* --- TOASTS --- */
  #toast-container {
    position: fixed;
    bottom: 5.5rem;
    right: 1.25rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
  }

  .toast-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(11, 19, 41, 0.95);
    border: 1px solid var(--color-primary);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem;
    color: var(--color-text-main);
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    transform: translateY(12px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .toast-item.toast-show {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  .toast-levelup {
    border-color: #fde047;
    box-shadow: 0 0 20px rgba(253, 224, 71, 0.3);
  }

  /* --- SPEECH BUBBLE --- */
  #speech-bubble {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translate(-50%, -20px) scale(0.9);
    background: rgba(11, 19, 41, 0.9);
    border: 1.5px solid var(--color-primary);
    border-radius: var(--radius-full);
    padding: 0.5rem 1.25rem;
    color: var(--color-text-main);
    font-weight: 700;
    font-size: 0.95rem;
    pointer-events: none;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 18px var(--color-glow);
    z-index: 15;
    white-space: nowrap;
  }

  #speech-bubble.visible {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }

  #laser-dot {
    position: fixed;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 16px #f87171, 0 0 30px #ef4444;
    pointer-events: none;
    z-index: 40;
    transform: translate(-50%, -50%);
    display: none;
  }

  /* Overlays */
  #disco-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s ease;
  }

  body.disco-active #disco-overlay {
    opacity: 0.22;
    background: radial-gradient(circle at 50% 50%, #f43f5e, #3b82f6, #8b5cf6, transparent);
    animation: discoSpin 4s linear infinite;
  }

  @keyframes discoSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
  }

  #sleep-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.65);
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.8s ease;
  }

  body.sleep-active #sleep-overlay {
    opacity: 1;
  }

  .gpu-layer {
    transform: translate3d(0, 0, 0);
    will-change: transform;
  }

  #paw-left, #paw-right {
    cursor: pointer;
    transition: filter 0.2s ease;
  }

  #paw-left:hover, #paw-right:hover {
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.75));
  }

  #cat-nose:hover {
    filter: drop-shadow(0 0 8px rgba(244, 63, 94, 0.85));
  }

  /* SEO Accessible Text Box */
  .seo-crawlable-info {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@layer utilities {
  @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;
    }
  }
}
