/* The Cube Hub — shared styles (Version C: Bright & Modern) */
:root {
  --bg: #120E33;
  --panel: #1F1950;
  --ink: #0E0B24;
  --white: #ffffff;
  --soft: #C9C2F5;
  --purple: #6C4DFF;
  --purple-dark: #4B2FE0;
  --green: #5CF08A;
  --cyan: #3DD6FF;
  --yellow: #FFE14D;
  --pink: #FF6FD8;
  --coral: #FF6B4A;
  --lilac: #B9A6FF;
  --sky: #E9F9FF;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: Outfit, system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
}
a { color: #E9E5FF; }
a:hover { color: var(--white); }
h1, h2, h3 { margin: 0; }
p { margin: 0; }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---------- Navigation ---------- */
.nav {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 20px; background: var(--panel);
  border-radius: 999px; padding: 10px 12px 10px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--white); }
.brand span { font-size: 18px; font-weight: 800; letter-spacing: 1px; white-space: nowrap; }
.nav-links { display: flex; flex-wrap: wrap; gap: 0; font-size: 14px; font-weight: 500; }
.nav-links a { text-decoration: none; padding: 10px 6px; border-radius: 999px; }
.nav-links a.active { background: var(--white); color: var(--ink); }
.pill { border-radius: 999px; padding: 10px 14px; font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; }
.pill.yellow { background: var(--yellow); }

