/* Lancer Lane: Orange Lutheran colors (OLu Red #9E2A2F, OLu Gold #C5B783,
   white), Caslon for display, Montserrat as the Gotham stand-in. Mobile
   first; the iPad in class is the primary screen. */
:root {
  --red: #9E2A2F; --red-deep: #7A1E23; --red-bright: #BD261A;
  --gold: #C5B783; --gold-bright: #EACC55; --gold-deep: #9C8B52;
  --paper: #F6F1E8; --card: #FFFFFF; --ink: #1E1618; --muted: #6F6660; --line: #E6DFD3; --soft: #F1EBE0;
  --green: #2E7D4F; --danger: #B3261E; --white-day: #FFFFFF;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 6px 24px rgba(30, 22, 24, .08);
  --font-display: 'Libre Caslon Display', 'Adobe Caslon Pro', Georgia, 'Times New Roman', serif;
  --font-ui: 'Montserrat', 'Gotham', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --tab-h: 66px; --fab: 60px;
  --header-ink: #FFFFFF;
  color-scheme: light;
}
[data-theme="vintage"] { --red: #BD261A; --red-deep: #8E1B12; --gold: #EACC55; --gold-bright: #F5DD7A; --gold-deep: #B89A2A; --paper: #FFF8E6; --soft: #F8ECC8; --line: #EADFB8; --card: #FFFDF6; }
[data-theme="midnight"] { --paper: #141018; --card: #1F1922; --ink: #F4EEE6; --muted: #A79E95; --line: #332A35; --soft: #2A2230; --red: #C8353B; --red-deep: #8F2327; --gold: #D8C892; --white-day: #2C2530; --shadow: 0 8px 28px rgba(0, 0, 0, .45); color-scheme: dark; }
[data-theme="stage"] { --paper: #120C1C; --card: #231733; --ink: #FBF4E4; --muted: #B5A9C4; --line: #3A2A50; --soft: #2E2040; --red: #E0323A; --red-deep: #9C1F2A; --gold: #F2C94C; --gold-bright: #FFE082; --white-day: #2F2244; --shadow: 0 8px 28px rgba(0, 0, 0, .5); color-scheme: dark; }
[data-theme="codered"] { --paper: #1A0F10; --card: #2A1517; --ink: #FFF4F1; --muted: #D4A8A5; --line: #4A2427; --soft: #3A1B1E; --red: #E8323A; --red-deep: #B3121C; --gold: #F5D061; --white-day: #3A1B1E; --shadow: 0 8px 28px rgba(0, 0, 0, .5); color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-ui); font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0; }
a { color: var(--red); }
::selection { background: var(--gold); color: var(--ink); }

#app { min-height: 100dvh; display: flex; flex-direction: column; }
.view { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 14px 16px calc(var(--tab-h) + var(--fab) + 24px + env(safe-area-inset-bottom)); }

/* ---- top bar --------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 20; background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%); color: var(--header-ink); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 3px solid var(--gold); box-shadow: 0 4px 18px rgba(0, 0, 0, .18); }
.topbar-inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.brand img { width: auto; height: 38px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)); }
.brand-name { font-family: var(--font-display); font-size: 21px; letter-spacing: .12em; text-transform: uppercase; line-height: 1; }
.brand-sub { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .85; margin-top: 3px; font-weight: 600; white-space: nowrap; }
@media (max-width: 480px) { .brand-name { font-size: 17px; letter-spacing: .1em; white-space: nowrap; } .brand-sub { display: none; } .brand img { height: 32px; } .pill { padding: 6px 9px; font-size: 12px; } }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; font-weight: 800; font-size: 13px; background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .22); white-space: nowrap; }
.pill.gold { background: var(--gold); color: var(--red-deep); border-color: transparent; }
.pill .lvl { font-size: 12px; letter-spacing: .08em; }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); color: #fff; }
.iconbtn svg { width: 20px; height: 20px; }

/* ---- tab bar --------------------------------------------------------------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: center; box-shadow: 0 -6px 20px rgba(30, 22, 24, .06); }
.tabbar-inner { display: flex; width: 100%; max-width: 760px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding-top: 6px; }
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--red); }
.tab.active svg { filter: drop-shadow(0 2px 4px rgba(158, 42, 47, .25)); }

.fab { position: fixed; right: 18px; bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom)); z-index: 21; width: var(--fab); height: var(--fab); border-radius: 50%; background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff; font-size: 34px; line-height: 1; font-weight: 500; box-shadow: 0 8px 22px rgba(158, 42, 47, .4), inset 0 0 0 2px var(--gold); transition: transform .12s; }
.fab:active { transform: scale(.94); }
@media (min-width: 800px) { .fab { right: calc(50% - 380px + 18px); } }

/* ---- cards ----------------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card, .card + .section, .section + .section, .section + .card { margin-top: 14px; }
.section-title { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 18px 4px 8px; }
.section-title .count { background: var(--soft); color: var(--muted); border-radius: 999px; padding: 2px 9px; font-size: 11px; }
.section-title.overdue { color: var(--danger); }
.section-title.today { color: var(--red); }
h2.display { font-family: var(--font-display); font-size: 26px; letter-spacing: .02em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---- day card -------------------------------------------------------------- */
.daycard { border-radius: 22px; padding: 18px 18px 14px; position: relative; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); background: var(--card); }
.daycard.red { background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%); color: #fff; border-color: transparent; }
.daycard.white { background: var(--white-day); color: var(--ink); border: 2px solid var(--red); }
.daycard.off { background: var(--soft); }
.daycard::after { content: ''; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(197, 183, 131, .28), transparent 65%); pointer-events: none; }
.daycard .wm { position: absolute; right: -6px; bottom: -22px; height: 150px; width: auto; opacity: .10; pointer-events: none; }
.daycard.red .wm { opacity: .13; }
.daycard.white .wm { opacity: .07; }
.daycard > * { position: relative; }
.daycard .wm { z-index: 0; }
.daycard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.daycard .dow { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.daycard .date { font-family: var(--font-display); font-size: 30px; line-height: 1.05; margin-top: 2px; }
.daytype { flex-shrink: 0; font-family: var(--font-display); letter-spacing: .1em; text-transform: uppercase; font-size: 13px; padding: 9px 12px; border-radius: 12px; border: 2px solid currentColor; line-height: 1; text-align: center; }
.daycard.red .daytype { background: var(--gold); color: var(--red-deep); border-color: var(--gold); }
.daycard.white .daytype { background: var(--red); color: #fff; border-color: var(--red); }
.daycard.off .daytype { color: var(--muted); }
.daytype small { display: block; font-family: var(--font-ui); font-weight: 800; font-size: 9px; letter-spacing: .12em; margin-top: 4px; opacity: .9; }
.daycard-sub { margin-top: 10px; font-size: 13px; font-weight: 600; opacity: .9; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, .08); }
.daycard.red .tag { background: rgba(255, 255, 255, .18); }
.tag.gold { background: var(--gold); color: var(--red-deep); }
.nowline { margin-top: 12px; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.nowline .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 0 4px rgba(234, 204, 85, .3); animation: pulse 1.6s infinite; }
.daycard.white .nowline .dot { background: var(--red); box-shadow: 0 0 0 4px rgba(158, 42, 47, .2); }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }

.blocks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.block { border-radius: 14px; padding: 10px 8px 9px; text-align: left; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); color: inherit; min-height: 74px; display: flex; flex-direction: column; gap: 3px; position: relative; transition: transform .1s; }
.daycard.white .block, .daycard.off .block { background: var(--soft); border-color: var(--line); }
.block:active { transform: scale(.97); }
.block.past { opacity: .55; }
.block.now { outline: 2px solid var(--gold-bright); outline-offset: 1px; background: rgba(255, 255, 255, .22); }
.daycard.white .block.now { outline-color: var(--red); background: #fff; }
.block .b { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .8; display: flex; justify-content: space-between; }
.block .n { font-weight: 800; font-size: 13px; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.block .e { font-size: 16px; line-height: 1; }
.block .t { font-size: 10px; opacity: .8; margin-top: auto; font-weight: 600; }
.block.free { opacity: .6; }
.events { margin-top: 12px; font-size: 13px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- setup / notices --------------------------------------------------------- */
.notice { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px dashed var(--gold-deep); border-radius: var(--radius); padding: 12px 14px; margin-top: 14px; }
.notice .ico { font-size: 22px; }
.notice .body { flex: 1; font-size: 14px; }
.notice .body b { display: block; }
.notice .x { color: var(--muted); font-size: 20px; padding: 6px; }

/* ---- assignment list ------------------------------------------------------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: stretch; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 12px 12px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--lc, var(--gold)); }
.item.overdue::before { background: var(--danger); }
.check { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--lc, var(--gold-deep)); display: inline-flex; align-items: center; justify-content: center; align-self: center; margin-left: 6px; background: transparent; transition: transform .12s, background .15s; }
.check svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 3; fill: none; opacity: 0; transform: scale(.4); transition: opacity .15s, transform .18s cubic-bezier(.2, 1.4, .4, 1); }
.check:active { transform: scale(.9); }
.item.done .check, .check.on { background: var(--green); border-color: var(--green); }
.item.done .check svg, .check.on svg { opacity: 1; transform: scale(1); }
.item.done .item-title { text-decoration: line-through; color: var(--muted); }
.item-body { flex: 1; min-width: 0; text-align: left; padding: 2px 0; }
.item-title { font-weight: 700; font-size: 15.5px; line-height: 1.25; word-break: break-word; }
.item-meta { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: center; margin-top: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
.lane-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border-radius: 999px; background: color-mix(in srgb, var(--lc, var(--gold)) 14%, transparent); color: var(--lc, var(--ink)); font-weight: 800; font-size: 11.5px; letter-spacing: .02em; }
[data-theme="midnight"] .lane-chip, [data-theme="stage"] .lane-chip, [data-theme="codered"] .lane-chip { background: color-mix(in srgb, var(--lc, var(--gold)) 28%, transparent); color: #fff; }
.due { font-weight: 700; }
.due.overdue { color: var(--danger); }
.due.today { color: var(--red); }
.due.tomorrow { color: var(--gold-deep); }
.item.done-anim { animation: done-pop .45s ease; }
@keyframes done-pop { 0% { transform: scale(1); } 40% { transform: scale(1.03); background: color-mix(in srgb, var(--green) 12%, var(--card)); } 100% { transform: scale(1); } }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .big { font-size: 44px; margin-bottom: 8px; }
.empty b { color: var(--ink); font-family: var(--font-display); font-size: 20px; display: block; letter-spacing: .02em; }
.linkbtn { color: var(--red); font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; padding: 8px 4px; }
.done-toggle { width: 100%; text-align: center; margin-top: 16px; }

/* ---- buttons --------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: 14px; font-weight: 800; font-size: 15px; letter-spacing: .02em; background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(158, 42, 47, .3); transition: transform .1s; min-height: 48px; }
.btn:active { transform: scale(.97); }
.btn.gold { background: var(--gold); color: var(--red-deep); box-shadow: 0 6px 16px rgba(197, 183, 131, .35); }
.btn.ghost { background: var(--soft); color: var(--ink); box-shadow: none; }
.btn.danger { background: transparent; color: var(--danger); box-shadow: none; }
.btn.block { width: 100%; }
.btn.sm { padding: 9px 14px; font-size: 13px; min-height: 38px; border-radius: 11px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* ---- sheets ---------------------------------------------------------------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(20, 12, 14, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 640px; max-height: 92dvh; background: var(--card); color: var(--ink); border-radius: 24px 24px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); display: flex; flex-direction: column; animation: rise .22s cubic-bezier(.2, .9, .3, 1); }
@keyframes rise { from { transform: translateY(40px); opacity: .6; } }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; padding: 20px; } .sheet { border-radius: 24px; max-height: 88dvh; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 8px; }
.sheet-head h2 { font-family: var(--font-display); font-size: 22px; letter-spacing: .03em; flex: 1; }
.sheet-close { width: 36px; height: 36px; border-radius: 50%; background: var(--soft); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: var(--muted); }
.sheet-body { overflow-y: auto; padding: 4px 18px 18px; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; background: var(--card); }
.grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 0; }

.field { margin-top: 14px; }
.field label, .field .lbl { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.input { width: 100%; border: 2px solid var(--line); background: var(--paper); border-radius: 14px; padding: 13px 14px; font-size: 17px; font-weight: 600; outline: none; transition: border-color .15s; min-height: 50px; }
.input:focus { border-color: var(--red); background: var(--card); }
textarea.input { min-height: 80px; resize: vertical; font-weight: 500; font-size: 15px; }
.input.big { font-size: 20px; font-weight: 700; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 999px; background: var(--soft); border: 2px solid transparent; font-weight: 700; font-size: 14px; white-space: nowrap; color: var(--ink); transition: transform .1s; position: relative; }
.chip:active { transform: scale(.96); }
.chip.on { border-color: var(--lc, var(--red)); background: color-mix(in srgb, var(--lc, var(--red)) 14%, var(--card)); }
.chip .now { position: absolute; top: -8px; right: 8px; font-size: 9px; font-weight: 900; letter-spacing: .1em; background: var(--gold-bright); color: var(--red-deep); padding: 2px 6px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.chip .sub { font-size: 11px; color: var(--muted); font-weight: 600; }
.chip.ghosty { border-style: dashed; border-color: var(--line); color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; box-shadow: inset 0 0 0 2px var(--card); }
.swatch.on { border-color: var(--ink); }
.emojis { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); font-size: 22px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid transparent; }
.emoji.on { border-color: var(--red); background: var(--card); }
.daybtns { display: flex; gap: 6px; }
.daybtn { flex: 1; padding: 10px 0; border-radius: 10px; background: var(--soft); font-weight: 800; font-size: 13px; border: 2px solid transparent; }
.daybtn.on { border-color: var(--red); background: color-mix(in srgb, var(--red) 12%, var(--card)); color: var(--red); }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; }
.xp-preview { font-size: 13px; font-weight: 700; color: var(--gold-deep); }

/* ---- week ------------------------------------------------------------------ */
.weeknav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.weeknav h2 { font-family: var(--font-display); font-size: 22px; letter-spacing: .02em; }
.weeknav .iconbtn { background: var(--soft); color: var(--ink); border-color: var(--line); }
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.daycell { border-radius: 14px; padding: 8px 4px 8px; text-align: center; background: var(--card); border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 84px; color: var(--ink); }
.daycell .wd { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.daycell .dn { font-family: var(--font-display); font-size: 20px; line-height: 1; }
.daycell .rw { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--red); }
.daycell .rw.R { background: var(--red); }
.daycell .rw.W { background: var(--white-day); }
.daycell .rw.off { border-color: var(--line); background: repeating-linear-gradient(45deg, var(--line) 0 2px, transparent 2px 4px); }
.daycell .rw.fin { border-color: var(--gold-deep); background: var(--gold); }
.daycell .cnt { font-size: 11px; font-weight: 800; color: var(--muted); min-height: 14px; }
.daycell .cnt.has { color: var(--red); }
.daycell.today { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 40%, transparent); }
.daycell.sel { border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--card)); }
.daycell.dim { opacity: .55; }
.dayhead { margin: 16px 4px 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.dayhead h3 { font-family: var(--font-display); font-size: 20px; }
.legend { display: flex; gap: 14px; font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 4px 0; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--red); display: inline-block; }
.legend i.R { background: var(--red); }
.legend i.fin { border-color: var(--gold-deep); background: var(--gold); }
.evlist { display: flex; flex-direction: column; gap: 6px; }
.ev { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; font-weight: 600; }
.ev .d { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); min-width: 62px; }
.ev.off .d { color: var(--danger); }

