/* Raas Hub website: shared styles for every page.
   Two looks, like the app: "peacock" (default, pastel and colourful) and
   "minimal" (black and white). The theme button switches data-theme. */
:root {
  --bg: #f5eeff;
  --bg-a: #ebddfb;
  --bg-b: #dde1ff;
  --card: #ffffff;
  --card-soft: #f8f4ff;
  --text: #1e1b4b;
  --muted: #5b5b86;
  --line: #e6defa;
  --primary: #2f5bea;
  --secondary: #9b3fc1;
  --accent: #d9480f;
  --gold: #b7791f;
  --ok: #1e9e4a;
  --error: #d92d45;
  --on-accent: #ffffff;
  --hero: linear-gradient(135deg, #d9deff, #ebddfb);
  --brand: linear-gradient(90deg, #9b3fc1, #d92d45, #d9480f);
  --shadow: 0 6px 24px rgba(47, 41, 120, 0.08);
  --radius: 18px;
}
:root[data-theme="minimal"] {
  --bg: #ffffff;
  --bg-a: #ffffff;
  --bg-b: #ffffff;
  --card: #ffffff;
  --card-soft: #f5f5f5;
  --text: #000000;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --primary: #000000;
  --secondary: #000000;
  --accent: #000000;
  --gold: #000000;
  --hero: #f5f5f5;
  --brand: #000000;
  --shadow: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg-a), var(--bg) 40%, var(--bg-b));
  background-attachment: fixed;
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); }
button { font: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }

