/* Class Aquarium — design system */
:root {
  --ink: #1C2A4A;
  --ink-2: #4A5878;
  --muted: #66738F;
  --line: #E2E9F4;
  --bg: #F3F7FD;
  --card: #FFFFFF;
  --primary: #2F7BF5;
  --primary-d: #1D5FD0;
  --mint: #19BFA0;
  --mint-d: #0E9A80;
  --sun: #FFC23C;
  --sun-d: #E39A00;
  --coral: #FF6B6B;
  --coral-d: #D94848;
  --grape: #8B5CF6;
  --pink: #FF7EB6;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(28, 42, 74, .06), 0 8px 24px rgba(28, 42, 74, .08);
  --shadow-lg: 0 20px 60px rgba(16, 30, 70, .25);
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --c-sun: #FFC23C; --c-orange: #FF8A3D; --c-coral: #FF6B6B; --c-pink: #FF7EB6; --c-grape: #A374F5;
  --c-blue: #4D8DF7; --c-sky: #3CC8F0; --c-teal: #22C7A9; --c-lime: #8BD448; --c-snow: #C9D3E3; --c-night: #4A5578;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.has-modal, body.no-scroll { overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -.01em; line-height: 1.15; }
p { margin: 0; line-height: 1.5; }
a { color: var(--primary); }
button, input, textarea, select { font: inherit; color: inherit; }
input, textarea {
  width: 100%;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-weight: 700;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(47, 123, 245, .15); }
input::placeholder, textarea::placeholder { color: #A9B4CA; font-weight: 600; }
:focus-visible { outline: 3px solid rgba(47, 123, 245, .5); outline-offset: 2px; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.pad { padding: 24px; }

/* ------------------------------------------------------------ buttons */
.btn {
  --b: var(--card); --bd: var(--line); --fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 0; border-radius: var(--radius-sm);
  background: var(--b); color: var(--fg);
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 0 var(--bd);
  transition: transform .08s, box-shadow .08s, filter .15s, background .15s;
  user-select: none;
}
.btn:hover { filter: brightness(1.04); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--bd); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { --b: var(--primary); --bd: var(--primary-d); --fg: #fff; }
.btn-mint { --b: var(--mint); --bd: var(--mint-d); --fg: #fff; }
.btn-sun { --b: var(--sun); --bd: var(--sun-d); --fg: #3D2A00; }
.btn-danger { --b: var(--coral); --bd: var(--coral-d); --fg: #fff; }
.btn-ghost { --b: #fff; --bd: #D6DFEE; --fg: var(--ink); border: 2px solid #D6DFEE; box-shadow: 0 3px 0 #D6DFEE; }
.btn-ghost.on { --b: #EAF2FF; border-color: var(--primary); color: var(--primary-d); box-shadow: 0 3px 0 var(--primary); }
.btn-ghost-light { --b: rgba(255, 255, 255, .14); --bd: rgba(0, 0, 0, .18); --fg: #fff; }
.btn-glass { --b: rgba(255, 255, 255, .9); --bd: rgba(13, 50, 110, .25); }
.btn-icon { padding: 0; width: 44px; }
.btn-lg { min-height: 52px; font-size: 18px; padding: 0 24px; border-radius: 16px; }
.btn-xl { min-height: 62px; font-size: 22px; border-radius: 18px; box-shadow: 0 5px 0 var(--bd); }
.btn-block { width: 100%; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn-ghost.is-busy::after, .btn-mini.is-busy::after { border-color: #CBD5E6; border-top-color: var(--primary); }
.btn-mini {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px;
  border: 2px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
  font-family: var(--font-display); font-weight: 500; font-size: 14px; color: var(--ink-2);
}
.btn-mini:hover { border-color: #C6D2E6; color: var(--ink); }
.btn-mini.danger:hover { border-color: #FFC2C2; color: var(--coral-d); background: #FFF5F5; }
.btn-mini .icon { width: 16px; height: 16px; }
.btn-mini.is-busy { position: relative; color: transparent; }
.btn-mini.is-busy::after { content: ''; position: absolute; left: 50%; top: 50%; margin: -8px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid; animation: spin .7s linear infinite; }

.chip { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 700; }
.chip:hover { border-color: var(--primary); }

.seg { display: inline-flex; background: #E8EEF8; border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-family: var(--font-display); font-weight: 500; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(28, 42, 74, .15); }
.seg-lg { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.seg-lg button { display: flex; flex-direction: column; padding: 10px; }
.seg-lg small { font-family: var(--font-body); font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------- brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand-mark { width: 40px; height: 40px; display: block; flex: none; filter: drop-shadow(0 2px 0 rgba(28,42,74,.12)); transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name { font-family: var(--font-display); font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.brand-name b { font-weight: 700; color: var(--primary); }
.brand-sm .brand-mark { width: 34px; height: 34px; }
.brand-sm .brand-name { font-size: 19px; }

/* -------------------------------------------------------------- pills */
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-family: var(--font-display); font-weight: 600; font-size: 13px; white-space: nowrap; }
.stage-0 { background: #E6F0FF; color: #3767B8; }
.stage-1 { background: #E0F7FF; color: #157FA6; }
.stage-2 { background: #DDF7F0; color: #0E8C73; }
.stage-3 { background: #E9F8D9; color: #4C8A12; }
.stage-4 { background: #FFF1D6; color: #A86B00; }
.stage-5 { background: #FFE8DA; color: #C2561A; }
.stage-6 { background: #FFE3EC; color: #C23A6A; }
.stage-7 { background: #F6E3FF; color: #9A3FC2; }
.stage-8 { background: #E9E4FF; color: #5B3FD8; box-shadow: inset 0 0 0 2px #CFC3FF; }
.stage-9 { background: linear-gradient(90deg, #FFE27A, #FFB547); color: #6B3E00; box-shadow: 0 0 0 2px #fff, 0 0 12px rgba(255, 190, 60, .7); }
.stage-10 { background: linear-gradient(90deg, #FF7EB6, #FFC23C, #5BE3A8, #4DA3FF, #B57CFF); background-size: 200% 100%; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); box-shadow: 0 0 0 2px #fff, 0 0 14px rgba(181, 124, 255, .7); animation: rainbow 4s linear infinite; }
.pill-egg { background: #EEF2F8; color: var(--muted); }

.bar { position: relative; height: 12px; background: #E6ECF6; border-radius: 999px; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #39D3B4, #2F7BF5); border-radius: 999px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bar-sm { height: 8px; }
.bar-goal { height: 16px; }
.bar-goal i { background: linear-gradient(90deg, #FFC23C, #FF7EB6); }

/* -------------------------------------------------------------- tanks */
.tank { position: relative; overflow: hidden; background: #1C83C9; }
.tank-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; }
.tank.editing .tank-svg { touch-action: none; } /* only block scrolling while dragging decorations */
.tank .fish { cursor: pointer; }
.tank.editing .t-fish { pointer-events: none; opacity: .85; }
.tank .decor.editable { cursor: grab; }
.tank .decor.editable:active { cursor: grabbing; }
.fish-label text { font-family: var(--font-display); font-weight: 600; font-size: 19px; fill: var(--ink); }
.fish-label { pointer-events: none; }
.fx-pop { pointer-events: none; }
.fx-pop text { font-family: var(--font-display); font-weight: 700; fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, .15); stroke-width: 3px; }

/* --------------------------------------------------------------- home */
.home { min-height: 100vh; display: flex; flex-direction: column; }
.hero { position: relative; min-height: min(860px, 100vh); display: flex; flex-direction: column; padding: 0 24px 48px; overflow: hidden; }
.hero-tank { position: absolute; inset: 0; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 40, 90, .45) 0%, rgba(8, 40, 90, .15) 40%, rgba(8, 40, 90, 0) 70%); pointer-events: none; }
.home-nav { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 20px 0; max-width: 1120px; width: 100%; margin: 0 auto; }
.home-nav .brand { color: #fff; }
.home-nav .brand-name b { color: #FFD66B; }
.hero-content { position: relative; max-width: 1120px; width: 100%; margin: 4vh auto 0; color: #fff; pointer-events: none; }
.hero-content h1 { font-size: clamp(38px, 6vw, 68px); font-weight: 700; text-shadow: 0 2px 20px rgba(0, 30, 80, .35); }
.hero-content p { max-width: 560px; font-size: clamp(17px, 2vw, 20px); margin-top: 16px; opacity: .95; text-shadow: 0 1px 8px rgba(0, 30, 80, .4); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .22); padding: 6px 14px; border-radius: 999px; font-family: var(--font-display); font-weight: 500; margin-bottom: 16px; }
.choice-row { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); gap: 20px; max-width: 1120px; width: 100%; margin: auto auto 0; padding-top: 32px; }
.choice-card { background: #fff; border-radius: 24px; padding: 24px; box-shadow: var(--shadow-lg); }
.choice-card h2 { font-size: 26px; margin-top: 12px; }
.choice-card p { color: var(--ink-2); margin: 4px 0 16px; }
.choice-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; }
.choice-icon .icon { width: 28px; height: 28px; }
.choice-icon.mint { background: var(--mint); box-shadow: 0 4px 0 var(--mint-d); }
.choice-icon.blue { background: var(--primary); box-shadow: 0 4px 0 var(--primary-d); }
.code-input-row { display: flex; gap: 10px; }
.code-input { font-family: var(--font-display); font-size: 24px; letter-spacing: .2em; text-transform: uppercase; text-align: center; font-weight: 600; }
.code-xl { font-size: 34px; padding: 16px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 1120px; width: 100%; margin: 56px auto; padding: 0 24px; }
.feature { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.feature h3 { font-size: 21px; margin: 14px 0 6px; }
.feature p { color: var(--ink-2); }
.feature-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; }
.feature-icon .icon { width: 26px; height: 26px; }
.feature-icon.sun { background: #FFF2D1; color: #C98600; }
.feature-icon.pink { background: #FFE5F1; color: #D63B82; }
.feature-icon.blue { background: #E3EEFF; color: var(--primary); }
.footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 24px; max-width: 1120px; width: 100%; margin-inline: auto; color: var(--muted); border-top: 2px solid var(--line); }

/* --------------------------------------------------------------- auth */
.auth-page { min-height: 100vh; position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 16px 48px; }
.auth-bg { position: fixed; inset: 0; background:
  radial-gradient(1200px 500px at 50% -10%, #BFE8FF 0%, transparent 60%),
  radial-gradient(600px 400px at 100% 100%, #CFF5EA 0%, transparent 60%),
  linear-gradient(180deg, #EAF6FF, #F3F7FD); z-index: -1; }
.auth-nav { width: 100%; max-width: 1120px; padding: 20px 0; }
.auth-card { width: 100%; max-width: 460px; background: #fff; border-radius: 28px; padding: 32px; box-shadow: var(--shadow); margin-top: 4vh; }
.auth-head { text-align: center; margin-bottom: 24px; }
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; font-family: var(--font-display); font-size: 26px; color: var(--ink); }
.boot b { color: var(--primary); }
.boot img { animation: boot-bob 1.6s ease-in-out infinite; }
@keyframes boot-bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
.auth-head .choice-icon { margin: 0 auto 14px; }
.logo-anim { display: block; width: 96px; height: 96px; margin: 0 auto 10px; object-fit: contain; mix-blend-mode: multiply; pointer-events: none; }
.logo-anim-lg { width: 128px; height: 128px; margin-bottom: 8px; }
.auth-head h1 { font-size: 30px; }
.auth-head p { color: var(--ink-2); margin-top: 6px; }
.auth-foot { text-align: center; margin-top: 20px; color: var(--ink-2); }
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-family: var(--font-display); font-weight: 500; font-size: 15px; color: var(--ink-2); padding: 0; }
.field > span em { font-style: normal; color: var(--muted); font-family: var(--font-body); font-size: 13px; }
fieldset.field > legend { margin-bottom: 8px; }
.hint { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.hint .icon { margin-top: 2px; }
.recent { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.recent > span { width: 100%; font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--line);
}
.topbar.slim { justify-content: space-between; }
.topbar-class { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; padding-left: 16px; border-left: 2px solid var(--line); }
.topbar-class h1 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-chip { display: inline-flex; align-items: center; gap: 8px; border: 2px dashed #B8CBEA; background: #F2F7FF; color: var(--ink-2); border-radius: 12px; padding: 6px 12px; cursor: pointer; white-space: nowrap; font-weight: 700; font-size: 14px; }
.code-chip b { font-family: var(--font-display); letter-spacing: .12em; color: var(--primary-d); font-size: 16px; }
.code-chip:hover { border-color: var(--primary); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.step-label { display: inline-flex; gap: 8px; align-items: center; font-family: var(--font-display); color: var(--ink-2); }

/* --------------------------------------------------------- dashboard */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; max-width: 1440px; margin: 0 auto; padding: 24px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-left { display: flex; align-items: baseline; gap: 10px; }
.toolbar-left h2 { font-size: 26px; }
.count { color: var(--muted); }
.toolbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.student-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 14px 16px; border: 3px solid transparent; border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow); cursor: pointer; text-align: center;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.student-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(28, 42, 74, .06), 0 14px 30px rgba(28, 42, 74, .12); }
.student-card.selected { border-color: var(--primary); background: #F4F8FF; }
.sc-art { width: 100%; aspect-ratio: 1.45; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--tint) 18%, #F4F9FF); }
.sc-art svg { width: 86%; height: 86%; }
.sc-name { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.1; }
.sc-stats { display: flex; gap: 12px; font-size: 14px; color: var(--ink-2); }
.sc-stats span { display: inline-flex; align-items: center; gap: 4px; }
.sc-stats .icon { width: 16px; height: 16px; color: var(--sun-d); }
.student-card .bar { width: 100%; }
.student-card .check { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; display: none; place-items: center; background: #fff; border: 2px solid #CBD6EA; color: #fff; }
.student-card.selecting .check { display: grid; }
.student-card.selected .check { background: var(--primary); border-color: var(--primary); }
.student-card .check .icon { width: 16px; height: 16px; }
.student-card.pop { animation: pop .6s cubic-bezier(.3, 1.6, .5, 1); }
.empty { grid-column: 1 / -1; text-align: center; background: #fff; border: 3px dashed var(--line); border-radius: 24px; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-art svg { width: 140px; height: 110px; }
.empty h3 { font-size: 24px; }
.empty p { color: var(--ink-2); max-width: 380px; margin-bottom: 8px; }

.dash-side { display: flex; flex-direction: column; gap: 16px; }
.card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.card-head h3 { font-size: 18px; }
.card-head .muted { font-size: 13px; }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.goal-label { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.goal-label .icon { color: var(--sun-d); }
.goal-num { color: var(--ink-2); }
.goal-num b { font-family: var(--font-display); font-size: 22px; color: var(--ink); }
.goal-reward { margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.goal-done .goal-reward b { color: #C2306F; }
.feed { display: flex; flex-direction: column; gap: 6px; }
.feed-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.feed-row:hover { background: #F6F9FE; }
.feed-row .btn-mini { opacity: 0; transition: opacity .15s; }
.feed-row:hover .btn-mini, .feed-row .btn-mini:focus-visible { opacity: 1; }
@media (hover: none) { .feed-row .btn-mini { opacity: 1; } }
.feed-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.feed-icon.pos { background: #FFF2D1; color: #C98600; }
.feed-icon.neg { background: #EEF2F8; color: var(--muted); }
.feed-text { flex: 1; min-width: 0; font-size: 15px; }
.feed-text b { font-family: var(--font-display); }
.feed-text small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stages { display: grid; gap: 8px; }
.stage-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.stage-count { font-family: var(--font-display); min-width: 28px; text-align: center; background: #F0F4FA; border-radius: 8px; padding: 2px 6px; }

.select-bar {
  position: fixed; left: 50%; bottom: 20px; z-index: 30; transform: translate(-50%, 140%);
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 20px;
  background: var(--ink); color: #fff; border-radius: 20px; box-shadow: var(--shadow-lg);
  transition: transform .25s cubic-bezier(.2, .9, .3, 1.2);
}
.select-bar.show { transform: translate(-50%, 0); }
.select-bar #sel-count { font-family: var(--font-display); margin-right: 8px; white-space: nowrap; }

/* -------------------------------------------------------------- modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(15, 28, 60, .5); opacity: 0; transition: opacity .2s; overflow-y: auto; }
.modal-backdrop.in { opacity: 1; }
.modal { position: relative; width: 100%; background: #fff; border-radius: 28px; box-shadow: var(--shadow-lg); transform: translateY(16px) scale(.97); transition: transform .25s cubic-bezier(.2, .9, .3, 1.2); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-backdrop.in .modal { transform: none; }
.modal-sm { max-width: 420px; }
.modal-md { max-width: 640px; }
.modal-lg { max-width: 860px; }
.modal-body { padding: 28px; }
.modal-body > div > h2, .modal-body > form > h2 { font-size: 26px; margin-bottom: 16px; }
.modal-x { position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; border-radius: 12px; border: 0; background: #F0F4FA; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.modal-x:hover { background: #E4EAF4; color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.modal-actions.spread { justify-content: space-between; align-items: center; }
.confirm { text-align: center; }
.confirm h2 { font-size: 24px; margin-bottom: 8px !important; }
.confirm p { color: var(--ink-2); }
.confirm .modal-actions { justify-content: center; }
.confirm-art { margin-bottom: 12px; }
.confirm-item { width: 140px; height: 110px; margin: 0 auto; background: #F2F7FF; border-radius: 20px; display: grid; place-items: center; padding: 12px; }
.confirm-item svg { width: 100%; height: 100%; }

.created { text-align: center; }
.created p { color: var(--ink-2); }
.big-code { font-family: var(--font-display); font-weight: 700; font-size: 52px; letter-spacing: .18em; color: var(--primary-d); background: #EEF5FF; border: 3px dashed #A9C6F5; border-radius: 20px; padding: 10px; margin: 16px 0; }
.share-link { display: flex; gap: 8px; margin-bottom: 12px; }
.share-link input { font-size: 14px; }
.created .hint { justify-content: center; }
.created .modal-actions { justify-content: center; }

/* award */
.award-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-right: 40px; }
.award-head h2 { font-size: 26px; }
.award-head p { color: var(--ink-2); }
.av-stack { display: flex; }
.av-stack .av { width: 72px; height: 60px; border-radius: 16px; background: #EEF5FF; display: grid; place-items: center; border: 3px solid #fff; box-shadow: var(--shadow); }
.av-stack .av + .av { margin-left: -28px; }
.av-stack svg { width: 90%; height: 90%; }
.reward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.reward-tile {
  --t: var(--primary); --td: var(--primary-d); --tl: #EAF2FF;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px 14px;
  border: 0; border-radius: 18px; background: var(--tl); cursor: pointer; box-shadow: 0 4px 0 color-mix(in srgb, var(--t) 35%, transparent);
  transition: transform .1s, box-shadow .1s;
}
.reward-tile:hover { transform: translateY(-2px); }
.reward-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--t) 35%, transparent); }
.reward-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--t); color: #fff; box-shadow: 0 3px 0 var(--td); }
.reward-icon .icon { width: 28px; height: 28px; }
.reward-label { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1.15; text-align: center; }
.reward-pts { position: absolute; top: 8px; right: 8px; font-family: var(--font-display); font-weight: 700; font-size: 14px; background: #fff; color: var(--td); border-radius: 999px; padding: 2px 8px; }
.reward-tile.is-busy .reward-icon { animation: pulse .8s infinite; }
.tile-blue { --t: #2F7BF5; --td: #1D5FD0; --tl: #EAF2FF; }
.tile-pink { --t: #F25AA0; --td: #C93A7D; --tl: #FFEAF4; }
.tile-mint { --t: #19BFA0; --td: #0E9A80; --tl: #E2F8F3; }
.tile-sun { --t: #F5AE14; --td: #C98600; --tl: #FFF5DC; }
.tile-grape { --t: #8B5CF6; --td: #6B3FD8; --tl: #F1EBFF; }
.tile-coral { --t: #FF6B6B; --td: #D94848; --tl: #FFEDED; }
.tile-teal { --t: #1AAFCF; --td: #0F8AA6; --tl: #E2F6FB; }
.tile-orange { --t: #FF8A3D; --td: #DB6A1E; --tl: #FFF0E5; }
.custom-award { margin-top: 20px; border-top: 2px solid var(--line); padding-top: 14px; }
.custom-award summary { cursor: pointer; font-family: var(--font-display); color: var(--ink-2); }
.custom-row { display: flex; gap: 10px; margin: 12px 0 8px; flex-wrap: wrap; }
.custom-row input#c-reason { flex: 1; min-width: 160px; width: auto; }
.stepper { display: flex; align-items: center; border: 2px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.stepper button { width: 42px; height: 44px; border: 0; background: #F4F7FC; cursor: pointer; display: grid; place-items: center; }
.stepper input { width: 64px; border: 0; border-radius: 0; text-align: center; font-family: var(--font-display); font-size: 18px; padding: 8px 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper input:focus { box-shadow: none; }

/* students modal */
.add-students { display: flex; gap: 10px; align-items: stretch; margin-bottom: 16px; }
.add-students textarea { resize: vertical; min-height: 52px; }
.teacher-list { display: grid; gap: 8px; margin: 16px 0; }
.t-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: #F7FAFE; }
.t-row.me { background: #EEF5FF; box-shadow: inset 0 0 0 2px #D5E5FF; }
.t-av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.t-row:nth-child(4n+2) .t-av { background: #FF8A5B; }
.t-row:nth-child(4n+3) .t-av { background: #22B98F; }
.t-row:nth-child(4n+4) .t-av { background: #9B6BFF; }
.t-who { min-width: 0; display: grid; gap: 2px; }
.t-who b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-who em { font-style: normal; color: var(--muted); font-weight: 600; }
.t-who small { color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.role { padding: 1px 8px; border-radius: 999px; font-weight: 800; font-size: 12px; background: #E6ECF5; color: var(--ink-2); }
.role-owner { background: #FFF1C9; color: #8A5A00; }
.t-actions { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; }
.t-actions:empty { display: none; }
.t-actions .btn-mini { white-space: nowrap; }
.t-edit { grid-column: 2; display: flex; gap: 8px; margin-top: 4px; }
.t-edit input { flex: 1; min-width: 0; }
.t-add-form { border-top: 2px dashed var(--line); padding-top: 16px; display: grid; gap: 10px; }
.t-add-form h3 { font-size: 18px; }
.t-add-form .btn { justify-self: start; }
.toggle-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: #F7FAFE; cursor: pointer; margin-bottom: 16px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row small { display: block; color: var(--muted); font-weight: 600; }
.toggle { flex: none; width: 44px; height: 26px; border-radius: 999px; background: #CBD6EA; position: relative; transition: background .2s; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.toggle-row input:checked + .toggle { background: var(--primary); }
.toggle-row input:checked + .toggle::after { transform: translateX(18px); }
.toggle-row input:focus-visible + .toggle { outline: 3px solid var(--primary); outline-offset: 2px; }
@media (max-width: 520px) { .t-actions, .t-edit { grid-column: 1 / -1; } .t-edit { flex-wrap: wrap; } }
.student-table { display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; padding-right: 4px; }
.st-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 6px 8px; border-radius: 14px; background: #F7FAFE; }
.st-av svg { width: 56px; height: 46px; display: block; }
.st-name { padding: 8px 12px; border-color: transparent; background: transparent; }
.st-name:hover { border-color: var(--line); background: #fff; }
.pin { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 18px; letter-spacing: .15em; background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: 4px 10px; }
.pin .icon { width: 15px; height: 15px; color: var(--muted); }
.st-actions { display: flex; gap: 6px; }

/* settings */
.settings { display: grid; gap: 22px; }
.settings h2 { margin-bottom: 0 !important; }
.row-2 { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; }
.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.theme-opt { border: 3px solid transparent; background: #F4F7FC; border-radius: 16px; padding: 6px; cursor: pointer; display: grid; gap: 4px; font-family: var(--font-display); font-size: 14px; }
.theme-opt svg { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; display: block; height: auto; }
.theme-opt.on { border-color: var(--primary); background: #EAF2FF; }
.reward-edit { display: grid; gap: 8px; margin-bottom: 10px; }
.re-row { display: grid; grid-template-columns: 46px 1fr 90px auto; gap: 8px; align-items: center; }
.re-icon { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--t); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 3px 0 var(--td); }
.re-row input { padding: 10px 12px; }

/* ----------------------------------------------------- class display */
.display { position: fixed; inset: 0; background: #0E5D9A; }
.display-tank { position: absolute; inset: 0; }
.glass { background: rgba(255, 255, 255, .94); border-radius: 20px; box-shadow: 0 8px 30px rgba(0, 30, 80, .2); }
.display-top { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; gap: 14px; align-items: flex-start; pointer-events: none; }
.display-top > * { pointer-events: auto; }
.display-title { display: flex; align-items: center; gap: 14px; padding: 10px 18px 10px 12px; }
.display-title h1 { font-size: 24px; }
.display-title p { color: var(--ink-2); font-size: 14px; }
.display-goal { width: 320px; padding: 12px 16px; margin-left: auto; }
.goal-compact .goal-label { font-size: 16px; }
.goal-compact .goal-num b { font-size: 18px; }
.goal-compact .goal-reward { margin-top: 6px; font-size: 14px; }
.display-tools { display: flex; gap: 8px; }
.display-tools .btn { background: rgba(255, 255, 255, .88); }
.display-goal[hidden] + .display-tools { margin-left: auto; }
.display-date { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 14px; line-height: 1.2; }
.display-date[hidden] { display: none; }
.display-date > .icon { width: 30px; height: 30px; color: var(--coral, #FF6B6B); flex: none; }
.display-date b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--ink); white-space: nowrap; }
.display-date span { display: block; font-family: var(--font-display); font-size: 15px; color: var(--ink-2); }
.display-join { position: absolute; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 16px; }
.display-join .icon { color: var(--primary); }
.display-join .code { font-family: var(--font-display); letter-spacing: .15em; color: var(--primary-d); font-size: 20px; }
.display-feed { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.feed-pop { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; padding: 8px 16px 8px 8px; box-shadow: 0 8px 30px rgba(0, 30, 80, .25); transform: translateX(120%); transition: transform .4s cubic-bezier(.2, .9, .3, 1.2); }
.feed-pop.in { transform: none; }
.feed-pop b { display: block; font-family: var(--font-display); font-size: 18px; }
.feed-pop small { color: var(--ink-2); font-size: 15px; }
.fp-art { width: 64px; height: 52px; display: grid; place-items: center; background: #EEF5FF; border-radius: 12px; }
.fp-art svg { width: 100%; height: 100%; }
.display-empty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.display-empty .glass { padding: 24px 32px; text-align: center; }
.display-empty h2 { font-size: 28px; margin-bottom: 6px; }

.peek { display: grid; gap: 16px; }
.peek-tank { aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; }
.peek-info { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.peek-info h2 { font-size: 26px; margin: 0 !important; }
.peek-stats { display: flex; gap: 12px; align-items: center; }
.peek-stats span:not(.pill) { display: inline-flex; gap: 6px; align-items: center; font-family: var(--font-display); }
.peek-stats .icon { color: var(--sun-d); }

/* --------------------------------------------------------------- join */
.join-page { min-height: 100vh; background: linear-gradient(180deg, #E4F4FF, var(--bg) 320px); }
.join { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; }
.join-head { text-align: center; margin-bottom: 28px; }
.join-head h1 { font-size: clamp(30px, 4vw, 42px); }
.join-head p { color: var(--ink-2); font-size: 19px; margin-top: 6px; }
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.name-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; border: 0; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s; }
.name-tile:hover { transform: translateY(-3px) rotate(-1deg); }
.nt-art { width: 100%; aspect-ratio: 1.4; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--tint) 18%, #F4F9FF); }
.nt-art svg { width: 86%; height: 86%; }
.nt-name { font-family: var(--font-display); font-size: 20px; font-weight: 600; }

.pinpad { text-align: center; }
.pin-av { width: 120px; height: 96px; margin: 0 auto 8px; background: #EEF5FF; border-radius: 24px; display: grid; place-items: center; }
.pin-av svg { width: 90%; height: 90%; }
.pinpad h2 { margin-bottom: 2px !important; }
.pinpad p { color: var(--ink-2); }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 20px; }
.pin-dots i { width: 20px; height: 20px; border-radius: 50%; border: 3px solid #C7D3E8; transition: background .1s, transform .1s; }
.pin-dots i.on { background: var(--primary); border-color: var(--primary); transform: scale(1.1); }
.pin-dots.shake { animation: shake .45s; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 280px; margin: 0 auto; }
.keys button { height: 64px; border: 0; border-radius: 18px; background: #F0F5FC; font-family: var(--font-display); font-size: 28px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 0 #D8E2F1; display: grid; place-items: center; }
.keys button:active { transform: translateY(3px); box-shadow: 0 1px 0 #D8E2F1; }
.keys .k-alt { background: #fff; color: var(--muted); border: 2px solid var(--line); }

/* ------------------------------------------------------------ creator */
.creator-page { min-height: 100vh; background: linear-gradient(180deg, #E4F4FF, var(--bg) 400px); }
.creator { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 32px; max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; align-items: start; }
.creator-preview { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 20px; }
.bowl { position: relative; aspect-ratio: 1.15; border-radius: 48% 48% 44% 44%; background: radial-gradient(circle at 35% 25%, #B9F0FF 0%, #58C4EE 45%, #1E8FD0 100%); box-shadow: inset 0 -20px 40px rgba(0, 40, 100, .25), inset 0 10px 30px rgba(255, 255, 255, .5), var(--shadow); display: grid; place-items: center; overflow: hidden; }
.bowl::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 18%; background: #F5DCA6; border-top: 4px solid #E3BF7E; }
.bowl-fish { width: 70%; animation: bob 3s ease-in-out infinite; position: relative; z-index: 1; }
.bowl-fish svg { width: 100%; height: auto; display: block; }
.bowl-bubbles i { position: absolute; bottom: 20%; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .3); animation: rise 4s linear infinite; }
.bowl-bubbles i:nth-child(1) { left: 20%; }
.bowl-bubbles i:nth-child(2) { left: 70%; animation-delay: 1.3s; width: 10px; height: 10px; }
.bowl-bubbles i:nth-child(3) { left: 50%; animation-delay: 2.6s; }
.name-field > span { font-family: var(--font-display); color: var(--ink-2); display: block; margin-bottom: 6px; }
.name-row { display: flex; gap: 8px; }
.name-row input { font-family: var(--font-display); font-size: 22px; text-align: center; }
.creator-options { background: #fff; border-radius: 28px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 22px; }
.creator-options h1 { font-size: 30px; }
.opt-group h3 { display: flex; align-items: center; gap: 10px; font-size: 19px; margin-bottom: 10px; }
.num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: 15px; }
.species-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.species-grid.patterns { grid-template-columns: repeat(4, 1fr); }
.opt { border: 3px solid transparent; background: #F4F7FC; border-radius: 16px; padding: 6px 4px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--font-display); font-size: 14px; transition: transform .1s; }
.opt:hover { transform: translateY(-2px); }
.opt svg { width: 100%; height: auto; aspect-ratio: 1.3; }
.opt.on { border-color: var(--primary); background: #EAF2FF; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; background: var(--sw); box-shadow: 0 0 0 2px var(--line), inset 0 -4px 0 rgba(0, 0, 0, .12); cursor: pointer; transition: transform .1s; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 3px var(--primary), inset 0 -4px 0 rgba(0, 0, 0, .12); transform: scale(1.1); }

/* ------------------------------------------------------------ my tank */
.me-page { min-height: 100vh; display: flex; flex-direction: column; }
.me-top { gap: 14px; }
.me-id { display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 2px solid var(--line); min-width: 0; }
.me-av { width: 54px; height: 44px; background: #EEF5FF; border-radius: 12px; display: grid; place-items: center; flex: none; }
.me-av svg { width: 100%; height: 100%; }
.me-id b { display: block; font-family: var(--font-display); font-size: 19px; line-height: 1.1; white-space: nowrap; }
.me-id small { color: var(--muted); font-size: 13px; }
.me-growth { flex: 1; max-width: 340px; min-width: 160px; }
.mg-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.mg-top b { font-family: var(--font-display); color: var(--ink); }
.coins-chip { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 12px; border-radius: 999px; background: #FFF4D6; color: #9A6500; border: 2px solid #FFE19A; }
.coins-chip .icon { width: 24px; height: 24px; color: var(--sun-d); }
.coins-chip b { font-family: var(--font-display); font-size: 20px; color: #6B4600; }
.me { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 20px; padding: 20px 24px 24px; max-width: 1600px; width: 100%; margin: 0 auto; }
.me-tank-col { min-width: 0; }
.tank-frame { position: sticky; top: 92px; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow), 0 0 0 6px #fff; aspect-ratio: 16 / 10; max-height: calc(100vh - 120px); width: 100%; }
#my-tank { position: absolute; inset: 0; }
.edit-bar { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 18px; background: rgba(20, 35, 70, .88); color: #fff; transform: translateY(-160%); transition: transform .25s cubic-bezier(.2, .9, .3, 1.2); }
.edit-bar.show { transform: none; }
.edit-hint { display: inline-flex; gap: 8px; align-items: center; margin-right: auto; font-family: var(--font-display); }
.me-panel { background: #fff; border-radius: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; overflow: hidden; align-self: start; }
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px; gap: 4px; background: #F4F7FC; border-bottom: 2px solid var(--line); }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 0; background: transparent; border-radius: 14px; cursor: pointer; font-family: var(--font-display); font-weight: 500; font-size: 14px; color: var(--ink-2); }
.tabs button .icon { width: 24px; height: 24px; }
.tabs button.on { background: #fff; color: var(--primary-d); box-shadow: 0 2px 6px rgba(28, 42, 74, .1); }
.tab-body { padding: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.panel-head h2 { font-size: 24px; }
.panel-head p { font-size: 14px; }
.slot-title { font-size: 17px; margin: 18px 0 10px; color: var(--ink-2); }
.panel-head + .slot-title { margin-top: 0; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.item-grid.themes { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.item-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 10px 12px; border: 2px solid var(--line); border-radius: 18px; background: #fff; }
.ic-art { position: relative; width: 100%; aspect-ratio: 1.2; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(180deg, #E8F6FF, #D3EEFD); padding: 8px; }
.ic-art > svg { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
.item-wide .ic-art { aspect-ratio: 16 / 9; padding: 0; overflow: hidden; }
.item-wide .ic-art > svg { inset: 0; width: 100%; height: 100%; }
.ic-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; text-align: center; line-height: 1.15; }
.ic-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: 100%; min-height: 36px; border: 0; border-radius: 11px; background: #EEF2F8; color: var(--ink-2); font-family: var(--font-display); font-weight: 600; font-size: 15px; cursor: pointer; }
.ic-btn .icon { width: 17px; height: 17px; }
.ic-btn:disabled { cursor: not-allowed; opacity: .75; }
.ic-buy { background: var(--sun); color: #4A3200; box-shadow: 0 3px 0 var(--sun-d); }
.ic-buy .icon { color: #8A5A00; }
.ic-go { background: var(--primary); color: #fff; box-shadow: 0 3px 0 var(--primary-d); }
.ic-on { background: #DDF7F0; color: #0E8C73; }
.ic-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.ic-btn.is-busy { color: transparent; position: relative; }
.ic-btn.is-busy::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .2); border-top-color: currentColor; animation: spin .7s linear infinite; }
.item-card.locked .ic-art > svg { filter: grayscale(1) opacity(.45); }
.item-card.locked .ic-btn { font-size: 13px; }
.item-card.pricey .ic-art > svg { opacity: .8; }
.item-card.wearing { border-color: #8EE3CF; background: #F4FDFA; }
.ic-lock { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--muted); box-shadow: var(--shadow); }
.ic-lock .icon { width: 15px; height: 15px; }
.ic-badge { position: absolute; top: 14px; left: 14px; font-family: var(--font-display); font-size: 13px; background: #fff; border-radius: 999px; padding: 1px 8px; box-shadow: var(--shadow); }

.journey { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 0; }
.journey li { position: relative; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 8px 0; color: var(--muted); }
.journey li::before { content: ''; position: absolute; left: 19px; top: -50%; height: 100%; width: 3px; background: var(--line); z-index: 0; }
.journey li:first-child::before { display: none; }
.journey li.done::before, .journey li.now::before { background: var(--mint); }
.j-dot { position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 3px solid var(--line); display: grid; place-items: center; color: #fff; }
.done .j-dot { background: var(--mint); border-color: var(--mint); }
.now .j-dot { background: var(--primary); border-color: #BFD6FF; box-shadow: 0 0 0 5px #E3EEFF; }
.j-name { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.done .j-name, .now .j-name { color: var(--ink); }
.j-pts { font-size: 14px; }

.levelup { position: relative; text-align: center; overflow: hidden; }
.lu-rays { position: absolute; left: 50%; top: 80px; width: 520px; height: 520px; margin: -260px 0 0 -260px; background: repeating-conic-gradient(from 0deg, rgba(255, 210, 80, .28) 0 10deg, transparent 10deg 20deg); border-radius: 50%; animation: spin 14s linear infinite; mask: radial-gradient(circle, #000 20%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); }
.lu-fish { position: relative; width: 220px; margin: 0 auto; animation: bob 2.4s ease-in-out infinite; }
.lu-fish svg { width: 100%; height: auto; }
.levelup h2 { position: relative; font-size: 34px; margin: 4px 0 6px !important; color: var(--grape); }
.levelup p { position: relative; color: var(--ink-2); font-size: 18px; }
.lu-items { display: flex; justify-content: center; gap: 8px; margin: 8px 0 20px; }
.lu-items span { width: 60px; height: 52px; background: #F2F7FF; border-radius: 12px; padding: 6px; display: grid; place-items: center; }
.lu-items svg { width: 100%; height: 100%; }
.levelup .btn { position: relative; margin-top: 8px; }

/* -------------------------------------------------------------- store */
.has-badge { position: relative; }
.badge { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 13px; display: grid; place-items: center; box-shadow: 0 0 0 3px #fff; }
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 12px; }
.count-badge:empty { display: none; }
.store-admin h2 { display: flex; align-items: center; gap: 10px; }
.seg-tabs { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin-bottom: 18px; }
.seg-tabs button { padding: 10px; font-size: 15px; }
.pane-intro { margin-bottom: 14px; font-size: 15px; }
.req-list { display: grid; gap: 8px; }
.req-row { display: grid; grid-template-columns: 56px 1fr auto auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 16px; background: #F7FAFE; }
.req-list.done .req-row { grid-template-columns: 40px 1fr auto; background: transparent; padding: 4px 8px; }
.req-text { font-size: 16px; min-width: 0; }
.req-text b { font-family: var(--font-display); font-weight: 600; }
.req-text small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.req-text small .icon { width: 14px; height: 14px; color: var(--sun-d); }
.empty.slim { padding: 28px 20px; }
.empty.slim h3 { font-size: 20px; }
.price-input { display: flex; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: var(--radius-sm); padding-left: 10px; background: #fff; }
.price-input .icon { color: var(--sun-d); }
.price-input input { border: 0; padding: 10px 8px 10px 0; box-shadow: none !important; }
.store-admin .re-row { grid-template-columns: 46px 1fr 120px auto; }
select { width: 100%; border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; background: #fff; font-weight: 700; outline: none; }
select:focus { border-color: var(--primary); }
.item-card small.center { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 3px; font-size: 12px; text-align: center; line-height: 1.3; }
.item-card small .icon { width: 13px; height: 13px; }
.reward-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.shop-reward { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px 12px; border-radius: 18px; background: var(--tl); text-align: center; }
.sr-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1.15; min-height: 2.3em; display: grid; place-items: center; }
.reward-icon-big { color: #fff; background: var(--mint); }
.reward-icon-big .icon { width: 56px; height: 56px; }
.j-name small { display: flex; align-items: center; gap: 4px; font-family: var(--font-body); font-weight: 700; font-size: 12px; color: var(--grape); }
.j-name small .icon { width: 13px; height: 13px; }
.lu-evo { display: inline-flex !important; align-items: center; gap: 6px; background: #F1EBFF; color: #6B3FD8 !important; border-radius: 999px; padding: 4px 12px; font-size: 15px !important; margin: 6px 0; font-weight: 800; }
.fish-shadow { pointer-events: none; }
.food { pointer-events: none; }
.food-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.food-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 10px; border: 2px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, #F2FBF8, #fff); }
.fc-art { width: 100%; aspect-ratio: 1.5; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(180deg, #DDF5FF, #BFE6FA); }
.fc-art svg { height: 88%; width: auto; }
.fc-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.fc-grow { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; color: #0E8C73; background: #DDF7F0; border-radius: 999px; padding: 2px 10px; }
.fc-grow .icon { width: 15px; height: 15px; }
.food-card.pricey .fc-art svg { opacity: .55; }
.grow-now { margin-top: 16px; padding: 12px 14px; border-radius: 16px; background: #F4F8FE; }
.reward-pts { display: inline-flex; align-items: center; gap: 2px; }
.reward-pts .icon { width: 13px; height: 13px; color: var(--sun-d); }
.seg-2 { grid-template-columns: repeat(2, 1fr); }
.si-head, .si-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 120px 90px 40px; gap: 10px; align-items: center; }
.si-head { font-family: var(--font-display); font-size: 13px; color: var(--muted); padding: 0 4px 6px; }
.si-list { display: grid; gap: 8px; max-height: 48vh; overflow-y: auto; padding: 2px; }
.si-row { padding: 6px; border-radius: 16px; background: #F7FAFE; }
.si-row input { padding: 10px 12px; }
.si-photo { position: relative; width: 64px; height: 56px; padding: 0; border: 0; background: none; cursor: pointer; }
.si-thumb { width: 64px; height: 56px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: #fff; border: 2px solid var(--line); }
.si-thumb.sm { width: 40px; height: 36px; border-radius: 10px; }
.si-thumb img { width: 100%; height: 100%; object-fit: cover; }
.si-icon { background: #FFF2D1; color: #C98600; border-color: #FFE19A; }
.si-icon .icon { width: 26px; height: 26px; }
.si-thumb.sm .icon { width: 18px; height: 18px; }
.si-cam { position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.si-cam .icon { width: 14px; height: 14px; }
.si-photo.is-busy .si-cam { animation: pulse .8s infinite; }
.stock-input { text-align: center; }
.stock-input.sold-out { border-color: #FFC2C2; background: #FFF5F5; }
.req-row .si-thumb { width: 56px; height: 48px; }
.req-list.done .req-row { grid-template-columns: 40px 1fr auto; }
.row-gap { display: inline-flex; gap: 10px; }
.bday-pick { text-align: center; }
.bday-pick .row-2 { grid-template-columns: 1.5fr 1fr; text-align: left; margin-top: 16px; }
.bday-icon { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 20px; background: #FF5D93; color: #fff; display: grid; place-items: center; box-shadow: 0 4px 0 #C93A6C; }
.bday-icon .icon { width: 34px; height: 34px; }
.btn-mini.has-bday { border-color: #FFC2DA; background: #FFF2F8; color: #C93A6C; }
.sc-art { position: relative; }
.bday-badge { position: absolute; top: 6px; left: 6px; width: 30px; height: 30px; border-radius: 50%; background: #FF5D93; color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px #fff; animation: pop 1.6s ease-in-out infinite; }
.bday-badge .icon { width: 17px; height: 17px; }
.banner-text { font-family: var(--font-display); font-weight: 700; font-size: 34px; fill: #fff; paint-order: stroke; stroke: rgba(150, 20, 70, .35); stroke-width: 4px; }
.sr-art { width: 100%; aspect-ratio: 1.25; border-radius: 14px; overflow: hidden; }
.sr-art.photo { background: #fff; display: block; box-shadow: 0 2px 0 rgba(0, 0, 0, .06); }
.sr-art.icon-box { display: grid; place-items: center; background: rgba(255, 255, 255, .55); }
.shop-reward .ic-btn { margin-top: auto; }
.sr-art.photo img, .feed-thumb.photo img, .confirm-item.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sr-stock { font-size: 12px; font-weight: 800; color: var(--coral-d); min-height: 1em; margin-top: -4px; }
.shop-reward.sold-out { filter: grayscale(.8); opacity: .7; }
.feed-thumb { width: 36px; height: 36px; flex: none; border-radius: 11px; overflow: hidden; display: grid; place-items: center; }
.feed-thumb.reward-icon { background: #FFF2D1; color: #C98600; box-shadow: none; }
.feed-thumb.reward-icon .icon { width: 20px; height: 20px; }
.confirm-item.photo { padding: 0; overflow: hidden; }

/* ----------------------------------------------------- toasts & misc */
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 700; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-12px) scale(.96); transition: opacity .25s, transform .25s cubic-bezier(.2, .9, .3, 1.3); }
.toast.in { opacity: 1; transform: none; }
.toast .icon { width: 22px; height: 22px; color: #FFD66B; }
.toast-success { background: #0E8C73; }
.toast-success .icon { color: #CFFFF2; }
.toast-error { background: #C93A3A; }
.toast-error .icon { color: #FFD6D6; }
.demo-banner { position: fixed; left: 16px; bottom: 16px; z-index: 150; display: flex; align-items: center; gap: 10px; max-width: 520px; padding: 10px 10px 10px 14px; background: #FFF8E1; border: 2px solid #FFE08A; color: #6B4E00; border-radius: 16px; box-shadow: var(--shadow); font-size: 14px; }
.demo-banner > .icon { color: var(--sun-d); }
.demo-banner button { border: 0; background: transparent; cursor: pointer; color: #9A7A20; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; flex: none; }
.loading-page { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 5px solid #D6E2F4; border-top-color: var(--primary); animation: spin .8s linear infinite; }
.fish-avatar { display: block; overflow: visible; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rainbow { to { background-position: 200% 0; } }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.08) rotate(-2deg); } 70% { transform: scale(.98); } 100% { transform: none; } }
@keyframes pulse { 50% { transform: scale(.9); } }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-2deg); } }
@keyframes rise { from { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } to { transform: translateY(-340px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* --------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .me { grid-template-columns: 1fr; }
  .tank-frame { position: relative; top: 0; max-height: none; }
  .me-panel { align-self: stretch; }
}
@media (max-width: 1024px) {
  .dash { grid-template-columns: 1fr; }
  .dash-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .topbar .btn span { display: none; }
  .topbar .btn:not(.btn-icon) { padding: 0 12px; }
}
@media (max-width: 860px) {
  .choice-row, .features { grid-template-columns: 1fr; }
  .choice-row { max-width: 520px; }
  .creator { grid-template-columns: 1fr; }
  .creator-preview { position: relative; top: 0; max-width: 360px; margin: 0 auto; width: 100%; }
  .display-goal { width: 240px; }
  .display-title h1 { font-size: 20px; }
}
@media (max-width: 720px) {
  .topbar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .topbar-class { order: 3; width: 100%; padding-left: 0; border-left: 0; flex-basis: 100%; justify-content: space-between; }
  .topbar-class h1 { font-size: 19px; }
  .brand-name { font-size: 19px; }
  .me-top .brand-name { display: none; }
  .me-id { border-left: 0; padding-left: 0; }
  .me-growth { order: 4; flex-basis: 100%; max-width: none; }
  .dash, .me { padding: 16px; }
  .roster { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .toolbar-left h2 { font-size: 22px; }
  .hero { padding: 0 16px 24px; }
  .modal-body { padding: 22px 18px; }
  .st-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .st-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .add-students { flex-direction: column; }
  .row-2 { grid-template-columns: 1fr; }
  .species-grid { grid-template-columns: repeat(3, 1fr); }
  .species-grid.patterns { grid-template-columns: repeat(2, 1fr); }
  .creator-options { padding: 20px 16px; }
  .creator, .join { padding: 20px 16px 48px; }
  .name-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .tank-frame { aspect-ratio: 4 / 3; border-radius: 22px; }
  .edit-hint span, .edit-hint { display: none; }
  .edit-bar { justify-content: flex-end; }
  .display-top { flex-wrap: wrap; }
  .display-goal { order: 3; width: 100%; margin-left: 0; }
  .display-join { right: 16px; font-size: 14px; }
  .display-feed { bottom: 80px; }
  .footer { flex-direction: column; }
  .select-bar { left: 16px; right: 16px; transform: translateY(140%); justify-content: flex-end; flex-wrap: wrap; }
  .select-bar.show { transform: none; }
  .code-chip { font-size: 13px; }
        .req-row { grid-template-columns: 48px 1fr; }
  .req-row .btn, .req-row .btn-mini { grid-column: span 1; }
  .tabs button { font-size: 12px; padding: 8px 2px; }
  .si-head { display: none; }
  .si-row { grid-template-columns: 56px 1fr 40px; }
  .si-row .price-input, .si-row .stock-input { grid-column: span 1; }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .item-grid.themes { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .tab-body { padding: 14px; }
}
/* ---------- celebrations ---------- */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 400; }
.receipt { pointer-events: none; }
.receipt text { font-family: var(--font-display); }
.receipt .rc-head { font-size: 13px; font-weight: 700; letter-spacing: .25em; fill: #A3AEC2; }
.receipt .rc-reason { font-size: 22px; font-weight: 700; fill: var(--ink); }
.receipt .rc-coins { font-size: 22px; font-weight: 700; fill: #C98600; }
.receipt .rc-coins.neg { fill: #7A869E; }
.egg { cursor: pointer; }
.egg-label text { font-size: 15px; }
.group-tag text { font-family: var(--font-display); font-weight: 700; font-size: 26px; fill: var(--ink); }
.group-tag { pointer-events: none; }
.goal-party { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(4, 22, 46, .35); z-index: 30; cursor: pointer; }
.goal-party[hidden] { display: none; }
.gp-card { background: #fff; border-radius: 32px; padding: 32px 48px; text-align: center; box-shadow: 0 30px 80px rgba(0, 20, 60, .45); animation: gp-in .7s cubic-bezier(.2, 1.5, .4, 1); max-width: min(560px, calc(100vw - 32px)); }
.gp-trophy { width: 110px; height: 110px; margin: -90px auto 8px; border-radius: 50%; background: linear-gradient(160deg, #FFE066, #F5AE14); display: grid; place-items: center; box-shadow: 0 8px 0 #C98600, 0 0 0 10px #fff; color: #fff; animation: bob 1.6s ease-in-out infinite; }
.gp-trophy .icon { width: 60px; height: 60px; }
.gp-card h2 { font-size: 42px; color: var(--primary); }
.gp-card p { font-size: 20px; color: var(--ink-2); margin-top: 6px; }
.gp-reward { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px !important; padding: 10px 20px; border-radius: 999px; background: #FFF5DC; color: #8A5A00 !important; font-family: var(--font-display); font-weight: 700; }
@keyframes gp-in { from { transform: scale(.4) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- classroom tools ---------- */
.tools-drawer { position: absolute; top: 84px; right: 16px; bottom: 16px; width: 380px; max-width: calc(100vw - 32px); z-index: 25; background: rgba(255, 255, 255, .97); border-radius: 24px; box-shadow: 0 20px 60px rgba(0, 30, 80, .35); display: flex; flex-direction: column; animation: drawer-in .3s cubic-bezier(.2, .9, .3, 1.1); }
.tools-drawer[hidden] { display: none; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
.td-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px 20px; }
.td-head h2 { font-size: 22px; display: flex; align-items: center; gap: 8px; }
.td-head h2 .icon { color: var(--primary); }
.td-body { overflow-y: auto; padding: 4px 16px 16px; display: grid; gap: 12px; align-content: start; }
.tool { background: #F7FAFE; border-radius: 18px; padding: 14px; display: grid; gap: 10px; }
.tool-title { display: flex; gap: 12px; align-items: flex-start; }
.tool-title h3 { font-size: 18px; }
.tool-title p { color: var(--ink-2); font-size: 14px; line-height: 1.35; }
.tool-icon { flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--t); color: #fff; box-shadow: 0 3px 0 var(--td); }
.tool-icon .icon { width: 24px; height: 24px; }
.tool .check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.tool .check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--primary); flex: none; }
.tool-note { font-size: 13px; color: var(--muted); }
.tool-note:empty { display: none; }
.link { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-row .chip { padding: 6px 12px; }
.custom-time { display: flex; gap: 8px; align-items: end; }
.custom-time label { flex: 1; font-size: 13px; font-weight: 800; color: var(--ink-2); display: grid; gap: 4px; }
.seg-sm { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.seg-sm button { padding: 7px 8px; font-size: 14px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper b { font-family: var(--font-display); font-size: 26px; min-width: 32px; text-align: center; }
.absent summary { cursor: pointer; font-weight: 800; font-size: 14px; color: var(--ink-2); }
.absent-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 160px; overflow-y: auto; }
.absent-list .chip { padding: 4px 10px; font-size: 14px; }
.absent-list .chip.off { opacity: .45; text-decoration: line-through; background: #EEF2F8; }
.range { display: grid; gap: 4px; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.range input { accent-color: var(--grape); }

.pick-card { position: absolute; left: 50%; bottom: 28px; transform: translate(-50%, 140%); z-index: 22; transition: transform .45s cubic-bezier(.2, 1.4, .4, 1); }
.pick-card[hidden] { display: none; }
.pick-card.in { transform: translate(-50%, 0); }
.pc-inner { display: flex; align-items: center; gap: 18px; background: #fff; border-radius: 28px; padding: 12px 18px 12px 12px; box-shadow: 0 20px 60px rgba(0, 20, 60, .4); border: 4px solid #FFE066; }
.pc-art { width: 120px; height: 98px; border-radius: 20px; background: linear-gradient(180deg, #DDF0FF, #B9E0FF); display: grid; place-items: center; }
.pc-art svg { width: 110px; height: 90px; }
.pc-text small { font-weight: 800; color: var(--muted); font-size: 15px; }
.pc-text h2 { font-size: 54px; line-height: 1; color: var(--primary); }
.pc-actions { display: flex; gap: 8px; }

.timer-card { position: absolute; top: 108px; left: 50%; transform: translateX(-50%); z-index: 21; display: flex; align-items: center; gap: 18px; padding: 14px 16px 14px 10px; cursor: grab; touch-action: none; user-select: none; border-radius: 28px; }
.timer-card.moved { transform: none; }
.display:has(.groups-board:not([hidden])) .timer-card:not(.moved) { top: 172px; }
.timer-card.dragging { cursor: grabbing; box-shadow: 0 24px 60px rgba(0, 30, 80, .4); }
.timer-card[hidden] { display: none; }
.tc-grip { color: #B5C0D3; display: grid; place-items: center; }
.tc-grip .icon { width: 22px; height: 22px; }
.tc-ring { width: 150px; height: 150px; flex: none; }
.tc-ring circle { transition: stroke-dashoffset .25s linear; }
.tc-time { font-family: var(--font-display); font-weight: 700; font-size: 132px; line-height: 1; min-width: 3.1ch; text-align: center; color: var(--ink); font-variant-numeric: tabular-nums; }
.tc-actions { display: grid; grid-template-columns: auto auto; gap: 6px; }
.tc-actions .btn[hidden] { display: none; }
.timer-card[data-size="m"] .tc-ring { width: 96px; height: 96px; }
.timer-card[data-size="m"] .tc-time { font-size: 80px; }
.timer-card[data-size="xl"] { padding: 20px 24px 20px 14px; }
.timer-card[data-size="xl"] .tc-ring { width: 240px; height: 240px; }
.timer-card[data-size="xl"] .tc-time { font-size: 220px; }
.timer-card.paused .tc-time { opacity: .55; }
.timer-card.ending .tc-time { color: var(--coral); animation: pulse 1s infinite; }
.timer-card.done { box-shadow: 0 0 0 8px #FFE066, 0 20px 50px rgba(0, 30, 80, .35); animation: shake .6s 2; }
.timer-card.done .tc-time { color: var(--primary); }
.timer-card.done .tc-time { font-size: 96px; }
.timer-card[data-size="xl"].done .tc-time { font-size: 150px; }
.timer-card[data-size="m"].done .tc-time { font-size: 56px; }

.groups-board { position: absolute; left: 16px; right: 16px; top: 96px; z-index: 20; display: grid; gap: 10px; justify-items: center; pointer-events: none; }
.groups-board > * { pointer-events: auto; }
.gb-cards { width: 100%; }
.groups-board[hidden] { display: none; }
.gb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; max-height: 42vh; overflow-y: auto; }
.groups-board.mini .gb-cards { display: none; }
.gb-card { background: rgba(255, 255, 255, .96); border-radius: 18px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0, 30, 80, .2); border-top: 6px solid #FFE066; }
.gb-card:nth-child(4n+2) { border-top-color: #7FE0FF; } .gb-card:nth-child(4n+3) { border-top-color: #9BF0B4; } .gb-card:nth-child(4n+4) { border-top-color: #FF9CC2; }
.gb-card h3 { font-size: 18px; margin-bottom: 4px; }
.gb-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.gb-card li { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; }
.gb-av svg { width: 34px; height: 28px; display: block; }
.gb-actions { display: flex; gap: 8px; justify-content: center; padding: 8px; border-radius: 18px; order: -1; }

.noise-meter { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 21; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; width: min(560px, calc(100vw - 32px)); }
.noise-meter[hidden] { display: none; }
.nm-face { min-width: 130px; font-family: var(--font-display); font-size: 18px; }
.nm-bar { position: relative; flex: 1; height: 18px; border-radius: 999px; background: #E6ECF5; overflow: hidden; }
.nm-bar i { position: absolute; inset: 0 auto 0 0; background: #3DDC97; border-radius: 999px; transition: background .2s; }
.nm-bar i.warm { background: #FFC23C; }
.nm-bar i.loud { background: #FF5D73; }
.nm-line { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--ink); opacity: .5; }

@media (max-width: 720px) {
  .tools-drawer { top: auto; height: 72vh; left: 16px; width: auto; }
  .pc-inner { flex-wrap: wrap; justify-content: center; }
  .pc-text h2 { font-size: 40px; }
  .timer-card { top: auto; bottom: 120px; gap: 10px; }
  .timer-card .tc-ring, .timer-card[data-size] .tc-ring { width: 64px; height: 64px; }
  .timer-card .tc-time, .timer-card[data-size] .tc-time { font-size: 56px; }
}

/* ---------- subscription ---------- */
.billing-bar { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 18px; border-radius: 18px; margin-bottom: 16px; background: #EEF5FF; border: 2px solid #D5E5FF; }
.billing-bar[hidden] { display: none; }
.billing-bar > .icon { width: 26px; height: 26px; color: var(--primary); flex: none; }
.billing-bar div { flex: 1; display: grid; gap: 2px; min-width: 0; }
.billing-bar b { font-family: var(--font-display); font-size: 17px; }
.billing-bar span { color: var(--ink-2); font-size: 14px; }
.billing-bar .btn { flex: none; }
.billing-bar.warn { background: #FFF7E0; border-color: #FFE29A; }
.billing-bar.warn > .icon { color: #C98600; }
.billing-bar.danger { background: #FFEFEF; border-color: #FFC9C9; }
.billing-bar.danger > .icon { color: var(--coral); }
.plans { text-align: center; }
.plans h2 { font-size: 28px; }
.plans .hint { justify-content: center; margin-top: 14px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; text-align: left; }
.plan-grid .spinner { margin: 30px auto; grid-column: 1 / -1; }
.plan-card { position: relative; border: 2px solid var(--line); border-radius: 22px; padding: 18px; display: grid; gap: 10px; align-content: start; }
.plan-card.best { border-color: #FFD66B; background: #FFFBEF; }
.plan-card h3 { font-size: 20px; }
.plan-price b { font-family: var(--font-display); font-size: 36px; }
.plan-price span { color: var(--muted); font-weight: 700; margin-left: 4px; }
.plan-card ul { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; color: var(--ink-2); font-weight: 700; font-size: 14px; }
.plan-card li { display: flex; gap: 6px; align-items: center; }
.plan-card li .icon { color: var(--mint, #19BFA0); width: 18px; height: 18px; }
.plan-badge { position: absolute; top: -12px; right: 14px; background: var(--sun, #F5AE14); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 999px; box-shadow: 0 2px 0 #C98600; }
.sub-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: #F7FAFE; margin-bottom: 16px; }
.sub-row div { flex: 1; display: grid; min-width: 160px; }
.sub-row span { color: var(--ink-2); font-size: 14px; }
.trial-note { display: flex; align-items: center; justify-content: center; gap: 8px; background: #EAFBF1; color: #0E7A5E; font-weight: 800; border-radius: 12px; padding: 8px 12px; margin: 10px 0; }
@media (max-width: 640px) { .billing-bar { flex-wrap: wrap; } .billing-bar .btn { width: 100%; } }

/* ---------- site admin ---------- */
.choice-icon.grape { background: var(--grape); box-shadow: 0 4px 0 #6B3FD8; }
.admin-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: #F1EBFF; color: #5B35C9; font-family: var(--font-display); font-weight: 600; font-size: 14px; white-space: nowrap; }
.admin-pill .icon { width: 15px; height: 15px; }
.admin { max-width: 1280px; margin: 0 auto; padding: 20px; display: grid; gap: 16px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat-tile { background: #fff; border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); border-top: 5px solid var(--t); display: grid; gap: 2px; }
.stat-tile span { color: var(--ink-2); font-weight: 800; font-size: 14px; }
.stat-tile b { font-family: var(--font-display); font-size: 34px; line-height: 1.1; }
.stat-tile small { color: var(--muted); font-weight: 700; }
.admin-note { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 700; margin: 0; }
.admin-note .icon { color: var(--grape); }
.admin-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.admin-tools input[type=search] { flex: 1; min-width: 200px; }
.admin-tools select { width: auto; }
.admin-table { display: grid; gap: 4px; }
.at-row { display: grid; grid-template-columns: minmax(180px, 2fr) 1.3fr 1fr 1fr 1fr 1.3fr; gap: 10px; align-items: center; text-align: left; border: 0; background: #F7FAFE; border-radius: 12px; padding: 10px 12px; font: inherit; color: var(--ink); cursor: pointer; }
.at-row:hover { background: #EEF5FF; }
.at-row small { color: var(--muted); font-weight: 700; }
.at-head { background: none; cursor: default; color: var(--muted); font-weight: 800; font-size: 13px; padding-top: 0; padding-bottom: 0; }
.at-head:hover { background: none; }
.at-name { display: grid; min-width: 0; }
.at-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-name small { letter-spacing: .1em; }
.st { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: 13px; background: #E6ECF5; color: var(--ink-2); white-space: nowrap; }
.st-trial { background: #EAF2FF; color: #1D5FD0; }
.st-paid { background: #E2F8F3; color: #0E7A5E; }
.st-warn { background: #FFF5DC; color: #8A5A00; }
.st-locked { background: #FFEDED; color: #B33636; }
.st-free { background: #F1EBFF; color: #5B35C9; }
.admin-detail h2 { font-size: 26px; }
.ad-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.ad-links { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-sec { border-top: 2px solid var(--line); padding-top: 14px; margin-top: 14px; display: grid; gap: 10px; }
.ad-sec h3 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.ad-sec h3 .icon { color: var(--primary); }
.ad-sec.danger h3 .icon { color: var(--coral); }
.ad-sub { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 700; color: var(--ink-2); }
.ad-sub a { color: var(--primary); }
.ad-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ad-actions input { width: auto; flex: 1; min-width: 180px; }
.ad-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: #F7FAFE; border-radius: 12px; }
.ad-row b { flex: 1; }
.ad-students { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; max-height: 320px; overflow-y: auto; }
.ad-st { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 8px; background: #F7FAFE; border-radius: 12px; }
.ad-st small { display: block; color: var(--muted); font-weight: 700; }
.ad-av svg { width: 44px; height: 36px; display: block; }
.ad-coins { display: inline-flex; gap: 4px; align-items: center; font-weight: 800; }
.ad-coins .icon { color: var(--sun-d); width: 16px; height: 16px; }
@media (max-width: 860px) { .at-row { grid-template-columns: 1fr auto; } .at-row > span:nth-child(n+2):nth-child(-n+5) { display: none; } }

/* The teacher dashboard's top bar needs its room for the class name, so it shows just the logo. */
.dash-page .topbar .brand-name { display: none; }

@media print { .topbar, .select-bar, #toasts { display: none; } }