/* ---- lanes ----------------------------------------------------------------- */
.lanegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .lanegrid { grid-template-columns: 1fr; } }
.lane { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px; text-align: left; box-shadow: var(--shadow); position: relative; overflow: hidden; color: var(--ink); width: 100%; }
.lane::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--lc, var(--gold)); }
.lane .ico { width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--lc, var(--gold)) 16%, transparent); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; margin-left: 4px; }
.lane .p { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--lc, var(--muted)); }
.lane .nm { font-weight: 800; font-size: 15px; line-height: 1.2; }
.lane .sub { font-size: 12px; color: var(--muted); font-weight: 600; }
.lane.empty-lane { border-style: dashed; box-shadow: none; }
.lane.empty-lane .nm { color: var(--muted); font-weight: 600; }
.bell { display: grid; grid-template-columns: 1fr; gap: 6px; }
.bellrow { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.bellrow .tm { font-variant-numeric: tabular-nums; font-weight: 800; min-width: 118px; color: var(--muted); font-size: 13px; }
.bellrow .lb { font-weight: 700; flex: 1; }
.bellrow.now { border-color: var(--red); background: color-mix(in srgb, var(--red) 7%, var(--card)); }
.bellrow.minor { opacity: .7; }

/* ---- rewards --------------------------------------------------------------- */
.levelcard { background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%); color: #fff; border-radius: 22px; padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; border: 1px solid transparent; }
.levelcard::after { content: ''; position: absolute; right: -50px; bottom: -80px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(234, 204, 85, .35), transparent 65%); pointer-events: none; }
.levelcard .wm { position: absolute; right: 14px; top: 12px; height: 92px; width: auto; opacity: .9; filter: drop-shadow(0 3px 8px rgba(0,0,0,.25)); }
.levelcard > * { position: relative; }
.levelcard .wm { z-index: 0; }
.crest { width: 96px; height: 96px; border-radius: 50%; margin: 6px auto 4px; background: linear-gradient(135deg, var(--red), var(--red-deep)); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 22px rgba(158, 42, 47, .35), inset 0 0 0 3px var(--gold); }
.crest img { height: 56px; width: auto; }
.hero { background: linear-gradient(135deg, var(--red), var(--red-deep)); border-radius: 18px; padding: 18px 18px 14px; margin: 4px 0 6px; display: flex; justify-content: center; box-shadow: var(--shadow); }
.hero img { height: 120px; width: auto; }
.cross { height: 14px; width: auto; vertical-align: -2px; margin-right: 4px; opacity: .9; }
.about-lockup { display: block; width: 70%; max-width: 320px; height: auto; margin: 4px auto 12px; }
[data-theme="midnight"] .about-lockup, [data-theme="stage"] .about-lockup, [data-theme="codered"] .about-lockup { background: #fff; border-radius: 10px; padding: 10px 14px; }
.levelcard .lvl-n { font-family: var(--font-display); font-size: 64px; line-height: 1; }
.levelcard .lvl-t { font-family: var(--font-display); letter-spacing: .14em; text-transform: uppercase; font-size: 15px; color: var(--gold); margin-top: 4px; }
.levelcard .name { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.bar { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .2); overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); border-radius: 999px; transition: width .6s cubic-bezier(.2, .9, .3, 1); }
.bar-lbl { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-top: 6px; opacity: .9; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow); }
.stat .v { font-family: var(--font-display); font-size: 26px; line-height: 1; }
.stat .l { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 560px) { .badges { grid-template-columns: repeat(4, 1fr); } }
.badge { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow); color: var(--ink); }
.badge .e { font-size: 30px; line-height: 1; }
.badge .n { font-weight: 800; font-size: 12.5px; margin-top: 6px; line-height: 1.2; }
.badge .d { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.25; }
.badge.locked { opacity: .55; }
.badge.locked .e { filter: grayscale(1); }
.badge.new { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 40%, transparent); }
.unlocks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.unlock { display: flex; align-items: center; gap: 10px; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; text-align: left; color: var(--ink); width: 100%; }
.unlock.on { border-color: var(--red); }
.unlock.locked { opacity: .6; }
.unlock .sw { display: flex; gap: 3px; }
.unlock .sw i { width: 14px; height: 24px; border-radius: 4px; display: block; }
.unlock .n { font-weight: 800; font-size: 13.5px; }
.unlock .s { font-size: 11px; color: var(--muted); font-weight: 700; }
.howto { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 13.5px; }
.howto b { text-align: right; color: var(--gold-deep); white-space: nowrap; }

