/* =========================================================
   STRIVE HARD — SF founder satire UI
   ========================================================= */

:root {
  --bg: #0b0c10;
  --bg-elev: #12141c;
  --bg-panel: #161822;
  --border: #2a2d3a;
  --text: #f2f3f7;
  --muted: #9aa0b4;
  --accent: #7c5cff;
  --accent-2: #ff4d8d;
  --gold: #f5c542;
  --green: #3dd68c;
  --danger: #ff5c5c;
  --x-black: #000;
  --phone-bezel: #1a1b22;
  --phone-screen: #0e0f14;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --font: "Inter", system-ui, sans-serif;
  --display: "Space Grotesk", var(--font);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

button,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

#app {
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--muted);
  color: var(--text);
}

.btn-lg {
  padding: 0.95rem 1.8rem;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* ---------- Title ---------- */

#screen-title {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#screen-title.active {
  display: flex;
}

.title-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(124, 92, 255, 0.35), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(255, 77, 141, 0.18), transparent 50%),
    radial-gradient(ellipse 40% 30% at 10% 70%, rgba(61, 214, 140, 0.12), transparent 50%),
    var(--bg);
}

.title-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

.title-card {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 2rem;
  padding: 2.5rem 2rem;
  text-align: center;
  background: rgba(18, 20, 28, 0.85);
  border: 1px solid var(--border);
  border-radius: 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.title-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-2);
}

.title-logo {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #fff 20%, #c4b5fd 50%, #ff8fb8 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title-tagline {
  margin: 1rem 0 0.5rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.title-rating {
  margin: 0 0 1.75rem;
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 600;
}

.title-card .btn {
  margin: 0.35rem;
}

.title-hint {
  margin: 1.5rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.8;
}

/* ---------- Character select ---------- */

#screen-character.active {
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 2rem 1rem 3rem;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(124, 92, 255, 0.2), transparent 60%),
    var(--bg);
}

.char-select {
  width: min(1100px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.char-header {
  text-align: center;
}

.char-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 2rem;
}

.char-header p {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.char-card {
  text-align: left;
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg-panel);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.char-card:hover {
  border-color: #4a4e63;
  transform: translateY(-2px);
}

.char-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25);
}

.char-emoji {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.char-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
}

.char-age {
  display: block;
  margin: 0.2rem 0 0.6rem;
  font-size: 0.85rem;
  color: var(--accent-2);
  font-weight: 600;
}

.char-blurb {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.char-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.85rem;
}

.trait {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.15);
  color: #c4b5fd;
}

.char-footer {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ---------- Game layout ---------- */

#screen-game.active {
  display: block;
}

.game-layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 340px);
  gap: 0;
  min-height: 100vh;
}

.story-panel {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  border-right: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 40% at 0% 0%, rgba(124, 92, 255, 0.08), transparent 50%),
    var(--bg);
}

.story-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 12, 16, 0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.brand-mini {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  flex-shrink: 0;
}

.topbar-menu {
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  min-width: 0;
  margin-left: auto;
}

.char-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.25rem 0.65rem 0.25rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(124, 92, 255, 0.12);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 1;
}

.char-chip-emoji {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.char-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12rem;
}

.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
  flex-shrink: 0;
}

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

.stat-icon {
  margin-right: 0.15rem;
}

.story-body {
  flex: 1;
  padding: 1.5rem 1.5rem 2rem;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.location-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(61, 214, 140, 0.12);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 600;
}

.story-scene h2 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: 1.65rem;
  letter-spacing: -0.02em;
}

.scene-art {
  height: 8px;
  border-radius: 999px;
  margin-bottom: 1.25rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--gold));
  opacity: 0.85;
}

.scene-text {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  color: #d7dae6;
  white-space: pre-line;
}

.scene-text .effect {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: rgba(245, 197, 66, 0.12);
  color: var(--gold);
  font-size: 0.88rem;
  font-weight: 600;
}

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

.choice-btn {
  text-align: left;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: #1c1e2c;
  transform: translateX(3px);
}

.choice-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.choice-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.choice-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.choice-cost {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
}

/* ---------- Phone ---------- */

.phone-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: linear-gradient(180deg, #0d0e14 0%, #141622 100%);
  position: sticky;
  top: 0;
  height: 100vh;
}

