﻿/* ===================================================================
   SERPENT HOUSE — Dark green / silver / gold gothic theme
   =================================================================== */
:root {
  --bg-deep: #05120c;
  --bg: #0a1f15;
  --bg-2: #0f2a1d;
  --bg-3: #143626;
  --green: #1f5a3a;
  --green-bright: #2f8a58;
  --emerald: #3fbf7f;
  --silver: #c4ccc7;
  --silver-dim: #8d9791;
  --silver-bright: #e9eeeb;
  --gold: #c9a227;
  --gold-light: #f2d872;
  --gold-dark: #7d5f0e;
  --danger: #b3323f;
  --amber: #d08a1f;
  --font-display: 'Cinzel Decorative', 'Cinzel', serif;
  --font-head: 'Cinzel', serif;
  --font-body: 'IM Fell English', Georgia, serif;
  --sidebar-w: 260px;
  --radius: 10px;
  --gold-grad: linear-gradient(135deg, #f6e27a 0%, #c9a227 35%, #8a6a12 60%, #e6c757 85%, #a8851a 100%);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font-body); font-size: 17px; color: var(--silver);
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(47, 138, 88, .18), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(201, 162, 39, .07), transparent 50%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 6px);
  background-attachment: fixed; display: flex; min-height: 100vh;
}
a { color: var(--gold-light); text-decoration: none; }
a:hover { color: var(--gold); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: .04em; margin: 0; }
.gold-text {
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; filter: drop-shadow(0 0 6px rgba(201,162,39,.35));
}
.snakeskin, .frame {
  position: relative;
  background:
    radial-gradient(circle at 50% 0, rgba(63,191,127,.13) 0 35%, transparent 36%) 0 0 / 14px 14px,
    radial-gradient(circle at 0 50%, rgba(63,191,127,.10) 0 35%, transparent 36%) 7px 7px / 14px 14px,
    linear-gradient(160deg, var(--bg-2), var(--bg));
  border: 1px solid rgba(201,162,39,.45); border-radius: var(--radius);
  box-shadow: inset 0 0 0 3px var(--bg-deep), inset 0 0 0 4px rgba(201,162,39,.55), 0 10px 30px rgba(0,0,0,.45);
}
.frame { padding: 22px 24px; }
.frame::before, .frame::after {
  content: ''; position: absolute; width: 18px; height: 18px;
  border: 2px solid var(--gold); pointer-events: none;
}
.frame::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.frame::after { bottom: 6px; right: 6px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.ornament-corner {
  position: fixed; width: 90px; height: 90px; pointer-events: none; z-index: 0; opacity: .55;
  background:
    radial-gradient(circle at 0 0, transparent 60px, var(--gold) 61px, transparent 63px),
    radial-gradient(circle at 0 0, transparent 70px, rgba(201,162,39,.4) 71px, transparent 72px);
}
.ornament-corner.tl { top: 0; left: 0; }
.ornament-corner.tr { top: 0; right: 0; transform: scaleX(-1); }
.ornament-corner.bl { bottom: 0; left: 0; transform: scaleY(-1); }
.ornament-corner.br { bottom: 0; right: 0; transform: scale(-1); }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, #0c261a 0%, #071810 100%);
  border-right: 1px solid rgba(201,162,39,.35);
  box-shadow: 4px 0 30px rgba(0,0,0,.5); display: flex; flex-direction: column; z-index: 10;
}
.sidebar::before {
  content: ''; position: absolute; inset: 0 0 0 auto; width: 3px;
  background: var(--gold-grad); opacity: .6;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 18px 16px; border-bottom: 1px solid rgba(201,162,39,.25); }