/* ---------- Cards & layout ---------- */
.row { display: flex; flex-wrap: wrap; gap: 24px; }
.grow { flex: 999 1 560px; min-width: 0; }
.side { flex: 1 1 300px; display: flex; flex-direction: column; gap: 24px; }
.card { border-radius: 36px; padding: 26px; color: var(--ink); display: flex; flex-direction: column; gap: 14px; }
.card.purple { background: var(--purple); color: var(--white); }
.card.sky { background: var(--sky); }
.card.green { background: var(--green); }
.card.dark { background: var(--panel); color: var(--white); }
.label { font-size: 13px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.badge { align-self: center; background: var(--white); color: var(--purple-dark); border-radius: 999px; padding: 6px 16px; }
.section-title { font-size: 40px; font-weight: 800; }
.muted { color: var(--soft); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.tile {
  border-radius: 28px; padding: 26px; color: var(--ink); text-decoration: none;
  display: flex; flex-direction: column; gap: 12px; min-height: 180px;
  transition: transform .15s ease;
}
.tile:hover { transform: translateY(-4px); color: var(--ink); }
.tile h3 { font-size: 24px; font-weight: 700; }
.tile p { font-size: 15px; line-height: 1.5; font-weight: 500; }
.tile .top { display: flex; justify-content: space-between; align-items: flex-start; }
.arrow { background: var(--ink); color: var(--white); border-radius: 999px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.soon { background: var(--ink); color: var(--white); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-weight: 700; font-size: 16px; border: 0; cursor: pointer;
  border-radius: 999px; padding: 14px 22px; min-height: 44px;
  background: var(--ink); color: var(--white); text-decoration: none; text-align: center;
  transition: transform .1s ease, filter .1s ease;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { filter: brightness(1.15); color: var(--white); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.white { background: var(--white); color: var(--ink); }
.btn.white:hover { color: var(--ink); }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.green { background: var(--green); color: var(--ink); }
.btn.coral { background: var(--coral); color: var(--ink); }
.btn.cyan { background: var(--cyan); color: var(--ink); }
.btn.small { padding: 8px 14px; font-size: 14px; min-height: 40px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Timer ---------- */
.scramble { font-family: var(--mono); font-size: 20px; line-height: 1.6; text-align: center; }
.timer-area { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; user-select: none; touch-action: manipulation; cursor: pointer; border-radius: 28px; padding: 8px; }
.time { font-family: var(--mono); font-size: clamp(72px, 14vw, 128px); font-weight: 700; line-height: 1; letter-spacing: -3px; transition: color .1s; }
.time.holding { color: #FFB3B3; }
.time.ready { color: var(--green); }
.key { font-family: var(--mono); background: var(--white); color: var(--purple-dark); font-weight: 700; padding: 4px 12px; border-radius: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; width: 100%; }
.stat { border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-align: left; }
.stat b { font-size: 13px; letter-spacing: 1px; }
.stat span { font-family: var(--mono); font-size: 28px; font-weight: 700; }
.times { display: flex; flex-wrap: wrap; gap: 8px; }
.times li { list-style: none; font-family: var(--mono); background: rgba(255,255,255,.16); padding: 6px 12px; border-radius: 999px; font-size: 14px; }
.times li.best { background: var(--green); color: var(--ink); }
.times { margin: 0; padding: 0; }
.xpbar { height: 14px; background: rgba(14,11,36,.2); border-radius: 999px; overflow: hidden; }
.xpbar div { height: 14px; background: var(--ink); border-radius: 999px; transition: width .4s ease; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--yellow); color: var(--ink); font-weight: 800; padding: 14px 24px; border-radius: 999px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 10; }
.toast.show { opacity: 1; }

/* ---------- 3D cube ---------- */
.cube-scene { position: relative; perspective: 1000px; touch-action: none; cursor: grab; margin: 0 auto; }
.cube-scene:active { cursor: grabbing; }
.cube-root { position: absolute; left: 50%; top: 50%; transform-style: preserve-3d; }
.cubie { position: absolute; transform-style: preserve-3d; }
.sticker { position: absolute; inset: 0; background: var(--ink); border: solid var(--ink); border-radius: 14%; backface-visibility: hidden; }

/* ---------- Simulator ---------- */
.moves { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.moves .btn { padding: 10px 0; font-family: var(--mono); }
.solution { display: flex; flex-wrap: wrap; gap: 6px; min-height: 36px; }
.chip { font-family: var(--mono); font-weight: 700; padding: 6px 10px; border-radius: 10px; background: rgba(14,11,36,.12); }
.card.purple .chip { background: rgba(255,255,255,.18); }
.chip.now { background: var(--yellow); color: var(--ink); }
.chip.done { opacity: .45; }
.status { font-weight: 600; min-height: 22px; }

/* Color net (enter your cube) */
.net { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; max-width: 560px; width: 100%; }
.net button { aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 6px; cursor: pointer; padding: 0; min-width: 0; }
.net button.center { cursor: default; outline: 3px solid var(--ink); outline-offset: -6px; }
.net .gap { aspect-ratio: 1; }
.palette { display: flex; flex-wrap: wrap; gap: 10px; }
.palette button { width: 48px; height: 48px; border-radius: 14px; border: 3px solid var(--ink); cursor: pointer; }
.palette button[aria-pressed="true"] { outline: 4px solid var(--purple); outline-offset: 2px; }

/* ---------- Learn ---------- */
.mini-card { background: var(--panel); border-radius: 28px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.mini-card h3 { font-family: var(--mono); font-size: 26px; }
.mini-card p { font-size: 15px; color: var(--soft); line-height: 1.45; }
.steps { display: flex; flex-direction: column; gap: 14px; counter-reset: step; }
.step { background: var(--panel); border-radius: 24px; padding: 20px 22px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.step-num { background: var(--yellow); color: var(--ink); width: 48px; height: 48px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; flex: none; }
.step-body { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; }
.step-body h3 { font-size: 22px; }
.step-body p { color: var(--soft); line-height: 1.5; }
.alg { font-family: var(--mono); font-weight: 700; color: var(--yellow); }

footer { padding-top: 8px; font-size: 14px; color: var(--soft); display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
footer span:last-child { font-family: var(--mono); }

@media (max-width: 640px) {
  .section-title { font-size: 30px; }
  .nav { border-radius: 28px; }
}

/* ---------- Tabs (Algorithms) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; background: var(--panel); padding: 6px; border-radius: 999px; align-self: flex-start; }
.tabs button { font: inherit; font-weight: 700; font-size: 16px; border: 0; cursor: pointer; border-radius: 999px; padding: 12px 20px; background: transparent; color: var(--white); min-height: 44px; }
.tabs button[aria-selected="true"] { background: var(--white); color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.alg-card { background: var(--panel); border-radius: 28px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.alg-card h3 { font-size: 22px; }
.alg-card .alg { font-size: 15px; line-height: 1.5; }
.alg-card.learned { outline: 3px solid var(--green); }
.tag { font-size: 12px; font-weight: 800; letter-spacing: 1px; padding: 4px 10px; border-radius: 999px; color: var(--ink); }
.hidden { display: none !important; }

/* ---------- Videos ---------- */
.video { border-radius: 28px; padding: 24px; color: var(--ink); display: flex; flex-direction: column; gap: 10px; }
.video h3 { font-size: 22px; }
.video p { font-size: 15px; line-height: 1.5; font-weight: 500; }
.video .play { width: 56px; height: 56px; border-radius: 999px; background: var(--ink); display: flex; align-items: center; justify-content: center; }
.video.watched { box-shadow: inset 0 0 0 4px var(--ink); }

/* ---------- Battle ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; flex: 1 1 200px; }
.field input, .field select { font: inherit; font-size: 18px; padding: 12px 16px; border-radius: 16px; border: 3px solid var(--ink); min-height: 48px; }
.code { font-family: var(--mono); font-size: 44px; font-weight: 700; letter-spacing: 6px; }
.score { display: flex; flex-wrap: wrap; gap: 14px; width: 100%; }
.score > div { flex: 1 1 200px; border-radius: 24px; padding: 18px 20px; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.score .big { font-family: var(--mono); font-size: 40px; font-weight: 700; }
.turn { font-size: 22px; font-weight: 800; }
table.results { width: 100%; border-collapse: collapse; font-size: 16px; }
table.results th, table.results td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(14,11,36,.15); }
table.results td { font-family: var(--mono); }
.win { background: var(--yellow); border-radius: 8px; padding: 2px 8px; }

/* ---------- Titles & achievements ---------- */
.title-chip { display: inline-block; font-size: 13px; font-weight: 800; padding: 4px 12px; border-radius: 999px; background: var(--ink); color: var(--yellow); letter-spacing: .5px; }
.medal { width: 44px; height: 44px; border-radius: 999px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: var(--ink); border: 4px solid var(--ink); background: var(--yellow); }
.achievements { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.achievement { border-radius: 22px; padding: 16px; display: flex; align-items: center; gap: 12px; color: var(--ink); }
.achievement b { display: block; font-size: 16px; }
.achievement span.small { font-size: 13px; font-weight: 600; }
.achievement.locked { background: var(--panel) !important; color: var(--soft); }
.achievement.locked .medal { background: #3A3466; border-color: #4A4478; color: var(--soft); }
.celebrate { position: fixed; left: 50%; top: 24px; transform: translate(-50%, -140%); background: var(--yellow); color: var(--ink); font-weight: 800; font-size: 18px; padding: 16px 26px; border-radius: 24px; display: flex; align-items: center; gap: 14px; z-index: 20; transition: transform .4s cubic-bezier(.2,1.4,.4,1); max-width: 90vw; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.celebrate.show { transform: translate(-50%, 0); }

/* ---------- Daily streak week ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week .day { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; }
.week .dot { width: 28px; height: 28px; border-radius: 999px; border: 3px solid var(--ink); background: transparent; }
.week .day.done .dot { background: var(--ink); }
.week .day.today .dot { box-shadow: 0 0 0 3px var(--white); }

/* "Are you sure?" pop-up */
.confirm-back { position: fixed; inset: 0; background: rgba(10, 8, 30, .7); display: flex; align-items: center; justify-content: center; z-index: 30; padding: 20px; }
.confirm-back[hidden] { display: none; }
.confirm-box { background: #fff; color: var(--ink); border-radius: 28px; padding: 28px; max-width: 420px; width: 100%; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.confirm-box h3 { margin: 0; font-size: 28px; font-weight: 800; }
.confirm-box p { margin: 0; font-size: 17px; line-height: 1.5; }

/* News page */
.card.yellow { background: var(--yellow); }
.card.cyan { background: var(--cyan); }
.card.pink { background: var(--pink); }
.card.coral { background: var(--coral); }
.card.lilac { background: var(--lilac); }
.record-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.record-card { gap: 10px; }
.record-event { margin: 0; font-size: 28px; font-weight: 800; }
.record-row { background: rgba(255,255,255,.55); border-radius: 22px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.card.purple .record-row { background: rgba(255,255,255,.16); }
.record-time { font-family: var(--mono); font-size: 40px; font-weight: 800; line-height: 1.1; }
.record-who { font-weight: 800; font-size: 17px; }
.record-where { font-size: 14px; opacity: .85; }
.news-list { display: flex; flex-direction: column; gap: 18px; }
.news-card { background: var(--white); }
.news-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.news-tag { border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.news-tag.green { background: var(--green); }
.news-tag.yellow { background: var(--yellow); }
.news-date { font-weight: 700; color: #5B5580; }
.news-title { margin: 0; font-size: 24px; font-weight: 800; }
.news-text { margin: 0; font-size: 17px; line-height: 1.55; }
.video-btn { align-self: flex-start; margin-top: 8px; background: var(--ink); color: var(--white); text-decoration: none; font-weight: 800; font-size: 14px; border-radius: 999px; padding: 9px 16px; min-height: 36px; display: inline-flex; align-items: center; }
.video-btn:hover { background: #2A2370; }
.video-btn.search { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.card.purple .video-btn { background: var(--white); color: var(--ink); }
.card.purple .video-btn.search { background: transparent; color: var(--white); border-color: var(--white); }

/* Requests page */
.btn.purple { background: var(--purple); color: var(--white); }
.tabs button[aria-pressed="true"] { background: var(--white); color: var(--ink); }
.req-field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.req-field small { font-weight: 500; color: #5B5580; }
.req-field select, .req-field textarea, .req-field input { font: inherit; font-weight: 500; font-size: 17px; border: 2px solid var(--ink); border-radius: 16px; padding: 12px 14px; background: #fff; color: var(--ink); }
.req-field textarea { resize: vertical; min-height: 110px; }
.req-field select:focus, .req-field textarea:focus, .req-field input:focus { outline: 3px solid var(--purple); outline-offset: 2px; }
.req-empty { color: var(--soft); font-size: 18px; margin: 0; }
.req-card { background: var(--white); }
.req-card.done { opacity: .75; }
.req-card .news-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.news-tag.req-purple { background: var(--purple); color: #fff; }
.news-tag.req-green { background: var(--green); }
.news-tag.req-cyan { background: var(--cyan); }
.news-tag.req-coral { background: var(--coral); }
.news-tag.req-yellow { background: var(--yellow); }
.req-card .btn.white { border: 2px solid var(--ink); }
.req-status.s-new { background: var(--sky); color: var(--ink); border: 2px solid var(--ink); }
.req-status.s-planned { background: var(--yellow); color: var(--ink); }
.req-status.s-done { background: var(--green); color: var(--ink); }
.req-status:hover, .req-status:hover * { color: var(--ink); }
.bot-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.req-safety { margin: 0; font-size: 15px; font-weight: 600; }
.req-thanks { margin: 0; font-size: 18px; font-weight: 800; color: var(--purple-dark); }
.req-mode { margin: 0; font-size: 14px; color: #5B5580; }
.section-title { color: var(--white); font-size: 30px; font-weight: 800; margin: 8px 0 0; }
.section-title small { font-size: 16px; font-weight: 500; color: var(--soft); }
.req-pill { border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 800; }
.req-pill.s-new { background: var(--sky); border: 2px solid var(--ink); }
.req-pill.s-planned { background: var(--yellow); }
.req-pill.s-done { background: var(--green); }

/* About page */
.about-hero { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 36px; padding: 36px; }
.about-photo { flex: 0 0 auto; width: 300px; height: 300px; border-radius: 50%; overflow: hidden; border: 6px solid var(--yellow); background: #fff; box-shadow: 0 14px 40px rgba(0,0,0,.35); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.14); display: block; }
.about-text { flex: 1 1 340px; display: flex; flex-direction: column; gap: 14px; }
.about-text h1 { font-size: 48px; font-weight: 800; margin: 0; }
.about-text p { font-size: 19px; line-height: 1.6; margin: 0; max-width: 640px; }
@media (max-width: 600px) { .about-photo { width: 220px; height: 220px; margin: 0 auto; } .about-text h1 { font-size: 38px; } }