.phone {
  width: 100%;
  max-width: 300px;
  height: min(640px, calc(100vh - 2.5rem));
  background: var(--phone-bezel);
  border-radius: 36px;
  border: 3px solid #2c2e3a;
  box-shadow:
    0 0 0 1px #0a0a0c,
    0 25px 50px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.phone-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #050506;
  border-radius: 0 0 14px 14px;
  z-index: 10;
}

.phone-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #c8cad4;
  position: relative;
  z-index: 2;
}

.phone-brand {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}

.phone-screen {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.phone-screen.active {
  display: flex;
}

.phone-wallpaper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(124, 92, 255, 0.4), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255, 77, 141, 0.25), transparent 40%),
    linear-gradient(160deg, #1a1030, #0a0b10 70%);
  z-index: 0;
}

#phone-home {
  position: relative;
}

.phone-apps {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem 0.65rem;
  padding: 1.5rem 1.15rem 0.75rem;
  margin-top: auto;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  padding: 0.25rem;
}

.app-glyph {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: #22243a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.app-x {
  background: #000;
  color: #fff;
  font-weight: 800;
  border: 1px solid #333;
}

.app-map {
  background: linear-gradient(145deg, #3dd68c, #1a9b5c);
}

.app-texts {
  background: linear-gradient(145deg, #3ecf5a, #1fa83a);
}

.app-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: #e8e9f0;
}

.app-badge {
  position: absolute;
  top: 0;
  right: calc(50% - 32px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-dock {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 0.75rem;
  text-align: center;
}

.dock-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.45);
}

/* App chrome */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
  background: var(--phone-screen);
  flex-shrink: 0;
}

.app-back {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-back:hover {
  background: rgba(124, 92, 255, 0.15);
}

.app-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.app-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 600;
}

.app-action:hover {
  background: rgba(124, 92, 255, 0.15);
}

.app-action-spacer {
  width: 32px;
}

/* X app */

.x-profile {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  background: #0a0a0c;
  flex-shrink: 0;
}

.x-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.x-meta strong {
  display: block;
  font-size: 0.95rem;
}

.x-meta span {
  font-size: 0.8rem;
  color: var(--muted);
}

.x-counts {
  display: flex;
  gap: 0.85rem;
  margin-top: 0.65rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.x-counts strong {
  color: var(--text);
  display: block;
  font-size: 0.9rem;
}

.x-feed {
  flex: 1;
  overflow-y: auto;
  background: #000;
  min-height: 0;
}

.x-post {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #1a1a1a;
}

.x-post-head {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
}

.x-post-head strong {
  color: #fff;
}

.x-post-head span {
  color: #71767b;
}

.x-post-body {
  font-size: 0.85rem;
  color: #e7e9ea;
  line-height: 1.4;
  white-space: pre-wrap;
}

.x-post-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: #71767b;
}

.x-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #71767b;
  font-size: 0.85rem;
}

/* Map */

.map-hint {
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.75rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.map-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0.5rem;
}

.map-pin {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem;
  margin-bottom: 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  transition: border-color 0.15s;
}

.map-pin:hover:not(:disabled) {
  border-color: var(--accent);
}

.map-pin:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.map-pin.here {
  border-color: var(--green);
  background: rgba(61, 214, 140, 0.08);
}

.map-pin-name {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
}

