:root {
  --paper: #FFF9EC;
  --panel: #FFFFFF;
  --ink: #1B1B2F;
  --ink-soft: #524F63;
  --pink: #FF4FA0;
  --teal: #00A99D;
  --yellow: #FFC93C;
  --purple: #6C5CE7;
  --line: #1B1B2F;
  --dot: rgba(27, 27, 47, 0.09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  background-image: radial-gradient(var(--dot) 1.4px, transparent 1.4px);
  background-size: 18px 18px;
  color: var(--ink);
  font-family: 'Literata', Georgia, serif;
  font-size: 17px;
  line-height: 1.65;
}

::selection { background: var(--yellow); color: var(--ink); }

a { color: var(--purple); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--pink); }

h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--ink); line-height: 1.15; margin-top: 0; }
code, .mono { font-family: 'JetBrains Mono', monospace; }

/* ---------- Header / nav ---------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: var(--panel);
  border-bottom: 3px solid var(--line);
}

.site-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
}

.brand-icon {
  width: 30px;
  height: 30px;
  border: 2px solid var(--line);
  background: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 3px 3px 0 var(--line);
  flex-shrink: 0;
}

.site-header nav a {
  margin-left: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
}
.site-header nav a:hover { color: var(--pink); }

.site-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 100px;
}

/* ---------- Cards / boxes ---------- */
.box {
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  padding: 24px 26px;
  margin-bottom: 28px;
}

/* ---------- Hero (homepage) ---------- */
.hero {
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: 8px 8px 0 var(--line);
  padding: 36px 32px;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(45deg, transparent 0 10px, rgba(255, 79, 160, 0.045) 10px 20px);
}
.kicker {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  background: var(--pink);
  color: #fff;
  padding: 6px 10px;
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 var(--line);
  margin-bottom: 16px;
}
.hero h1 { font-size: 36px; margin: 0 0 10px; }
.hero .sub { font-size: 18px; color: var(--ink-soft); max-width: 560px; margin: 0 0 6px; }

.marquee-wrap {
  margin-top: 22px;
  border-top: 2px dashed var(--line);
  border-bottom: 2px dashed var(--line);
  padding: 9px 0;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}
.marquee {
  display: inline-block;
  padding-left: 100%;
  animation: scroll-left 22s linear infinite;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--teal);
}
@keyframes scroll-left { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .marquee { animation: none; padding-left: 0; } }

/* ---------- Sections / stats ---------- */
.stats-list { list-style: none; padding: 0; display: flex; gap: 24px; flex-wrap: wrap; }
.stats-list li { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--ink-soft); }
.stats-list strong { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 26px; color: var(--ink); }

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border: 2px solid var(--line);
  background: var(--yellow);
  transform: rotate(-2deg);
  box-shadow: 3px 3px 0 var(--line);
}

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  background: var(--pink);
  color: #fff;
  border: 2px solid var(--line);
  padding: 9px 16px;
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform 0.08s ease;
}
.button:hover { color: #fff; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.button:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--line); }
.button.small { padding: 5px 10px; font-size: 12px; box-shadow: 2px 2px 0 var(--line); }

/* ---------- Forms ---------- */
form { display: flex; flex-direction: column; max-width: 480px; }
label { margin-top: 14px; font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.02em; }
input, textarea, select {
  font-family: 'Literata', Georgia, serif;
  font-size: 15px;
  padding: 9px 10px;
  border: 2px solid var(--line);
  background: #fff;
  margin-top: 5px;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2.5px dashed var(--purple); outline-offset: 1px; }
textarea { min-height: 100px; font-family: 'JetBrains Mono', monospace; font-size: 13px; }

.form-message { color: var(--purple); font-weight: 700; font-family: 'JetBrains Mono', monospace; font-size: 13px; }

/* ---------- Dashboard grid / messages ---------- */
.dashboard-grid { display: grid; gap: 22px; }

.message-list { list-style: none; padding: 0; }
.message-list li {
  border: 2px solid var(--line);
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--panel);
  box-shadow: 3px 3px 0 var(--line);
}

pre {
  background: var(--ink);
  color: #B9F5E5;
  border: 2px solid var(--line);
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  box-shadow: 4px 4px 0 var(--purple);
}

