/* ─────────────────────────────────────────────────────────────────────────────
   Did I Break It? — Design System
   Dark MTG Premium Theme | Space Grotesk + JetBrains Mono
───────────────────────────────────────────────────────────────────────────── */

/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap");

/* ── Design Tokens ────────────────────────────────────────────────────────── */
:root {
  /* Palette */
  --bg-base:        #080a0f;
  --bg-surface:     #0f1219;
  --bg-elevated:    #161b26;
  --bg-panel:       #1a2035;
  --bg-input:       #0d1120;

  --accent-gold:    #c9a227;
  --accent-gold-dim:#8a6b18;
  --accent-blue:    #3b82f6;
  --accent-cyan:    #06b6d4;

  --valid-green:    #22c55e;
  --valid-glow:     rgba(34, 197, 94, 0.2);
  --invalid-red:    #ef4444;
  --invalid-glow:   rgba(239, 68, 68, 0.2);
  --warn-amber:     #f59e0b;

  --text-primary:   #e8eaf0;
  --text-secondary: #8b93a8;
  --text-muted:     #4a5268;
  --text-accent:    #c9a227;

  --border-subtle:  rgba(255,255,255,0.06);
  --border-dim:     rgba(255,255,255,0.10);
  --border-bright:  rgba(201,162,39,0.3);

  /* Mana colors */
  --mana-W: #f9f9f0;
  --mana-U: #1a6db5;
  --mana-B: #3a3040;
  --mana-R: #cc2200;
  --mana-G: #00733e;
  --mana-C: #9aa9b2;

  /* Typography */
  --font-sans: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  /* Spacing & Shape */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-pill:9999px;

  /* Transitions */
  --transition-fast: 140ms ease;
  --transition-base: 220ms ease;
  --transition-slow: 400ms ease;

  /* Shadows */
  --shadow-card:  0 4px 24px rgba(0,0,0,0.5), 0 1px 4px rgba(0,0,0,0.3);
  --shadow-panel: 0 8px 40px rgba(0,0,0,0.6);
  --shadow-gold:  0 0 24px rgba(201,162,39,0.15);
  --shadow-glow-valid:   0 0 32px var(--valid-glow);
  --shadow-glow-invalid: 0 0 32px var(--invalid-glow);
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family:      var(--font-sans);
  background-color: var(--bg-base);
  color:            var(--text-primary);
  min-height:       100dvh;
  line-height:      1.6;
  overflow-x:       hidden;
}

/* ── Animated Background ──────────────────────────────────────────────────── */
.bg-grid {
  position:   fixed;
  inset:      0;
  background-image:
    linear-gradient(rgba(201,162,39,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,162,39,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position:       fixed;
  border-radius:  50%;
  filter:         blur(140px);
  pointer-events: none;
  z-index:        0;
  animation:      pulse-glow 8s ease-in-out infinite;
}

.bg-glow--1 {
  width:  600px; height: 600px;
  top:    -200px; left: -100px;
  background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
}

.bg-glow--2 {
  width:  500px; height: 500px;
  bottom: -150px; right: -100px;
  background: radial-gradient(circle, rgba(201,162,39,0.05) 0%, transparent 70%);
  animation-delay: 4s;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.1); }
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  position:   sticky;
  top:        0;
  z-index:    100;
  background: rgba(8,10,15,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width:   1400px;
  margin:      0 auto;
  padding:     0 1rem;
  height:      56px;
  display:     flex;
  align-items: center;
  gap:         1rem;
}

/* Brand */
.header-brand {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
  flex-shrink: 0;
}

.brand-icon {
  font-size:   1.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(201,162,39,0.5));
}

.brand-text { display: flex; flex-direction: column; }

.brand-name {
  font-size:   1rem;
  font-weight: 700;
  color:       var(--accent-gold);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size:  0.65rem;
  color:      var(--text-muted);
  font-weight:400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Tab nav */
.tab-nav {
  display:     flex;
  gap:         0.25rem;
  background:  var(--bg-elevated);
  padding:     3px;
  border-radius: var(--radius-pill);
  border:      1px solid var(--border-subtle);
  margin-left: auto;
}

.tab-btn {
  display:       flex;
  align-items:   center;
  gap:           0.4rem;
  padding:       0.35rem 0.9rem;
  border:        none;
  border-radius: var(--radius-pill);
  background:    transparent;
  color:         var(--text-secondary);
  font-family:   var(--font-sans);
  font-size:     0.8125rem;
  font-weight:   500;
  cursor:        pointer;
  transition:    all var(--transition-base);
  white-space:   nowrap;
}

.tab-btn .tab-icon { font-size: 0.9rem; }

.tab-btn:hover {
  color:      var(--text-primary);
  background: var(--border-subtle);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dim));
  color:      #0a0b0f;
  font-weight:700;
  box-shadow: 0 2px 12px rgba(201,162,39,0.35);
}

/* Status dot */
.header-status {
  display:      flex;
  align-items:  center;
  gap:          0.4rem;
  flex-shrink:  0;
  margin-left:  0.5rem;
}

.status-dot {
  width:         7px;
  height:        7px;
  border-radius: 50%;
  background:    var(--text-muted);
  transition:    background var(--transition-base);
}

.status-dot--online      { background: var(--valid-green); box-shadow: 0 0 6px var(--valid-green); }
.status-dot--offline     { background: var(--invalid-red); }
.status-dot--connecting  { background: var(--warn-amber);  animation: blink 1.2s ease-in-out infinite; }

@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

.status-label {
  font-size:   0.7rem;
  color:       var(--text-muted);
  font-family: var(--font-mono);
}

/* ── App Main ─────────────────────────────────────────────────────────────── */
.app-main {
  position:   relative;
  z-index:    1;
  max-width:  1400px;
  margin:     0 auto;
  padding:    1rem;
}