.map-pin-desc {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.map-pin-meta {
  display: block;
  font-size: 0.7rem;
  color: var(--gold);
  margin-top: 0.3rem;
  font-weight: 600;
}

/* Texts */

.text-threads {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.thread-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.thread-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.thread-row.unread .thread-preview {
  color: var(--text);
  font-weight: 600;
}

.thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #2a2d3a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.thread-body {
  flex: 1;
  min-width: 0;
}

.thread-name {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
}

.thread-preview {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.text-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.text-chat-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}

.bubble {
  max-width: 88%;
  padding: 0.55rem 0.75rem;
  border-radius: 16px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.bubble.them {
  align-self: flex-start;
  background: #2a2d3a;
  border-bottom-left-radius: 4px;
}

.bubble.me {
  align-self: flex-end;
  background: #0a84ff;
  border-bottom-right-radius: 4px;
}

.chat-replies {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  max-height: 40%;
  overflow-y: auto;
}

.reply-btn {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 0.78rem;
}

.reply-btn:hover {
  border-color: #0a84ff;
  background: rgba(10, 132, 255, 0.12);
}

.texts-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Selfie composer */

.selfie-composer {
  padding: 0.85rem;
  overflow-y: auto;
  flex: 1;
}

.selfie-preview {
  height: 100px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, #2a1f4a, #1a1030);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
}

.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

#selfie-caption {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  margin-bottom: 0.65rem;
}

.selfie-presets {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.preset-btn {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}

.preset-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ---------- Modal & toast ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(360px, 100%);
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.modal-card h3 {
  margin: 0 0 1rem;
  font-family: var(--display);
  text-align: center;
}

.modal-card .btn {
  margin-bottom: 0.5rem;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: #1e2030;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 200;
  font-size: 0.9rem;
  font-weight: 500;
  max-width: min(90vw, 420px);
  text-align: center;
}

.toast[hidden] {
  display: none;
}

.toast.good {
  border-color: rgba(61, 214, 140, 0.5);
  color: var(--green);
}

.toast.bad {
  border-color: rgba(255, 92, 92, 0.5);
  color: var(--danger);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .story-panel {
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .phone-panel {
    position: relative;
    height: auto;
    padding: 1rem;
    justify-content: center;
  }

  .phone {
    max-width: 340px;
    height: 520px;
  }
}

/* ---------- FlareUp dating app ---------- */

.app-flare {
  background: linear-gradient(145deg, #ff4d8d, #ff8a3d 55%, #ffc107);
  font-size: 1.45rem;
}

.flare-header {
  background: linear-gradient(90deg, #1a0a14, #2a1020);
  border-bottom-color: rgba(255, 77, 141, 0.35);
}

.flare-hint {
  margin: 0;
  padding: 0.45rem 0.75rem 0.25rem;
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.35;
  flex-shrink: 0;
}

.flare-matches-line {
  margin: 0;
  padding: 0 0.75rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-2);
  flex-shrink: 0;
}

.flare-deck {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0.65rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flare-card {
  background: linear-gradient(165deg, #1c1220 0%, #12141c 60%);
  border: 1px solid rgba(255, 77, 141, 0.35);
  border-radius: 16px;
  padding: 0.75rem;
  box-shadow: 0 8px 24px rgba(255, 77, 141, 0.12);
}

.flare-card-hero {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.flare-emoji {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff4d8d, #7c5cff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.flare-card-title strong {
  font-size: 1.05rem;
  font-family: var(--display);
}

.flare-age {
  margin-left: 0.35rem;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
}

.flare-job {
  font-size: 0.75rem;
  color: #ffb3cc;
  font-weight: 600;
  margin-top: 0.1rem;
}

.flare-dist {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.flare-tagline {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-style: italic;
  color: #e8c4d4;
}

.flare-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
}

.flare-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 77, 141, 0.15);
  color: #ff8fb8;
  border: 1px solid rgba(255, 77, 141, 0.3);
}

.flare-bio {
  margin: 0 0 0.55rem;
  font-size: 0.74rem;
  line-height: 1.4;
  color: #c8cad8;
  white-space: pre-line;
}

.flare-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.4rem;
}

.flare-interest {
  font-size: 0.62rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(124, 92, 255, 0.15);
  color: #c4b5fd;
}

.flare-remaining {
  margin: 0;
  font-size: 0.65rem;
  color: var(--muted);
}

.flare-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.35rem 0 0.25rem;
  flex-shrink: 0;
}

.flare-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  transition: transform 0.12s, box-shadow 0.12s;
}

.flare-btn:hover {
  transform: scale(1.08);
}

.flare-pass {
  color: #ff5c5c;
  border-color: rgba(255, 92, 92, 0.5);
  background: rgba(255, 92, 92, 0.1);
}

.flare-like {
  color: #3dd68c;
  border-color: rgba(61, 214, 140, 0.5);
  background: rgba(61, 214, 140, 0.12);
  box-shadow: 0 4px 16px rgba(61, 214, 140, 0.2);
}

.flare-empty {
  flex: 1;
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.flare-empty-sub {
  font-size: 0.75rem;
  margin: 0.5rem 0 1rem;
}

/* ---------- Corgi Café seizure-brand theme ---------- */

@keyframes corgi-chromatic {
  0% {
    background-position: 0% 50%;
    filter: hue-rotate(0deg) saturate(1.4);
  }
  25% {
    background-position: 50% 100%;
    filter: hue-rotate(40deg) saturate(1.8);
  }
  50% {
    background-position: 100% 50%;
    filter: hue-rotate(-30deg) saturate(2);
  }
  75% {
    background-position: 50% 0%;
    filter: hue-rotate(70deg) saturate(1.6);
  }
  100% {
    background-position: 0% 50%;
    filter: hue-rotate(0deg) saturate(1.4);
  }
}

@keyframes corgi-bar-pulse {
  0%,
  100% {
    background: linear-gradient(90deg, #ff6b00, #ff00aa, #ffe600, #00ff88, #7c5cff);
    background-size: 300% 100%;
    background-position: 0% 50%;
    opacity: 1;
    box-shadow: 0 0 16px #ff6b00, 0 0 32px #ff00aa;
  }
  33% {
    background-position: 50% 50%;
    box-shadow: 0 0 20px #00ff88, 0 0 40px #ffe600;
  }
  66% {
    background-position: 100% 50%;
    box-shadow: 0 0 18px #7c5cff, 0 0 36px #ff00aa;
  }
}

@keyframes corgi-text-flicker {
  0%,
  100% {
    text-shadow: 0 0 0 transparent;
  }
  40% {
    text-shadow: 2px 0 #ff00aa, -2px 0 #00ffcc;
  }
  70% {
    text-shadow: -1px 0 #ffe600, 1px 0 #ff6b00;
  }
}

body.at-corgi-cafe .story-panel {
  background:
    linear-gradient(
      125deg,
      rgba(255, 107, 0, 0.18),
      rgba(255, 0, 170, 0.14),
      rgba(255, 230, 0, 0.16),
      rgba(0, 255, 136, 0.12),
      rgba(124, 92, 255, 0.18)
    );
  background-size: 400% 400%;
  animation: corgi-chromatic 2.2s ease-in-out infinite;
}

.story-body.corgi-seizure {
  position: relative;
}

.story-body.corgi-seizure::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(255, 0, 170, 0.04) 3px,
      rgba(255, 0, 170, 0.04) 6px
    ),
    radial-gradient(circle at 20% 30%, rgba(255, 230, 0, 0.15), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255, 0, 100, 0.18), transparent 45%);
  mix-blend-mode: screen;
  animation: corgi-chromatic 1.6s linear infinite;
  z-index: 0;
}

.story-body.corgi-seizure > * {
  position: relative;
  z-index: 1;
}

.story-body.corgi-seizure .location-badge {
  background: rgba(255, 107, 0, 0.25);
  color: #ffe600;
  border: 1px solid rgba(255, 0, 170, 0.5);
  animation: corgi-text-flicker 1.1s steps(2) infinite;
}

.story-body.corgi-seizure #scene-title {
  animation: corgi-text-flicker 0.9s steps(3) infinite;
  color: #fff;
}

