/* Extra features: soft theme, home cards, room side panel, stats, admin features/security, dialogs. */

/* ---------- soft pastel theme (members can switch to it) ---------- */
/* exact shades from Leelo's Pinterest palettes:
   light  #fdebeb #fedbe1 #fcccd8 #f7b4c4 #ffe0f5 #ff9cb6
   strip  #f4999e #ea8e99 #df8096 #d47394 #ca6891 #bf5b8d #b65189 #883460
   deep   #772c55 #5d324d   text #542430 #9c606c */
body.soft {
  --bg: #fdebeb; --panel: #fff8f8; --panel-2: #fedbe1; --line: #f7b4c4; --text: #542430; --muted: #9c606c;
  --neon: #df8096; --neon-dark: #b65189; --soft: #ca6891; --cyan: #883460; --gold: #d47394; --shadow: #f4999e; --error: #bf5b8d;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 10% -10%, rgba(252, 204, 216, .8) 0, transparent 45%), radial-gradient(circle at 100% 110%, rgba(255, 224, 245, .9) 0, transparent 45%);
}
body.soft #topbar { background: rgba(255, 255, 255, .9); }
body.soft input, body.soft textarea, body.soft select { background: #fff8fb; color: var(--text); }
body.soft .tile, body.soft .furn, body.soft .maker-tabs { background: #fff0f6; }
body.soft .toast { color: #fff; }
body.soft .brand, body.soft .neon, body.soft .big { text-shadow: none; }
html:has(body.soft) { background: #fdebeb; }

/* ---------- top bar ---------- */
.icon-btn { padding: 4px 9px; font-size: 16px; }
.brand { white-space: nowrap; }
#topbar .stats { gap: 8px; }
@media (max-width: 900px) {
  #topbar .today { display: none; }
  #topbar button { padding: 5px 9px; }
}

/* ---------- home ---------- */
.home-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 20px; }
.home-top:has(> :not([hidden]):only-child) { grid-template-columns: 1fr; }
.home-top:not(:has(> :not([hidden]))) { display: none; }
.quote-card { margin: 0; position: relative; padding: 22px 26px 16px; overflow: hidden; animation: view-in .5s both; }
.quote-card .q-mark { position: absolute; top: -18px; inset-inline-start: 10px; font-size: 90px; color: var(--neon); opacity: .25; font-family: Georgia, serif; }
.quote-card blockquote { margin: 0; font-size: 18px; line-height: 1.5; position: relative; }
.quote-card figcaption { margin-top: 10px; font-size: 12px; color: var(--muted); }
.exam-card { padding: 16px 18px; }
.exam-days { font-size: 46px; font-weight: 700; color: var(--neon); text-shadow: 0 0 14px rgba(255, 62, 165, .5); line-height: 1; animation: pulse-text 2.5s ease-in-out infinite; }
.exam-label { font-weight: 700; margin-top: 4px; }
.exam-form { display: grid; gap: 8px; }
.exam-form input { margin: 0; }
.progress-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.goal-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.goal-form label { display: flex; align-items: center; gap: 6px; margin: 0; }
.goal-form input { width: 80px; margin: 0; padding: 6px; }

/* ---------- room: subject, side panel, to-do, mixer, away ---------- */
.subject-wrap { display: flex; align-items: center; gap: 8px; margin: 0 0 0 auto; }
.subject-wrap select { width: auto; margin: 0; padding: 6px 8px; }
.side-panel { margin-top: 16px; padding: 0; overflow: hidden; }
.side-body { padding: 14px; }
.todo-form { display: flex; gap: 6px; }
.todo-form input { margin: 0; }
.todo-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.todo-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; background: var(--panel-2); border: 2px solid var(--line); animation: view-in .25s both; }
.todo-list li label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); flex: 1; cursor: pointer; }
.todo-list li input { width: 18px; height: 18px; margin: 0; accent-color: var(--neon); }
.todo-list li.done span { text-decoration: line-through; color: var(--muted); }
.mixer-list { display: grid; gap: 10px; }
.mix-row { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 10px; margin: 0; color: var(--text); }
.mix-row input { margin: 0; accent-color: var(--neon); }
.pomo-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; flex-wrap: wrap; animation: view-in .2s both; }
.pomo-form label { margin: 0; font-size: 12px; }
.pomo-form input { width: 70px; margin: 2px 0 0; padding: 5px; }
.people-panel li .subj { margin-inline-start: auto; font-size: 11px; color: var(--muted); }
.scene-wrap.away::after {
  content: '⏸'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 60px;
  background: rgba(10, 6, 18, .45); color: #fff; pointer-events: none; animation: view-in .3s both;
}