table { width: 100%; border-collapse: collapse; margin: 18px 0; background: var(--panel); border: 2px solid var(--line); }
th, td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; font-size: 14.5px; vertical-align: top; }
th { background: var(--ink); color: var(--paper); font-family: 'JetBrains Mono', monospace; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }

ul.tick { list-style: none; padding-left: 0; }
ul.tick li { margin-bottom: 10px; }
ul.tick li::before { content: "\2726  "; color: var(--pink); font-weight: 700; }

.site-footer {
  border-top: 3px solid var(--line);
  padding: 24px 28px;
  margin-top: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 720px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .site-header nav a { margin-left: 0; margin-right: 14px; }
  .hero h1 { font-size: 28px; }
}

/* ---------- theme picker + style designer (dashboards) ---------- */
.theme-group-label { font-size: 12px; margin: 16px 0 6px; color: var(--ink-soft); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.theme-chip {
  display: flex; flex-direction: column; gap: 6px; align-items: stretch;
  padding: 6px; background: var(--panel); border: 2px solid var(--line); cursor: pointer;
  font-family: 'Space Grotesk', sans-serif; font-size: 12px; text-align: left; color: var(--ink);
}
.theme-chip:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--line); }
.theme-chip.selected { outline: 3px solid var(--pink); outline-offset: 1px; }
.theme-chip:disabled { opacity: 0.45; cursor: not-allowed; }
.theme-swatch { display: flex; align-items: center; justify-content: center; height: 46px; border: 1px solid var(--line); }
.theme-swatch-panel { display: flex; align-items: center; justify-content: center; width: 58%; height: 62%; border: 2px solid; }
.theme-swatch-dot { width: 12px; height: 12px; border-radius: 50%; }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px 18px; }
.style-row { display: flex; align-items: center; gap: 8px; margin: 0; text-transform: none; font-size: 13px; }
.style-row .style-label { flex: 1; }
.style-row input[type="color"] { width: 40px; height: 28px; padding: 0; margin: 0; }
.style-row input[type="range"] { width: 110px; padding: 0; margin: 0; }
.style-row select { margin: 0; padding: 4px; max-width: 130px; }
.style-row output { width: 36px; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.hidden-hate { font-style: italic; color: var(--ink-soft); }

/* ---------- visual editor + live preview ---------- */
#preview-frame { width: 100%; height: 540px; border: 2px solid var(--line); background: #fff; }
.style-row.locked { opacity: 0.5; }

/* =========================================================================
   Usability pass: focus, buttons, forms, wide pages, tabbed dashboard
   ========================================================================= */

/* ---------- accessibility & basics ---------- */
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--yellow); color: var(--ink); border: 2px solid var(--line); padding: 8px 14px; font-weight: 700;
}
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.button:focus-visible { outline-offset: 3px; }
.site-header nav a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -3px 0 var(--yellow); }
.site-main.wide { max-width: 1240px; }
@media (max-width: 720px) { .site-main { padding: 28px 14px 70px; } .box { padding: 18px 16px; } }

/* ---------- buttons: one primary, calm secondaries ---------- */
.button { min-height: 38px; line-height: 1.2; }
.button.small { min-height: 30px; }
.button.secondary { background: var(--panel); color: var(--ink); }
.button.secondary:hover { color: var(--pink); }
.button.danger { background: var(--ink); color: #fff; }
.button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--line); }

/* ---------- forms ---------- */
.field-help { font-size: 14px; color: var(--ink-soft); margin: 0 0 12px; }
.consent-row {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 16px;
  font-family: 'Literata', Georgia, serif; font-size: 14.5px; color: var(--ink); text-transform: none; letter-spacing: 0;
}
.consent-row input { margin: 4px 0 0; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--pink); }
.consent-row { padding: 12px 14px; border: 2px dashed var(--line); background: #FFFBEA; }
.form-message:empty { display: none; }
.form-message.error { color: firebrick; }
details.inline-help { margin: 6px 0 12px; }
details.inline-help summary { cursor: pointer; font-family: 'JetBrains Mono', monospace; font-size: 13px; }

/* ---------- grids on wide pages (admin, accountless dashboard) ---------- */
.dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.dashboard-grid .box { margin-bottom: 0; }

/* ---------- the tabbed dashboard ---------- */
.dash-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 30px; align-items: start; }
.dash-nav { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 6px; }
.dash-tab {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 14px; border: 2px solid var(--line); background: var(--panel); color: var(--ink);
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 14px; text-decoration: none;
  box-shadow: 3px 3px 0 var(--line); white-space: nowrap;
}
.dash-tab:hover { color: var(--pink); transform: translate(-1px, -1px); }
.dash-tab[aria-current="page"] { background: var(--yellow); color: var(--ink); }
.tab-badge {
  background: var(--pink); color: #fff; border: 2px solid var(--line); border-radius: 999px;
  min-width: 24px; padding: 0 6px; text-align: center; font-size: 12px; line-height: 20px;
}
.tab-badge[hidden] { display: none; }

