/* =========================================================
   NUMNora.mn — menu drawer, nav buttons, pickers, tutorials,
   majors guide, timetable, chat, game categories
   ========================================================= */

/* ---------- Nav buttons: noticeable "pop", never jumpy ---------- */
.nav-link {
  position: relative;
  transition: transform 0.18s cubic-bezier(0.3, 0.7, 0.4, 1.4), background 0.18s, color 0.18s, box-shadow 0.18s;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  transition: width 0.22s ease;
}
.nav-link:hover,
.nav-item:focus-within .nav-link {
  transform: translateY(-2px);
  background: var(--surface);
  color: var(--text) !important;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 22%, transparent);
  text-decoration: none;
}
.nav-link:hover::after { width: 40%; }
.nav-link.is-active { box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent); }
.nav-link.is-active::after { display: none; }

/* ---------- The menu button: three vertical bars ---------- */
.menu-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.3, 0.7, 0.4, 1.4), border-color 0.18s, box-shadow 0.18s;
}
.menu-button:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 25%, transparent); }
.menu-bars { width: 24px; height: 24px; }
.menu-bars .bar { fill: currentColor; transform-box: fill-box; transform-origin: center; transition: transform 0.25s ease; }
.menu-bars .bar-2 { fill: var(--primary); }
.menu-button:hover .bar-1 { transform: scaleY(1.25); }
.menu-button:hover .bar-2 { transform: scaleY(0.75); }
.menu-button:hover .bar-3 { transform: scaleY(1.6); }
.menu-button[aria-expanded="true"] .bar-1 { transform: scaleY(0.6); }
.menu-button[aria-expanded="true"] .bar-3 { transform: scaleY(0.6); }

/* ---------- The drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 150; pointer-events: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); opacity: 0; transition: opacity 0.25s; }
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 92vw);
  overflow-y: auto;
  padding: 18px 20px 30px;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer.is-open { pointer-events: auto; }
.drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer.is-open .drawer-panel { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.drawer-pages { display: none; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.drawer-pages a { padding: 10px 14px; border-radius: var(--radius-sm); color: var(--text) !important; font: 700 0.95rem var(--font-ui); }
.drawer-pages a:hover { background: var(--surface); text-decoration: none; }
.drawer-pages a.is-active { background: var(--primary); color: var(--on-primary) !important; }
.drawer-tabs { margin-bottom: 12px; }
.drawer-store { margin-bottom: 18px; }
.drawer-section h4 { margin: 18px 0 8px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.tutorial-list { display: flex; flex-direction: column; gap: 8px; }
.tutorial-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 600 0.92rem var(--font-ui);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.tutorial-item:hover { transform: translateX(4px); border-color: var(--accent); }
.tutorial-item small { display: block; color: var(--muted); font-weight: 500; }
.tutorial-emoji { font-size: 1.5rem; }

/* Theme picker: swatch + name */
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 600 0.8rem var(--font-ui);
  text-align: left;
  cursor: pointer;
}
.theme-option:hover { border-color: var(--accent); }
.theme-option.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-tint); }
.theme-swatch { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.12); }

/* Faint theme pattern (checks, blueprint grid, pitch stripes…) on High and Ultra */
:root[data-theme-name]:is([data-gfx="high"], [data-gfx="ultra"]) body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--theme-pattern, none);
  pointer-events: none;
}

/* Font picker: every font written in itself, no labels */
.font-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.font-option {
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.font-option:hover { border-color: var(--accent); }
.font-option.is-active { border-color: var(--primary); background: var(--primary-tint); }

/* ---------- Tutorial card ---------- */
.tutorial-box { max-width: 460px; text-align: center; }
.tutorial-step-emoji { margin: 18px 0 6px; font-size: 3rem; line-height: 1; }
.tutorial-box p { color: var(--muted); }
.tutorial-dots { display: flex; justify-content: center; gap: 6px; margin: 14px 0 4px; }
.tutorial-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.tutorial-dots span.is-active { width: 22px; border-radius: 8px; background: var(--primary); }
.tutorial-box .modal-actions { justify-content: center; }

/* ---------- Majors guide ---------- */
.majors-guide { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-bottom: 18px; border-left: 4px solid var(--accent); }
.majors-guide ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 0.92rem; }
.majors-guide h3 { margin: 0 0 6px; }
.majors-guide .guide-emoji { font-size: 2.2rem; }
.school-tiles-tip { display: inline-block; margin: 0 0 8px; padding: 4px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 700 0.82rem var(--font-ui); animation: bob 1.6s ease-in-out infinite; }
.school-tiles.is-new .school-tile-btn { animation: tile-glow 2.2s ease-in-out infinite; }
@keyframes tile-glow {
  50% { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
}

/* ---------- Timetable ---------- */
.calendar-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 14px; }
.calendar-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.calendar-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-left: auto; font-size: 0.9rem; color: var(--muted); }
.calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.calendar-legend i { width: 12px; height: 12px; border-radius: 50%; }

.calendar-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.calendar-grid { display: grid; min-width: 680px; position: relative; }
.cal-corner,
.cal-day { position: sticky; top: 0; z-index: 2; display: grid; place-items: center; background: var(--surface-2); border-bottom: 1px solid var(--border); font: 600 0.92rem var(--font-ui); color: var(--muted); }
.cal-day { border-left: 1px solid var(--border); }
.cal-day.is-today { color: var(--primary-text); background: var(--primary-tint); }
.cal-time { display: flex; align-items: center; padding-left: 10px; white-space: nowrap; font-size: 0.8rem; color: var(--muted); border-bottom: 1px dashed var(--border); font-variant-numeric: tabular-nums; }
.cal-time.is-now { color: var(--primary-text); font-weight: 800; }
.cal-cell { border: 0; border-left: 1px solid var(--border); border-bottom: 1px dashed var(--border); background: transparent; cursor: pointer; }
.cal-cell:hover { background: var(--accent-tint); }
.cal-cell.is-now { background: var(--primary-tint); }
.cal-class {
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 3px;
  padding: 6px 8px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  font: 600 0.8rem var(--font-ui);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cal-class:hover { transform: scale(1.02); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15); }
