/* CIY.Club Streams — bright "clubhouse" look in the CIY colours (Style Guide 2) */
:root {
  --bright: #00AEEF; --blue: #3698D4; --light: #B9E2F8; --black: #000;
  --ink: #0b2236; --muted: #5b7186; --bg: #EEF8FE; --card: #fff; --line: #d6e9f5;
  --yellow: #FFD23F; --green: #1FB873; --coral: #FF6B6B; --review: #3698D4;
  --rookie: #8fd3da; --trainee: #6cc5ce; --apprentice: #7E86C4; --enthusiast: #1E78B4; --professional: #154E9E; --master: #1BA39C; --boss: #8f949b; --goat: #111;
  --r: 18px; --shadow: 0 6px 18px rgba(0, 76, 122, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Nunito, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); min-height: 100vh;
  background-image: radial-gradient(circle at 12% -10%, #d3efff 0, transparent 40%), radial-gradient(circle at 100% 0, #e0f4ff 0, transparent 35%); }
a { color: var(--blue); }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { font-weight: 900; margin: 0 0 6px; letter-spacing: -.01em; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; }
.loading { padding: 80px; text-align: center; color: var(--muted); font-weight: 700; }
.hint { color: var(--muted); margin: 0 0 14px; }
.num { font-family: "Chakra Petch", Nunito, sans-serif; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--black); font-weight: 900; font-size: 20px; }
.brand .mark { width: 34px; height: 34px; }
.brand b { color: var(--bright); }
.brand small { display: block; font-size: 11px; letter-spacing: .22em; color: var(--blue); font-weight: 800; margin-top: -3px; }
.top nav { display: flex; gap: 4px; margin-left: 12px; }
.top nav a { text-decoration: none; color: var(--muted); font-weight: 800; padding: 8px 14px; border-radius: 99px; }
.top nav a.on, .top nav a:hover { background: #e3f4fd; color: var(--ink); }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--muted); }
.btn { border: 0; border-radius: 99px; padding: 10px 18px; font-weight: 800; background: var(--bright); color: #fff; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn.dark { background: var(--ink); }
.btn.green { background: var(--green); }
.btn.coral { background: var(--coral); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.page { max-width: 1180px; margin: 0 auto; padding: 26px 24px 80px; }

/* hero */
.hero { display: grid; grid-template-columns: 170px 1fr auto; gap: 22px; align-items: center; background: linear-gradient(120deg, var(--bright), var(--blue));
  color: #fff; border-radius: 26px; padding: 18px 28px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, transparent 1px 28px); pointer-events: none; }
.hero .bot svg { width: 170px; height: auto; display: block; filter: drop-shadow(0 10px 16px rgba(0,0,0,.18)); }
.hero h1 { font-size: 32px; }
.hero p { margin: 0; opacity: .95; font-weight: 600; }
.hero .stats { display: flex; gap: 12px; z-index: 1; }
.stat { background: rgba(255,255,255,.18); border-radius: 16px; padding: 10px 16px; text-align: center; min-width: 92px; }
.stat b { display: block; font-family: "Chakra Petch", Nunito; font-size: 28px; line-height: 1.1; }
.stat span { font-size: 12px; font-weight: 800; opacity: .9; text-transform: uppercase; letter-spacing: .06em; }

.continue { margin-top: 18px; display: flex; align-items: center; gap: 16px; background: var(--card); border-radius: var(--r); padding: 14px 18px; box-shadow: var(--shadow); border: 2px solid var(--line); }
.continue .lv { width: 10px; align-self: stretch; border-radius: 6px; }
.continue .t { font-weight: 900; font-size: 18px; }
.continue .s { color: var(--muted); font-weight: 700; font-size: 14px; }
.continue .btn { margin-left: auto; }

.section { margin-top: 30px; }
.section > h2 { display: flex; align-items: center; gap: 10px; }
.section > h2 .pill { font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-weight: 800; font-size: 12px; background: #e3f4fd; color: var(--blue); }
.pill.lv { color: #fff; }

/* Matrix tiles (HQ look: done = greyed out, available = dark grey with yellow text) */
.matrix-level { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: start; margin: 12px 0; }
.level-tag { border-radius: 14px; padding: 12px; color: #fff; font-weight: 900; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.level-tag .ciy-badge, .level-tag svg { filter: drop-shadow(0 3px 6px rgba(0,0,0,.25)); }
.level-tag small { font-weight: 700; opacity: .9; font-size: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.tile { position: relative; border: 0; text-align: left; border-radius: 14px; padding: 12px 12px 10px; min-height: 92px; display: flex; flex-direction: column; gap: 3px;
  background: #3a3f47; color: var(--yellow); box-shadow: 0 3px 0 rgba(0,0,0,.18); transition: transform .12s; }
.tile:hover { transform: translateY(-2px); }
.tile .n { font-family: "Chakra Petch", Nunito; font-size: 12px; opacity: .8; }
.tile .t { font-weight: 900; font-size: 15px; line-height: 1.15; }
.tile .k { font-size: 12px; font-weight: 700; opacity: .8; margin-top: auto; }
.tile .st { position: absolute; top: 9px; right: 9px; display: inline-flex; }
.tile.approved { background: #dfe5ea; color: #8a97a3; box-shadow: none; }
.tile.approved .st { color: var(--green); }
.tile.submitted { background: #fff; color: var(--ink); outline: 3px solid var(--review); }
.tile.in_progress { background: #3a3f47; color: var(--yellow); outline: 3px dashed var(--yellow); outline-offset: -3px; }
.tile.try_again { background: #fff; color: var(--ink); outline: 3px solid var(--coral); }
.tile.locked, .tile.coming_soon { background: #f3f6f9; color: #a9b6c2; box-shadow: none; border: 2px dashed #d5dee6; cursor: default; }
.tile.locked:hover, .tile.coming_soon:hover { transform: none; }
.tile .aab { position: absolute; bottom: 8px; right: 9px; font-size: 11px; font-weight: 900; color: #b88a00; }

/* Streams */
.streams { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.stream { border: 0; text-align: left; background: var(--card); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px;
  align-items: center; border: 2px solid transparent; transition: transform .12s, border-color .12s; color: var(--ink); }
.stream:hover { transform: translateY(-2px); border-color: var(--light); }
.stream .art { display: flex; justify-content: center; width: 92px; overflow: hidden; }
.stream .nm { font-weight: 900; font-size: 17px; line-height: 1.15; }
.stream .tg { color: var(--muted); font-size: 13px; font-weight: 600; margin: 3px 0 8px; }
.bar { height: 8px; background: #e6f1f8; border-radius: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--bright), var(--blue)); border-radius: 9px; }
.stream .meta { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; color: var(--muted); margin-top: 6px; }
.stream.locked { background: #f7fafc; color: #8e9dab; box-shadow: none; border: 2px dashed #d5dee6; }
.stream.locked .why { font-size: 12px; font-weight: 700; color: #7c8b99; display: flex; gap: 6px; align-items: flex-start; }
.stream.soon { opacity: .75; }

/* stream page */
.crumbs { display: flex; gap: 8px; align-items: center; font-weight: 800; color: var(--muted); margin-bottom: 12px; }
.crumbs a { text-decoration: none; }
.stream-head { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; background: var(--card); border-radius: 22px; padding: 18px 22px; box-shadow: var(--shadow); }
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* achievement page */
.ach { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
.card { background: var(--card); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); }
.ach-head { border-radius: 22px; padding: 20px 24px; color: #fff; display: grid; grid-template-columns: 1fr 130px; align-items: center; margin-bottom: 18px; position: relative; overflow: hidden; }
.ach-head .bot svg { width: 130px; height: auto; display: block; }
.ach-head h1 { font-size: 30px; }
.ach-head .sub { font-weight: 800; opacity: .92; }
.steps { padding-left: 22px; margin: 6px 0 0; }
.steps li { margin: 7px 0; line-height: 1.45; }
.steps ul { list-style: none; padding-left: 4px; margin: 6px 0; }
.steps ul li { display: flex; gap: 8px; margin: 4px 0; }
.steps ul li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--bright); margin-top: 7px; flex: none; }
.goal { list-style: none; padding: 0; margin: 6px 0 0; }
.goal li { display: flex; gap: 10px; padding: 9px 12px; background: #f2f9fd; border-radius: 12px; margin: 6px 0; font-weight: 700; }
.goal li svg { flex: none; color: var(--bright); margin-top: 2px; }
.goal li.ok svg { color: var(--green); }
.status-box { border-radius: 16px; padding: 14px; font-weight: 800; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.status-box.submitted { background: #e6f3fc; color: var(--blue); }
.status-box.approved { background: #e3f8ee; color: #0f8a54; }
.status-box.try_again { background: #ffeded; color: #c23c3c; }
.status-box.locked { background: #f1f4f7; color: #6b7c8c; }
.status-box p { margin: 4px 0 0; font-weight: 600; color: var(--ink); }
label.f { display: block; font-weight: 800; font-size: 14px; margin: 12px 0 5px; }
input.in, textarea.in, select.in { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; background: #fff; color: var(--ink); }
input.in:focus, textarea.in:focus, select.in:focus { outline: none; border-color: var(--bright); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* coach */
.coach-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.coach-grid > * { min-width: 0; }
.classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.class-card { border: 0; text-align: left; background: var(--card); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); color: var(--ink); }
.class-card:hover { outline: 2px solid var(--light); }
.class-card .nm { font-weight: 900; font-size: 17px; }
.class-card .meta { color: var(--muted); font-weight: 700; font-size: 13px; margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.live { color: var(--green); font-weight: 900; }
.queue-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: #f3f9fd; margin: 8px 0; border: 0; width: 100%; text-align: left; color: var(--ink); }
.queue-item:hover { background: #e3f4fd; }
.queue-item .who { font-weight: 900; }
.queue-item .what { font-size: 13px; color: var(--muted); font-weight: 700; }
.queue-item .lvdot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
table.cm { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.cm th { position: sticky; top: 0; background: #f4fafe; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 6px; text-align: center; border-bottom: 2px solid var(--line); }
table.cm th:first-child, table.cm td:first-child { text-align: left; }
table.cm td:first-child { min-width: 130px; }
table.cm td:nth-child(2) { min-width: 150px; }
table.cm td { padding: 7px 6px; border-bottom: 1px solid #edf3f8; text-align: center; }
table.cm tr.click:hover td { background: #f3faff; cursor: pointer; }
.cell { display: inline-block; min-width: 64px; padding: 3px 7px; border-radius: 8px; color: #fff; font-weight: 800; font-size: 11px; }
.cell.none { background: transparent; color: #c3ced8; }
.cell.locked { background: transparent; color: #c3ced8; }
.cell.done { background: #dfe5ea; color: #6c7a87; }
.cm-wrap { overflow: auto; max-height: 70vh; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.tabs { display: flex; gap: 6px; margin: 4px 0 14px; flex-wrap: wrap; }
.tabs button { border: 0; background: #e8f4fb; padding: 8px 14px; border-radius: 99px; font-weight: 800; color: var(--muted); }
.tabs button.on { background: var(--ink); color: #fff; }
.modal-back { position: fixed; inset: 0; background: rgba(8, 26, 42, .45); display: flex; align-items: flex-start; justify-content: center; z-index: 50; padding: 40px 16px; overflow: auto; }
.modal { background: #fff; border-radius: 22px; width: min(860px, 100%); padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal .x { float: right; border: 0; background: #eef5fa; border-radius: 99px; width: 34px; height: 34px; font-weight: 900; }
.checkline { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: #f4f9fc; margin: 5px 0; font-weight: 700; cursor: pointer; }
.checkline input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); }
.aab-toggle { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: #fff7d6; margin-top: 12px; font-weight: 800; cursor: pointer; }
.aab-toggle input { width: 20px; height: 20px; accent-color: #d29a00; }
.proof { background: #f4f9fc; border-radius: 14px; padding: 12px 14px; font-weight: 700; }
.proof a { word-break: break-all; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 10px; font-size: 14px; }
.kv b { color: var(--muted); font-weight: 800; }
details.instr { margin-top: 10px; }
details.instr summary { cursor: pointer; font-weight: 800; color: var(--blue); }
.prereq-row { display: grid; grid-template-columns: 240px 150px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf3f8; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #e3f4fd; color: var(--ink); border-radius: 99px; padding: 4px 6px 4px 10px; font-weight: 800; font-size: 12px; }
.chip button { border: 0; background: #fff; border-radius: 99px; width: 20px; height: 20px; line-height: 1; font-weight: 900; color: var(--muted); }
.flag { background: #fff2cc; color: #8a6400; }
.empty { text-align: center; color: var(--muted); font-weight: 700; padding: 30px; }
.empty svg { display: block; margin: 0 auto 6px; }

#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(40px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 99px;
  font-weight: 800; opacity: 0; transition: .2s; z-index: 99; pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--coral); }

.blocked { max-width: 520px; margin: 80px auto; text-align: center; }
.blocked svg { width: 180px; height: auto; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 110px 1fr; } .hero .stats { grid-column: 1 / -1; } .hero .bot svg { width: 110px; }
  .ach, .coach-grid { grid-template-columns: 1fr; }
  .matrix-level { grid-template-columns: 1fr; }
  .prereq-row { grid-template-columns: 1fr; }
}
@media print { .top, .actions { display: none; } body { background: #fff; } }
