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

:root {
  --bg:         #0c0e14;
  --surface:    #13151f;
  --surface-2:  #1c1f2e;
  --surface-3:  #252838;
  --border:     #272a3a;
  --border-2:   #32364a;
  --text:       #e0e2ef;
  --text-muted: #9294b0;
  --text-dim:   #b0b2c8;
  --gold:       #e8b84b;
  --gold-light: #f5d075;
  --gold-dim:   rgba(232, 184, 75, 0.12);
  --error:      #f75c5c;
  --success:    #52c87b;
  --info:       #4da6ff;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow:     0 4px 24px rgba(0,0,0,.5);
  --shadow-sm:  0 2px 8px rgba(0,0,0,.35);
}

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
ul { list-style: none; }

/* ─── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Navbar ──────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: rgba(12,14,20,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.1rem;
  font-weight: 500;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0;
}

.logo .tld {
  background: linear-gradient(90deg, #a86800 0%, #e8b84b 40%, #ffd700 70%, #c8860a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.nav-links a {
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  transition: color .15s;
}
.nav-links a:hover { color: var(--text); }
.nav-request-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 500;
  padding: .35rem .8rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.nav-request-btn:hover {
  border-color: var(--gold);
  color: var(--text);
}

/* ─── Request Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}
.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: .25rem .5rem;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,.06); }
.modal-desc {
  color: var(--text-muted);
  font-size: .875rem;
  margin-bottom: 1.5rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1.1rem;
}
.form-group label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.label-optional {
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
}
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  padding: .55rem .8rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  resize: vertical;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232,184,75,.15);
}
.form-group select { cursor: pointer; }
.form-actions { margin-top: 1.5rem; }
.form-feedback {
  margin-top: .85rem;
  font-size: .85rem;
  padding: .5rem .75rem;
  border-radius: var(--radius);
}
.form-feedback[hidden] { display: none; }
.feedback-ok  { background: rgba(82,200,123,.12); color: #52c87b; border: 1px solid rgba(82,200,123,.25); }
.feedback-err { background: rgba(255,80,80,.1);   color: #ff6b6b; border: 1px solid rgba(255,80,80,.2); }


.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  border: none;
  transition: background .15s, color .15s, transform .1s, box-shadow .15s;
  line-height: 1.4;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: var(--gold);
  color: #0c0e14;
}
.btn-primary:hover:not(:disabled) {
  background: var(--gold-light);
  box-shadow: 0 0 16px rgba(232,184,75,.35);
}

.btn-secondary {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border-2);
}
.btn-secondary:hover {
  background: var(--border-2);
  border-color: var(--gold);
  color: var(--gold);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-2);
}
.btn-outline:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--surface-2);
}
.btn-outline.btn-active {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: .4rem .7rem;
}
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

/* ─── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-beginner   { background: rgba(82,200,123,.15); color: #52c87b; }
.badge-intermediate { background: rgba(232,184,75,.15); color: #e8b84b; }
.badge-advanced   { background: rgba(247,92,92,.15); color: #f75c5c; }

/* ─── Container ───────────────────────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─── Hero ────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 3.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(232,184,75,.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: .75rem;
}
.hero h1 .accent {
  background: linear-gradient(0deg, #a86800 0%, #e8b84b 40%, #ffd700 70%, #c8860a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero p {
  font-size: clamp(.95rem, 2vw, 1.1rem);
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 2rem;
}

/* ─── Section Title ───────────────────────────────────────────────── */
.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1.25rem;
}

/* ─── Ninja Speech Bubble ─────────────────────────────────────────── */
.ninja-bubble {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  margin-top: .75rem;
  margin-bottom: 2.75rem;
}
.ninja-emoji {
  font-size: 2.4rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
}
.bubble {
  position: relative;
  top: -0.7rem;
  background: linear-gradient(-90deg, rgba(232,184,75,.14) 0%, rgba(232,184,75,.07) 100%);
  border: 1px solid rgba(232,184,75,.45);
  border-radius: 1rem 1rem 1rem .4rem;
  padding: .6rem 1.15rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 4px 18px rgba(0,0,0,.35), 0 0 0 1px rgba(232,184,75,.08) inset;
  max-width: min(340px, 70vw);
}
/* tail border */
.bubble::before {
  content: '';
  position: absolute;
  left: -.7rem;
  top: 75%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: .45rem solid transparent;
  border-bottom: .45rem solid transparent;
  border-right: .65rem solid rgba(232,184,75,.45);
}
/* tail fill */
.bubble::after {
  content: '';
  position: absolute;
  left: -.45rem;
  top: 75%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: .48rem solid transparent;
  border-bottom: .48rem solid transparent;
  border-right: .55rem solid #1e1a10;
}