/* ---- settings -------------------------------------------------------------- */
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 22px; letter-spacing: .08em; font-weight: 700; background: var(--paper); border: 2px dashed var(--gold-deep); border-radius: 14px; padding: 12px; text-align: center; word-break: break-all; }
.sync-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.sync-dot.ok { background: var(--green); }
.sync-dot.error { background: var(--danger); }
.sync-dot.syncing { background: var(--gold-deep); animation: pulse 1s infinite; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: center; }
.kv:last-child { border-bottom: 0; }
.kv b { font-weight: 800; }
.seg { display: flex; background: var(--soft); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; padding: 8px 10px; border-radius: 9px; font-weight: 800; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--red); box-shadow: 0 2px 8px rgba(0, 0, 0, .1); }
.steps { padding-left: 20px; margin: 6px 0 0; font-size: 14px; }
.steps li { margin-bottom: 6px; }

/* ---- toasts / modal --------------------------------------------------------- */
.toasts { position: fixed; top: calc(env(safe-area-inset-top) + 74px); left: 0; right: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 999px; font-weight: 800; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transform: translateY(-12px); opacity: 0; transition: all .25s cubic-bezier(.2, .9, .3, 1); max-width: 100%; text-align: center; }
.toast.in { transform: none; opacity: 1; }
.toast.xp { background: linear-gradient(135deg, var(--gold), var(--gold-bright)); color: var(--red-deep); }
.toast.bad { background: var(--danger); color: #fff; }
.modal { text-align: center; padding: 10px 6px 4px; }
.modal .big { font-size: 60px; line-height: 1; }
.modal h2 { font-family: var(--font-display); font-size: 30px; letter-spacing: .04em; margin-top: 8px; }
.modal .lvl-n { font-family: var(--font-display); font-size: 88px; line-height: 1; color: var(--red); }
.modal p { color: var(--muted); font-weight: 600; }
.fx { position: fixed; inset: 0; z-index: 70; pointer-events: none; width: 100%; height: 100%; }
body.spotlight-on::before { content: ''; position: fixed; inset: -30%; z-index: 65; pointer-events: none; background: radial-gradient(ellipse 30% 45% at 50% 30%, rgba(255, 246, 199, .55), transparent 70%); animation: sweep 1.4s ease; }
@keyframes sweep { 0% { transform: translateX(-30%); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateX(30%); opacity: 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 900px) {
  .view { padding-top: 22px; }
  .blocks { gap: 10px; }
}
