/* ==========================================================
   Cleef Chat – content pages (page.php + pages/)
   Loaded after index_modern.css and uses its colours (--bg, --card, ...),
   so light/dark mode works the same as on the home page.
   ========================================================== */

/* logo text: same look as ".brand h1" on the home page, but not an h1,
   so each page keeps its own heading */
.brand-name { font: normal 28px/1 "SCRIPTBL", var(--font); }
.brand-name small { font: 500 12px var(--font); color: var(--muted); margin-left: 6px; }

.menu a.active { color: var(--text); background: var(--surface-2); }

.page-main { padding-top: 32px; padding-bottom: 10px; }

/* ---------- page heading ---------- */
.page-head { margin: 0 0 22px; }
.page-head .eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent-2);
  font-size: 12.5px;
  font-weight: 600;
}
.page-head h1 { margin: 0; font-size: 34px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; }
.page-head p { margin: 8px 0 0; color: var(--muted); max-width: 640px; }

/* ---------- layout: main column + optional side column ---------- */
.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: 22px;
  align-items: start;
}
.page-grid .panel { margin-bottom: 0; }
.page-grid > div { display: grid; gap: 22px; }

/* ---------- long text ---------- */
.prose { font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h2, .prose h3 { margin: 28px 0 8px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.prose h3:empty { display: none; }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--accent); }
.prose b, .prose strong { color: var(--text); font-weight: 650; }
.prose a { text-decoration: underline; text-decoration-color: rgba(34, 211, 238, 0.4); text-underline-offset: 2px; }
.prose .note {
  padding: 14px 16px;
  margin: 0 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 92, 168, 0.35);
  background: rgba(255, 92, 168, 0.08);
}
.prose .muted { color: var(--muted); font-size: 13.5px; }

/* numbered rule sections (§) */
.rule { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; margin-bottom: 26px; }
.rule:last-child { margin-bottom: 0; }
.rule-no {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 750;
}
.rule h2 { margin: 8px 0 8px; }

/* ---------- small lists (features, links) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--item);
  font-size: 13.5px;
  color: var(--muted);
}
.socials { display: flex; gap: 10px; margin-top: 16px; }
.socials a {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.socials a:hover { background: var(--surface-2); }
.socials svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.imprint-img { display: block; max-width: 100%; height: auto; border-radius: 12px; background: #fff; padding: 10px; margin-bottom: 12px; }

/* ---------- form (contact) ---------- */
.form .field textarea {
  width: 100%;
  min-height: 130px;
  padding: 22px 16px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18); }
.form .field textarea:focus + label,
.form .field textarea:not(:placeholder-shown) + label { top: 8px; font-size: 11.5px; color: var(--accent-2); }
.form-result { min-height: 0; margin-bottom: 12px; font-size: 14px; }
.form-result:empty { display: none; }
.form-result.ok { color: var(--green); }
.form-result.err { color: var(--pink); }

/* ---------- tables (privacy policy) ---------- */
.data-table { width: 100%; margin: 0 0 18px; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.data-table tbody tr:hover { background: var(--item); }

/* jump targets land below the sticky header */
.prose [id] { scroll-margin-top: 86px; }

/* ---------- table of contents ---------- */
/* the aside must be as tall as the text column, otherwise the sticky box has no room to move */
.page-grid > aside { align-self: stretch; }
.toc { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow-y: auto; }
.toc ol { margin: 0; padding-left: 22px; font-size: 14px; }
.toc li { margin: 5px 0; color: var(--muted); }
.toc li::marker { color: var(--muted); }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--text); }

/* ---------- guide pages (chat-coins) ---------- */
.crumbs { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs span { margin: 0 6px; opacity: 0.6; }
.page-head .lead { max-width: 760px; font-size: 16px; line-height: 1.65; }
.page-head .lead b { color: var(--text); }

.page-grid > aside { display: grid; gap: 22px; align-content: start; }
.page-grid > aside .toc { top: 86px; }

.steps { list-style: none; counter-reset: step; margin: 18px 0 0; padding: 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  margin: 0 0 14px;
  padding: 18px 18px 14px 66px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--item);
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 16px; top: 16px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 750;
}
.steps > li::marker { content: none; }
.steps h3 { margin: 4px 0 6px; font-size: 16.5px; }
.steps p:last-child { margin-bottom: 0; }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.podium li { margin: 0; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); text-align: center; font-size: 13.5px; color: var(--muted); }
.podium li b { display: block; color: var(--text); font-size: 15px; }

.faq details { border: 1px solid var(--border); border-radius: 14px; background: var(--item); margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 44px 14px 16px; font-weight: 650; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 11px; font-size: 20px; color: var(--accent-2); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 16px 14px; color: var(--muted); }