/* ─── Opening Cards Grid ──────────────────────────────────────────── */

/* Browse toolbar: search + filter chips */
.browse-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.search-wrap {
  position: relative;
  flex: 1 1 220px;
  max-width: 360px;
}
.search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: .55rem .85rem .55rem 2.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232,184,75,.15);
}
/* hide the browser clear button */
.search-input::-webkit-search-cancel-button { display: none; }

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  justify-content: center;
}
.chip-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .4rem;
}
.chip {
  padding: .35rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.chip:hover {
  border-color: var(--gold);
  color: var(--text);
}
.chip-active {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1108;
  font-weight: 700;
}
.chip-divider {
  width: 1px;
  height: 1.2rem;
  background: var(--border);
  margin: 0 .15rem;
}
.chip-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 0;
  font-size: .95rem;
}

.openings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  padding-bottom: 4rem;
}

.opening-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color .2s, box-shadow .2s, transform .15s;
  overflow: hidden;
  border-left-width: 3px;
}
.opening-card.color-white { border-left-color: rgba(255,250,235,.6); }
.opening-card.color-black { border-left-color: rgba(120,100,180,.5); }
.opening-card.color-both  { border-left-color: var(--border); }
.opening-card:hover {
  border-color: var(--gold);
  border-left-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(232,184,75,.2), 0 8px 32px rgba(0,0,0,.4);
  transform: translateY(-2px);
}

.opening-card-inner { padding: 1.4rem; }

.opening-eco {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gold);
  margin-bottom: .5rem;
}
.opening-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .25rem;
  letter-spacing: -.015em;
}
.opening-subtitle {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}
.opening-desc {
  font-size: .85rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 1rem;
}
.opening-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-right {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.color-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .5rem;
  border-radius: 999px;
  letter-spacing: .02em;
}
.color-badge-white {
  background: rgba(240,230,200,.1);
  color: rgba(255,250,235,1);
  border: 1px solid rgba(240,230,200,.2);
}
.color-badge-black {
  background: rgba(100,90,140,.15);
  color: rgba(150,140,190,.85);
  border: 1px solid rgba(120,110,160,.25);
}
.color-badge-both {
  background: rgba(255,255,255,.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.line-count {
  font-size: .75rem;
  color: var(--text-muted);
}

/* ─── Page Header ─────────────────────────────────────────────────── */
.page-header {
  background: linear-gradient(180deg, rgba(232,184,75,.05) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
}
.page-header .container { display: flex; flex-direction: column; gap: .5rem; }

.breadcrumb {
  font-size: .8rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-bottom: .25rem;
  transition: color .15s;
}
.breadcrumb:hover { color: var(--text); }

.page-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
}
.eco-badge {
  font-size: .75rem;
  font-weight: 600;
  background: var(--gold-dim);
  color: var(--gold);
  padding: .2rem .6rem;
  border-radius: 20px;
  border: 1px solid rgba(232,184,75,.25);
  letter-spacing: .02em;
}
.page-header .subtitle {
  font-size: .95rem;
  color: var(--gold);
  font-weight: 500;
}
.page-header .description {
  font-size: .9rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.65;
}

/* ─── Lines Section ───────────────────────────────────────────────── */
.lines-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0 1rem;
}
.lines-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.lines-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding-bottom: 4rem;
}

.line-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  transition: border-color .2s, box-shadow .15s;
}
.line-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-sm);
}

.line-select { padding-top: .15rem; flex-shrink: 0; }

.line-checkbox {
  width: 17px;
  height: 17px;
  accent-color: var(--gold);
  cursor: pointer;
  border-radius: 4px;
}

.line-info { flex: 1; min-width: 0; }

.line-name-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .3rem;
  flex-wrap: wrap;
}
.line-name {
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -.01em;
}
.line-description {
  font-size: .85rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: .6rem;
}
.line-moves {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: .8rem;
  color: var(--text-muted);
  background: var(--surface-2);
  display: inline-block;
  padding: .3rem .65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  letter-spacing: .01em;
}

