/* ============================================================================
   Chanky Circle (learn) - shared styles
   Header/start-screen styling ported from melt/learn; the rule-card/badge/
   chip/exception-panel system is ported verbatim (structure + class names)
   from stress/learn's own guide-page CSS, which is itself already the
   site's adaptation of chunks02.html's own visual language
   (electric-yellow -> accent-gold, spotlight-blue -> the chunk-spotlight
   orange chunks/study and chunks/practice already use, so a chip here
   reads as the same signal as a brick in those sibling apps).
   ============================================================================ */

:root {
  --bg-color: #232323;
  --card-color: #1d1d1d;
  --exception-bg: #161616;
  --accent-gold: #e6c27a;
  --hot-pink: #FF2E88;
  --light-gray: #D8D8D8;
  --darker-gray: #888888;

  --chunk-spotlight: #FFB74D;
  --sep-blue: #00F0FF;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg-color);
  color: var(--light-gray);
  font-family: Verdana, Geneva, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 60px;
}

a { color: inherit; }

/* -------------------------------------------------------------------------
   Header (shared: start screen, rules screen)
   ------------------------------------------------------------------------- */
header.app-header {
  position: sticky;
  top: 0;
  background-color: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(5px);
  border-bottom: 2px solid var(--card-color);
  padding: 15px 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-title { display: flex; align-items: center; gap: 12px; }
.logo-link { display: inline-flex; border-radius: 50%; line-height: 0; flex-shrink: 0; }
.logo-img { width: 56px; height: 56px; border-radius: 50%; display: block; object-fit: cover; }

.back-link {
  color: var(--darker-gray);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent-gold); }

header.app-header h1 {
  color: var(--accent-gold);
  font-size: 1.3rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* -------------------------------------------------------------------------
   Start screen - group grid, matching stress/learn's own convention
   exactly (3 numbered groups, a Go button and a "?" out to the source
   guide).
   ------------------------------------------------------------------------- */
.hero { max-width: 800px; margin: 30px auto 0; padding: 0 20px; }
.hero p { color: #c8c8c8; font-size: 1.05rem; }

main { max-width: 800px; margin: 0 auto; padding: 20px; }

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.level-card {
  background-color: var(--card-color);
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.level-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 4px; }
.level-desc { color: #999; font-size: 0.85rem; margin-bottom: 14px; }

.group-actions { display: flex; gap: 10px; margin-top: auto; }

.go-btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  padding: 8px 20px;
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s ease, opacity 0.15s ease;
  flex: 1 1 auto;
  background-color: var(--accent-gold);
  color: #121212;
}
.go-btn:hover { transform: translateY(-1px); opacity: 0.92; }

.no-results {
  display: none;
  text-align: center;
  padding: 40px;
  color: var(--darker-gray);
}

.site-footer {
  text-align: center;
  color: var(--darker-gray);
  font-size: 0.8rem;
  margin-top: 40px;
}

/* -------------------------------------------------------------------------
   Rules screen - rule cards, confidence badges, example chips, exception
   panels. Ported verbatim from stress/learn's own guide-page CSS.
   ------------------------------------------------------------------------- */
.guide-main { max-width: 800px; margin: 30px auto; padding: 0 20px; }

.global-controls { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 14px; }
.control-btn {
  background: none;
  border: 1px solid #444;
  color: var(--darker-gray);
  padding: 5px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 700;
}
.control-btn:hover { color: var(--accent-gold); border-color: var(--accent-gold); }

.rule-card {
  background-color: var(--card-color);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid #252525;
}

.card-header {
  padding: 18px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  user-select: none;
  background-color: #222222;
}

.pattern-visual {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 0.03em;
}

.header-meta { display: flex; align-items: center; gap: 12px; }

.badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-high { background-color: #2b7a3e; color: #e2f7e6; }
.badge-mid { background-color: #3b6b8c; color: #e6f2fc; }
.badge-low { background-color: #8c4f3b; color: #fcebe6; }

.arrow { font-size: 0.8rem; transition: transform 0.3s; color: var(--darker-gray); }
.rule-card.active .arrow { transform: rotate(180deg); }

.card-body { padding: 20px; display: none; border-top: 1px solid #2a2a2a; }
.rule-card.active .card-body { display: block; }

.explanation { font-size: 0.95rem; margin-bottom: 15px; color: #c8c8c8; }

.chip-group-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--darker-gray);
  margin-bottom: 6px;
  font-weight: 600;
}

.chips-container { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }

.word-chip {
  background-color: #2a2a2a;
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid #3a3a3a;
}
.word-chip strong { color: var(--darker-gray); font-size: 0.85em; }

/* The three chip-content marks every example carries, matching
   chunks/study's and chunks/practice's own brick colors so a chip here
   reads as the same signal as a brick in those sibling apps. */
.spotlight { color: var(--chunk-spotlight); font-weight: 800; }
.chunk-sep { color: var(--sep-blue); font-weight: 800; padding: 0 4px; }
.mumble { color: var(--darker-gray); font-style: italic; }

.exception-panel {
  background-color: var(--exception-bg);
  border-left: 4px solid var(--hot-pink);
  border-top: 1px solid #25121a;
  border-right: 1px solid #25121a;
  border-bottom: 1px solid #25121a;
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
}

.exception-title {
  color: var(--hot-pink);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.exception-words { color: #e0b3c5; font-size: 0.9rem; line-height: 1.5; }
.exception-words .spotlight { color: var(--chunk-spotlight); }