.facts dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0 0 16px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.facts .btn { display: block; line-height: 52px; height: 52px; text-align: center; color: #fff; }

/* ---------- quiz page ---------- */
.qotd .q { font-size: 18px; font-weight: 650; color: var(--text); margin-bottom: 14px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; counter-reset: c; }
.choices li {
  counter-increment: c;
  margin: 0; padding: 12px 14px 12px 46px; position: relative;
  border-radius: 14px; border: 1px solid var(--border); background: var(--item);
}
.choices li::before {
  content: counter(c, upper-alpha);
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 8px; background: var(--surface-2); color: var(--accent-2); font-weight: 700; font-size: 13px;
}
.reveal { margin: 0 0 12px; border: 1px dashed var(--border); border-radius: 14px; }
.reveal summary { cursor: pointer; padding: 12px 14px; font-weight: 650; color: var(--accent-2); }
.reveal p { margin: 0; padding: 0 14px 12px; }
.btn.inline { display: inline-block; width: auto; height: 48px; padding: 0 22px; line-height: 48px; color: #fff; text-decoration: none; }

.leader { list-style: none; counter-reset: r; margin: 0 0 12px; padding: 0; }
.leader li {
  counter-increment: r;
  display: flex; align-items: center; gap: 10px;
  margin: 0; padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.leader li:last-child { border-bottom: 0; }
.leader li::before { content: counter(r); width: 22px; flex: none; text-align: right; color: var(--muted); font-weight: 700; }
.leader li:nth-child(-n+3)::before { color: var(--accent-2); }
.leader a { display: flex; align-items: center; gap: 8px; min-width: 0; margin-right: auto; color: var(--text); text-decoration: none; }
.leader a:hover b { color: var(--accent-2); }
.leader a > img:first-child { width: 32px; height: 32px; flex: none; border-radius: 50%; object-fit: cover; }
.leader b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader .qm { width: 16px; height: 16px; }
.leader span { color: var(--muted); white-space: nowrap; font-size: 13px; }
.leader.small a > img:first-child { width: 28px; height: 28px; }

@media (max-width: 600px) {
  .choices { grid-template-columns: 1fr; }
}

/* ---------- about page ---------- */
.titlebox .h4 { margin: 0 0 18px; font-size: 18px; font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0 0 12px; padding: 0; list-style: none; }
.stat-grid li { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--item); color: var(--muted); font-size: 13px; }
.stat-grid b { display: block; color: var(--text); font-size: 22px; font-weight: 750; letter-spacing: -0.01em; }
.userlist.team .onlineuser small { margin-top: -6px; font-size: 11.5px; color: var(--accent-2); }
.voice { margin: 0 0 14px; padding: 14px 16px; border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--item); }
.voice cite { display: block; margin-top: 8px; font-style: normal; font-size: 13px; color: var(--muted); }
.contact-list { margin: 0; padding-left: 20px; font-size: 14px; }
.contact-list li { margin: 6px 0; color: var(--muted); }
.contact-list li::marker { color: var(--accent); }

/* ---------- poker page ---------- */
.hands .cards { white-space: nowrap; font-weight: 600; letter-spacing: 0.02em; }
.hands .red { color: #e5484d; }
.glossary { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.glossary dt { font-weight: 650; color: var(--text); }
.glossary dd { margin: 0; color: var(--muted); }
@media (max-width: 600px) {
  .hands td:nth-child(4), .hands th:nth-child(4) { display: none; }
  .glossary { grid-template-columns: 1fr; gap: 2px; }
  .glossary dd { margin-bottom: 8px; }
}

/* ---------- battleship page ---------- */
.fleet { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.fleet li { display: flex; align-items: center; gap: 12px; margin: 0; }
.fleet .ship { display: grid; grid-template-columns: repeat(var(--n), 20px); gap: 3px; width: 116px; flex: none; }
.fleet .ship i { height: 20px; border-radius: 5px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* ---------- connect four page ---------- */
.c4-wrap { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 12px; }
.c4-wrap ul { margin: 0; }
.c4 {
  display: grid; grid-template-columns: repeat(7, 26px); gap: 5px;
  flex: none; padding: 9px; border-radius: 14px; background: #2f55d4;
}
.c4 i { width: 26px; height: 26px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.35); }
.c4 i.r { background: #e53935; }
.c4 i.y { background: #fdd835; }
.c4 i.win { box-shadow: 0 0 0 3px #fff, 0 0 10px rgba(255, 255, 255, 0.7); }
@media (max-width: 600px) {
  .c4-wrap { flex-direction: column; }
}

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 50px 28px; }
.notfound .big {
  font-size: 96px; font-weight: 800; line-height: 1; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.notfound .btn { display: inline-block; width: auto; padding: 0 26px; line-height: 52px; margin-top: 10px; color: #fff; }

@media (max-width: 980px) {
  .page-grid { grid-template-columns: 1fr; }
  .page-grid > aside { order: -1; }
  .toc { position: static; max-height: none; }
  .toc ol { columns: 2; column-gap: 28px; }
}
@media (max-width: 600px) {
  .toc ol { columns: 1; }
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 8px 6px; }
  .steps > li { padding: 16px 14px 12px 58px; }
  .steps > li::before { left: 12px; }
  .podium { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .brand-name small { display: none; }
}
@media (max-width: 600px) {
  .page-main { padding-top: 20px; }
  .page-head h1 { font-size: 27px; }
  .rule { grid-template-columns: 1fr; gap: 8px; }
  .rule-no { width: 36px; height: 36px; border-radius: 11px; }
}