.line-actions { flex-shrink: 0; display: flex; align-items: center; }

/* ─── Practice Layout ─────────────────────────────────────────────── */
.practice-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  grid-template-areas: "board sidebar";
  gap: 0;
  height: calc(100vh - 60px);
  align-items: stretch;
}

.practice-board-container {
  grid-area: board;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  overflow: hidden;
}

.practice-sidebar {
  grid-area: sidebar;
  padding: 2rem 1.75rem;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--border);
}

#board {
  /* Fill as much of the container as possible — board is square so use the smaller dimension */
  width: min(calc(100vh - 60px - 5rem), calc(100% - 4rem));
  box-shadow: 0 8px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04);
  border-radius: 4px;
  overflow: hidden;
  /* Prevent touch scroll while dragging pieces on mobile */
  touch-action: none;
}
/* Prevent scroll when dragging pieces on mobile — must cover all children */
#board, #board * {
  touch-action: none;
}

/* Override chessboard.js highlight colors */
.highlight-white { box-shadow: inset 0 0 0 4px rgba(232,184,75,.7) !important; }
.highlight-black { box-shadow: inset 0 0 0 4px rgba(77,166,255,.7) !important; }



.line-title-box { border-bottom: 1px solid var(--border); padding-bottom: 1.25rem; }
.line-title-box h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: .2rem;
}
.practice-line-subtitle {
  font-size: .8rem;
  color: var(--gold);
  font-weight: 500;
}
.line-meta-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .6rem;
}
.line-count-badge {
  font-size: .75rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .15rem .6rem;
}

/* ─── Move List ───────────────────────────────────────────────────── */
.move-list {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem;
  min-height: 80px;
}

/* ─── Moves header & toggle ───────────────────────────────────────── */
.moves-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}
.moves-header .section-title { margin-bottom: 0; }
.moves-toggles {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .3rem;
}
.moves-toggles .toggle-label {
  flex-direction: row-reverse;
}
.moves-toggles .toggle-text {
  width: 5rem;
  text-align: right;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  user-select: none;
}
.toggle-label input { display: none; }

.toggle-track {
  width: 30px;
  height: 17px;
  background: var(--border-2);
  border-radius: 999px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform .2s, background .2s;
}
.toggle-label input:checked + .toggle-track { background: var(--gold); }
.toggle-label input:checked + .toggle-track .toggle-thumb {
  transform: translateX(13px);
  background: #0c0e14;
}
.toggle-text {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.moves-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: .82rem;
}
.moves-table tr:hover { background: rgba(255,255,255,.02); }
.move-num {
  color: var(--text-dim);
  padding: .2rem .4rem .2rem 0;
  width: 28px;
  text-align: right;
  font-size: .75rem;
  vertical-align: middle;
}
.move-cell {
  padding: .22rem .45rem;
  border-radius: 4px;
  cursor: default;
  transition: background .1s;
  vertical-align: middle;
  min-width: 60px;
}
.move-cell.played { color: var(--text-dim); }
.move-cell.current {
  background: var(--gold-dim);
  color: var(--gold);
  font-weight: 600;
  border: 1px solid rgba(232,184,75,.3);
}
.move-cell.future { color: var(--text-muted); }

/* ─── Practice Status ─────────────────────────────────────────────── */
.practice-status {
  border-radius: var(--radius);
  overflow: hidden;
}
.status-info, .status-idle {
  background: rgba(77,166,255,.1);
  border: 1px solid rgba(77,166,255,.25);
  color: #7dc3ff;
  padding: .65rem 1rem;
  font-size: .875rem;
  border-radius: var(--radius);
}
.status-error {
  background: rgba(247,92,92,.1);
  border: 1px solid rgba(247,92,92,.25);
  color: #ff8585;
  padding: .65rem 1rem;
  font-size: .875rem;
  border-radius: var(--radius);
  animation: shake .3s ease;
}
.status-success {
  background: rgba(82,200,123,.1);
  border: 1px solid rgba(82,200,123,.25);
  color: #6fe89a;
  padding: .65rem 1rem;
  font-size: .875rem;
  border-radius: var(--radius);
}
.status-hint {
  background: rgba(232,184,75,.1);
  border: 1px solid rgba(232,184,75,.25);
  color: var(--gold);
  padding: .65rem 1rem;
  font-size: .875rem;
  border-radius: var(--radius);
}

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