.cal-class-top { display: flex; justify-content: space-between; gap: 4px; font-size: 0.7rem; opacity: 0.85; }
.cal-pill { padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.75); }
.cal-class-name { font-size: 0.82rem; line-height: 1.2; }
.cal-class-seats { margin-top: auto; align-self: flex-end; font-size: 0.7rem; opacity: 0.8; }
.cal-detail-head { margin: 26px 0 12px; padding: 14px 16px; border-radius: var(--radius-sm); color: #222831; }
.cal-detail-head small { display: block; margin-top: 4px; opacity: 0.75; }
.cal-detail-row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.cal-detail-row span { color: var(--muted); }
.cal-form .field-label { display: flex; flex-direction: column; gap: 6px; }
.cal-form .input { margin: 0 0 10px; }

/* ---------- Games: categories ---------- */
.game-category { margin-bottom: 34px; scroll-margin-top: 90px; }
.game-category > h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.35rem; }
.game-category > h2 small { padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.8rem; }
.game-soon { display: flex; align-items: center; gap: 14px; color: var(--muted); border-style: dashed; }

/* ---------- Theatre mode + full screen (js/common.js) ---------- */
.view-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.view-modes { display: inline-flex; gap: 8px; margin-left: auto; }
[data-theatre].is-on { border-color: var(--accent); background: var(--accent-tint); }
.theatre-exit {
  position: fixed; top: 6px; left: 50%; transform: translateX(-50%); z-index: 120; padding: 5px 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  font: 700 0.82rem var(--font-ui); cursor: pointer; opacity: 0.55; transition: opacity 0.2s;
}
.theatre-exit:hover { opacity: 1; }
body:not(.theatre-mode) .theatre-exit { display: none; }
body.theatre-mode #site-header,
body.theatre-mode .page-intro,
body.theatre-mode #site-footer,
body.theatre-mode .nora,
body.theatre-mode .theme-pet,
body.theatre-mode .theatre-hide { display: none !important; }
body.theatre-mode main.container { max-width: none; padding: 12px 16px 16px; }
/* Games page in theatre mode: the game takes the whole window */
body.theatre-mode .room-layout { grid-template-columns: 1fr; margin-top: 0; }
body.theatre-mode .game-stage { min-height: calc(100vh - 90px); display: flex; flex-direction: column; justify-content: center; font-size: 1.12rem; }
body.theatre-mode .flappy-canvas,
.game-stage:fullscreen .flappy-canvas { width: auto; max-width: none; height: calc(100vh - 150px); }
/* Full screen */
.game-stage:fullscreen, main:fullscreen { overflow: auto; background: var(--bg); color: var(--text); }
.game-stage:fullscreen { display: flex; flex-direction: column; justify-content: center; padding: 4vh 8vw; border-radius: 0; font-size: 1.2rem; }
main:fullscreen { max-width: none; padding: 20px; }