/* ---------- Header ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
header.site .inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 19px; margin-right: auto; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
nav.links { display: flex; gap: 4px; }
nav.links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 999px;
}
nav.links a:hover { color: var(--text); background: var(--card-soft); }
nav.links a[aria-current="page"] { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
.icon-btn svg { width: 20px; height: 20px; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  nav.links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  nav.links.open { display: flex; }
  nav.links a { padding: 12px; border-radius: 12px; }
  .header-cta { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 14px;
  border: 0;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  color: var(--on-accent);
  background: var(--brand);
  white-space: nowrap;
}
.btn.secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Layout bits ---------- */
main { padding: 28px 0 56px; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: 0 0 8px; }
h2 { font-size: clamp(21px, 2.6vw, 26px); line-height: 1.25; margin: 0 0 12px; }
h3 { font-size: 18px; margin: 22px 0 6px; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 20px; }
.muted { color: var(--muted); }
.updated { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.section { margin-top: 48px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 700; text-decoration: none; white-space: nowrap; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.grid.tight { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid a.card { display: block; text-decoration: none; color: var(--text); margin: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}
.chip.warm { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.chip.dark { background: rgba(0, 0, 0, .55); color: #fff; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.tab[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }
.empty, .loading { text-align: center; color: var(--muted); padding: 32px 12px; }
.loading::after {
  content: "";
  display: block;
  width: 26px;
  height: 26px;
  margin: 12px auto 0;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  align-items: center;
  padding: 36px 0 12px;
}
.hero .art { display: flex; justify-content: center; }
.hero .art img { width: min(340px, 80%); filter: drop-shadow(0 18px 30px rgba(155, 63, 193, .25)); }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero .actions { justify-content: center; }
  .hero .art { order: -1; }
  .hero .art img { width: 180px; }
}

/* ---------- Event cards ---------- */
.event-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.event-card .cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--hero);
  overflow: hidden;
}
.event-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.event-card .cover .badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 6px; }
.event-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.event-card .title { font-size: 18px; font-weight: 800; line-height: 1.3; }
.event-card .meta { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.event-card .meta svg { width: 15px; height: 15px; flex: none; }
.event-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; }
.price { font-weight: 800; font-size: 17px; }
.date-badge {
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 4px 10px;
  text-align: center;
  line-height: 1.1;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.date-badge small { display: block; font-size: 11px; text-transform: uppercase; color: var(--accent); }

/* Carousel (home featured events) */
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: min(86%, 420px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel > * { scroll-snap-align: start; margin: 0; }
.dots { display: flex; justify-content: center; gap: 6px; }
.dots span { width: 7px; height: 7px; border-radius: 4px; background: var(--line); transition: width .2s; }
.dots span.on { width: 20px; background: var(--primary); }

/* ---------- Event page ---------- */
.event-hero { border-radius: var(--radius); overflow: hidden; aspect-ratio: 21 / 9; background: var(--hero); margin-bottom: 20px; }
.event-hero img { width: 100%; height: 100%; object-fit: cover; }
.event-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.event-layout .side { position: sticky; top: 84px; }
@media (max-width: 860px) {
  .event-layout { grid-template-columns: 1fr; }
  .event-layout .side { position: static; }
  .event-hero { aspect-ratio: 16 / 10; }
}
.facts { list-style: none; padding: 0; margin: 0; }
.facts li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts li:last-child { border-bottom: 0; }
.facts svg { width: 20px; height: 20px; color: var(--primary); flex: none; margin-top: 2px; }
.facts strong { display: block; }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.pre { white-space: pre-line; }

/* ---------- News ---------- */
.news-card { padding: 0; overflow: hidden; }
.news-card .thumb { aspect-ratio: 16 / 9; background: var(--hero); }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-card .body { padding: 14px 16px 16px; }
.news-card .title { font-weight: 800; font-size: 17px; line-height: 1.3; margin: 6px 0 4px; }
.news-card p { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-img { border-radius: var(--radius); overflow: hidden; margin: 16px 0 22px; }

/* ---------- Community ---------- */
.feed { display: grid; gap: 16px; max-width: 640px; margin: 0 auto; }
.post { margin: 0; }
.post .head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.post .who { font-weight: 700; line-height: 1.2; }
.post .when { font-size: 13px; color: var(--muted); }
.post .text { margin: 0 0 10px; white-space: pre-line; word-wrap: break-word; }
.post .photos { display: grid; gap: 4px; border-radius: 14px; overflow: hidden; margin-bottom: 10px; }
.post .photos.n2 { grid-template-columns: 1fr 1fr; }
.post .photos.n3, .post .photos.n4 { grid-template-columns: 1fr 1fr; }
.post .photos img { width: 100%; height: 100%; max-height: 520px; object-fit: cover; aspect-ratio: auto; }
.post .photos.n2 img, .post .photos.n3 img, .post .photos.n4 img { aspect-ratio: 1; }
.post audio { width: 100%; margin-bottom: 10px; }
.post .stats { display: flex; gap: 18px; color: var(--muted); font-size: 14px; }
.post .stats span { display: inline-flex; align-items: center; gap: 5px; }
.post .stats svg { width: 17px; height: 17px; }
.post .place { font-size: 13px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; margin-bottom: 8px; }
.post .place svg { width: 14px; height: 14px; }
.going-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-note { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- Play ---------- */
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mode { text-align: left; cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 16px; color: var(--text); box-shadow: var(--shadow); }
.mode strong { display: block; font-size: 17px; }
.mode span { color: var(--muted); font-size: 14px; }
.mode:hover { border-color: var(--primary); }
.quiz-box { max-width: 640px; margin: 0 auto; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 8px; }
.timer { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 18px; }
.timer > i { display: block; height: 100%; background: var(--brand); transition: width .2s linear; }
.question { font-size: 21px; font-weight: 800; margin: 0 0 16px; line-height: 1.35; }
.options { display: grid; gap: 10px; }
.option {
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.option:hover:not(:disabled) { border-color: var(--primary); }
.option.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--card)); }
.option.wrong { border-color: var(--error); background: color-mix(in srgb, var(--error) 10%, var(--card)); }
.big-score { font-size: 54px; font-weight: 900; line-height: 1; background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Taali */
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.count-strip { display: flex; gap: 6px; margin: 14px 0; }
.count-cell { flex: 1; text-align: center; padding: 8px 0; border-radius: 12px; background: var(--card-soft); border: 2px solid transparent; }
.count-cell b { display: block; font-size: 18px; }
.count-cell small { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.count-cell.clap { background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.count-cell.active { border-color: var(--primary); background: var(--primary); color: var(--on-accent); }
.count-cell.active small { color: var(--on-accent); }
.lane { width: 100%; height: 96px; border-radius: 16px; background: var(--card-soft); display: block; }
.clap-pad {
  width: 100%;
  margin-top: 14px;
  padding: 34px 12px;
  border-radius: 22px;
  border: 0;
  background: var(--brand);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.clap-pad:active { transform: scale(.98); }
.feedback { text-align: center; font-weight: 800; font-size: 20px; min-height: 30px; margin-top: 10px; }
.meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 10px; }
.meter > i { display: block; height: 100%; width: 0; background: var(--ok); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Get the app / buddies ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.feature { margin: 0; }
.feature .ic { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--brand); color: #fff; margin-bottom: 10px; }
.feature .ic svg { width: 24px; height: 24px; }
.feature strong { display: block; font-size: 17px; margin-bottom: 4px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }
.buddies { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.buddy { text-align: center; margin: 0; padding: 14px; }
.buddy img { width: 96px; height: 96px; margin: 0 auto 6px; }
.buddy strong { display: block; }
.buddy small { color: var(--muted); }
.stores { display: flex; gap: 10px; flex-wrap: wrap; }
.store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 14px;
  background: #000;
  color: #fff;
  text-decoration: none;
  min-width: 190px;
}
.store svg { width: 26px; height: 26px; }
.store small { display: block; font-size: 11px; opacity: .8; line-height: 1.1; }
.store b { display: block; font-size: 17px; line-height: 1.2; }
.store[aria-disabled="true"] { opacity: .75; cursor: default; }
.cta-band {
  border-radius: 24px;
  padding: 28px;
  background: var(--hero);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

/* ---------- Tables, forms, legal ---------- */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table-wrap { overflow-x: auto; }
label { display: block; font-weight: 600; margin: 16px 0 6px; }
input, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
textarea { min-height: 96px; resize: vertical; }
#deleteForm button[type="submit"] {
  margin-top: 18px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--error);
  border: 0;
  border-radius: 12px;
  padding: 13px 20px;
  cursor: pointer;
  width: 100%;
}
#deleteForm button[type="submit"]:disabled { opacity: .5; cursor: default; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin-top: 5px; }
.notice { border-radius: 12px; padding: 12px 14px; margin-top: 16px; display: none; }
.notice.ok { display: block; background: rgba(30, 158, 74, .12); color: var(--ok); }
.notice.err { display: block; background: rgba(217, 45, 69, .12); color: var(--error); }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
summary { font-weight: 700; cursor: pointer; }

/* ---------- Footer ---------- */
footer.site { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--card) 70%, transparent); color: var(--muted); font-size: 14px; }
footer.site .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 20px; padding: 32px 0 20px; }
footer.site h4 { color: var(--text); margin: 0 0 8px; font-size: 14px; }
footer.site a { color: var(--muted); text-decoration: none; display: block; padding: 3px 0; }
footer.site a:hover { color: var(--primary); }
footer.site .legal { border-top: 1px solid var(--line); padding: 14px 0 28px; }
@media (max-width: 760px) { footer.site .cols { grid-template-columns: 1fr 1fr; } footer.site .cols > :first-child { grid-column: 1 / -1; } }