/* ─── Practice Controls ───────────────────────────────────────────── */
.practice-controls {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.practice-controls .btn { flex: 1; justify-content: center; min-width: 80px; }

/* ─── Line Tips ───────────────────────────────────────────────────── */
.line-tips {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.line-tips h4 {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .65rem;
}
.line-tips ul { display: flex; flex-direction: column; gap: .45rem; }
.line-tips li {
  font-size: .82rem;
  color: var(--text-dim);
  line-height: 1.5;
  padding-left: 1rem;
  position: relative;
}
.line-tips li::before {
  content: '▸';
  position: absolute;
  left: 0;
  font-size: .75rem;
  top: .05rem;
  color: var(--gold);
  opacity: .8;
}

/* ─── Goal & Streak Bar ───────────────────────────────────────────── */
.goal-area {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.goal-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}
.goal-input {
  width: 52px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  padding: .2rem .5rem;
  text-align: center;
  appearance: none;
  -moz-appearance: textfield;
}
.goal-input::-webkit-inner-spin-button,
.goal-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.goal-input:focus { outline: none; border-color: var(--gold); }

.streak-bar-track {
  position: relative;
  height: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.streak-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #c48a20, var(--gold), var(--gold-light));
  border-radius: var(--radius);
  transition: width .4s cubic-bezier(.34,1.56,.64,1);
}
.streak-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text);
  mix-blend-mode: difference;
  pointer-events: none;
}

/* ─── Score Counter ───────────────────────────────────────────────── */
.score-counter {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.score-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .6rem .5rem;
  gap: .1rem;
}
.score-value {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--gold);
  line-height: 1;
}
.score-label {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}
.score-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ─── Progress Bar ────────────────────────────────────────────────── */
.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width .4s ease;
}

/* ─── 404 ─────────────────────────────────────────────────────────── */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  gap: 1rem;
  text-align: center;
  padding: 2rem;
}
.not-found h2 { font-size: 2rem; font-weight: 800; }
.not-found p { color: var(--text-muted); }

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .practice-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "board" "sidebar";
    height: auto;
  }
  .practice-board-container {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
  }
  #board {
    width: min(calc(100vw - 2rem), 480px);
  }
  .practice-sidebar {
    width: 100%;
    border-left: none;
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 600px) {
  .navbar { padding: 0 1rem; }
  .line-card { flex-wrap: wrap; }
  .line-actions { width: 100%; }
  .line-actions .btn { width: 100%; justify-content: center; }
}

/* ── Ad slots ────────────────────────────────────────────────────── */
.ad-slot {
  min-height: 90px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.ad-slot-home {
  margin: 2rem auto 0;
  max-width: 728px;
}
.ad-slot-sidebar {
}
.ad-slot-blocked {
  border: 1px dashed var(--border-2);
  padding: 1rem 1.25rem;
}
.ad-blocked {
  text-align: center;
}
.ad-blocked p {
  margin: 0.25rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.ad-blocked p:first-child {
  color: var(--text-dim);
}

/* ── Cookie consent banner ───────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border-2);
  z-index: 400;
  padding: 0.9rem 1.5rem;
}
.cookie-banner-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.cookie-banner-inner p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-dim);
  flex: 1;
  min-width: 200px;
}
.cookie-banner-inner a { color: var(--gold); }
.cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.btn-sm {
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.site-footer p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.site-footer a { color: var(--gold); }

body.is-practice .site-footer { display: none; }
.privacy-page {
  max-width: 720px;
  padding: 3rem 1.5rem;
}
.privacy-page h1 {
  margin-bottom: 0.25rem;
}
.privacy-updated {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2.5rem;
}
.privacy-page section {
  margin-bottom: 2rem;
}
.privacy-page h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-dim);
}
.privacy-page p, .privacy-page li {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-dim);
}
.privacy-page a { color: var(--gold); }
.privacy-page code {
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.85em;
}
.privacy-page ul {
  padding-left: 1.25rem;
}
.privacy-consent-actions {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
}
.privacy-consent-status {
  font-size: 0.85rem;
  color: var(--text-muted);
}