/* ---------- Theme pet (js/companions.js) ---------- */
.theme-pet { position: fixed; left: 14px; bottom: 14px; z-index: 90; display: flex; flex-direction: column; align-items: flex-start; transition: left 3s linear; }
.pet-body {
  display: grid; place-items: center; width: calc(52px * var(--pet-scale, 1.5)); height: calc(52px * var(--pet-scale, 1.5)); padding: 0;
  pointer-events: auto; touch-action: manipulation;
  border: 2px solid var(--accent); border-radius: 50%; background: var(--surface);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 25%, transparent);
  font-size: calc(1.7rem * var(--pet-scale, 1.5)); line-height: 1; cursor: pointer;
  animation: pet-pulse 2.4s ease-in-out infinite;
}
.theme-pet[data-anim="float"]   .pet-body { animation: pet-float 3.2s ease-in-out infinite; }
.theme-pet[data-anim="sway"]    .pet-body { animation: pet-sway 2.6s ease-in-out infinite; }
.theme-pet[data-anim="beat"]    .pet-body { animation: pet-beat 1.3s ease-in-out infinite; }
.theme-pet[data-anim="shake"]   .pet-body { animation: pet-shake 1.8s ease-in-out infinite; }
.theme-pet[data-anim="hop"]     .pet-body { animation: pet-hop 1.5s cubic-bezier(0.3, 0.7, 0.4, 1) infinite; }
.theme-pet[data-anim="bounce"]  .pet-body { animation: pet-bounce 0.9s cubic-bezier(0.5, 0, 0.5, 1) infinite alternate; }
.theme-pet[data-anim="spin"]    .pet-body { animation: pet-spin 5s linear infinite; }
.theme-pet[data-anim="roll"]    .pet-body { animation: pet-roll 3s ease-in-out infinite; }
.theme-pet[data-anim="flicker"] .pet-body { animation: pet-flicker 2.2s steps(1) infinite; }
/* Emotions while it talks (High / Ultra) */
.theme-pet[data-mood="romantic"]  .pet-body { animation: pet-beat 0.8s ease-in-out infinite; border-color: #ff5c9e; }
.theme-pet[data-mood="edu"]       .pet-body { animation: pet-nod 1s ease-in-out infinite; }
.theme-pet[data-mood="confusing"] .pet-body { animation: pet-wobble 1.2s ease-in-out infinite; }
.theme-pet[data-mood="question"]  .pet-body { animation: pet-tilt 1.6s ease-in-out infinite; }
.theme-pet.is-walking .pet-body { animation: pet-waddle 0.5s ease-in-out infinite; }
.theme-pet.is-flipped .pet-body { scale: -1 1; }
.theme-pet.is-poked .pet-body { animation: pet-poke 0.5s ease-out 1; }
.pet-mood { position: absolute; left: 40px; bottom: 40px; font-size: 1rem; opacity: 0; transform: scale(0.4); transition: opacity 0.3s, transform 0.3s cubic-bezier(0.3, 0.7, 0.4, 1.6); pointer-events: none; }
.pet-bubble {
  max-width: min(260px, 70vw); margin: 0 0 8px 6px; padding: 9px 13px;
  border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow); font: 600 0.86rem/1.4 var(--font-ui);
  opacity: 0; transform: translateY(8px) scale(0.96); transform-origin: bottom left; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.theme-pet.is-talking .pet-bubble { opacity: 1; transform: none; }
.theme-pet.is-talking .pet-mood { opacity: 1; transform: none; }

@keyframes pet-pulse   { 50% { transform: scale(1.1); } }
@keyframes pet-float   { 50% { transform: translateY(-8px); } }
@keyframes pet-sway    { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }
@keyframes pet-beat    { 0%, 40%, 100% { transform: scale(1); } 20% { transform: scale(1.18); } 30% { transform: scale(1.06); } }
@keyframes pet-shake   { 0%, 60%, 100% { transform: none; } 65%, 75%, 85% { transform: translateX(-3px) rotate(-6deg); } 70%, 80%, 90% { transform: translateX(3px) rotate(6deg); } }
@keyframes pet-hop     { 0%, 55%, 100% { transform: translateY(0) scale(1, 1); } 25% { transform: translateY(-12px) scale(0.96, 1.05); } 50% { transform: translateY(0) scale(1.08, 0.92); } }
@keyframes pet-bounce  { from { transform: translateY(0) scale(1.06, 0.94); } to { transform: translateY(-14px); } }
@keyframes pet-spin    { to { transform: rotate(360deg); } }
@keyframes pet-roll    { 0%, 100% { transform: translateX(0) rotate(0); } 50% { transform: translateX(14px) rotate(360deg); } }
@keyframes pet-flicker { 0%, 100% { opacity: 1; } 46% { opacity: 0.55; } 50% { opacity: 1; } 54% { opacity: 0.7; } 58% { opacity: 1; } }
@keyframes pet-nod     { 50% { transform: translateY(4px) rotate(4deg); } }
@keyframes pet-wobble  { 25% { transform: rotate(-18deg); } 75% { transform: rotate(18deg) scale(0.95); } }
@keyframes pet-tilt    { 50% { transform: rotate(-16deg) translateY(-3px); } }
@keyframes pet-waddle  { 0%, 100% { transform: rotate(-8deg) translateY(0); } 50% { transform: rotate(8deg) translateY(-4px); } }
@keyframes pet-poke    { 30% { transform: translateY(-16px) scale(1.15); } 60% { transform: scale(0.92, 1.06); } }

/* ---------- Automatic tips (Ultra) ---------- */
.auto-tip {
  position: fixed; z-index: 140; max-width: 260px; padding: 8px 12px;
  border-radius: 12px; background: var(--text); color: var(--bg); font: 600 0.82rem/1.4 var(--font-ui);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25); pointer-events: none;
  opacity: 0; transform: translateY(6px); transition: opacity 0.2s, transform 0.2s;
}
.auto-tip.is-visible { opacity: 1; transform: none; }