/* only the active tab's sections are shown */
.dash-content > section[data-tab] { display: none; margin-bottom: 24px; }
.dash-content[data-active="overview"] > [data-tab="overview"],
.dash-content[data-active="messages"] > [data-tab="messages"],
.dash-content[data-active="appearance"] > [data-tab="appearance"],
.dash-content[data-active="settings"] > [data-tab="settings"],
.dash-content[data-active="share"] > [data-tab="share"],
.dash-content[data-active="billing"] > [data-tab="billing"],
.dash-content[data-active="competitions"] > [data-tab="competitions"],
.dash-content[data-active="account"] > [data-tab="account"] { display: block; }
.dash-content form { max-width: 680px; }

/* appearance: controls on the left, the live preview stays in view on the right */
.dash-content[data-active="appearance"] {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px); column-gap: 26px; align-items: start;
}
.dash-content[data-active="appearance"] > [data-tab="appearance"] { grid-column: 1; }
.dash-content[data-active="appearance"] > .preview-box { grid-column: 2; grid-row: 1 / span 12; position: sticky; top: 14px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.preview-head h2 { margin: 0; }
#preview-frame { width: 100%; height: clamp(420px, calc(100vh - 210px), 760px); border: 2px solid var(--line); background: #fff; }

/* overview */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 10px 0 18px; }
.stat-card {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: #FFFBEA;
  border: 2px solid var(--line); box-shadow: 3px 3px 0 var(--line); color: var(--ink); text-decoration: none;
}
.stat-number { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 28px; line-height: 1.1; }
.stat-number small { font-size: 15px; color: var(--ink-soft); font-weight: 500; }
.stat-label { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-soft); }
.stat-link:hover { background: var(--yellow); transform: translate(-1px, -1px); }
.quick-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.quick-actions .button { margin-top: 0; }
.checklist { list-style: none; padding: 0; margin: 8px 0 0; }
.checklist li { padding: 9px 0; border-bottom: 1px dashed #c9c5d6; }
.checklist li:last-child { border-bottom: 0; }
.checklist li.done a { color: var(--ink-soft); text-decoration: line-through; }
.checklist small { color: var(--ink-soft); }

/* folding groups inside a long section (Appearance) */
details.fold { border-top: 2px solid var(--line); padding: 12px 0 4px; }
details.fold:first-of-type { border-top: 0; padding-top: 0; }
details.fold > summary {
  cursor: pointer; list-style: none; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 20px; padding: 4px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "\25B8"; color: var(--pink); transition: transform 0.12s ease; }
details.fold[open] > summary::before { transform: rotate(90deg); }
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* a clear, calm heads-up after a theme change */
.notice { margin-top: 14px; padding: 14px 16px; background: #FFFBEA; border: 2px solid var(--line); box-shadow: 3px 3px 0 var(--line); }
.notice[hidden] { display: none; }
.notice p { margin: 0 0 10px; font-size: 15px; }
.notice .button { margin-right: 8px; }

/* the editor: say which settings are overriding the theme */
.style-row { padding: 4px 8px; border-left: 4px solid transparent; }
.style-row.is-on { border-left-color: var(--pink); background: #FFF4FA; }
.style-row:not(.is-on):not(.locked) { opacity: 0.85; }
.style-row.locked { opacity: 0.5; }
.style-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

@media (max-width: 960px) {
  .dash-shell { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .dash-nav {
    flex-direction: row; overflow-x: auto; position: sticky; top: 0; z-index: 20; gap: 8px;
    padding: 10px 2px 12px; background: var(--paper); border-bottom: 2px solid var(--line); margin: 0 -2px;
  }
  .dash-tab { box-shadow: 2px 2px 0 var(--line); }
  .dash-content[data-active="appearance"] { display: block; }
  .dash-content[data-active="appearance"] > .preview-box { position: static; }
  #preview-frame { height: 380px; }
}


.consent-row label { margin: 0; font-family: inherit; font-size: inherit; text-transform: none; letter-spacing: 0; color: inherit; }

/* ---------- tickable setup checklist ---------- */
.checklist li { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.checklist input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--teal); flex-shrink: 0; align-self: center; cursor: pointer; }
.checklist input[type="checkbox"]:disabled { cursor: default; }
.box.flash { animation: flash-box 1.8s ease; }
@keyframes flash-box { 0% { box-shadow: 0 0 0 6px var(--yellow), 5px 5px 0 var(--line); } 100% { box-shadow: 5px 5px 0 var(--line); } }
@media (prefers-reduced-motion: reduce) { .box.flash { animation: none; outline: 4px solid var(--yellow); } }

/* ---------- pre-launch ribbon ---------- */
.launch-ribbon { background: var(--yellow); color: var(--ink); text-align: center; padding: 8px 14px; font-family: 'JetBrains Mono', monospace; font-size: 13px; border-bottom: 3px solid var(--line); }

/* ---------- signed-in sessions ---------- */
.session-list { list-style: none; padding: 0; margin: 0 0 12px; }
.session-list li { padding: 8px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.session-list .this-device { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: var(--yellow); padding: 1px 6px; }

/* small label next to a heading */
.tag { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; vertical-align: middle; background: var(--yellow); color: var(--ink); padding: 2px 6px; margin-left: 6px; }
.image-rules p { margin: 0 0 6px; }

/* ---------- admin image review ---------- */
.review-card { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px 0; border-bottom: 2px dashed var(--line); }
.review-card img { max-width: 100%; max-height: 160px; border: 2px solid var(--line); background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.review-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.review-actions input[type="text"] { flex: 1 1 200px; margin: 0; }
.review-actions select { margin: 0; width: auto; }
@media (max-width: 640px) { .review-card { grid-template-columns: minmax(0, 1fr); } }

/* ---------- competitions ---------- */
.competition-card { border-top: 2px dashed var(--line); padding: 14px 0; }
.competition-card:first-child { border-top: 0; }
.competition-card h3 { margin: 0 0 6px; }
.competition-prize { font-weight: 700; margin: 0 0 6px; }
.competition-rules { white-space: pre-wrap; margin: 0 0 6px; }
.competition-form button { margin-right: 8px; }
.competition-winners { margin: 6px 0 0; }

/* ---------- admin tabs ---------- */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.admin-tabs button { font: inherit; padding: 8px 14px; border: 2px solid var(--line); background: var(--paper, #fff); cursor: pointer; }
.admin-tabs button.active { background: var(--yellow); font-weight: 700; }
.competition-entries-table td, .competition-entries-table th { vertical-align: top; padding: 6px; }
.competition-entries-table .win-place { width: 4.5em; margin: 0 4px; }
.competition-entries-table select { width: auto; margin: 0; }

/* ---------- admin support ---------- */
.support-output { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; background: var(--paper, #fff); border: 2px solid var(--line); padding: 10px; font-size: 13px; }
#support-op { width: auto; max-width: 100%; }

.reported-message { margin: 6px 0; padding: 6px 10px; border-left: 4px solid var(--pink); background: var(--paper, #fff); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- accessibility ---------- */
/* Read by screen readers, invisible on screen (e.g. a page's main heading where the design has none). */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Wide tables scroll inside their own box on small screens instead of making the whole page scroll sideways. */
.table-scroll { overflow-x: auto; max-width: 100%; }
.table-scroll table { min-width: 520px; }

/* ---------- guides ---------- */
.guide-list { list-style: none; padding: 0; }
.guide-list li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.guide-steps { padding-left: 1.4em; }
.guide-steps h2 { font-size: 1.15em; margin: 18px 0 6px; }
.snippet { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--paper, #fff); border: 2px solid var(--line); padding: 10px; font-size: 13px; }
.breadcrumbs { font-size: 14px; margin: 0 0 10px; }
.guide-cta .button { margin: 0 8px 8px 0; }
.guide code { overflow-wrap: anywhere; word-break: break-word; }