.scene-art.corgi-seizure-bar {
  height: 14px;
  border-radius: 6px;
  animation: corgi-bar-pulse 0.7s linear infinite;
  opacity: 1;
}

.story-body.corgi-seizure .choice-btn {
  border-color: rgba(255, 107, 0, 0.55);
  background: rgba(20, 8, 24, 0.85);
}

.story-body.corgi-seizure .choice-btn:hover:not(:disabled) {
  border-color: #ff00aa;
  background: rgba(255, 0, 170, 0.12);
  box-shadow: 0 0 12px rgba(255, 230, 0, 0.25);
}

/* Prefer reduced motion: keep weird colors, kill strobe */
@media (prefers-reduced-motion: reduce) {
  body.at-corgi-cafe .story-panel,
  .story-body.corgi-seizure::before,
  .scene-art.corgi-seizure-bar,
  .story-body.corgi-seizure .location-badge,
  .story-body.corgi-seizure #scene-title {
    animation: none !important;
  }

  body.at-corgi-cafe .story-panel {
    background: linear-gradient(135deg, #3a1800, #2a0030 50%, #1a2a00);
    filter: saturate(1.3);
  }

  .scene-art.corgi-seizure-bar {
    background: linear-gradient(90deg, #ff6b00, #ff00aa, #ffe600, #00ff88);
  }
}

@media (max-width: 480px) {
  .story-topbar {
    flex-wrap: wrap;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .stats-bar {
    gap: 0.5rem 0.75rem;
    font-size: 0.78rem;
  }

  .char-chip-name {
    max-width: 9rem;
  }

  .story-body {
    padding: 1rem;
  }

  .title-card {
    padding: 1.75rem 1.25rem;
  }
}