/* Tab panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   JUDGE CHAT TAB
══════════════════════════════════════════════════════════════════════════ */
.judge-layout {
  display:        flex;
  flex-direction: column;
  height:         calc(100dvh - 56px - 2rem);
  max-width:      780px;
  margin:         0 auto;
  gap:            0;
}

/* Firefox Android dvh keyboard fallback via CSS custom property set by JS */
@supports (height: 1dvh) {
  .judge-layout {
    height: calc(var(--visual-vh, 100dvh) - 56px - 2rem);
  }
}

/* Chat window */
.chat-window {
  flex:           1;
  overflow-y:     auto;
  padding:        1rem 0;
  display:        flex;
  flex-direction: column;
  gap:            1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-dim) transparent;
}

/* Welcome */
.chat-welcome {
  text-align:  center;
  margin:      auto;
  padding:     2rem 1.5rem;
  max-width:   420px;
}

.welcome-icon {
  font-size:     3.5rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 16px rgba(201,162,39,0.4));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}

.welcome-title {
  font-size:     1.75rem;
  font-weight:   700;
  color:         var(--accent-gold);
  margin-bottom: 0.5rem;
}

.welcome-body {
  color:       var(--text-secondary);
  line-height: 1.7;
  font-size:   0.9375rem;
}

/* Chat bubbles */
.chat-bubble {
  display:       flex;
  gap:           0.625rem;
  max-width:     88%;
  animation:     bubble-in 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.chat-bubble--user {
  align-self:      flex-end;
  flex-direction:  row-reverse;
}

.chat-bubble--judge { align-self: flex-start; }

.bubble-avatar {
  font-size:    1.25rem;
  flex-shrink:  0;
  width:        36px;
  height:       36px;
  display:      flex;
  align-items:  center;
  justify-content: center;
  background:   var(--bg-elevated);
  border-radius:50%;
  border:       1px solid var(--border-bright);
  box-shadow:   var(--shadow-gold);
}

.bubble-body {
  display:       flex;
  flex-direction:column;
  gap:           0.4rem;
}

.bubble-text {
  padding:       0.75rem 1rem;
  border-radius: var(--radius-lg);
  line-height:   1.7;
  font-size:     0.9rem;
}

.chat-bubble--user .bubble-text {
  background:    linear-gradient(135deg, #1e3a5f, #152d4d);
  border:        1px solid rgba(59,130,246,0.3);
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
  color:         #c5d8f5;
}

.chat-bubble--judge .bubble-text {
  background:   var(--bg-elevated);
  border:       1px solid var(--border-dim);
  border-radius:4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
}

/* Verdict badges in bubble */
.bubble-badges {
  display:  flex;
  gap:      0.4rem;
  flex-wrap:wrap;
}

.badge {
  display:       inline-flex;
  align-items:   center;
  padding:       0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size:     0.7rem;
  font-weight:   700;
  letter-spacing:0.04em;
  text-transform:uppercase;
  font-family:   var(--font-mono);
}

.badge--valid   { background: var(--valid-glow);   color: var(--valid-green);  border: 1px solid var(--valid-green); }
.badge--invalid { background: var(--invalid-glow); color: var(--invalid-red);  border: 1px solid var(--invalid-red); }
.badge--warn    { background: rgba(245,158,11,0.15); color: var(--warn-amber); border: 1px solid var(--warn-amber); }

/* Judge Call badge tooltip */
.badge--warn-tip {
  position:  relative;
  cursor:    help;
}

.badge--warn-tip::after {
  content:       attr(data-tip);
  position:      absolute;
  bottom:        calc(100% + 8px);
  left:          50%;
  transform:     translateX(-50%);
  width:         max-content;
  max-width:     280px;
  padding:       0.5rem 0.75rem;
  background:    var(--bg-panel);
  border:        1px solid var(--warn-amber);
  border-radius: var(--radius-md);
  color:         var(--text-secondary);
  font-size:     0.75rem;
  font-weight:   400;
  font-family:   var(--font-sans);
  text-transform:none;
  letter-spacing:normal;
  line-height:   1.5;
  white-space:   normal;
  box-shadow:    0 8px 24px rgba(0,0,0,0.5);
  pointer-events:none;
  opacity:       0;
  transition:    opacity 200ms ease;
  z-index:       500;
}

.badge--warn-tip::before {
  content:      "";
  position:     absolute;
  bottom:       calc(100% + 2px);
  left:         50%;
  transform:    translateX(-50%);
  border:       6px solid transparent;
  border-top-color: var(--warn-amber);
  pointer-events: none;
  opacity:      0;
  transition:   opacity 200ms ease;
  z-index:      501;
}

.badge--warn-tip:hover::after,
.badge--warn-tip:hover::before {
  opacity: 1;
}

/* Suppress native title tooltip when CSS tooltip is active */
.badge--warn-tip:hover { position: relative; }

/* Card chips in bubble */
.bubble-cards {
  display:  flex;
  flex-wrap:wrap;
  gap:      0.3rem;
}

/* Typing indicator */
.typing-dots {
  display:     flex;
  gap:         5px;
  align-items: center;
  height:      20px;
}

.typing-dots span {
  width:         8px;
  height:        8px;
  border-radius: 50%;
  background:    var(--accent-gold);
  opacity:       0.4;
  animation:     typing-dot 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
  0%,100% { opacity: 0.4; transform: translateY(0); }
  50%     { opacity: 1;   transform: translateY(-5px); }
}

/* Input area */
.chat-input-area {
  padding:    0.75rem 0;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-subtle);
  display:    flex;
  flex-direction: column;
  gap:        0.5rem;
  flex-shrink: 0;
  background: var(--bg-base);
  position:   relative;
  z-index:    10;
}

.quick-prompts {
  display:   flex;
  flex-wrap: wrap;
  gap:       0.375rem;
  align-items: center;
}

.qp-label {
  font-size:  0.7rem;
  color:      var(--text-muted);
  font-weight:600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.qp-chip {
  padding:       0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  border:        1px solid var(--border-dim);
  background:    var(--bg-elevated);
  color:         var(--text-secondary);
  font-size:     0.75rem;
  cursor:        pointer;
  transition:    all var(--transition-fast);
  font-family:   var(--font-sans);
}

.qp-chip:hover {
  border-color: var(--accent-gold);
  color:        var(--accent-gold);
  background:   rgba(201,162,39,0.08);
}

.input-row {
  display:   flex;
  gap:       0.5rem;
  align-items:flex-end;
}

.chat-textarea {
  flex:        1;
  resize:      none;
  min-height:  44px;
  max-height:  140px;
  padding:     0.65rem 0.875rem;
  background:  var(--bg-input);
  border:      1px solid var(--border-dim);
  border-radius:var(--radius-lg);
  color:       var(--text-primary);
  font-family: var(--font-sans);
  font-size:   0.9rem;
  line-height: 1.5;
  outline:     none;
  transition:  border-color var(--transition-fast), box-shadow var(--transition-fast);
  overflow-y:  hidden;
}

.chat-textarea:focus {
  border-color: var(--accent-gold);
  box-shadow:   0 0 0 3px rgba(201,162,39,0.12);
}

.chat-textarea::placeholder { color: var(--text-muted); }

.send-btn {
  width:         44px;
  height:        44px;
  border-radius: 50%;
  border:        none;
  background:    linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dim));
  color:         #080a0f;
  font-size:     1rem;
  cursor:        pointer;
  flex-shrink:   0;
  display:       flex;
  align-items:   center;
  justify-content:center;
  transition:    all var(--transition-fast);
  box-shadow:    0 2px 12px rgba(201,162,39,0.3);
}

