/* Brain Challenge — 1000 puzzle levels */
:root {
  --bg: #f8f5ee;
  --ink: #2e2b25;
  --muted: #8b8579;
  --card: #ffffff;
  --line: #e8e1d2;
  --accent: #526d5b;
  --ok: #3f6b4c;
  --bad: #b8544f;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

/* header */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 16px;
}
.brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.brand span { color: var(--accent); }
.head-link { font-size: 14px; color: var(--muted); text-decoration: none; }
.head-link:hover { color: var(--accent); }

/* hud */
.hud { margin-bottom: 12px; }
.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.level-no { font-size: 26px; font-weight: 800; }
.level-no small { font-size: 14px; font-weight: 500; color: var(--muted); }
.type-tag {
  padding: 5px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.timer-row { display: flex; align-items: center; gap: 10px; }
.timer-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #e6dfd1;
  overflow: hidden;
}
.timer-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: #c9a44c;
  transition: width 1s linear;
}
.timer-fill.danger { background: #c8645f; }
.timer-text { font-size: 14px; color: var(--muted); min-width: 38px; text-align: right; }
.timer-text.danger { color: var(--bad); font-weight: 700; }
.streak {
  padding: 3px 10px;
  border-radius: 999px;
  background: #f3e7c9;
  color: #8a6a2a;
  font-size: 13px;
}

/* card */
.card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(90, 78, 55, 0.1);
  padding: 24px 20px;
  margin-bottom: 16px;
}

.prompt {
  margin: 0 0 20px;
  font-size: 19px;
  font-weight: 650;
  line-height: 1.45;
}

/* grid cells */
.grid {
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
}
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 8px 0;
  background: #fdfbf6;
  border: 2px solid #ebe4d4;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(120, 105, 80, 0.06);
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease;
}
.cell:hover { border-color: #d8cfba; }
.cell:active { transform: scale(0.97); }
.cell .char {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
}
.cell .glyph-wrap { display: flex; align-items: center; justify-content: center; }
.cell .glyph { width: 34px; height: 34px; }
.glyph-circle { border-radius: 50%; }
.glyph-square { border-radius: 5px; }
.glyph-diamond { border-radius: 5px; transform: rotate(45deg); }
.cell.right { background: #e8f2e9; border-color: var(--accent); }
.cell.wrong { background: #fbeceb; border-color: #c8645f; }
.cell.answer { border-style: dashed; border-color: var(--accent); }

/* sequence */
.sequence {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}
.seq-item {
  min-width: 56px;
  padding: 10px 12px;
  text-align: center;
  background: #f7f4ec;
  border-radius: 12px;
  font-size: 22px;
  font-weight: 700;
}
.seq-item.ask { color: #fff; background: var(--accent); }

/* picture clue */
.picture {
  text-align: center;
  font-size: 40px;
  line-height: 1.5;
  letter-spacing: 6px;
  padding: 6px 0 18px;
}
.clue {
  text-align: center;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 4px;
  padding: 6px 0 18px;
}

/* options */
.options { display: grid; gap: 10px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fdfbf6;
  border: 2px solid #ebe4d4;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.08s ease;
}
.option:hover { border-color: #d8cfba; }
.option:active { transform: scale(0.99); }
.option-key {
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}
.option-text { font-size: 17px; }
.option.right { background: #e8f2e9; border-color: var(--accent); }
.option.wrong { background: #fbeceb; border-color: #c8645f; }
.option.answer { border-style: dashed; border-color: var(--accent); }
.option.dead { opacity: 0.35; text-decoration: line-through; cursor: default; }

/* feedback */
.feedback {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  display: none;
}
.feedback.show { display: block; }
.feedback.ok { background: #eef6ef; }
.feedback.bad { background: #fdf0ee; }
.feedback-title { font-weight: 800; margin-bottom: 4px; }
.feedback.ok .feedback-title { color: var(--ok); }
.feedback.bad .feedback-title { color: var(--bad); }
.feedback-text { font-size: 14px; color: #6f6a60; line-height: 1.5; }

/* buttons */
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  flex: 1 1 auto;
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
}
.btn:active { transform: scale(0.99); }
.btn.ghost {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--line);
}
.btn.wide { flex-basis: 100%; }

/* hint */
.hint-btn {
  margin-top: 16px;
  padding: 12px;
  width: 100%;
  border: 2px dashed #dcc69a;
  border-radius: 12px;
  background: #fff6e4;
  color: #8a6a2a;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}
.hint { margin-top: 14px; padding: 10px 14px; border-radius: 10px; background: #f6efdc; color: #8a6a2a; font-size: 14px; }

/* footer nav */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.pager .meta { font-size: 13px; color: var(--muted); text-align: center; }
.pager button { padding: 9px 14px; font-size: 14px; }

.jump { display: flex; gap: 8px; margin-top: 14px; }
.jump input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
}
.jump button { padding: 10px 16px; font-size: 14px; }

/* ad slot */
.ad-slot {
  margin: 18px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #ddd3bd;
  border-radius: 12px;
  color: #b9b2a3;
  font-size: 13px;
}

/* prose / SEO content */
.prose { margin-top: 28px; font-size: 15px; line-height: 1.7; color: #4a473f; }
.prose h2 { font-size: 20px; margin: 26px 0 10px; }
.prose h3 { font-size: 16px; margin: 20px 0 8px; }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 14px 20px; padding: 0; }
.prose li { margin-bottom: 6px; }
.prose a { text-decoration: underline; }

.site-foot { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.site-foot a { color: var(--muted); }

@media (max-width: 480px) {
  .brand { font-size: 18px; }
  .level-no { font-size: 22px; }
  .picture { font-size: 32px; letter-spacing: 4px; }
  .clue { font-size: 28px; }
  .cell { min-height: 46px; }
  .cell .char { font-size: 24px; }
  .cell .glyph { width: 28px; height: 28px; }
  .seq-item { font-size: 18px; min-width: 46px; padding: 8px 10px; }
}