.crest { width: 62px; height: 72px; filter: drop-shadow(0 0 8px rgba(201,162,39,.35)); transition: transform .5s; }
.brand:hover .crest { transform: rotate(-4deg) scale(1.04); }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.1; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-family: var(--font-head); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--silver-dim); margin-top: 4px; }
.nav { display: flex; flex-direction: column; padding: 14px 10px; gap: 4px; flex: 1; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 18px; border-radius: 8px; font-family: var(--font-head); font-size: .9rem; letter-spacing: .06em; color: var(--silver); border: 1px solid transparent; overflow: hidden; transition: all .25s ease; }
.nav-link i { width: 20px; text-align: center; color: var(--gold); transition: transform .3s; }
.nav-link:hover { background: rgba(47,138,88,.15); border-color: rgba(201,162,39,.3); color: var(--silver-bright); }
.nav-link:hover i { transform: scale(1.15); }
.nav-link.active { background: linear-gradient(90deg, rgba(201,162,39,.16), rgba(47,138,88,.12)); border-color: rgba(201,162,39,.55); color: var(--gold-light); box-shadow: inset 0 0 20px rgba(201,162,39,.08), 0 0 14px rgba(201,162,39,.12); }
.snake-coil { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 4px; background: repeating-linear-gradient(180deg, var(--emerald) 0 4px, var(--green) 4px 8px); transform: scaleY(0); transform-origin: top; transition: transform .35s ease; }
.nav-link:hover .snake-coil, .nav-link.active .snake-coil { transform: scaleY(1); }
.sidebar-foot { padding: 16px 18px 22px; border-top: 1px solid rgba(201,162,39,.2); }
.motto { font-style: italic; font-size: .85rem; color: var(--silver-dim); }
.menu-toggle { display: none; position: fixed; top: 14px; left: 14px; z-index: 30; background: var(--bg-2); border: 1px solid var(--gold); color: var(--gold); width: 42px; height: 42px; border-radius: 8px; font-size: 1.1rem; }
.main { flex: 1; min-width: 0; padding: 34px 40px 60px; position: relative; z-index: 1; }
.page-header { margin-bottom: 26px; }
.page-title { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; display: flex; align-items: center; gap: 14px; }
.page-title i { font-size: 1.6rem; -webkit-text-fill-color: var(--gold); }
.header-rule { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: var(--gold); }
.header-rule span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.loading { text-align: center; color: var(--silver-dim); padding: 60px; font-style: italic; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: .5 } 50% { opacity: 1 } }
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.muted { color: var(--silver-dim); } .small { font-size: .85rem; } .center { text-align: center; }
.section-title { font-family: var(--font-head); font-size: 1.15rem; color: var(--gold-light); display: flex; align-items: center; gap: 10px; margin-bottom: 14px; letter-spacing: .08em; }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(201,162,39,.5), transparent); }
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 999px; cursor: pointer; font-family: var(--font-head); font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--silver-bright); background: linear-gradient(180deg, var(--bg-3), var(--bg)); border: 1px solid rgba(201,162,39,.7); box-shadow: 0 0 0 rgba(201,162,39,0), inset 0 1px 0 rgba(255,255,255,.06); transition: box-shadow .3s, transform .15s, color .3s; overflow: visible; }
.btn::before { content: ''; position: absolute; inset: -4px; border-radius: 999px; pointer-events: none; border: 2px dashed transparent; background: repeating-conic-gradient(from 0deg, var(--emerald) 0 8deg, var(--green) 8deg 16deg) border-box; -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .0; transition: opacity .35s; animation: coilspin 6s linear infinite paused; }
.btn::after { content: ''; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-light); top: -6px; left: 50%; box-shadow: 0 0 8px var(--gold); opacity: 0; transition: opacity .3s; transform-origin: 50% calc(50% + var(--r, 20px)); animation: orbit 6s linear infinite paused; }
.btn:hover { color: var(--gold-light); box-shadow: 0 0 18px rgba(201,162,39,.45), 0 0 40px rgba(63,191,127,.15); }
.btn:hover::before { opacity: .9; animation-play-state: running; }
.btn:hover::after { opacity: 1; animation-play-state: running; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary { background: linear-gradient(180deg, #2a7a4d, #1a4d31); border-color: var(--gold); }
.btn.gold { background: var(--gold-grad); color: #1b1503; border-color: var(--gold-light); font-weight: 700; }
.btn.danger { border-color: rgba(179,50,63,.7); }
.btn.danger:hover { box-shadow: 0 0 18px rgba(179,50,63,.45); color: #f3b3ba; }
.btn.sm { padding: 6px 12px; font-size: .72rem; }
.btn.icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
@keyframes coilspin { to { transform: rotate(360deg); } }
@keyframes orbit { from { transform: translateX(-50%) rotate(0deg); } to { transform: translateX(-50%) rotate(360deg); } }
input, select, textarea { font-family: var(--font-body); font-size: 1rem; color: var(--silver-bright); background: rgba(5,18,12,.7); border: 1px solid rgba(201,162,39,.4); border-radius: 6px; padding: 9px 12px; outline: none; transition: border-color .2s, box-shadow .2s; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 10px rgba(201,162,39,.25); }
select option { background: var(--bg); }
textarea { resize: vertical; min-height: 90px; }
label { display: block; font-family: var(--font-head); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.field { display: flex; flex-direction: column; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
input[type=color] { padding: 2px; height: 40px; }
input[type=checkbox] { width: auto; accent-color: var(--gold); }
.card { background: linear-gradient(160deg, rgba(20,54,38,.6), rgba(10,31,21,.9)); border: 1px solid rgba(201,162,39,.3); border-radius: var(--radius); padding: 16px 18px; transition: border-color .25s, transform .25s, box-shadow .25s; }
.card:hover { border-color: rgba(201,162,39,.7); box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.card.link-card { display: block; }
.link-card:hover { transform: translateY(-3px); }
.item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 8px; background: rgba(5,18,12,.45); border: 1px solid rgba(201,162,39,.18); margin-bottom: 8px; transition: border-color .2s, background .2s; }
.item:hover { border-color: rgba(201,162,39,.5); background: rgba(20,54,38,.4); }
.item.done { opacity: .5; }
.item.done .item-title { text-decoration: line-through; }
.item-title { flex: 1; font-size: 1.05rem; }
.item-actions { display: flex; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-family: var(--font-head); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; border: 1px solid; white-space: nowrap; }
.badge.urgent { color: #f3a8b0; border-color: rgba(179,50,63,.7); background: rgba(179,50,63,.15); }
.badge.medium { color: #f2cf7a; border-color: rgba(208,138,31,.7); background: rgba(208,138,31,.15); }
.badge.low { color: #9ee0bb; border-color: rgba(63,191,127,.6); background: rgba(63,191,127,.12); }
.badge.exam { color: #f3a8b0; border-color: rgba(179,50,63,.7); background: rgba(179,50,63,.15); }
.badge.event { color: var(--gold-light); border-color: rgba(201,162,39,.6); background: rgba(201,162,39,.12); }
.badge.assignment { color: #9ee0bb; border-color: rgba(63,191,127,.6); background: rgba(63,191,127,.12); }
.badge.completed { color: #9ee0bb; border-color: rgba(63,191,127,.6); }
.badge.pending { color: var(--silver); border-color: rgba(196,204,199,.4); }
.badge.subject { color: var(--silver-bright); border-color: rgba(196,204,199,.35); background: rgba(196,204,199,.06); }
.stat { text-align: center; padding: 20px 14px; }
.stat .num { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; }
.stat .lbl { font-family: var(--font-head); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--silver-dim); margin-top: 4px; }
.hub-tile { text-align: center; padding: 26px 18px; }
.hub-tile i { font-size: 2rem; color: var(--gold); margin-bottom: 10px; display: block; transition: transform .35s; }
.hub-tile:hover i { transform: rotate(-8deg) scale(1.15); }
.hub-tile h3 { color: var(--silver-bright); font-size: 1rem; }
.hub-tile p { margin: 6px 0 0; color: var(--silver-dim); font-size: .9rem; font-style: italic; }
.habit-wrap { overflow-x: auto; }
.habit-table { border-collapse: separate; border-spacing: 2px; width: 100%; min-width: 900px; }
.habit-table th, .habit-table td { text-align: center; font-size: .8rem; }
.habit-table th { color: var(--gold); font-family: var(--font-head); font-weight: 600; padding: 6px 2px; }
.habit-table th.today, .habit-table td.today { background: rgba(201,162,39,.12); }
.habit-table th.weekend { color: var(--silver-dim); }
.habit-table td.name { text-align: left; padding: 6px 10px; color: var(--silver-bright); min-width: 160px; white-space: nowrap; font-size: 1rem; }
.habit-table td.name .del { opacity: 0; margin-left: 6px; color: var(--danger); cursor: pointer; transition: opacity .2s; }
.habit-table tr:hover td.name .del { opacity: 1; }
.habit-cell { width: 26px; height: 26px; border-radius: 5px; margin: auto; cursor: pointer; background: rgba(5,18,12,.6); border: 1px solid rgba(201,162,39,.2); display: flex; align-items: center; justify-content: center; transition: all .2s; }
.habit-cell:hover { border-color: var(--gold); box-shadow: 0 0 8px rgba(201,162,39,.35); }
.habit-cell.on { background: radial-gradient(circle at 30% 30%, #3fbf7f, #1f5a3a); border-color: var(--emerald); }
.habit-cell .scale { width: 16px; height: 16px; transform: scale(0); transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.habit-cell.on .scale { transform: scale(1); }
.habit-table td.total { color: var(--gold-light); font-family: var(--font-head); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-family: var(--font-head); font-size: .75rem; letter-spacing: .12em; color: var(--gold); padding: 6px 0; }
.cal-day { min-height: 96px; padding: 6px; border-radius: 6px; background: rgba(5,18,12,.5); border: 1px solid rgba(201,162,39,.15); display: flex; flex-direction: column; gap: 3px; cursor: pointer; transition: border-color .2s; }
.cal-day:hover { border-color: rgba(201,162,39,.6); }
.cal-day.other { opacity: .35; }
.cal-day.today { border-color: var(--gold); box-shadow: inset 0 0 14px rgba(201,162,39,.15); }
.cal-day .d { font-family: var(--font-head); font-size: .8rem; color: var(--silver-dim); }
.cal-day.today .d { color: var(--gold-light); font-weight: 700; }
.cal-ev { font-size: .72rem; padding: 2px 6px; border-radius: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-left: 3px solid; background: rgba(0,0,0,.3); }
.cal-ev.event { border-color: var(--gold); color: var(--gold-light); }
.cal-ev.exam { border-color: var(--danger); color: #f3a8b0; }
.cal-ev.assignment { border-color: var(--emerald); color: #9ee0bb; }
.cal-ev.done { opacity: .5; text-decoration: line-through; }
.list-date { font-family: var(--font-head); color: var(--gold); letter-spacing: .1em; margin: 18px 0 8px; font-size: .9rem; display: flex; align-items: center; gap: 10px; }
.list-date::after { content: ''; flex: 1; height: 1px; background: rgba(201,162,39,.3); }
.toggle-group { display: inline-flex; border: 1px solid rgba(201,162,39,.5); border-radius: 999px; overflow: hidden; }
.toggle-group button { background: transparent; border: 0; color: var(--silver); padding: 8px 18px; cursor: pointer; font-family: var(--font-head); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; transition: all .2s; }
.toggle-group button.active { background: var(--gold-grad); color: #1b1503; font-weight: 700; }
.pomo-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.pomo-ring { position: relative; width: 340px; height: 340px; margin: 0 auto; }
.pomo-ring svg { width: 100%; height: 100%; overflow: visible; }
.pomo-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.pomo-time { font-family: var(--font-display); font-size: 3rem; font-weight: 700; line-height: 1; }
.pomo-phase { font-family: var(--font-head); letter-spacing: .2em; text-transform: uppercase; font-size: .8rem; color: var(--silver-dim); margin-top: 8px; }
.pomo-round { font-size: .85rem; color: var(--gold); margin-top: 4px; }
.pomo-controls { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.round-dots { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.round-dots span { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--gold); background: transparent; transition: background .3s; }
.round-dots span.done { background: var(--gold-grad); box-shadow: 0 0 8px var(--gold); }
.round-dots span.cur { background: var(--emerald); border-color: var(--emerald); animation: pulse 1.5s infinite; }
.snake-head-anim { transition: transform .9s linear; }
.gpa-big { font-family: var(--font-display); font-size: 3.4rem; font-weight: 900; line-height: 1; }
.grade-pill { font-family: var(--font-head); font-weight: 700; padding: 4px 10px; border-radius: 6px; color: #1b1503; background: var(--gold-grad); min-width: 52px; text-align: center; }
.grade-pill.low { background: linear-gradient(135deg, #e07a85, #b3323f); color: #fff; }
.grade-pill.mid { background: linear-gradient(135deg, #f2cf7a, #d08a1f); }
.chart-box { position: relative; height: 220px; }
.grade-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.grade-table th { text-align: left; color: var(--gold); font-family: var(--font-head); font-weight: 600; font-size: .75rem; letter-spacing: .1em; padding: 6px 8px; border-bottom: 1px solid rgba(201,162,39,.3); }
.grade-table td { padding: 7px 8px; border-bottom: 1px solid rgba(201,162,39,.12); }
.note-card { position: relative; }
.note-card .note-date { font-family: var(--font-head); color: var(--gold); font-size: .8rem; letter-spacing: .1em; }
.note-card h3 { color: var(--silver-bright); margin: 6px 0 8px; font-size: 1.1rem; }
.note-card p { white-space: pre-wrap; line-height: 1.55; margin: 0; }
.note-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.note-card:hover .note-actions { opacity: 1; }
.subject-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.subject-tab { padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(201,162,39,.4); cursor: pointer; font-family: var(--font-head); font-size: .8rem; letter-spacing: .08em; background: rgba(5,18,12,.5); color: var(--silver); transition: all .2s; display: inline-flex; align-items: center; gap: 8px; }
.subject-tab:hover { border-color: var(--gold); color: var(--gold-light); }
.subject-tab.active { background: var(--gold-grad); color: #1b1503; font-weight: 700; border-color: var(--gold-light); }
.subject-tab .x { opacity: .6; } .subject-tab .x:hover { opacity: 1; color: var(--danger); }
.toast { position: fixed; bottom: 26px; right: 26px; z-index: 100; padding: 12px 20px; border-radius: 8px; background: linear-gradient(160deg, var(--bg-3), var(--bg)); border: 1px solid var(--gold); color: var(--silver-bright); font-family: var(--font-head); font-size: .85rem; letter-spacing: .06em; transform: translateY(20px); opacity: 0; pointer-events: none; transition: all .3s; box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 16px rgba(201,162,39,.3); }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.err { border-color: var(--danger); }
.empty { text-align: center; padding: 34px; color: var(--silver-dim); font-style: italic; }
.empty i { display: block; font-size: 2rem; color: var(--gold-dark); margin-bottom: 10px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 90; backdrop-filter: blur(3px); }
.modal { width: min(560px, 92vw); max-height: 90vh; overflow: auto; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--green), var(--gold-dark)); border-radius: 6px; }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .3s; }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .main { padding: 70px 18px 40px; }
  .pomo-wrap { grid-template-columns: 1fr; }
  .page-title { font-size: 1.5rem; }
  .cal-day { min-height: 64px; }
}