/* ---------- Home hero: what is coming up ---------- */
.today-card { max-width: 520px; margin: 4px 0 20px; padding: 14px 16px; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); text-align: left; }
.today-card.is-urgent { border-left-color: #e5484d; animation: today-glow 2.4s ease-in-out infinite; }
@keyframes today-glow { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, #e5484d 22%, transparent); } }
.today-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.today-head a { margin-left: auto; font: 600 0.84rem var(--font-ui); }
.today-list { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.today-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-size: 0.92rem; }
.today-list li.is-today { background: color-mix(in srgb, #e5484d 14%, var(--surface)); }
.today-list small { color: var(--muted); font-weight: 600; white-space: nowrap; }
.today-list li.is-today small { color: #e5484d; }

/* ---------- Timetable: important dates ---------- */
.events-card { margin-bottom: 16px; }
.events-form { display: grid; grid-template-columns: minmax(140px, 2fr) auto auto auto auto; gap: 8px; align-items: center; }
.events-form .input { margin: 0; }
.event-list { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.event-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.event-item.is-top { border-left: 4px solid #e5484d; }
.event-item.is-past { opacity: 0.5; }
.event-main small { display: block; color: var(--muted); }
.event-emoji { font-size: 1.3rem; }

.social-login { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.social-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 0.8rem; font-weight: 800; }
.inapp-notice { text-align: left; }
.inapp-notice p { margin: 0 0 8px; }
.social-btn.is-dimmed { opacity: 0.45; }
.google-other { align-self: center; font-size: 0.78rem; opacity: 0.8; }
.google-own { display: flex; justify-content: center; min-height: 44px; }
.social-or { align-self: center; font-size: 0.8rem; opacity: 0.7; }

/* ---------- Landing page: coloured hero, alternating feature rows, closing invitation ---------- */
.hero--big {
  padding: 96px 0 130px; color: var(--on-primary);
  background: linear-gradient(155deg, color-mix(in srgb, var(--primary) 78%, #000) 0%, var(--primary) 52%, color-mix(in srgb, var(--accent) 62%, var(--primary)) 100%);
}
.hero--big::before { background: #fff; opacity: 0.12; }
.hero--big::after { background: #000; opacity: 0.16; }
.hero--big .hero-title { font-size: clamp(2.5rem, 6.4vw, 4.6rem); font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; line-height: 1.02; }
.hero--big .hero-title .gradient-text { background: none; -webkit-background-clip: border-box; background-clip: border-box; -webkit-text-fill-color: currentColor; color: inherit; opacity: 0.85; }
.hero--big .hero-text { color: inherit; opacity: 0.9; font-size: 1.2rem; max-width: 520px; }
.hero--big .hero-tag { background: rgba(255, 255, 255, 0.16); color: inherit; border-color: transparent; }
.hero--big .hero-actions .btn { padding: 15px 30px; border-radius: 999px; font-size: 1.05rem; }
.hero--big .hero-actions .btn--primary { background: var(--on-primary); color: var(--primary) !important; border-color: var(--on-primary); }
.hero--big .hero-actions .btn--ghost { background: rgba(0, 0, 0, 0.28); color: var(--on-primary) !important; border-color: transparent; }
.hero--big .hero-stats span, .hero--big .scroll-hint { color: inherit !important; opacity: 0.8; }
.hero--big .live-card { color: var(--text); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55); transform: rotate(2deg); }
.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 70px; z-index: 1; }
.hero-wave path { fill: var(--bg-soft); }
.hero--big .container { position: relative; z-index: 2; }

.feature-row { padding: 84px 0; }
.feature-row--soft { background: var(--bg-soft); }
.feature-inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.is-flip .feature-art { order: 2; }
.feature-text h2 { margin: 0 0 14px; font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.feature-text p { margin: 0 0 22px; color: var(--muted); font-size: 1.1rem; line-height: 1.6; max-width: 460px; }
.feature-text .btn { border-radius: 999px; padding: 12px 26px; }
.feature-art { display: grid; place-items: center; min-height: 280px; border-radius: 28px; padding: 34px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--primary) 22%, var(--surface)), color-mix(in srgb, var(--accent) 26%, var(--surface))); }
.art-card { width: min(100%, 360px); padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 22px 44px -18px rgba(0, 0, 0, 0.45); transform: rotate(-2deg); }
.is-flip .art-card { transform: rotate(2deg); }
.art-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.art-chips span { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 0.78rem; font-weight: 700; }
.art-room { text-align: center; }
.art-live { display: inline-flex; align-items: center; gap: 6px; font: 800 0.72rem var(--font-ui); letter-spacing: 0.06em; color: var(--muted); }
.art-live i { width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; }
.art-timer { display: block; margin: 6px 0 12px; font-size: 3.4rem; line-height: 1; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.art-faces { display: flex; justify-content: center; }
.art-faces .avatar { width: 44px; height: 44px; margin-left: -8px; border: 2px solid var(--surface); }
.art-chips { justify-content: center; }
.art-list > div { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.art-list > div:first-child { border-top: 0; }
.art-list span { font-size: 1.4rem; }
.art-list b { height: 12px; border-radius: 6px; background: var(--surface-2); }
.art-list > div:nth-child(2) b { width: 70%; } .art-list > div:nth-child(3) b { width: 85%; } .art-list > div:nth-child(4) b { width: 55%; }
.art-list em { font-style: normal; font-weight: 800; font-size: 0.8rem; padding: 3px 9px; border-radius: 999px; background: var(--primary-tint); color: var(--primary-text); }
.art-bubble { display: flex; align-items: flex-end; gap: 8px; margin: 0 0 10px; }
.art-bubble.is-me { justify-content: flex-end; }
.art-bubble .avatar { width: 34px; height: 34px; }
.art-bubble span { display: block; width: 62%; height: 34px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); }
.art-bubble.is-me span { width: 48%; border-radius: 16px 16px 4px 16px; background: var(--primary); opacity: 0.85; }
.art-chat .art-chips { justify-content: flex-start; }
.art-games { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: center; }
.art-board { aspect-ratio: 1; border-radius: 10px; border: 2px solid var(--border);
  background: repeating-conic-gradient(#769656 0% 25%, #eeeed2 0% 50%) 0 0 / 50% 50%; }
.art-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.art-tiles span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; background: var(--surface-2); font-size: 1.3rem; }
.art-avatars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.art-avatars .avatar { width: 100%; height: auto; aspect-ratio: 1; }
.home-ready { padding: 92px 0; text-align: center; color: var(--on-primary);
  background: linear-gradient(155deg, color-mix(in srgb, var(--primary) 80%, #000), var(--primary) 60%, color-mix(in srgb, var(--accent) 55%, var(--primary))); }
.home-ready h2 { margin: 0 0 10px; font-size: clamp(1.9rem, 4.4vw, 3.2rem); font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; }
.home-ready p { margin: 0 auto 26px; max-width: 520px; opacity: 0.9; font-size: 1.1rem; }
.home-ready .hero-actions { justify-content: center; }
.home-ready .btn { padding: 15px 30px; border-radius: 999px; font-size: 1.05rem; }
.home-ready .btn--primary { background: var(--on-primary); color: var(--primary) !important; border-color: var(--on-primary); }
.home-ready .btn--ghost { background: rgba(0, 0, 0, 0.28); color: var(--on-primary) !important; border-color: transparent; }
@media (max-width: 860px) {
  .hero--big { padding: 64px 0 110px; }
  .hero--big .live-card { transform: none; }
  .feature-row { padding: 56px 0; }
  .feature-inner { grid-template-columns: 1fr; gap: 28px; }
  .is-flip .feature-art { order: 0; }
  .feature-art { min-height: 0; padding: 22px; }
}

/* ---------- Bank-transfer payment page, notifications ---------- */
.payment-page { max-width: 720px; display: flex; flex-direction: column; gap: 16px; }
.pay-packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.pay-package { display: flex; flex-direction: column; gap: 3px; padding: 14px; border: 2px solid var(--border); border-radius: 14px; background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pay-package:hover:not(:disabled), .pay-package.is-active { border-color: var(--primary); }
.pay-package:disabled { opacity: 0.6; cursor: not-allowed; }
.pay-package b { font-size: 1.05rem; }
.pay-package small { color: var(--muted); }
.pay-rows { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.pay-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 2fr) auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); }
.pay-row:first-child { border-top: 0; }
.pay-row span { color: var(--muted); font-size: 0.85rem; }
.pay-row b { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pay-row--big { background: var(--surface-2); }
.pay-row--big b { font-size: 1.1rem; color: var(--primary-text); }
.pay-order { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.pay-order-side { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pay-status--paid, .pay-status--approved { background: color-mix(in srgb, var(--success) 22%, transparent); color: var(--success); }
.pay-status--cancelled, .pay-status--declined { opacity: 0.6; }
.pay-fold { margin-top: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; }
.pay-fold summary { padding: 11px 0; font-weight: 700; cursor: pointer; }
.pay-fold[open] { padding-bottom: 14px; }
.pay-template { margin: 0 0 10px; padding: 12px; border-radius: 10px; background: var(--surface-2); font: 0.8rem/1.5 "JetBrains Mono", ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 520px) { .pay-row { grid-template-columns: 1fr auto; } .pay-row span { grid-column: 1 / -1; } }
.profile-id { margin: 10px 0 0; font-size: 0.9rem; }
.nav-bell { position: relative; display: none; width: 38px; height: 38px; font-size: 1.05rem; }
@media (max-width: 760px) { .nav-bell:not(.is-hidden) { display: inline-grid; place-items: center; } }
.note-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e53935; color: #fff; font: 800 0.66rem/1 Inter, sans-serif; font-style: normal; }
.nav-bell .note-count { position: absolute; top: -4px; right: -4px; }
.note-list { margin: 0; padding: 0; list-style: none; }
.note-list li { padding: 8px 0 8px 12px; border-top: 1px solid var(--border); border-left: 3px solid transparent; font-size: 0.86rem; }
.note-list li:first-child { border-top: 0; }
.note-list li.is-new { border-left-color: #e53935; font-weight: 700; }
.note-list small { display: block; color: var(--muted); font-weight: 500; font-size: 0.72rem; }
.footer-contacts a { margin-left: 8px; }

/* ---------- Back / reload arrows, the buddy's speech bubble ---------- */
.nav-arrows { display: flex; gap: 4px; }
.nav-go { width: 38px; height: 38px; font-size: 1.15rem; line-height: 1; }
@media (max-width: 420px) { .nav-go { width: 32px; height: 32px; font-size: 1rem; } .nav-tools { gap: 5px; } }
.buddy-bubble {
  position: fixed; z-index: 301; max-width: 260px; padding: 9px 13px; border-radius: 4px 16px 16px 16px; pointer-events: none;
  background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow); font-size: 0.86rem; font-weight: 600;
  opacity: 0; transform: translateY(6px) scale(0.96); transition: opacity 0.2s, transform 0.2s;
}
.buddy-bubble.is-visible { opacity: 1; transform: none; }
.circle-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.circle-choices .chip { font-size: 0.8rem; text-decoration: none; }
.nora-bubble p { margin: 0; }

/* ---------- Checkout page and guide book ---------- */
.checkout-page { max-width: 560px; }
.checkout-card { text-align: center; padding: 28px; margin-bottom: 18px; }
.checkout-step { margin: 0 0 12px; font: 800 0.75rem var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.checkout-art { font-size: 3.6rem; line-height: 1.1; }
.checkout-themes { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 6px; }
.checkout-themes span { width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(128, 128, 128, 0.35); }
.checkout-card h1 { margin: 8px 0 4px; font-size: 1.5rem; }
.checkout-rows { margin: 18px 0 8px; text-align: left; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.checkout-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--border); }
.checkout-rows > div:first-child { border-top: 0; }
.checkout-rows dt { color: var(--muted); }
.checkout-rows dd { margin: 0; font-variant-numeric: tabular-nums; }
.checkout-sub { padding-top: 0 !important; border-top: 0 !important; font-size: 0.8rem; color: var(--muted); }
.checkout-total { background: var(--surface-2); }
.checkout-short { color: #d9534f; font-weight: 700; }
.checkout-cancel { margin-top: 12px; }
.checkout-how ul, .guide-section ul { padding-left: 20px; }
.checkout-how li, .guide-section li { margin-bottom: 8px; line-height: 1.55; }
.checkout-how h3 { margin: 18px 0 8px; }
.guide-page { max-width: 820px; }
.guide-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; padding: 14px; }
.guide-toc a { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 0.85rem; font-weight: 600; text-decoration: none; color: var(--text); }
.guide-toc a:hover { background: var(--primary-tint); }
.guide-section { margin-bottom: 14px; scroll-margin-top: 84px; }
.guide-section h2 { margin-top: 0; font-size: 1.2rem; }

/* ---------- Terms and the cookie notice ---------- */
.terms-page { max-width: 820px; }
.terms-page li { margin-bottom: 8px; line-height: 1.55; }
.terms-page hr { margin: 28px 0; border: 0; border-top: 1px solid var(--border); }
.terms-check { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0; font-size: 0.9rem; line-height: 1.4; }
.terms-check input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary); }
.terms-gate { z-index: 500; }
.cookie-bar {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 300; display: flex; align-items: center; gap: 14px;
  width: min(680px, calc(100vw - 24px)); padding: 12px 16px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3); font-size: 0.86rem;
}
.cookie-bar p { margin: 0; flex: 1; }
@media (max-width: 560px) { .cookie-bar { flex-direction: column; align-items: stretch; text-align: center; } }

/* ---------- Preview cards (js/preview.js) ---------- */
.peek {
  position: fixed; z-index: 400; width: max-content; max-width: min(280px, calc(100vw - 16px)); padding: 12px 14px; pointer-events: none;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  font-size: 0.85rem; text-align: center; animation: rise 0.15s ease-out;
}
.peek b { display: block; font-size: 0.95rem; }
.peek p { margin: 4px 0 0; color: var(--muted); }
.peek p b { display: inline; color: var(--text); font-size: inherit; }
.peek-art { font-size: 2.2rem; line-height: 1.2; }
.peek-art svg { width: 44px; height: 44px; }
.peek-warn { color: #d9534f !important; font-weight: 700; }
.peek-hint { font-style: italic; }
.peek-swatches { display: flex; justify-content: center; gap: 4px; margin-bottom: 8px; }
.peek-swatches i { width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(128, 128, 128, 0.4); }
.peek .peek-avatar { width: 140px; height: 140px; border-radius: 50%; display: block; margin: 0 auto 8px; font-size: 3rem; }

/* ---------- Notice card (Aura too low), focus-sound volume ---------- */
.soon-card { max-width: 560px; margin: 40px auto; padding: 36px 28px; text-align: center; }
.soon-art { font-size: 4rem; line-height: 1; }
.soon-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.sound-volume { width: 100%; margin-top: 10px; accent-color: var(--primary); }
.chip:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Admin page: give NoraCoin / Ultra ---------- */
.gift-form { display: grid; grid-template-columns: minmax(200px, 2fr) 1fr 1fr auto; gap: 10px; align-items: end; margin: 10px 0; }
.gift-form label { font-size: 0.78rem; font-weight: 700; display: flex; flex-direction: column; gap: 4px; }
.gift-form .input { margin: 0; }
@media (max-width: 720px) { .gift-form { grid-template-columns: 1fr; } }

/* ---------- "Payments are not added yet" page ---------- */
.payment-page { max-width: 560px; }
.payment-card { text-align: center; padding: 40px 28px; }
.payment-art { font-size: 3.6rem; line-height: 1; margin-bottom: 10px; }
.payment-card h1 { font-size: 1.5rem; margin: 0 0 10px; }
.payment-actions { justify-content: center; margin-top: 22px; }

/* ---------- Profile: Ерөнхий суурь course groups ---------- */
.course-search { margin-bottom: 8px; }
.gened { margin-bottom: 8px; border: 1px solid var(--border); border-left: 6px solid var(--gened); border-radius: var(--radius-sm); background: var(--surface-2); }
.gened summary { padding: 10px 12px; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.gened summary small { color: var(--gened); font-weight: 800; }
.gened .chip-row { padding: 4px 12px 12px; }
.gened .chip-row:empty { display: none; }
.gened-note { margin: 0; padding: 0 12px 12px; }
.gened .chip { text-align: left; font-size: 0.85rem; }
.gened .chip b { color: var(--gened); margin-right: 4px; }
.gened .chip.is-active b { color: inherit; }

#petSizeOptions { margin-bottom: 8px; }
/* The pet's box (with its hidden speech bubble) must never swallow taps meant for the guide or the page */
.theme-pet { pointer-events: none; }
.theme-pet .pet-mood { left: calc(40px * var(--pet-scale, 1.5)); bottom: calc(40px * var(--pet-scale, 1.5)); }

/* ---------- The menu as one tidy list (js/common.js renderDrawer) ---------- */
.drawer-group { padding: 8px 0; border-top: 1px solid var(--border); }
.drawer-group:first-of-type { border-top: 0; }
.drawer-pages { display: none; flex-direction: column; gap: 0; margin: 0; }
.drawer-row {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none;
  color: var(--text) !important; font: 600 0.95rem var(--font-ui); text-align: left; cursor: pointer; text-decoration: none !important;
}
.drawer-row:hover { background: var(--surface-2); }
.drawer-row.is-active { background: var(--surface-2); font-weight: 800; }
.drawer-row > span:nth-child(2) { flex: 1; min-width: 0; }
.drawer-ico { width: 24px; text-align: center; font-size: 1.1rem; flex-shrink: 0; }
.drawer-chev { color: var(--muted); font-size: 0.8rem; }
.drawer-small { font-size: 0.82rem; color: var(--muted) !important; }
.drawer-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 6px 12px 4px; font-size: 0.95rem; }
.drawer-title small { color: var(--muted); font-weight: 500; font-size: 0.7rem; }
.drawer-sec.is-open > .drawer-row { font-weight: 800; }
.drawer-body { padding: 4px 12px 14px 50px; }
.drawer-body h4 { margin: 14px 0 6px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.drawer-body h4:first-child { margin-top: 0; }
.drawer-admin { background: color-mix(in srgb, var(--accent) 9%, transparent); border-radius: 12px; padding: 8px 4px; margin: 6px 0; border-top: 0; }
@media (max-width: 760px) { .drawer-pages { display: flex; } .drawer-body { padding-left: 14px; } }

/* Themes: fold-out categories, and themes you do not own are blurred */
.theme-cat { margin-top: 6px; border: 1px solid var(--border); border-radius: 10px; }
.theme-cat .theme-grid { padding: 0 8px 8px; }
.theme-cat-head { display: flex; align-items: center; gap: 4px; padding-right: 6px; }
.theme-cat-head .drawer-row { padding: 8px 10px; font-size: 0.82rem; gap: 8px; }
.theme-cat-head small { color: var(--muted); font-weight: 600; }
.theme-bundle { flex-shrink: 0; font-size: 0.68rem; padding: 3px 8px; white-space: nowrap; }
.theme-option.is-blurred .theme-swatch { filter: blur(5px) saturate(0.6); transform: scale(1.25); }
.theme-option.is-blurred > span:last-child { filter: blur(2.2px); opacity: 0.75; }
.theme-option.is-blurred { overflow: hidden; transition: filter 0.2s; }
.theme-option.is-blurred:hover .theme-swatch, .theme-option.is-blurred:focus-visible .theme-swatch { filter: blur(1.5px); }
.theme-option.is-blurred:hover > span:last-child, .theme-option.is-blurred:focus-visible > span:last-child { filter: none; opacity: 1; }

/* ---------- Settings: locked choices, 10 languages ---------- */
.theme-cat { grid-column: 1 / -1; margin: 12px 0 2px; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.theme-cat small { opacity: 0.7; font-weight: 600; }
.feature-note { margin-top: 6px; }
.lang-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.lang-grid button { font-size: 0.85rem; padding-inline: 4px; }

/* ---------- One-step sign in / sign up ---------- */
#authView.is-easy > .tabs, #authView.is-easy > #authTitle, #authView.is-easy > #authText,
#authView.is-easy > #signInForm, #authView.is-easy > #phoneForm, #authView.is-easy > #codeForm { display: none !important; }
.phone-field { display: grid; grid-template-columns: auto 1fr; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.phone-field span { padding: 0 12px; font-weight: 700; white-space: nowrap; }
.phone-field .input { margin: 0; border: 0; border-left: 1px solid var(--border); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 1.1rem; letter-spacing: 0.04em; }
#easyExtra { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 6px; }
#authView.is-easy { position: relative; overflow: hidden; padding: 0; border: 0; box-shadow: 0 18px 50px -18px color-mix(in srgb, var(--primary) 55%, transparent), var(--shadow); }
#authView.is-easy > form { margin: 0; padding: 22px 28px 28px; }
.auth-hero { display: none; }
#authView.is-easy .auth-hero {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; padding: 26px 28px 30px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 70%, var(--primary)) 0%, var(--primary) 55%, color-mix(in srgb, var(--primary) 70%, #000) 100%);
  clip-path: ellipse(120% 100% at 50% 0%);
}
.auth-hero-face { width: 68px; height: 68px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); border: 2px solid rgba(255, 255, 255, 0.55); display: grid; place-items: center; overflow: hidden; }
.auth-hero-face > * { width: 44px; height: 44px; }
.auth-hero strong { display: block; font-size: 1.35rem; letter-spacing: 0.01em; }
.auth-hero span { opacity: 0.9; font-size: 0.92rem; }
#authView.is-easy h1 { font-size: 1.45rem; }
#authView.is-easy .phone-field, #authView.is-easy .password-field .input { border-radius: 14px; }
#authView.is-easy .phone-field { transition: border-color 0.2s, box-shadow 0.2s; }
#authView.is-easy .phone-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
#authView.is-easy .phone-field .input:focus { outline: 0; box-shadow: none; }
#authView.is-easy .phone-field .input { border-radius: 0 14px 14px 0; }
#authView.is-easy .btn--block { margin-top: 12px; padding-block: 14px; border-radius: 14px; font-size: 1.05rem; }
.auth-perks { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.auth-perks li { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 0.8rem; }
@media (max-width: 480px) { #authView.is-easy > form { padding: 18px 18px 22px; } #authView.is-easy .auth-hero { padding: 20px 18px 24px; } }

/* ---------- QR login (account page) ---------- */
.qr-card h3 { margin: 0 0 4px; }
.qr-box { max-width: 420px; text-align: center; }
.qr-code { display: grid; place-items: center; width: 240px; height: 240px; margin: 14px auto 8px; padding: 10px; border-radius: 18px; background: #fff; box-shadow: 0 0 0 4px var(--primary-tint), var(--shadow); transition: opacity 0.3s, filter 0.3s; }
.qr-code svg { width: 100%; height: 100%; display: block; }
.qr-code.is-expired { opacity: 0.25; filter: blur(3px); }
.qr-left { margin: 0 0 10px; font: 700 0.9rem var(--font-ui); color: var(--primary-text); }
.qr-steps { margin: 0 0 10px; padding-left: 22px; text-align: left; line-height: 1.6; }
.qr-camera { position: relative; width: min(300px, 80vw); aspect-ratio: 1; margin: 14px auto; overflow: hidden; border-radius: 18px; background: #000; }
.qr-camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qr-frame { position: absolute; inset: 14%; border: 3px solid #fff; border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); animation: qr-frame 1.6s ease-in-out infinite; }
@keyframes qr-frame { 50% { inset: 17%; border-color: var(--accent); } }
#currentPassword { margin-bottom: 8px; }

/* ---------- Shop: promo code box ---------- */
.promo-form { display: flex; gap: 8px; max-width: 340px; margin-top: 10px; }
.promo-form .input { margin: 0; text-transform: uppercase; }

/* ---------- Admin page ---------- */
.admin-card, .admin-status { margin-bottom: 16px; }
.admin-status { border-left: 4px solid var(--success); }
.admin-status.is-warn { border-left-color: #e0a100; }
.admin-status.is-down { border-left-color: #e5484d; }
.admin-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th, .admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.admin-table th { color: var(--muted); font: 700 0.72rem var(--font-ui); text-transform: uppercase; letter-spacing: 0.05em; }
.admin-table tbody tr:hover { background: var(--surface-2); }

/* ---------- Shop: Ultra discount ---------- */
.old-price { opacity: 0.6; font-weight: 500; }
.ultra-deal { display: inline-block; margin: 8px 0 0; padding: 4px 12px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-strong); font: 700 0.82rem var(--font-ui); }
.ultra-deal.is-on { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }

@media (max-width: 760px) {
  .events-form { grid-template-columns: 1fr 1fr; }
  .pet-body { width: calc(44px * var(--pet-scale, 1.5)); height: calc(44px * var(--pet-scale, 1.5)); font-size: calc(1.4rem * var(--pet-scale, 1.5)); }
}
@media (prefers-reduced-motion: reduce) {
  .pet-body, .today-card { animation: none !important; }
}

/* ---------- Chat (Community + study partners) ---------- */
.chat-box { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 460px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.chat-channels { display: flex; flex-direction: column; gap: 2px; padding: 12px; background: var(--surface-2); border-right: 1px solid var(--border); }
.chat-channels h4 { margin: 0 0 8px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.chat-channel { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font: 600 0.88rem var(--font-ui); text-align: left; cursor: pointer; transition: background 0.15s, transform 0.15s; }
.chat-channel:hover { background: var(--surface); transform: translateX(3px); }
.chat-channel.is-active { background: var(--primary); color: var(--on-primary); }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chat-messages { flex: 1; display: flex; flex-direction: column; gap: 10px; max-height: 420px; min-height: 260px; overflow-y: auto; padding: 14px 16px; }
.chat-empty { margin: auto; color: var(--muted); }
.chat-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 85%; }
.chat-msg.is-mine { flex-direction: row-reverse; align-self: flex-end; }
.chat-avatar { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 700 0.8rem var(--font-ui); }
.chat-bubble { padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface-2); }
.chat-msg.is-mine .chat-bubble { border-radius: 14px 14px 4px 14px; background: var(--primary-tint); }
.chat-bubble small { color: var(--muted); font-size: 0.74rem; }
.chat-bubble p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.chat-form .input { margin: 0; }
.chat-signin { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--muted); }
.chat-demo { margin: 0; padding: 0 16px 12px; }
.partner-card .chat-box { margin-top: 12px; }

@media (max-width: 760px) {
  .chat-box { grid-template-columns: 1fr; }
  .chat-channels { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); }
  .chat-channels h4 { width: 100%; }
}

@media (max-width: 760px) {
  .drawer-pages { display: flex; }
  .nav-menu { display: none !important; }
  .majors-guide { grid-template-columns: 1fr; }
  .majors-guide .guide-emoji { display: none; }
}

/* The switch between the two sites (NUMNora <-> ELECNora) in the top bar */
.site-switch { display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text) !important; font: 700 0.82rem var(--font-ui); text-decoration: none; white-space: nowrap; }
.site-switch:hover { border-color: var(--accent); }
.site-switch--elec { background: #1d3a8a; border-color: #1d3a8a; color: #fff !important; }
@media (max-width: 1100px) { .site-switch span { display: none; } .site-switch { padding: 0 9px; } }
@media (max-width: 420px) { .site-switch { height: 32px; padding: 0 7px; } }

/* The cover that hides the page while it is not the active window (js/config.js → protectScreen) */
html.is-shielded body { filter: blur(26px) brightness(0.6); }
html.is-shielded::after { content: "🔒"; position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; font-size: 4rem; background: rgba(10, 14, 24, 0.55); }
/* The account's code, tiled faintly over a signed-in page (js/config.js → watermark) */
html.has-watermark::before { content: ""; position: fixed; inset: 0; z-index: 99998; pointer-events: none; background-image: var(--watermark); opacity: 0.16; }
/* Phones: no "save image" menu on a long press */
html.is-guarded img, html.is-guarded svg, html.is-guarded canvas { -webkit-touch-callout: none; }
/* Printing / "Save as PDF" gives an empty page everywhere except the certificate, which prints uncovered */
@media print {
  html.is-guarded:not(:has(#certSheet)) body { display: none !important; }
  html:has(#certSheet).is-shielded body { filter: none; }
  html:has(#certSheet).is-shielded::after, html.has-watermark::before { display: none; }
}

/* the closed menu drawer waits off-screen to the right: it must not make the page scroll sideways */
html, body { overflow-x: clip; }

/* Admin room (staff.html) */
.sr-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sr-chat { height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 8px 0; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.sr-msg { max-width: 82%; padding: 7px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.sr-msg.is-mine { align-self: flex-end; background: #1d3a8a; color: #fff; border-color: #1d3a8a; }
.sr-msg b { font-size: 0.78rem; }
.sr-msg small { margin-left: 8px; font-size: 0.68rem; opacity: 0.7; }
.sr-msg p { margin: 3px 0 0; line-height: 1.45; overflow-wrap: anywhere; }
.sr-list { list-style: none; margin: 0 0 14px; padding: 0; }
.sr-list li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.sr-list li .link-btn { margin-left: auto; }
.sr-log tr.is-secret td { background: rgba(255, 193, 7, 0.12); }
.sr-report { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.sr-report blockquote { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--border); color: var(--muted); }
@media (max-width: 900px) { .sr-grid { grid-template-columns: 1fr; } }