/* ---------- stats ---------- */
.heatmap { display: grid; grid-template-rows: repeat(7, 18px); grid-auto-flow: column; grid-auto-columns: 18px; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.hm { display: block; width: 18px; height: 18px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); animation: pop-in .3s both; }
.hm.l1 { background: rgba(255, 62, 165, .25); }
.hm.l2 { background: rgba(255, 62, 165, .5); }
.hm.l3 { background: rgba(255, 62, 165, .8); }
.hm.l4 { background: var(--neon); box-shadow: 0 0 8px rgba(255, 62, 165, .7); }
.hm.today { outline: 2px solid var(--cyan); outline-offset: 1px; }
.hm-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.hm-legend .hm { width: 12px; height: 12px; animation: none; }
.pr-row { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; margin-bottom: 8px; }
.pr-bar { height: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.pr-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--neon), var(--soft)); animation: grow .8s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
[dir="rtl"] .pr-bar i { transform-origin: right; }
.sessions { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.sessions li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.badge-tile { text-align: center; padding: 12px 8px; border: 2px solid var(--line); background: var(--panel-2); opacity: .55; filter: grayscale(.8); transition: transform .15s; }
.badge-tile.earned { opacity: 1; filter: none; border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 216, 106, .35); }
.badge-tile.earned:hover { transform: translateY(-3px) rotate(-1deg); }
.badge-tile .b-ic { font-size: 30px; }
.badge-tile.earned .b-ic { animation: float 3s ease-in-out infinite; }
.badge-tile .b-name { font-weight: 700; font-size: 13px; margin-top: 4px; }
.badge-tile .b-desc { font-size: 11px; color: var(--muted); }
.board { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.board-row { display: grid; grid-template-columns: 50px minmax(140px, 1.2fr) 2fr 80px; gap: 10px; align-items: center; padding: 8px 10px; background: var(--panel-2); border: 2px solid var(--line); animation: view-in .3s both; }
.board-row.you { border-color: var(--cyan); box-shadow: 0 0 12px rgba(62, 240, 255, .3); }
.board-row.gap { margin-top: 12px; }
.board-row .rank { font-size: 20px; text-align: center; font-weight: 700; }
.board-row .who { display: flex; align-items: center; gap: 8px; }
.board-row .who canvas { width: 16px; height: 24px; }

/* ---------- maintenance ---------- */
.maint { padding: 40px 24px; }
.maint-ic { font-size: 64px; animation: wiggle 2s ease-in-out infinite; }

/* ---------- switches (preferences + feature cards) ---------- */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 0 0 10px; color: var(--text); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { flex: none; width: 40px; height: 22px; background: var(--line); border: 2px solid var(--line); position: relative; transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 14px; height: 14px; background: #fff; transition: transform .2s cubic-bezier(.2, .8, .2, 1.4); }
.switch input:checked + i { background: var(--neon); border-color: var(--neon-dark); box-shadow: 0 0 10px rgba(255, 62, 165, .5); }
.switch input:checked + i::after { transform: translateX(18px); }
[dir="rtl"] .switch input:checked + i::after { transform: translateX(-18px); }
.switch input:focus-visible + i { outline: 2px solid var(--cyan); outline-offset: 2px; }
.prefs-block { border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); padding: 4px 0 6px; margin: 10px 0; }
.feature-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.feature-card { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; margin: 0; background: var(--panel); border: 2px solid var(--line); cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .15s; }
.feature-card:hover { transform: translateY(-2px); }
.feature-card.on { border-color: var(--neon); box-shadow: 0 0 12px rgba(255, 62, 165, .25); }
.feature-card .f-ic { font-size: 26px; text-align: center; }
.feature-card .f-body { display: grid; gap: 2px; color: var(--text); }
.feature-card .f-body small { color: var(--muted); font-size: 12px; }
.feature-card .switch { margin: 0; }
.sticky-save { position: sticky; bottom: 12px; z-index: 5; }
.secure-chip { border-color: #3fbf7f; color: #6af0a8; font-size: 12px; }
body.soft .secure-chip { color: #1f8a55; }
tr.warn td { color: var(--error); }

/* ---------- dialogs: help, tour, unlock ---------- */
.keys { list-style: none; padding: 0; display: grid; gap: 8px; }
.keys li { display: flex; gap: 12px; align-items: center; }
kbd { display: inline-block; min-width: 54px; text-align: center; padding: 3px 8px; border: 2px solid var(--line); border-bottom-width: 4px; background: var(--panel-2); font-family: var(--font); font-weight: 700; }
.tour { text-align: center; }
.tour-icon { font-size: 56px; animation: float 3s ease-in-out infinite; text-align: center; }
.tour-dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 16px; }
.tour-dots i { width: 8px; height: 8px; background: var(--line); }
.tour-dots i.on { background: var(--neon); box-shadow: 0 0 8px var(--neon); }
.otp { font-size: 30px; letter-spacing: 12px; text-align: center; font-weight: 700; padding: 12px; }

@keyframes pulse-text { 50% { transform: scale(1.06); } }
@keyframes pop-in { from { transform: scale(0); opacity: 0; } }
@keyframes grow { from { transform: scaleX(0); } }

@media (max-width: 760px) {
  .home-top { grid-template-columns: 1fr; }
  .board-row { grid-template-columns: 40px 1fr 70px; }
  .board-row .pr-bar { display: none; }
  .pr-row { grid-template-columns: 110px 1fr 60px; }
  .subject-wrap { margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
