:root { --bg: #f5f5f7; --card: #fff; --ink: #1f1d1a; --muted: #6e6e73; --line: #e5e5ea; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }
[hidden] { display: none !important; }

.top, main, footer { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.stripe { display: flex; height: 6px; border-radius: 0 0 6px 6px; overflow: hidden; }
.stripe i { flex: 1; }
.stripe i:nth-child(1) { background: #bc2a58; }
.stripe i:nth-child(2) { background: #cc9500; }
.stripe i:nth-child(3) { background: #f56e1e; }
.stripe i:nth-child(4) { background: #0f9269; }
.stripe i:nth-child(5) { background: #1b74e4; }

.top-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
h1 { font-size: 30px; margin: 20px 0 12px; letter-spacing: -0.02em; }
.sync { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
button {
  font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
}

.dates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; }
.date {
  flex: 0 0 auto; min-width: 76px; text-align: center; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 12px;
}
.date.selected { background: var(--ink); border-color: var(--ink); color: #fff; }
.date span { display: block; }
.date-name { font-size: 12px; opacity: 0.75; }
.date-num { font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.card {
  background: var(--card); border-radius: 18px; border-top: 6px solid var(--hall);
  padding: 14px 18px 18px; min-width: 0; overflow-wrap: anywhere; scroll-margin-top: 12px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
h2 { margin: 0; font-size: 21px; }
.college { color: var(--muted); font-size: 13px; }
.rec { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--bg); }
.note, .empty { color: var(--muted); }
.warn { color: #b3261e; font-size: 13px; }

.meal { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 13px; }
.pill { padding: 2px 10px; border-radius: 999px; background: #6e6e73; color: #fff; }
.pill-breakfast { background: #d26500; }
.pill-brunch { background: #a67400; }
.pill-lunch { background: #15843f; }
.pill-dinner { background: #5b52d6; }
.time { color: var(--muted); font-weight: 400; }
ul { margin: 0; padding-left: 18px; }
li { margin: 2px 0; }
details { margin-top: 8px; }
summary { cursor: pointer; color: var(--muted); font-size: 13px; }
h4 { margin: 10px 0 2px; font-size: 16px; color: var(--hall); }

footer { color: var(--muted); font-size: 12px; padding-top: 20px; padding-bottom: 32px; }

.meals { display: flex; gap: 8px; padding-bottom: 12px; }
.others { color: var(--muted); font-size: 13px; }

/* ---------- favorite dishes */
.favs { background: var(--card); border-radius: 18px; padding: 12px 14px; margin-bottom: 16px; overflow-wrap: anywhere; }
.favs form { display: flex; gap: 8px; margin-bottom: 8px; }
.favs input { flex: 1; min-width: 0; }
.favs p { margin: 8px 0 0; }
.fav-list { margin-top: 8px; font-size: 14px; }
.picks { list-style: none; padding-left: 0; }
.picks li { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-radius: 6px; padding: 0 0 0 6px; }
.picks li.fav { background: #fdf1d3; }
/* these bounce when something is saved, and only a box can be scaled */
#tab-count, button.star { display: inline-block; }
.card .picks li > span { font-size: 13px; color: var(--muted); }
.station { display: block; font-size: 16px; font-weight: 700; line-height: 1.5; color: var(--hall); }
.tops li { margin-bottom: 4px; }
.card h3 .meal-name { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
/* A hall with no hours has no heading, so its first dish needs no second line above it. */
.paper .card .meal > .tops:first-child li:first-child { border-top: 0; }
.card .meal > .tops:first-child { margin-top: 8px; }
button.star { flex: 0 0 auto; border: 0; background: none; padding: 0 6px; font-size: 18px; line-height: 28px; color: #a67400; }
button.star[aria-pressed="true"] { background: none; color: #a67400; }
.fav-here { background: #fdf1d3; }

/* ---------- tabs */
.tabs { display: flex; gap: 6px; padding-top: 14px; }
.tabs a { text-decoration: none; font-weight: 600; padding: 6px 16px; border-radius: 999px; color: var(--muted); }
.tabs a[aria-current="page"] { background: var(--ink); color: #fff; }
.tabs a.brand { color: var(--ink); font-weight: 600; font-size: 17px; padding-left: 0; margin-right: 8px; }

/* ---------- home */
/* Editorial layout on warm paper, in one round font. */
.home-page { background: #faf9f6; }
.home { max-width: 640px; padding-top: 10vh; padding-bottom: 48px; font-family: Poppins, "Segoe UI", sans-serif; }
/* The title has one college color per letter. */
.home h1 { font-size: clamp(52px, 13vw, 88px); font-weight: 500; line-height: 1.15; margin: 0; }
.cmc { color: #bc2a58; }
.hmc { color: #cc9500; }
.pitzer { color: #f56e1e; }
.scripps { color: #0f9269; }
.pomona { color: #1b74e4; }
/* Hidden until someone presses the C often enough. It takes no room, so nothing jumps. */
.credit { visibility: hidden; height: 20px; margin: -24px 0 4px; color: var(--muted); font-size: 13px; }
.credit.found { visibility: visible; }
/* Fast taps on the C should neither zoom nor select it. */
#egg-c { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.tagline { margin: 6px 0 52px; color: var(--muted); font-size: clamp(18px, 4.5vw, 22px); }
.tools { border-top: 1px solid #e8e3da; }
.tool {
  display: flex; align-items: center; gap: 24px; padding: 26px 4px;
  border-bottom: 1px solid #e8e3da; text-decoration: none;
}
.tool img { flex: 0 0 auto; width: 80px; height: 80px; }
.tool-name { display: block; font-size: 28px; font-weight: 600; }
.tool-line { display: block; color: var(--muted); font-size: 15px; }
.tool-arrow { margin-left: auto; color: var(--muted); font-size: 30px; transition: transform 0.2s; }
.tool:hover, .tool:focus-visible { background: #f4f1eb; }
.tool:hover .tool-arrow, .tool:focus-visible .tool-arrow { transform: translateX(6px); color: var(--ink); }
/* Slow unfold when the home page opens. Skipped for people who asked for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .home h1, .tagline, .tool, .quote { animation: unfold 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
  .tagline { animation-delay: 0.35s; }
  .tool:nth-child(1) { animation-delay: 0.7s; }
  .tool:nth-child(2) { animation-delay: 0.95s; }
  .quote { animation-delay: 1.2s; }
}
@keyframes unfold { from { opacity: 0; transform: translateY(28px) scale(0.96); } }

.quote { margin: 52px 0 0; overflow-wrap: anywhere; }
.quote blockquote { margin: 0 0 12px; font-size: 22px; line-height: 1.6; font-style: italic; }
.quote blockquote::before { content: "\201C"; }
.quote blockquote::after { content: "\201D"; }
.quote figcaption { color: var(--muted); font-size: 14px; }
.quote cite { font-style: normal; }
.quote cite::before { content: " · "; }

/* ---------- course planner */
.planner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.switch { display: none; }
input[type="search"], select {
  font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); max-width: 100%;
}
input[type="search"] { width: 100%; }
.search-row { display: flex; gap: 8px; }
.search-row button { flex: 0 0 auto; }
#filter-button.active { border-color: var(--ink); font-weight: 700; }
.filter-panel { display: grid; gap: 8px; }
.filters { display: grid; gap: 8px; margin-bottom: 12px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.label { color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.course { background: var(--card); border-radius: 14px; padding: 0 14px; margin: 0 0 8px; overflow-wrap: anywhere; }
.course > summary { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; color: var(--ink); font-size: 15px; list-style: none; }
.course > summary::-webkit-details-marker { display: none; }
.code { font-size: 12px; font-weight: 700; color: var(--muted); }
.title { font-weight: 600; }
.meta { flex: 0 0 auto; align-self: center; text-align: right; color: var(--muted); font-size: 12px; }
.section { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 8px 0; }
.section.on { box-shadow: inset 3px 0 0 var(--ink); padding-left: 10px; }
.section-info { min-width: 0; font-size: 14px; }
.detail, .seats { color: var(--muted); font-size: 12px; }
.bar { display: inline-block; vertical-align: middle; width: 90px; height: 8px; margin-right: 8px; border-radius: 4px; overflow: hidden; background: #d8d8de; }
.used { display: block; height: 100%; background: #15843f; }
.used.full { background: #b3261e; }
.state { font-weight: 700; }
.state-O, .state-R { color: #15843f; }
.state-C { color: #b3261e; }
.desc { font-size: 13px; }
.prereq { font-size: 13px; margin: 4px 0 8px; }
.prereq a { white-space: nowrap; }
button.add { background: var(--ink); border-color: var(--ink); color: #fff; }
.section button, .picked button { flex: 0 0 auto; }
.more { display: block; margin: 8px auto; }

.schedule { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.panel { background: var(--card); border-radius: 18px; padding: 14px; }
.week { display: grid; column-gap: 3px; margin-top: 8px; }
.day-name { text-align: center; font-size: 12px; font-weight: 600; padding-bottom: 4px; }
.hours { position: relative; }
.hours span { position: absolute; right: 4px; font-size: 11px; color: var(--muted); }
.day { position: relative; overflow: hidden; background-color: #fafafc; background-image: linear-gradient(var(--line) 1px, transparent 1px); }
.block { position: absolute; overflow: hidden; border-radius: 6px; border: 1px solid #fff; padding: 1px 4px; color: #fff; font-size: 11px; line-height: 1.25; }
.block strong, .block span { display: block; }
.block.ghost { background: rgba(31, 29, 26, 0.14); border: 1px dashed var(--ink); color: var(--ink); }
.picked { list-style: none; padding: 0; margin-top: 10px; }
.picked li { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-left: 5px solid var(--c); padding: 2px 0 2px 10px; margin: 6px 0; font-size: 13px; }
.pick-text { flex: 1; min-width: 0; }
.pick-line { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.pick-line strong { white-space: nowrap; }
.pick-title { flex: 1 1 80px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked button { padding: 0 10px; font-size: 18px; line-height: 26px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ---------- save, print, share */
.actions { position: relative; margin: 0; }
.actions > summary { list-style: none; color: var(--ink); padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); }
.actions > summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: grid; gap: 6px; width: max-content; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); }
button:disabled { opacity: 0.45; cursor: default; }
#share-link { width: 100%; font: inherit; font-size: 13px; padding: 6px 10px; margin-top: 8px; border-radius: 10px; border: 1px solid var(--line); }
.shared-note { background: var(--card); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.planner.shared { grid-template-columns: minmax(0, 1fr); }
.planner.shared .switch, .planner.shared .search, .planner.shared .actions, .planner.shared #untimed { display: none; }
.planner.shared .schedule { display: block; position: static; max-height: none; }
#print-sheet { display: none; }
@media print {
  .courses-page { background: #fff; }
  .courses-page > :not(#print-sheet) { display: none !important; }
  .courses-page #print-sheet { display: block; }
  #print-image { display: block; max-width: 100%; max-height: 185mm; margin: 0 auto; }
}

@media (max-width: 860px) {
  .planner { grid-template-columns: minmax(0, 1fr); }
  .switch { display: flex; gap: 8px; }
  .switch button { flex: 1; }
  .planner[data-view="search"] .schedule, .planner[data-view="schedule"] .search { display: none; }
  .schedule { position: static; max-height: none; }
  .panel { padding: 10px 8px; }
  .block { padding: 1px 2px; font-size: 10px; }
}

/* ---------- Dining and Courses in the home page style: warm paper, round font, thin rules */
.paper { --bg: #faf9f6; --card: #ffffff; --line: #e8e3da; --soft: #f4f1eb; font-family: Poppins, "Segoe UI", sans-serif; }
.paper h1 { font-weight: 500; }
.paper h2, .paper .title { font-weight: 600; }
.paper button, .paper .date { background: transparent; }
.paper button.add, .paper button[aria-pressed="true"], .paper .date.selected { background: var(--ink); }
.paper button.star[aria-pressed="true"] { background: none; }

/* Dining: each hall is a block under a line in its color, not a card. */
.paper .grid { column-gap: 32px; row-gap: 36px; }
.paper .card { background: none; border-radius: 0; border-top-width: 3px; padding: 14px 0 0; }
.paper .meal { border-color: var(--line); }
.paper .rec { background: var(--soft); }
.paper .fav-here { background: #fdf1d3; }
.paper .favs { background: none; border-radius: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; margin-bottom: 28px; }

/* Courses: results are rows between lines, the schedule sits under one line. */
.paper #results:not(:empty) { border-top: 1px solid var(--line); }
.paper #results > .empty { margin: 14px 0; }
.paper .course { background: none; border-radius: 0; border-bottom: 1px solid var(--line); margin: 0; padding: 0 4px; }
.paper .course > summary:hover { background: var(--soft); }
.paper .panel { background: none; border-radius: 0; border-top: 1px solid var(--line); padding: 12px 0; }
.paper .day { background-color: #f5f3ee; }
.paper .menu { background: var(--card); }
.paper .shared-note { background: none; border-radius: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; }
@media print { .paper.courses-page { background: #fff; } }
@media (max-width: 360px) { .paper .tabs { gap: 2px; } .paper .tabs a { padding-left: 10px; padding-right: 10px; } .paper .tabs a.brand { padding-left: 0; padding-right: 0; } }

/* ---------- phones: app layout with a bar at the bottom */
.bottom-nav, .date .date-short, .paper #fav-toggle { display: none; }
@media screen and (max-width: 700px) {
  .paper { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .paper .tabs { display: none; }
  body.paper { touch-action: pan-y pinch-zoom; }     /* sideways swipes switch pages */
  .paper .bottom-nav {
    display: flex; align-items: flex-end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff;
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a { flex: 1; text-align: center; text-decoration: none; padding: 9px 0 10px; font-size: 11px; font-weight: 600; color: #77736c; }
  .bottom-nav a[aria-current="page"] { color: var(--ink); }
  .bottom-nav svg { display: block; width: 24px; height: 24px; margin: 0 auto 2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  /* Home sits in the middle, raised, with a ring in the five college colors. */
  .bottom-nav a.home-link { color: var(--ink); }
  .bottom-nav .knob {
    display: block; width: 64px; height: 64px; margin: -34px auto 2px; padding: 4px; border-radius: 50%;
    background: conic-gradient(#bc2a58 0 20%, #cc9500 0 40%, #f56e1e 0 60%, #0f9269 0 80%, #1b74e4 0);
    box-shadow: 0 0 0 4px #fff, 0 6px 16px rgba(0, 0, 0, 0.25);
  }
  .bottom-nav .knob svg { width: 100%; height: 100%; margin: 0; padding: 12px; border-radius: 50%; background: #fff; }

  .paper h1 { font-size: 34px; margin: 18px 0 10px; }
  .paper .sync { font-size: 12px; }

  /* date row without scrolling, meal and view switches as one segmented bar */
  .paper .dates { gap: 2px; overflow: visible; }
  .paper .date { flex: 1 1 0; min-width: 0; padding: 7px 0; border-color: transparent; white-space: nowrap; }
  .paper .date-name, .paper .date-short { font-size: 11px; }
  .paper .date-num { font-size: 13px; }
  .paper .date.tomorrow .date-name { display: none; }
  .paper .date.tomorrow .date-short { display: block; order: -1; opacity: 0.75; }
  .paper .date.tomorrow { display: flex; flex-direction: column; }
  .paper .meals, .paper .switch { gap: 0; background: #eee8de; border-radius: 12px; padding: 3px; margin-bottom: 12px; }
  .paper .meals button, .paper .switch button { flex: 1; border: 0; border-radius: 10px; min-height: 38px; }
  .paper .meals button[aria-pressed="true"], .paper .switch button[aria-pressed="true"] { background: transparent; color: var(--ink); font-weight: 600; }

  /* The white highlight is one shape behind the buttons, so it can slide to the tapped one. */
  .paper .meals, .paper .switch { position: relative; }
  .paper .meals button, .paper .switch button { position: relative; z-index: 1; }
  .paper .meals::before, .paper .switch::before {
    content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; border-radius: 10px; background: #fff;
  }
  .paper .meals::before { width: calc((100% - 6px) / 3); }
  .paper .switch::before { width: calc((100% - 6px) / 2); }
  .paper .meals:has(button:nth-child(2)[aria-pressed="true"])::before,
  .paper .switch:has(button:nth-child(2)[aria-pressed="true"])::before { transform: translateX(100%); }
  .paper .meals:has(button:nth-child(3)[aria-pressed="true"])::before { transform: translateX(200%); }

  /* favorites fold into one line */
  .paper .favs { background: #fdf1d3; border: 0; border-radius: 14px; padding: 0 14px; margin-bottom: 14px; }
  .paper #fav-toggle { display: flex; justify-content: space-between; width: 100%; border: 0; padding: 12px 0; font-weight: 600; text-align: left; }
  .paper #fav-toggle::after { content: "›"; }
  .paper .favs.open #fav-toggle::after { content: "⌄"; }
  .paper #fav-body { display: none; padding-bottom: 12px; }
  .paper .favs.open #fav-body { display: block; }

  /* halls and courses become white cards */
  .paper .grid { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
  .paper .card { background: #fff; border-top: 0; border-radius: 18px; padding: 14px 16px; }
  .paper .card h2 { font-size: 18px; display: flex; align-items: center; gap: 9px; }
  .paper .card h2::before { content: ""; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--hall); }
  .paper .card .picks li { border-top: 1px solid #f0ebe2; border-radius: 0; padding: 4px 0; min-height: 44px; }
  .paper .card .picks li.fav { background: #fdf1d3; padding-left: 8px; }
  .paper button.star { min-width: 40px; min-height: 40px; }

  .paper #results:not(:empty) { border-top: 0; }
  .paper .course { background: #fff; border: 0; border-radius: 16px; padding: 0 14px; margin-bottom: 8px; }
  .paper .course > summary:hover { background: none; }
  .paper .panel { background: #fff; border: 0; border-radius: 18px; padding: 12px 10px; }
  .paper input[type="search"], .paper .search-row button, .paper .section button { min-height: 42px; }
}

@media screen and (max-width: 700px) and (prefers-reduced-motion: no-preference) {
  .paper .meals::before, .paper .switch::before { transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.2, 1); }
}

/* ---------- phones: slide between pages. Browsers without page transitions just switch. */
@media screen and (max-width: 700px) and (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .bottom-nav { view-transition-name: bottom-nav; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.28s; animation-timing-function: cubic-bezier(0.3, 0.7, 0.2, 1); animation-fill-mode: both; mix-blend-mode: normal; }
  /* The page being opened decides the direction: Courses is to the right of Dining. */
  html:has(.courses-page)::view-transition-old(root) { animation-name: leave-left; }
  html:has(.courses-page)::view-transition-new(root) { animation-name: enter-right; }
  html:has(#halls)::view-transition-old(root) { animation-name: leave-right; }
  html:has(#halls)::view-transition-new(root) { animation-name: enter-left; }
}
@keyframes enter-right { from { transform: translateX(100%); } }
@keyframes enter-left { from { transform: translateX(-100%); } }
@keyframes leave-left { to { transform: translateX(-30%); opacity: 0.4; } }
@keyframes leave-right { to { transform: translateX(30%); opacity: 0.4; } }

/* ---------- extras menu */
header.top { position: relative; }
.menu-button, .paper button.menu-button {
  position: absolute; left: 16px; top: 18px; z-index: 3; width: 38px; height: 38px; padding: 0 9px;
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
}
.menu-button:hover, .menu-button:focus-visible { border-color: var(--ink); }
.menu-button span { display: block; height: 2px; border-radius: 1px; background: var(--ink); }
.paper .tabs { padding-left: 46px; min-height: 56px; align-items: center; padding-top: 18px; }
.drawer {
  position: fixed; inset: 0 auto 0 0; margin: 0; width: min(300px, 82vw); height: 100%; max-height: 100%; max-width: none;
  border: 0; padding: 0; background: #faf9f6; color: var(--ink); font-family: Poppins, "Segoe UI", sans-serif;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.2);
}
.drawer::backdrop { background: rgba(31, 29, 26, 0.4); }
.drawer-inside { min-height: 100%; padding: 16px 20px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.drawer-head h2 { font-weight: 600; }
.drawer-close { width: 38px; height: 38px; padding: 0; font-size: 22px; background: transparent; }
.drawer-item { display: block; padding: 14px 0; border-top: 1px solid #e8e3da; text-decoration: none; }
.drawer-item strong { display: block; font-size: 17px; font-weight: 600; }
.drawer-item span { color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: no-preference) {
  .drawer[open] { animation: drawer-in 0.25s cubic-bezier(0.3, 0.7, 0.2, 1); }
}
@keyframes drawer-in { from { transform: translateX(-100%); } }

/* ---------- 5C Blocks */
.game { display: grid; grid-template-columns: auto 200px; justify-content: center; align-items: start; gap: 8px 28px; padding-bottom: 24px; }
.board-wrap { position: relative; grid-column: 1; }
#board { display: block; height: clamp(320px, calc(100vh - 190px), 640px); aspect-ratio: 1 / 2; border: 1px solid var(--line); border-radius: 8px; touch-action: none; }
.cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(250, 249, 246, 0.78); border-radius: 8px; text-align: center; }
.cover p { margin: 0; font-size: 20px; font-weight: 600; }
.cover p:empty { display: none; }
.paper .cover button { background: var(--ink); border-color: var(--ink); color: #fff; font-size: 16px; padding: 10px 26px; }
.side { grid-column: 2; }
/* Time left to keep the combo going. It sits just above the board and takes no room. */
.combo-bar { position: absolute; left: 0; right: 0; top: -8px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.combo-bar[hidden] { display: none; }
.combo-bar i { display: block; height: 100%; background: #f56e1e; transform-origin: left; }
.combo-bar.bonus { box-shadow: 0 0 6px 2px #ffc21a, 0 0 14px 5px rgba(255, 150, 30, 0.65); }
@media (prefers-reduced-motion: no-preference) { .combo-bar.bonus { animation: combo-glow 0.7s ease-in-out infinite alternate; } }
@keyframes combo-glow { to { box-shadow: 0 0 9px 3px #ffd34d, 0 0 22px 9px rgba(255, 150, 30, 0.75); } }
.fx-combo span.fx-time { margin-left: 4px; background: #d26500; }
.stats { margin: 0 0 14px; }
.stats div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; }
.stats dt, .next span, .keys { color: var(--muted); font-size: 13px; }
.stats dd { margin: 0; font-weight: 600; }
.next { margin-bottom: 14px; }
.next span { display: block; }
#next { display: block; width: 96px; height: 48px; margin-top: 4px; }
.pad { display: none; }
@media (max-width: 700px), (pointer: coarse) {
  .pad { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 18px; width: 100%; max-width: 420px; justify-self: center; }
  /* Left thumb: big color blocks laid out like arrow keys. Right thumb: one round turn button. */
  .moves { flex: 1; max-width: 230px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .paper .pad button { padding: 0; border: 0; color: #fff; font-size: 34px; line-height: 1; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
  .paper .moves button { height: 68px; border-radius: 16px; }
  .paper .pad [data-act="left"] { background: #1b74e4; }
  .paper .pad [data-act="right"] { background: #0f9269; }
  .paper .pad [data-act="down"] { grid-column: 1 / -1; background: #f56e1e; }
  .paper .pad .turn { flex: 0 0 auto; width: 112px; height: 112px; border-radius: 50%; font-size: 52px; background: #bc2a58; }
  .paper .pad button:active { filter: brightness(0.8); transform: scale(0.96); }
  .keys { display: none; }
}
@media (max-width: 700px) {
  /* The button sits beside the page title, where the hidden top tabs were. */
  .paper header.top h1 { margin-left: 46px; }
  .paper .menu-button { top: 22px; left: 10px; }
  .game-page h1 { font-size: 26px; }
  .game { grid-template-columns: auto 92px; gap: 10px 12px; padding: 0 10px; }
  #board { height: clamp(260px, calc(100vh - 355px), 560px); height: clamp(260px, calc(100dvh - 355px), 560px); }
  .stats div { display: block; padding: 4px 0; }
  #next { width: 72px; height: 36px; }
  .side button { width: 100%; padding-left: 0; padding-right: 0; }
}

/* ---------- 5C Blocks effects. They sit on top and never catch a tap. */
.fx-canvas, .fx-flash { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 15; }
.fx-flash { opacity: 0; background: #fff; z-index: 14; }
.fx-combo { position: fixed; z-index: 16; pointer-events: none; text-align: center; white-space: nowrap; line-height: 1.1; transform: translate(-50%, -50%); }
.fx-combo strong { display: block; font-weight: 700; color: #f56e1e; -webkit-text-stroke: 0.14em #fff; paint-order: stroke fill; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.3)); }
.fx-combo span { display: inline-block; margin-top: 4px; padding: 2px 12px; border-radius: 999px; background: #1f1d1a; color: #fff; font-size: 0.42em; font-weight: 700; }
.fx-combo.wild strong { color: transparent; -webkit-text-stroke: 0; background: linear-gradient(90deg, #bc2a58, #cc9500, #f56e1e, #0f9269, #1b74e4, #bc2a58) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 8px #fff) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)); }
@media (prefers-reduced-motion: no-preference) {
  .fx-combo.wild strong { animation: fx-rainbow 0.6s linear infinite; }
}
@keyframes fx-rainbow { to { background-position: -200% 0; } }
#sound, #effects { margin-top: 8px; }
/* Short phones: tighten everything so the controls stay above the bottom bar. */
@media (max-width: 700px) and (max-height: 700px) {
  .game-page h1 { font-size: 22px; margin: 18px 0 6px; }
  .game { row-gap: 8px; padding-bottom: 0; }
  #board { height: clamp(220px, calc(100vh - 320px), 560px); height: clamp(220px, calc(100dvh - 320px), 560px); }
  .stats { margin-bottom: 4px; }
  .stats div { display: flex; padding: 0; }
  .stats dt, .stats dd, .next span { font-size: 11px; }
  .next { margin-bottom: 4px; }
  #next { width: 48px; height: 24px; margin-top: 0; }
  .paper .side button { min-height: 0; padding-top: 3px; padding-bottom: 3px; font-size: 11px; }
  #sound, #effects { margin-top: 4px; }
  .paper .moves button { height: 52px; font-size: 28px; }
  .paper .pad .turn { width: 92px; height: 92px; font-size: 42px; }
}

/* The game page has one slim title line and no bar at the bottom, to leave room for play. */
.paper.game-page { padding-bottom: env(safe-area-inset-bottom); }
.game-page header.top h1.crumb { display: flex; align-items: center; gap: 10px; min-height: 38px; margin: 12px 0 10px 46px; font-size: 20px; white-space: nowrap; }
.game-page .crumb .brand { text-decoration: none; font-weight: 600; }
.game-page .crumb .sep { color: var(--line); font-weight: 400; }
.game-page .menu-button { top: 18px; }
#restart { margin-top: 8px; }
#board { height: clamp(320px, calc(100vh - 120px), 640px); }
@media (max-width: 700px) {
  .game-page .menu-button { top: 12px; }
  .game { padding-bottom: 8px; }
  #board { height: clamp(240px, calc(100vh - 292px), 560px); height: clamp(240px, calc(100dvh - 292px), 560px); }
  #sound, #effects, #restart { margin-top: 8px; }
}
@media (max-width: 700px), (pointer: coarse) {
  .moves { max-width: 260px; gap: 10px; }
  .paper .moves button { height: 90px; border-radius: 20px; font-size: 44px; }
  .paper .pad .turn { width: 136px; height: 136px; font-size: 66px; }
}
@media (max-width: 700px) and (max-height: 700px) {
  .game-page header.top h1.crumb { margin-top: 8px; margin-bottom: 6px; font-size: 18px; }
  .game-page .menu-button { top: 8px; }
  #board { height: clamp(200px, calc(100vh - 238px), 560px); height: clamp(200px, calc(100dvh - 238px), 560px); }
  #sound, #effects, #restart { margin-top: 4px; }
  .paper .moves button { height: 68px; font-size: 34px; }
  .paper .pad .turn { width: 108px; height: 108px; font-size: 50px; }
}
@media (max-width: 360px) { .paper .pad .turn { width: 96px; height: 96px; } .pad { gap: 12px; } }
.drawer-item[aria-current="page"] strong::after { content: " •"; color: #f56e1e; }
/* Effects demo: a list of scenes beside the board. */
.scenes { grid-column: 3; grid-row: 1; width: 230px; }
.scenes h2 { font-size: 18px; margin: 0 0 4px; }
.scenes p { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
#scene-list { display: grid; gap: 6px; margin-top: 8px; }
.paper #scene-list button { text-align: left; }
.paper #all-scenes { width: 100%; background: var(--ink); border-color: var(--ink); color: #fff; }
.showing .keys, .showing #pause, .showing #restart { display: none; }
@media (min-width: 701px) { .showing .game { grid-template-columns: auto 200px 230px; } .showing .board-wrap { grid-row: 1; } .showing .side { grid-row: 1; } }
@media (max-width: 700px) { .scenes { grid-column: 1 / -1; grid-row: auto; width: 100%; } .showing .pad { display: none; } }
/* Keep the menu button level with the game title. */
.paper.game-page button.menu-button { top: 18px; left: 16px; }
@media (max-width: 700px) { .paper.game-page button.menu-button { left: 10px; } }
@media (max-width: 700px) and (max-height: 700px) { .paper.game-page button.menu-button { top: 14px; } }

/* ---------- the colleges on Instagram */
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px 16px; align-items: start; }
.ig-card { min-width: 0; border-top: 3px solid var(--hall); padding-top: 10px; }
.ig-card h2 { font-size: 18px; margin: 0 0 8px; color: var(--hall); }
.ig-date { margin: -4px 0 8px; font-size: 13px; color: var(--muted); }
.ig-card iframe[hidden] { display: none; }
.ig-card iframe { display: block; width: 100%; height: 420px; border: 0; border-radius: 10px; background: #fff; }
.ig-card a { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--muted); }
@media (max-width: 360px) { .ig-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- the safe door between the home page and Dining or Courses (vault.js) */
.vault { position: fixed; inset: 0; z-index: 3000; overflow: hidden; }
.vault-door, .vault-face { position: absolute; inset: 0; }
.vault-face { background: #faf9f6; }
.vault svg { position: absolute; fill: none; stroke: #1f1d1a; stroke-width: 1; }
.vault svg * { vector-effect: non-scaling-stroke; }
.vault-dial { --size: min(46vmin, 260px); left: calc(50% - var(--size) / 2); top: calc(50% - var(--size) / 2); width: var(--size); height: var(--size); }
.vault-spin { transform-box: view-box; transform-origin: 100px 100px; stroke-width: 3; stroke-linecap: round; }
.vault.closing { animation: vault-fade 0.2s ease-out backwards; }
.vault.closing .vault-spin { transform: rotate(216deg); animation: vault-turn 0.62s cubic-bezier(0.6, 0, 0.25, 1) 0.08s backwards; }
.vault.opening { pointer-events: none; }
.vault.opening .vault-spin { transform: rotate(216deg); }
.vault.opening.go .vault-spin { transform: rotate(288deg); transition: transform 1.1s cubic-bezier(0.65, 0, 0.35, 1); }
/* No line along the cut: a soft shadow appears as the halves start to part. */
.vault.opening .vault-door { filter: drop-shadow(0 0 0 rgba(31, 29, 26, 0)); }
.vault.opening.go .vault-door { filter: drop-shadow(0 0 14px rgba(31, 29, 26, 0.24)); transition: transform 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.1s, filter 0.3s ease; }
/* each half is 65% of the screen at its widest; a torn edge reaches a little further */
.vault.opening.go .left { transform: translateX(-69%); }
.vault.opening.go .right { transform: translateX(69%); }
.vault.opening.go.torn .left { transform: translateX(-85%); }
.vault.opening.go.torn .right { transform: translateX(85%); }
/* Wide screens: two triangles that part toward the top left and bottom right corners. */
@media (min-width: 701px) {
  .vault.opening.go .left { transform: translate(-54%, -54%); }
  .vault.opening.go .right { transform: translate(54%, 54%); }
  .vault.opening.go.torn .left { transform: translate(-66%, -66%); }
  .vault.opening.go.torn .right { transform: translate(66%, 66%); }
}
@keyframes vault-fade { from { opacity: 0; } }
@keyframes vault-turn { from { transform: rotate(0deg); } }
@media print { .vault { display: none; } }

/* ---------- action game punch (impact.js) */
button.pressed-down, a.pressed-down, summary.pressed-down { scale: 0.9; }
.shard { position: fixed; z-index: 2500; margin: -4px 0 0 -4px; pointer-events: none; }
.day.landing { overflow: visible; }
.day.landing .block { z-index: 1; }
/* the sound switch, top right: two choices in a capsule */
header.top .sound-switch { position: absolute; top: 26px; right: 20px; display: flex; gap: 0; padding: 3px; border: 1px solid #cfc8bb; border-radius: 999px; background: #ded8cc; }
header.top .sound-switch button { display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; width: 60px; height: 28px; min-height: 0; border: 0; border-radius: 999px; padding: 0; background: transparent; color: #8b857a; }
header.top .sound-switch button[aria-pressed="true"] { background: transparent; color: var(--ink); }
/* One white pill behind the two icons, so it can slide to the chosen side. */
header.top .sound-switch::before { content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
header.top .sound-switch:has(button:nth-child(2)[aria-pressed="true"])::before { transform: translateX(100%); }
header.top .sound-switch button:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }
.sound-switch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) {
  header.top .sound-switch button { transition: color 0.25s ease; }
  header.top .sound-switch::before { transition: transform 0.34s cubic-bezier(0.3, 1.35, 0.5, 1); }
}
@media print { header.top .sound-switch { display: none; } }
@media screen and (max-width: 700px) {
  header.top .sound-switch { top: 28px; }
  header.top .sound-switch button { width: 54px; }
  .home-page header.top .sound-switch { top: 16px; }
  /* the sync line moves under the title, so the switch has the corner to itself */
  .paper .top-row .sync { width: 100%; justify-content: flex-end; }
}
/* very narrow phones: leave room for the page title */
@media screen and (max-width: 370px) { header.top .sound-switch { right: 16px; } header.top .sound-switch button { width: 40px; } }
@media screen and (max-width: 340px) { .paper header.top h1 { font-size: 27px; } }
.shard.piece { margin: 0; }
/* the title egg: the letter has to be a box to be thrown around */
#egg-c { display: inline-block; }
.egg-flash { position: fixed; inset: 0; z-index: 2400; pointer-events: none; background: radial-gradient(circle at 50% 28%, #fff 0, rgba(255, 216, 115, 0.85) 30%, rgba(188, 42, 88, 0) 70%); }

/* ---------- course details, opened from the week */
.week .block[data-key] { cursor: pointer; }
/* With a mouse (or the Tab key), a white wash says the class can be opened. */
.week .block[data-key]::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(160deg, rgba(255, 255, 255, 0) 15%, rgba(255, 255, 255, 0.55)); }
.week .block[data-key]:focus-visible::after { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .week .block[data-key]:hover::after { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) { .week .block[data-key]::after { transition: opacity 0.2s ease; } }
.showing-detail > .panel { display: none; }
.course-sheet { box-sizing: border-box; padding: 0; border: 0; color: var(--ink); background: #fff; }
.course-sheet:not([open]) { display: none; }
.course-sheet:not(:modal) { position: static; width: 100%; margin: 0; border-radius: 18px; }
.sheet-box { padding: 16px 18px 20px; border-top: 6px solid var(--c); border-radius: inherit; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-head .code { color: var(--muted); font-size: 12px; font-weight: 700; }
.sheet-head h2 { margin: 2px 0 0; font-size: 20px; font-weight: 600; line-height: 1.3; }
.paper #sheet-close { flex: 0 0 auto; width: 40px; height: 40px; min-height: 0; padding: 0; font-size: 22px; line-height: 1; }
#sheet-body dl { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px 12px; margin: 14px 0; font-size: 14px; }
#sheet-body dt { color: var(--muted); }
#sheet-body dd { margin: 0; }
#sheet-body .seats { font-size: 14px; }
#sheet-body h3 { margin: 16px 0 4px; font-size: 14px; font-weight: 600; }
#sheet-body p { margin: 0 0 8px; font-size: 14px; }
#sheet-body p.detail { margin-top: 14px; font-size: 12px; }
.course-sheet:modal { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%; max-height: 82vh; max-height: 82dvh; margin: 0; overflow-y: auto; overscroll-behavior: contain; border-radius: 20px 20px 0 0; }
.course-sheet:modal .sheet-box { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.course-sheet::backdrop { background: rgba(31, 29, 26, 0.4); }
html:has(.course-sheet:modal) { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .course-sheet:modal[open] { animation: sheet-up 0.25s cubic-bezier(0.3, 0.7, 0.2, 1); }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
@media print { .course-sheet { display: none; } .showing-detail > .panel { display: block; } }

/* ---------- clashing classes in the week */
.week .block.over { box-shadow: -3px 0 7px rgba(0, 0, 0, 0.35); }
.block.stacked strong, .block.stacked span { max-width: var(--free, 100%); overflow-wrap: anywhere; }
.block strong, .block span { position: relative; z-index: 1; }
.block:not(.ghost) .clash ~ strong, .block:not(.ghost) .clash ~ span { text-shadow: 0 0 2px #000, 0 0 4px #000; }
.block.ghost .clash ~ strong, .block.ghost .clash ~ span { text-shadow: 0 0 2px #fff, 0 0 4px #fff; }
.block .clash { position: absolute; left: 0; right: 0; box-sizing: border-box; border: 2px solid #ff2d20; background: repeating-linear-gradient(135deg, rgba(255, 45, 32, 0.75) 0 4px, rgba(255, 255, 255, 0.45) 4px 9px); pointer-events: none; }
/* Narrow phone columns: smaller words, broken only between them. */
@media (max-width: 700px) { .block.stacked strong, .block.stacked span { font-size: 8.5px; overflow-wrap: normal; } }