.send-btn:hover  { transform: scale(1.08); box-shadow: 0 4px 20px rgba(201,162,39,0.45); }
.send-btn:active { transform: scale(0.95); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.send-spinner {
  width:        16px;
  height:       16px;
  border:       2.5px solid rgba(8,10,15,0.3);
  border-top-color: #080a0f;
  border-radius:50%;
  animation:    spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════
   COMBO FINDER TAB
══════════════════════════════════════════════════════════════════════════ */
.combo-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap:    1.25rem;
  align-items: start;
}

/* ── Section headers ── */
.section-header {
  display:     flex;
  align-items: baseline;
  gap:         0.5rem;
  margin-bottom: 0.75rem;
}

.section-header--inline {
  margin-bottom: 0.5rem;
}

.section-title {
  font-size:  0.9rem;
  font-weight:700;
  color:      var(--text-primary);
  display:    flex;
  align-items:center;
  gap:        0.4rem;
}

.section-icon { font-size: 1em; }

.section-sub {
  font-size:  0.7rem;
  color:      var(--text-muted);
}

/* ── Card Slots ── */
.card-slots {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-slot {
  background:   var(--bg-surface);
  border:       1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  padding:      0.75rem;
  transition:   border-color var(--transition-base), box-shadow var(--transition-base);
}

.card-slot:hover,
.card-slot:focus-within {
  border-color: var(--border-bright);
  box-shadow:   var(--shadow-gold);
}

.card-slot--filled {
  border-color: rgba(201,162,39,0.25);
  background:   rgba(201,162,39,0.04);
}

.slot-label {
  font-size:     0.65rem;
  font-weight:   600;
  color:         var(--text-muted);
  text-transform:uppercase;
  letter-spacing:0.08em;
  margin-bottom: 0.35rem;
}

.slot-search-wrap {
  position: relative;
}

.slot-input {
  width:        100%;
  padding:      0.5rem 0.75rem;
  background:   var(--bg-input);
  border:       1px solid var(--border-subtle);
  border-radius:var(--radius-sm);
  color:        var(--text-primary);
  font-family:  var(--font-sans);
  font-size:    0.8125rem;
  outline:      none;
  transition:   border-color var(--transition-fast);
  padding-right: 2rem;
}

.slot-input:focus { border-color: var(--accent-gold); }
.slot-input::placeholder { color: var(--text-muted); }

.slot-clear {
  position:   absolute;
  right:      0.4rem;
  top:        50%;
  transform:  translateY(-50%);
  background: none;
  border:     none;
  color:      var(--text-muted);
  cursor:     pointer;
  font-size:  0.8rem;
  padding:    0.2rem;
  transition: color var(--transition-fast);
}

.slot-clear:hover { color: var(--invalid-red); }

/* Autocomplete dropdown */
.slot-autocomplete {
  position:      absolute;
  top:           calc(100% + 3px);
  left:          0;
  right:         0;
  background:    var(--bg-panel);
  border:        1px solid var(--border-bright);
  border-radius: var(--radius-md);
  overflow:      hidden;
  z-index:       200;
  display:       none;
  box-shadow:    var(--shadow-panel);
}

.slot-autocomplete.open { display: block; }

.ac-item {
  padding:    0.5rem 0.75rem;
  cursor:     pointer;
  font-size:  0.8125rem;
  color:      var(--text-secondary);
  transition: all var(--transition-fast);
  border-bottom: 1px solid var(--border-subtle);
}

.ac-item:last-child { border-bottom: none; }
.ac-item:hover,
.ac-item:focus {
  background: rgba(201,162,39,0.1);
  color:      var(--text-primary);
  outline:    none;
}

/* Card chip */
.card-chip {
  display:       inline-block;
  margin-top:    0.35rem;
  padding:       0.15rem 0.55rem;
  background:    rgba(201,162,39,0.1);
  border:        1px solid rgba(201,162,39,0.3);
  border-radius: var(--radius-pill);
  font-size:     0.75rem;
  color:         var(--accent-gold);
  font-weight:   500;
  cursor:        default;
  transition:    all var(--transition-fast);
  font-family:   var(--font-sans);
}

.card-chip:hover         { background: rgba(201,162,39,0.18); }
.card-chip--result       { cursor: default; }

/* Interactive card chips in judge responses */
.card-chip--interactive {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  text-decoration-color: rgba(201,162,39,0.4);
}

.card-chip--interactive:hover {
  background:    rgba(201,162,39,0.25);
  border-color:  var(--accent-gold);
  box-shadow:    0 0 12px rgba(201,162,39,0.2);
  transform:     translateY(-1px);
}

.card-chip--interactive:active {
  transform:     translateY(0);
}

/* ── Card Rulings Modal ───────────────────────────────────────────────────── */
.card-modal-overlay {
  position:       fixed;
  inset:          0;
  z-index:        1000;
  background:     rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display:        flex;
  align-items:    center;
  justify-content:center;
  padding:        1rem;
  animation:      modal-fade-in 200ms ease;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.card-modal {
  position:       relative;
  background:     var(--bg-surface);
  border:         1px solid var(--border-bright);
  border-radius:  var(--radius-xl);
  box-shadow:     0 24px 64px rgba(0,0,0,0.6);
  max-width:      720px;
  max-height:     85dvh;
  width:          100%;
  overflow-y:     auto;
  scrollbar-width:thin;
  scrollbar-color:var(--border-dim) transparent;
  animation:      modal-scale-in 250ms cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes modal-scale-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.card-modal-close {
  position:       absolute;
  top:            0.75rem;
  right:          0.75rem;
  width:          32px;
  height:         32px;
  border-radius:  50%;
  border:         1px solid var(--border-dim);
  background:     var(--bg-elevated);
  color:          var(--text-secondary);
  font-size:      1.25rem;
  cursor:         pointer;
  display:        flex;
  align-items:    center;
  justify-content:center;
  z-index:        10;
  transition:     all var(--transition-fast);
  line-height:    1;
}

.card-modal-close:hover {
  background:   rgba(239,68,68,0.15);
  border-color: var(--invalid-red);
  color:        var(--invalid-red);
}

.card-modal-body { padding: 1.25rem; }

/* Modal loading state */
.modal-loading {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  justify-content:center;
  padding:        3rem 1.5rem;
  gap:            1rem;
}

.modal-loading-text {
  color:      var(--text-secondary);
  font-size:  0.85rem;
  font-style: italic;
}

.modal-error {
  text-align:  center;
  padding:     2rem 1.5rem;
  color:       var(--invalid-red);
  font-size:   0.9rem;
}

/* Modal card layout — image + info side by side */
.modal-card-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap:     1.25rem;
}

.modal-card-image img {
  width:        100%;
  height:       auto;
  border-radius:var(--radius-md);
  box-shadow:   var(--shadow-card);
}

.modal-card-info {
  display:        flex;
  flex-direction: column;
  gap:            0.75rem;
}

.modal-card-header {
  display:     flex;
  align-items: baseline;
  gap:         0.625rem;
  flex-wrap:   wrap;
}

.modal-card-name {
  font-size:   1.125rem;
  font-weight: 700;
  color:       var(--accent-gold);
  line-height: 1.3;
}

.modal-mana {
  font-family: var(--font-mono);
  font-size:   0.8rem;
  color:       var(--text-secondary);
}

.modal-card-type {
  font-size:   0.8rem;
  color:       var(--text-secondary);
  font-weight: 500;
  font-style:  italic;
}

.modal-oracle {
  background:   var(--bg-elevated);
  border:       1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  padding:      0.75rem;
  font-size:    0.8125rem;
  line-height:  1.7;
  color:        var(--text-primary);
}

.modal-oracle p {
  margin-bottom: 0.4em;
}
.modal-oracle p:last-child { margin-bottom: 0; }

.modal-section-label {
  font-size:     0.65rem;
  font-weight:   700;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:         var(--text-muted);
  font-family:   var(--font-mono);
  margin-top:    0.25rem;
}

/* Legality tags */
.modal-legalities {
  display:   flex;
  flex-wrap: wrap;
  gap:       0.3rem;
}

.legal-tag {
  padding:       0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size:     0.65rem;
  font-weight:   600;
  text-transform:capitalize;
  font-family:   var(--font-mono);
}

.legal-yes    { background: var(--valid-glow);   color: var(--valid-green);  border: 1px solid var(--valid-green); }
.legal-no     { background: var(--invalid-glow); color: var(--text-muted);   border: 1px solid var(--border-dim); }
.legal-banned { background: var(--invalid-glow); color: var(--invalid-red);  border: 1px solid var(--invalid-red); }

/* Rulings list */
.modal-rulings {
  display:        flex;
  flex-direction: column;
  gap:            0.5rem;
  max-height:     240px;
  overflow-y:     auto;
  scrollbar-width:thin;
  scrollbar-color:var(--border-dim) transparent;
}

.ruling-item {
  display:       flex;
  gap:           0.625rem;
  padding:       0.5rem 0.625rem;
  background:    var(--bg-elevated);
  border:        1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size:     0.8rem;
  line-height:   1.6;
  align-items:   flex-start;
}

.ruling-date {
  font-family:   var(--font-mono);
  font-size:     0.7rem;
  color:         var(--text-muted);
  flex-shrink:   0;
  padding-top:   0.125rem;
  min-width:     5.5rem;
}

.ruling-text {
  color:       var(--text-secondary);
  flex:        1;
}

.modal-scryfall-link {
  display:         inline-flex;
  align-items:     center;
  gap:             0.25rem;
  font-size:       0.8rem;
  color:           var(--accent-cyan);
  text-decoration: none;
  font-weight:     500;
  margin-top:      0.25rem;
  transition:      color var(--transition-fast);
}

.modal-scryfall-link:hover { color: #67e8f9; text-decoration: underline; }

/* ── Commander Color Identity Section ─────────────────────────────────────── */
.ci-section {
  margin-top:    1rem;
  padding:       0.875rem;
  background:    var(--bg-surface);
  border:        1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.color-identity-grid {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
}

.ci-pip {
  width:           38px;
  height:          38px;
  border-radius:   50%;
  border:          2px solid var(--border-dim);
  font-weight:     800;
  font-size:       0.8rem;
  cursor:          pointer;
  transition:      all var(--transition-base);
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-family:     var(--font-sans);
  background:      var(--bg-elevated);
  color:           var(--text-muted);
  opacity:         0.5;
}

.ci-pip:hover { opacity: 0.85; transform: scale(1.1); }

.ci-pip--W { background: var(--mana-W); color: #333; border-color: rgba(0,0,0,0.15); }
.ci-pip--U { background: var(--mana-U); color: #fff; }
.ci-pip--B { background: var(--mana-B); color: #c9a0dc; border-color: #5a4a6a; }
.ci-pip--R { background: var(--mana-R); color: #fff; }
.ci-pip--G { background: var(--mana-G); color: #fff; }

.ci-pip--active {
  opacity: 1;
  transform: scale(1.08);
  box-shadow: 0 0 14px 2px rgba(201,162,39,0.35);
  border-color: var(--accent-gold);
}

.ci-hint {
  display:     block;
  text-align:  center;
  margin-top:  0.5rem;
  font-size:   0.7rem;
  color:       var(--text-muted);
  font-style:  italic;
}

/* ── Board State — Collapsible ────────────────────────────────────────────── */
.bs-details {
  margin-top: 1rem;
}

.bs-summary {
  display:      flex;
  align-items:  center;
  gap:          0.5rem;
  padding:      0.65rem 0.875rem;
  background:   var(--bg-surface);
  border:       1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  cursor:       pointer;
  font-size:    0.85rem;
  font-weight:  600;
  color:        var(--text-primary);
  list-style:   none;
  user-select:  none;
  transition:   border-color var(--transition-base);
}

.bs-summary::-webkit-details-marker { display: none; }

.bs-summary:hover {
  border-color: var(--border-bright);
}

.bs-optional {
  font-size:   0.65rem;
  font-weight: 400;
  color:       var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bs-chevron {
  margin-left: auto;
  font-size:   0.85rem;
  color:       var(--text-muted);
  transition:  transform var(--transition-base);
}

.bs-details[open] .bs-chevron {
  transform: rotate(180deg);
}

.board-state-panel {
  margin-top:    0.5rem;
  background:    var(--bg-surface);
  border:        1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding:       0.875rem;
  display:       flex;
  flex-direction:column;
  gap:           0.75rem;
}

.bs-row {
  display:     flex;
  align-items: center;
  gap:         0.75rem;
  justify-content: space-between;
}

.bs-row--mana    { flex-wrap: wrap; align-items: flex-start; }
.bs-row--notes   { flex-direction: column; align-items: stretch; gap: 0.35rem; }

.bs-label {
  font-size:   0.75rem;
  font-weight: 600;
  color:       var(--text-secondary);
  flex-shrink: 0;
}

/* Stepper */
.bs-stepper {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
  background:  var(--bg-elevated);
  border:      1px solid var(--border-dim);
  border-radius:var(--radius-pill);
  padding:     0.2rem 0.4rem;
}

.stepper-btn {
  width:         26px;
  height:        26px;
  border-radius: 50%;
  border:        1px solid var(--border-dim);
  background:    transparent;
  color:         var(--text-secondary);
  font-size:     1rem;
  line-height:   1;
  cursor:        pointer;
  transition:    all var(--transition-fast);
  display:       flex;
  align-items:   center;
  justify-content:center;
}

.stepper-btn:hover {
  background:   rgba(201,162,39,0.15);
  border-color: var(--accent-gold);
  color:        var(--accent-gold);
}

.stepper-val {
  min-width:   2.25rem;
  text-align:  center;
  font-size:   0.9rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color:       var(--text-primary);
}

/* Mana grid */
.mana-grid {
  display:  flex;
  flex-wrap:wrap;
  gap:      0.5rem;
  width:    100%;
}

.mana-cell {
  display:       flex;
  flex-direction:column;
  align-items:   center;
  gap:           0.15rem;
}

.mana-pip {
  width:         36px;
  height:        36px;
  border-radius: 50%;
  border:        2px solid transparent;
  font-weight:   800;
  font-size:     0.8rem;
  cursor:        pointer;
  transition:    all var(--transition-fast);
  display:       flex;
  align-items:   center;
  justify-content:center;
  font-family:   var(--font-sans);
}

.pip-W { background: var(--mana-W); color: #333; border-color: rgba(0,0,0,0.15); }
.pip-U { background: var(--mana-U); color: #fff; }
.pip-B { background: var(--mana-B); color: #c9a0dc; border-color: #5a4a6a; }
.pip-R { background: var(--mana-R); color: #fff; }
.pip-G { background: var(--mana-G); color: #fff; }
.pip-C { background: var(--mana-C); color: #fff; }

.mana-pip:hover { transform: scale(1.12); box-shadow: 0 4px 12px rgba(0,0,0,0.5); }

.mana-cell--active .mana-pip {
  box-shadow: 0 0 12px 2px rgba(255,255,255,0.2);
  transform:  scale(1.06);
}

.mana-counter {
  display:     flex;
  align-items: center;
  gap:         0.15rem;
}

.mana-minus, .mana-plus {
  width:         16px;
  height:        16px;
  border-radius: 50%;
  border:        1px solid var(--border-dim);
  background:    transparent;
  color:         var(--text-muted);
  font-size:     0.7rem;
  line-height:   1;
  cursor:        pointer;
  transition:    all var(--transition-fast);
  display:       flex;
  align-items:   center;
  justify-content:center;
}

.mana-minus:hover, .mana-plus:hover {
  background:  rgba(201,162,39,0.15);
  color:       var(--accent-gold);
  border-color:var(--accent-gold);
}

.mana-val {
  font-size:   0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color:       var(--text-primary);
  min-width:   1rem;
  text-align:  center;
}

/* Notes textarea */
.bs-notes-input {
  width:        100%;
  padding:      0.5rem 0.75rem;
  background:   var(--bg-input);
  border:       1px solid var(--border-subtle);
  border-radius:var(--radius-sm);
  color:        var(--text-primary);
  font-family:  var(--font-sans);
  font-size:    0.8125rem;
  resize:       none;
  outline:      none;
  transition:   border-color var(--transition-fast);
}

.bs-notes-input:focus      { border-color: var(--accent-gold); }
.bs-notes-input::placeholder { color: var(--text-muted); }

/* ── Check Combo Button ── */
.check-btn {
  width:         100%;
  margin-top:    1rem;
  padding:       0.75rem 1.25rem;
  border:        none;
  border-radius: var(--radius-lg);
  background:    linear-gradient(135deg, var(--accent-gold) 0%, #a07818 100%);
  color:         #080a0f;
  font-family:   var(--font-sans);
  font-size:     0.9375rem;
  font-weight:   700;
  cursor:        pointer;
  display:       flex;
  align-items:   center;
  justify-content:center;
  gap:           0.5rem;
  transition:    all var(--transition-base);
  box-shadow:    0 4px 20px rgba(201,162,39,0.3);
  letter-spacing:0.02em;
}

.check-btn:hover:not(:disabled) {
  transform:  translateY(-2px);
  box-shadow: 0 8px 32px rgba(201,162,39,0.45);
}

.check-btn:active:not(:disabled) { transform: translateY(0); }
.check-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.check-btn-icon { font-size: 1.1rem; }

.check-btn-spinner {
  width:         16px;
  height:        16px;
  border:        2.5px solid rgba(8,10,15,0.3);
  border-top-color: #080a0f;
  border-radius: 50%;
  animation:     spin 0.7s linear infinite;
}

/* ── Results Panel ── */
.combo-results {
  position:   sticky;
  top:        72px;
  background: var(--bg-surface);
  border:     1px solid var(--border-subtle);
  border-radius:var(--radius-xl);
  overflow:   hidden;
  min-height: 360px;
  max-height: calc(100dvh - 88px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-dim) transparent;
}

/* Empty state */
.results-empty {
  display:       flex;
  flex-direction:column;
  align-items:   center;
  justify-content:center;
  text-align:    center;
  padding:       3rem 1.5rem;
  min-height:    360px;
  gap:           0.75rem;
}

.results-empty-icon {
  font-size: 3rem;
  opacity:   0.6;
  animation: float 4s ease-in-out infinite;
}

.results-empty-title {
  font-size:   1.25rem;
  font-weight: 700;
  color:       var(--accent-gold);
}

.results-empty-sub {
  font-size:   0.8125rem;
  color:       var(--text-muted);
  max-width:   280px;
  line-height: 1.6;
}

/* Result content */
.results-content { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }

/* Verdict banner */
.verdict-banner {
  display:       flex;
  align-items:   center;
  gap:           0.875rem;
  padding:       1rem 1.125rem;
  border-radius: var(--radius-lg);
  border:        2px solid transparent;
  animation:     verdict-in 400ms cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes verdict-in {
  from { opacity:0; transform: scale(0.92); }
  to   { opacity:1; transform: scale(1); }
}

.verdict-banner--valid {
  background:   var(--valid-glow);
  border-color: var(--valid-green);
  box-shadow:   var(--shadow-glow-valid);
}

.verdict-banner--invalid {
  background:   var(--invalid-glow);
  border-color: var(--invalid-red);
  box-shadow:   var(--shadow-glow-invalid);
}

.verdict-icon {
  font-size:   1.75rem;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
}

.verdict-banner--valid   .verdict-icon { color: var(--valid-green); }
.verdict-banner--invalid .verdict-icon { color: var(--invalid-red); }

.verdict-text { flex: 1; }

.verdict-label {
  font-size:   0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family:  var(--font-mono);
  opacity:      0.8;
}

.verdict-banner--valid   .verdict-label { color: var(--valid-green); }
.verdict-banner--invalid .verdict-label { color: var(--invalid-red); }

.verdict-combo {
  font-size:   0.9rem;
  font-weight: 600;
  color:       var(--text-primary);
  margin-top:  0.125rem;
  line-height: 1.4;
}

.verdict-badge {
  padding:       0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size:     0.65rem;
  font-weight:   800;
  letter-spacing:0.1em;
  text-transform:uppercase;
  font-family:   var(--font-mono);
  flex-shrink:   0;
}

.verdict-banner--valid   .verdict-badge { background: var(--valid-green);  color: #080a0f; }
.verdict-banner--invalid .verdict-badge { background: var(--invalid-red);  color: #fff; }

/* Judge call warning */
.judge-call-warning {
  background:    rgba(245,158,11,0.1);
  border:        1px solid var(--warn-amber);
  border-radius: var(--radius-md);
  padding:       0.6rem 0.875rem;
  font-size:     0.8125rem;
  color:         var(--warn-amber);
  font-weight:   500;
}

/* Result sections */
.result-section {
  display:       flex;
  flex-direction:column;
  gap:           0.5rem;
}

.result-section-label {
  font-size:     0.65rem;
  font-weight:   700;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:         var(--text-muted);
  font-family:   var(--font-mono);
}

.result-cards-list {
  display:  flex;
  flex-wrap:wrap;
  gap:      0.3rem;
}

/* Explanation */
.result-explanation { color: var(--text-secondary); line-height: 1.8; font-size: 0.875rem; }
.result-explanation p { margin-bottom: 0.6em; }
.result-explanation p:last-child { margin-bottom: 0; }

/* Step list */
.step-list {
  list-style: none;
  display:    flex;
  flex-direction: column;
  gap:        0.625rem;
  counter-reset: step;
}

.step-item {
  display:     flex;
  gap:         0.75rem;
  align-items: flex-start;
}

.step-num {
  flex-shrink:   0;
  width:         26px;
  height:        26px;
  border-radius: 50%;
  background:    rgba(201,162,39,0.15);
  border:        1px solid var(--accent-gold-dim);
  color:         var(--accent-gold);
  font-size:     0.7rem;
  font-weight:   700;
  font-family:   var(--font-mono);
  display:       flex;
  align-items:   center;
  justify-content:center;
}

.step-text {
  flex:       1;
  color:      var(--text-secondary);
  line-height:1.7;
  font-size:  0.85rem;
  padding-top:0.2rem;
}

/* Rule links */
.rule-link {
  color:           var(--accent-cyan);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  transition:      color var(--transition-fast);
  font-family:     var(--font-mono);
  font-size:       0.82em;
}

.rule-link:hover { color: #67e8f9; }

/* Error state */
.results-error {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  justify-content:center;
  text-align:     center;
  padding:        2.5rem 1.5rem;
  gap:            0.75rem;
  min-height:     260px;
}

.results-error-icon { font-size: 2.25rem; }

.results-error-text {
  color:      var(--invalid-red);
  font-size:  0.85rem;
  max-width:  320px;
  line-height:1.6;
}

/* Loading state */
.results-loading {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  justify-content:center;
  padding:        3rem 1.5rem;
  gap:            1rem;
  min-height:     360px;
}

.results-loading-spinner {
  width:        56px;
  height:       56px;
  border:       3px solid var(--border-dim);
  border-top-color: var(--accent-gold);
  border-radius:50%;
  animation:    spin 0.9s linear infinite;
  box-shadow:   var(--shadow-gold);
}

.results-loading-text {
  color:      var(--text-secondary);
  font-size:  0.875rem;
  font-style: italic;
  animation:  blink 2s ease-in-out infinite;
}

/* ── Card Image Tooltip ────────────────────────────────────────────────────── */
.card-tooltip {
  position:      fixed;
  z-index:       999;
  pointer-events:none;
  border-radius: var(--radius-md);
  overflow:      hidden;
  box-shadow:    0 16px 48px rgba(0,0,0,0.7), 0 0 0 1px var(--border-bright);
  transition:    opacity 140ms ease;
  width:         200px;
}

.card-tooltip.hidden { display: none; }

.card-tooltip-img {
  display:   block;
  width:     100%;
  height:    auto;
  border-radius: var(--radius-md);
}

/* ── Error inline ──────────────────────────────────────────────────────────── */
.error-inline { color: var(--invalid-red); }
.muted { color: var(--text-muted); font-size: 0.8125rem; }

/* ── Scrollbar styling ─────────────────────────────────────────────────────── */
::-webkit-scrollbar             { width: 5px; }
::-webkit-scrollbar-track       { background: transparent; }
::-webkit-scrollbar-thumb       { background: var(--border-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-bright); }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .combo-layout {
    grid-template-columns: 1fr;
  }

  .combo-results {
    position: static;
    max-height: none;
    min-height: 200px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .header-inner  { padding: 0 0.75rem; gap: 0.5rem; height: 50px; }
  .brand-sub     { display: none; }
  .brand-name    { font-size: 0.9rem; }
  .brand-icon    { font-size: 1.25rem; }
  .tab-btn .tab-label { display: none; }
  .tab-btn .tab-icon  { font-size: 1.1rem; }
  .tab-btn       { padding: 0.35rem 0.65rem; }
  .header-status { display: none; }

  .app-main { padding: 0.625rem; }

  /* Judge chat */
  .judge-layout {
    height: calc(var(--visual-vh, 100dvh) - 50px - 1.25rem);
  }
  .chat-welcome { padding: 1.5rem 1rem; }
  .welcome-icon { font-size: 2.5rem; }
  .welcome-title { font-size: 1.375rem; }
  .welcome-body  { font-size: 0.85rem; }
  .chat-bubble { max-width: 92%; }
  .bubble-avatar { width: 30px; height: 30px; font-size: 1rem; }
  .bubble-text   { padding: 0.6rem 0.75rem; font-size: 0.85rem; }
  .qp-chip       { font-size: 0.7rem; padding: 0.2rem 0.5rem; }
  .chat-textarea {
    font-size: 16px;  /* Prevent iOS/Firefox zoom on focus */
    min-height: 40px;
    padding: 0.5rem 0.75rem;
  }
  .send-btn      { width: 40px; height: 40px; }

  /* Combo finder */
  .combo-layout { gap: 1rem; }

  .section-header {
    flex-direction: column;
    gap: 0.25rem;
  }

  .card-slot { padding: 0.625rem; }
  .slot-input { font-size: 0.8rem; padding: 0.45rem 0.625rem; }

  .ci-section { padding: 0.625rem; }
  .ci-pip     { width: 34px; height: 34px; font-size: 0.75rem; }

  .bs-summary { font-size: 0.8rem; padding: 0.5rem 0.75rem; }
  .board-state-panel { padding: 0.625rem; }
  .bs-label   { font-size: 0.7rem; }

  .mana-pip  { width: 32px; height: 32px; font-size: 0.75rem; }
  .mana-grid { gap: 0.375rem; }
  .mana-minus, .mana-plus { width: 14px; height: 14px; font-size: 0.65rem; }
  .mana-val  { font-size: 0.75rem; }

  .check-btn { font-size: 0.875rem; padding: 0.65rem 1rem; }

  .results-empty { padding: 2rem 1rem; min-height: 200px; }
  .results-empty-icon { font-size: 2.25rem; }
  .results-empty-title { font-size: 1.1rem; }
  .results-content { padding: 1rem; }
  .verdict-banner { padding: 0.75rem; gap: 0.625rem; }
  .verdict-icon  { font-size: 1.5rem; }

  .step-item { gap: 0.5rem; }
  .step-num  { width: 22px; height: 22px; font-size: 0.65rem; }
  .step-text { font-size: 0.8rem; }

  /* Modal on mobile */
  .card-modal-overlay { padding: 0.5rem; }
  .card-modal { max-height: 90dvh; border-radius: var(--radius-lg); }
  .card-modal-body { padding: 0.875rem; }
  .modal-card-layout { grid-template-columns: 1fr; }
  .modal-card-image img { max-width: 180px; margin: 0 auto; display: block; }
  .modal-card-name { font-size: 1rem; }
  .ruling-item { flex-direction: column; gap: 0.25rem; }
  .ruling-date { min-width: unset; }

  /* Card chips on mobile */
  .card-chip--interactive { font-size: 0.7rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Very small phones
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .app-main      { padding: 0.375rem; }
  .header-inner  { padding: 0 0.5rem; }
  .brand-name    { font-size: 0.8rem; }
  .tab-nav       { padding: 2px; }
  .color-identity-grid { gap: 0.375rem; }
  .ci-pip        { width: 30px; height: 30px; font-size: 0.7rem; }
  .mana-pip      { width: 28px; height: 28px; font-size: 0.7rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   "YOU BROKE IT!" — Celebration Banner
══════════════════════════════════════════════════════════════════════════ */

.broke-it-overlay {
  position:   fixed;
  top:        0;
  left:       0;
  right:      0;
  z-index:    2000;
  display:    flex;
  justify-content: center;
  padding-top:1.5rem;
  pointer-events: none;
  animation:  broke-in 500ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.broke-it-overlay.hidden { display: none; }

.broke-it--exit {
  animation: broke-out 500ms ease-out forwards;
}

@keyframes broke-in {
  0%   { opacity: 0; transform: translateY(-60px) scale(0.8); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes broke-out {
  to { opacity: 0; transform: translateY(-40px) scale(0.9); }
}

.broke-it-banner {
  display:      flex;
  align-items:  center;
  gap:          0.75rem;
  padding:      0.75rem 2rem;
  background:   linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,140,0,0.12));
  border:       1px solid var(--accent-gold);
  border-radius:var(--radius-pill);
  box-shadow:   0 8px 32px rgba(201,162,39,0.3), 0 0 60px rgba(255,165,0,0.1);
  pointer-events: auto;
  cursor:       pointer;
}

.broke-it-icon {
  font-size: 1.75rem;
  animation: broke-pulse 600ms ease-in-out 3;
}

@keyframes broke-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.3); }
}

.broke-it-title {
  font-family:    var(--font-sans);
  font-size:      1.25rem;
  font-weight:    800;
  letter-spacing: 0.06em;
  color:          transparent;
  background:     linear-gradient(135deg, #ffd700, #ff8c00, #ff4500);
  -webkit-background-clip: text;
  background-clip:text;
}

.broke-it-subtitle {
  font-family: var(--font-mono);
  font-size:   0.75rem;
  color:       var(--text-secondary);
  max-width:   300px;
  white-space: nowrap;
  overflow:    hidden;
  text-overflow:ellipsis;
}

@media (max-width: 640px) {
  .broke-it-banner { padding: 0.6rem 1.25rem; gap: 0.5rem; }
  .broke-it-icon   { font-size: 1.25rem; }
  .broke-it-title  { font-size: 1rem; }
  .broke-it-subtitle { display: none; }
}

/* ── Feedback bar ─────────────────────────────────────────────────────────── */

.feedback-bar {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.fb-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
  line-height: 1;
}

.fb-btn:hover:not(:disabled) {
  opacity: 1;
  background: rgba(255,255,255,0.08);
  transform: scale(1.1);
}

.fb-btn--selected {
  opacity: 1 !important;
  transform: scale(1.15);
}

.fb-btn--up.fb-btn--selected {
  border-color: #4ade80;
  background: rgba(74,222,128,0.15);
}

.fb-btn--down.fb-btn--selected {
  border-color: #f87171;
  background: rgba(248,113,113,0.15);
}

.fb-btn--dimmed {
  opacity: 0.2 !important;
  pointer-events: none;
}

.fb-btn:disabled {
  cursor: default;
}

/* Comment box (expands on 👎) */
.fb-comment {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 0;
}

.fb-comment--open {
  max-height: 200px;
  opacity: 1;
  margin-top: 0.5rem;
}

.fb-comment-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text);
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
  resize: vertical;
  min-height: 2.5rem;
  font-family: inherit;
}

.fb-comment-input:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}

.fb-comment-input::placeholder {
  color: rgba(255,255,255,0.35);
}

.fb-comment-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.35rem;
  justify-content: flex-end;
}

.fb-comment-send,
.fb-comment-skip {
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.fb-comment-send {
  background: var(--accent, #6366f1);
  color: #fff;
}

.fb-comment-send:hover {
  background: #818cf8;
}

.fb-comment-skip {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
}

.fb-comment-skip:hover {
  background: rgba(255,255,255,0.14);
}

/* Thanks confirmation */
.fb-thanks {
  font-size: 0.78rem;
  color: #4ade80;
  opacity: 0;
  animation: fbFadeIn 0.4s ease forwards;
}

@keyframes fbFadeIn {
  to { opacity: 1; }
}
