/* Campus Chaos v0.6 — expressive student planner. Chaotic, funny, easy to read.
 *
 * Identity: a student planner pushed past its limit. Bold but controlled colour,
 * expressive typography, campus/noticeboard motifs, distinct visual states, and
 * clear cause-and-effect feedback. No gradients, no glass, no dashboard glow.
 *
 * The underlying game logic (choices, meters, save/load, keyboard) is untouched;
 * only the presentation changes. Every ID and class the JS targets is preserved.
 */

:root {
  /* Bold but controlled palette. */
  --ink: #161615;            /* near-black text */
  --paper: #fffdf3;          /* planner paper */
  --desk: #e7e0cc;           /* desktop surface */
  --line: #3d3a33;           /* rules / borders */
  --muted: #6b6455;          /* secondary text */

  /* Controlled accent roles — never competing for attention. */
  --accent: #c0392b;         /* stress / danger / exams (warm red) */
  --accent-soft: #fbe7e3;    /* danger tint */
  --pos: #1e7a46;            /* good / progress */
  --pos-soft: #e6f2e9;       /* good tint */
  --gold: #e8a33d;           /* highlights / rent / weekends */
  --gold-soft: #fdf3d7;
  --chaos: #7b2cbf;          /* expressive punctuation (rare events) */

  --radius: 10px;
  --card-shadow: 4px 4px 0 var(--line);
  --focus: 3px solid var(--chaos);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--desk);
  background-image: radial-gradient(#d5cdb4 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

/* Expressive display type: loud, confident, a little unruly. */
h1, h2, .kicker, .notice h2, .planner-head h1, .stamp, .m-label {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  margin: 0 0 6px;
  color: var(--muted);
}
h1 { margin: 0; font-size: clamp(26px, 5vw, 40px); line-height: 1.1; }
.sub { margin: 4px 0 0; color: var(--muted); font-style: italic; font-size: 0.95rem; }

.desk { max-width: 1020px; margin: 0 auto; padding: 16px; }

.stamp {
  display: inline-block;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border: 2px solid var(--line);
  padding: 1px 8px;
  transform: rotate(-1.5deg);
  background: #fff;
  vertical-align: middle;
}
.upcoming {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.up-item {
  border: 1.5px dashed var(--line);
  background: #fff;
  padding: 2px 8px;
}
.up-item.hot {
  border-style: solid;
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.warn-tag {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-style: normal;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  padding: 0 5px;
  margin-left: 4px;
  font-weight: 700;
}

/* ── Start screen ── */
.start-screen {
  position: fixed;
  inset: 0;
  background: rgba(22, 22, 21, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.start-card {
  max-width: 520px;
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: var(--card-shadow);
  padding: 22px;
  border-radius: var(--radius);
}
.start-card h2 { margin: 4px 0 6px; font-size: clamp(20px, 4vw, 28px); }

button:focus-visible, summary:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

/* Disabled state keeps strong contrast. */
.choices button:disabled {
  cursor: not-allowed;
  background: #eae6db;
  color: #8a8678;
  border-color: #b9b2a2;
}
.choices button:disabled small { color: #a8a294; }

.diff-row { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.diff-row button { padding: 10px 14px; font-size: 13px; min-height: 44px; }
button, .choices button { min-height: 44px; }

kbd.hotkey {
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 3px 5px;
  margin-left: auto;
  opacity: 0.85;
  align-self: center;
}
#end-epis p {
  background: #fff;
  border: 1.5px solid var(--line);
  padding: 8px 10px;
  font-size: 14px;
  margin: 6px 0;
}
#end-epis p b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  display: block;
  color: var(--muted);
}
.meter.danger { outline: 4px solid var(--accent); outline-offset: -2px; }
.meter.danger .m-val { color: var(--accent); }
.exam-tag {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--accent);
  color: #fff;
  border: 1.5px solid var(--line);
  padding: 0 6px;
  font-weight: 700;
}

/* ── Calendar ── */
.calendar {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  flex-wrap: wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.cal-day {
  border: 1.5px solid var(--line);
  background: #fff;
  padding: 2px 7px;
  min-width: 44px;
  min-height: 44px;
  text-align: center;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.cal-day.now { background: var(--ink); color: var(--paper); }
.cal-day.done { background: #eae6db; text-decoration: line-through; color: #8a8678; }
.cal-day.weekend { border-style: dashed; color: var(--accent); }
.cal-day.deadline { border-bottom: 4px solid var(--accent); }

/* ── Header shell ── */
.planner-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--paper);
  border: 2px solid var(--line);
  padding: 14px 16px;
  box-shadow: var(--card-shadow);
  border-radius: var(--radius);
}
.head-actions { display: flex; gap: 8px; align-items: start; flex-wrap: wrap; }

button {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--line);
  border-radius: 8px;
}
button:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--line); }
button.primary { background: var(--ink); color: var(--paper); }
button.primary:active { box-shadow: 1px 1px 0 var(--line); }

/* ── Meters ── */
.meters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.meter {
  background: var(--paper);
  border: 2px solid var(--line);
  padding: 8px 10px;
  box-shadow: var(--card-shadow);
  border-radius: var(--radius);
  transition: border-color 0.15s, outline-color 0.15s;
}
@media (prefers-reduced-motion: reduce) {
  .meter { transition: none; }
}
.meter.danger {
  border-color: var(--accent);
  outline: 4px solid var(--accent);
  outline-offset: -2px;
  animation: meterPulse 1.2s infinite alternate;
}
@keyframes meterPulse {
  from { outline-color: var(--accent); }
  to { outline-color: #8a271f; }
}
.meter.danger .m-val { color: var(--accent); font-weight: 800; }
.m-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.m-val { float: right; font-weight: 800; font-size: 1.1rem; }
.m-bar { height: 12px; border: 2px solid var(--line); margin-top: 6px; background: #fff; border-radius: 6px; }
.m-bar > div { height: 100%; width: 50%; background: var(--ink); border-radius: 4px; transition: width 0.2s ease, background-color 0.2s ease; }
@media (prefers-reduced-motion: reduce) { .m-bar > div { transition: none; } }
.m-bar.money > div { background: var(--pos); }
.m-bar.bad > div { background: var(--accent); }
.m-bar.stress-high > div { background: var(--accent); }
.m-note { font-size: 11.5px; color: var(--muted); font-style: italic; }

/* ── Layout: notice board + planner log ── */
.board { display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; }

.notice {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--line);
  padding: 22px 18px 18px;
  box-shadow: var(--card-shadow);
  border-radius: var(--radius);
  min-height: 420px;
}
.pin {
  position: absolute;
  top: -12px;
  left: 14px;
  width: 22px;
  height: 22px;
  background: var(--accent);
  border: 2px solid var(--line);
  border-radius: 50%;
}
.notice-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  letter-spacing: 0.08em;
}
.notice h2 {
  margin: 6px 0 10px;
  font-size: clamp(20px, 4vw, 26px);
  line-height: 1.2;
}
.choices {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.choices button {
  text-align: left;
  background: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  border: 2px solid var(--line);
  box-shadow: 2px 2px 0 var(--line);
  border-radius: 8px;
  transition: background 0.1s, border-color 0.1s, transform 0.05s;
}
@media (prefers-reduced-motion: reduce) {
  .choices button { transition: none; }
}
.choices button strong { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.choices button small { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.choices button:hover:not(:disabled) { background: var(--gold-soft); border-color: var(--gold); }
.choices button:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--line); }
.outcome {
  margin-top: 14px;
  border-top: 3px double var(--line);
  padding-top: 12px;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 2px solid var(--line);
}
.hidden { display: none !important; }
.deltas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.delta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  border: 1.5px solid var(--line);
  padding: 2px 8px;
  background: #fff;
  border-radius: 6px;
  font-weight: 700;
}
.delta.up { background: var(--pos-soft); border-color: var(--pos); color: #14532d; }
.delta.down { background: var(--accent-soft); border-color: var(--accent); color: #7f1d1d; }

/* ── Planner log sidebar ── */
.planner {
  background: var(--paper);
  border: 2px solid var(--line);
  padding: 12px 14px;
  box-shadow: var(--card-shadow);
  border-radius: var(--radius);
  align-self: start;
  position: sticky;
  top: 14px;
  max-height: 82vh;
  overflow-y: auto;
}
.planner h3 {
  margin: 0 0 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.14em;
}
.planner ol { margin: 0; padding-left: 20px; font-size: 13px; }
.planner li { margin-bottom: 6px; border-bottom: 1px dashed #c9c2ad; padding-bottom: 6px; }
.planner li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.fineprint { font-size: 12.5px; color: var(--muted); }
pre {
  background: #fff;
  border: 1.5px solid var(--line);
  padding: 8px;
  font-size: 11.5px;
  overflow: auto;
  border-radius: 6px;
}
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
footer { margin-top: 14px; color: var(--muted); font-size: 0.9rem; }
code {
  background: #fff;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ── Responsive ── */
@media (max-width: 820px) {
  .meters { grid-template-columns: repeat(2, 1fr); }
  .board { grid-template-columns: 1fr; }
  .planner { position: static; max-height: none; width: 100%; }
}
@media (max-width: 520px) {
  .meters { grid-template-columns: 1fr; }
  .desk { padding: 10px; }
  .planner-head { padding: 10px 12px; }
}

/* Reduced motion: disable non-essential animation entirely. */
@media (prefers-reduced-motion: reduce) {
  .meter.danger { animation: none; }
}

/* ===== Rush days (Campus Rush in a frame, 2026-11-07) ===== */
.rush-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(22, 22, 21, .72); display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top, 0px)) 12px 12px; }
.rush-overlay.hidden { display: none; }
.rush-card { width: min(1100px, 100%); max-height: 100%; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; padding: 12px; display: grid; gap: 10px; grid-template-rows: auto minmax(0, 1fr) auto; }
.rush-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.rush-head h2 { margin: 0; font-size: 1.2rem; }
.rush-status { margin: 0; font-size: .95rem; }
.rush-frame { min-height: 0; }
.rush-frame iframe { display: block; width: 100%; height: min(72vh, 680px); border: 1px solid var(--ink); border-radius: 8px; background: #fff; }
.rush-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
body.rush-active { overflow: hidden; }


/* Campus Chaos 2.0: mode cards + morning briefing */
.mode-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 14px 0 10px; }
.mode-card { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 14px; text-decoration: none; color: inherit;
  border: 2px solid currentColor; border-radius: 10px; background: transparent; cursor: pointer; font: inherit; }
.mode-card b { font-size: 1.05rem; } .mode-card small { opacity: .8; line-height: 1.35; }
.mode-card.primary { box-shadow: 4px 4px 0 currentColor; }
.mode-card:focus-visible { outline: 3px solid #f5b301; outline-offset: 2px; }
.rush-brief { font-size: 1.05rem; line-height: 1.5; margin: 10px 0; padding: 12px 14px; border-left: 4px solid #f5b301; background: rgba(245,179,1,.08); }
