/* ── Base ────────────────────────────────────────────────────────────── */

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  overscroll-behavior: none;
}

/* ── Scrollbar ──────────────────────────────────────────────────────── */

#chat-messages::-webkit-scrollbar {
  width: 3px;
}

#chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 10px;
}

/* ── Urge button red glow ───────────────────────────────────────────── */

@keyframes pulseRed {
  0%   { box-shadow: 0 0 0px rgba(220, 38, 38, 0); }
  50%  { box-shadow: 0 0 22px rgba(220, 38, 38, 0.45); }
  100% { box-shadow: 0 0 0px rgba(220, 38, 38, 0); }
}

.urge-pulse-red {
  animation: pulseRed 2s ease-in-out infinite;
}

/* legacy alias */
.urge-pulse {
  animation: pulseRed 2s ease-in-out infinite;
}

/* ── Urge message fade ──────────────────────────────────────────────── */

#urge-message {
  transition: opacity 0.4s ease;
}

/* ── Chat message entrance ──────────────────────────────────────────── */

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-enter {
  animation: message-in 0.25s ease forwards;
}

/* ── Card hover lift ────────────────────────────────────────────────── */

.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* ── Active tab glow ────────────────────────────────────────────────── */

#tab-dashboard.bg-osa-accent,
#tab-chat.bg-osa-accent,
#tab-guide.bg-osa-accent {
  box-shadow: 0 0 12px rgba(201, 169, 110, 0.25);
}

/* ── Urge timer glow ────────────────────────────────────────────────── */

#urge-timer {
  text-shadow: 0 0 30px rgba(201, 169, 110, 0.4);
}

/* ── Input focus ring ───────────────────────────────────────────────── */

#chat-input:focus {
  box-shadow: 0 0 0 2px rgba(201, 169, 110, 0.2);
}

/* ── Smooth tab transition ──────────────────────────────────────────── */

.tab-content {
  transition: opacity 0.15s ease;
}

/* ── Urge form step reveal ──────────────────────────────────────────── */

.form-step {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.form-step-enter {
  animation: message-in 0.35s ease forwards;
}

/* ── Battle mode tint ───────────────────────────────────────────────── */

body.battle {
  background-color: #110505;
  transition: background-color 0.5s ease;
}

/* ── Day reward flash ───────────────────────────────────────────────── */

#reward-popup {
  animation: message-in 0.3s ease forwards;
}

/* ── Selection chips ────────────────────────────────────────────────── */

.chip {
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid #2a2a2a;
  background: #1a1a1a;
  color: #888888;
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.chip:active {
  transform: scale(0.96);
}

.chip-active {
  border-color: #c9a96e;
  background: rgba(201, 169, 110, 0.12);
  color: #c9a96e;
}

/* ── Auth Screen ────────────────────────────────────────────────── */

@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

#auth-screen .max-w-xs {
  animation: auth-card-in 0.45s ease forwards;
}

.auth-input:focus {
  box-shadow: 0 0 0 2px rgba(201, 169, 110, 0.18);
}

.auth-btn {
  box-shadow: 0 0 24px rgba(201, 169, 110, 0.18);
}

.auth-btn:hover:not(:disabled) {
  box-shadow: 0 0 36px rgba(201, 169, 110, 0.28);
}

.auth-btn:disabled {
  cursor: not-allowed;
}
