@tailwind base;
@tailwind components;
@tailwind utilities;

/* Design tokens live in theme-tokens.css (imported via layout.tsx) */

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
  background: var(--bg-app);
}

/* === Mobile PWA: safe-area insets for notched devices === */
@supports (padding-top: env(safe-area-inset-top)) {
  .safe-area-top {
    padding-top: env(safe-area-inset-top, 0px);
  }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* Quest input highlight: gentle amber glow on input area */
@keyframes quest-glow {
  0%,
  100% {
    box-shadow: 0 0 4px rgba(245, 158, 11, 0.3);
  }
  50% {
    box-shadow:
      0 0 12px rgba(245, 158, 11, 0.5),
      0 0 4px rgba(245, 158, 11, 0.2);
  }
}
.quest-input-highlight {
  animation: quest-glow 2.5s ease-in-out infinite;
  border-color: rgb(245, 158, 11) !important;
}

/* F155: Guide Engine Animations — wrapped for reduced-motion (A-3) */
@keyframes guide-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.03);
    opacity: 0.85;
  }
}

@keyframes guide-hud-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes guide-success-flash {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

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

@media (prefers-reduced-motion: no-preference) {
  .animate-guide-hud-enter {
    animation: guide-hud-enter 160ms ease-out;
  }

  .animate-guide-success {
    animation: guide-success-flash 0.4s ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  .animate-guide-hud-enter {
    animation: none;
  }

  .animate-guide-success {
    animation: none;
  }

  /* Disable breathe ring and transitions on guide overlay elements */
  [style*="guide-breathe"] {
    animation: none !important;
  }
}

.animate-guide-error {
  animation: guide-error-shake 0.3s ease-out;
}

/* Tier 3 System Notice — tone binding + entrance animation */
[data-notice-tone="info"] {
  --notice-label: var(--notice-info-label);
  --notice-icon: var(--notice-info-icon);
  --notice-border: var(--notice-info-border);
  --notice-surface: var(--cafe-surface);
}
[data-notice-tone="warning"] {
  --notice-label: var(--notice-warning-label);
  --notice-icon: var(--notice-warning-icon);
  --notice-border: var(--notice-warning-border);
  --notice-surface: var(--cafe-surface);
}
[data-notice-tone="error"] {
  --notice-label: var(--notice-error-label);
  --notice-icon: var(--notice-error-icon);
  --notice-border: var(--notice-error-border);
  --notice-surface: var(--notice-error-surface);
}
.system-notice-bar__label {
  color: var(--notice-label);
}
.system-notice-bar__icon {
  color: var(--notice-icon);
}
.system-notice-bar {
  border: 1px solid var(--notice-border);
  background: color-mix(in srgb, var(--notice-surface) 90%, transparent);
}
@keyframes system-notice-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .system-notice-bar {
    animation: system-notice-enter var(--notice-enter-duration) var(--notice-enter-easing);
  }
}

/* Werewolf Cute Theme → werewolf-theme.css */

/* F097/F056: CLI/Thinking table overrides — inherit cat-msg-inset-text
 * so light-mode dark-inset and dark-mode dark-inset both get readable text.
 * Falls back to cafe neutrals when --cat-msg-inset-text is unset. */
.cli-output-md thead {
  background: rgba(255, 255, 255, 0.06);
}
.cli-output-md th {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--cat-msg-inset-text, var(--cafe-text-secondary));
}
.cli-output-md td {
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--cat-msg-inset-text, var(--cafe-text-muted));
}
.cli-output-md code {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cat-msg-inset-text, var(--cafe-text-secondary));
}
