@font-face {
  font-family: 'Instrument Sans';
  src: url('./instrument-sans-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
:root {
  --ink: #f5f0ff;
  --paper: #0b1020;
  --line: #303d5c;
  --muted: #b2c0de;
  --lavender: #d4b5ff;
  --violet: #bda2f5;
  --display: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font: 100%/1.55 var(--display);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #b6bbff; outline-offset: 3px;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
.frame { width: min(calc(100% - 2 * var(--gutter)), var(--page-width)); margin-inline: auto; }
.masthead { background: #0b1226; color: white; }
.hero { background: var(--paper); color: white; }
.event-english { font-family: 'Instrument Sans', sans-serif; font-weight: 550; letter-spacing: -.02em; }
.masthead { border-bottom: 1px solid #303d5c; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.8rem; }
.brand, nav { display: flex; align-items: center; gap: .65rem; }
.brand, nav a { text-decoration: none; }
.brand strong { font: 700 1.4rem/1 var(--display); letter-spacing: -.06em; }
nav { gap: clamp(1rem, 3vw, 2.2rem); }
nav a { font-size: .95rem; color: #eee3ff; padding-block: .65rem; }
nav a:hover { color: var(--lavender); }
h1, h2 { font-family: var(--display); font-weight: 690; letter-spacing: -.045em; }
h1 { font-size: clamp(2.9rem, 4.7vw, 4.65rem); line-height: 1.1; }
.lead { color: #d7e2ff; margin-top: 1.1rem; }
.teams-section { padding-block: 3rem; }
.section-head, .section-head > div { display: flex; align-items: center; gap: .85rem; }
.section-head { justify-content: space-between; gap: 1.5rem; margin-bottom: 1.2rem; }
h2 { font-size: clamp(1.95rem, 3.8vw, 2.7rem); line-height: 1.2; }
#team-total { font-size: .94rem; font-weight: 650; color: var(--muted); }
.search { display: flex; gap: .9rem; align-items: center; width: min(20rem, 100%); padding-inline: 1rem; background: #17213a; border: 1px solid #53678f; }
.lens { position: relative; width: .95rem; height: .95rem; border: .12rem solid #b2c0de; border-radius: 50%; flex: none; }
.lens::after { content: ''; position: absolute; width: .48rem; height: .12rem; bottom: -.22rem; right: -.37rem; background: #b2c0de; transform: rotate(48deg); }
.search:focus-within { outline: 2px solid #b6bbff; outline-offset: 2px; }
.search input:focus-visible { outline: none; }
.search input { border: 0; background: transparent; padding: .7rem 0; min-width: 0; width: 100%; }
.teams { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,19rem),1fr)); gap: .95rem; align-items: stretch; }
.team { display: grid; grid-template-columns: 2.8rem minmax(0,1fr) auto; grid-template-rows: auto 1fr auto; align-items: center; gap: .75rem; padding: 1.2rem; border: 1px solid var(--line); border-top: 1px solid #475a82; background: #17213a; }
.team.supported { border-top-color: var(--violet); background: #2b223e; }
.monogram { width: 2.8rem; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; color: #d2d5ff; background: #303d67; font: 400 1.45rem var(--display); }
.team-emblem { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: contain; }
.team-monogram { grid-area: 1 / 1; }
.team h3 { min-width: 0; font-size: 1.14rem; line-height: 1.32; }
.count { color: #b2c0de; font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.count b { color: var(--ink); }
.team-members { grid-column: 1 / -1; color: var(--muted); font-size: .94rem; line-height: 1.55; }
.team-actions { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; align-self: end; }
.team-actions button, #retry, .send-message { min-height: 2.75rem; padding: .45rem .65rem; border: 1px solid var(--ink); font-size: .92rem; font-weight: 650; }
.write-message, .send-message, #retry { color: white; background: var(--ink); }
.write-message:hover, .send-message:hover, #retry:hover { background: #483063; }
.cheer-button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; background: var(--violet); border-color: var(--violet); color: #fff; }
.cheer-button:hover:not(:disabled) { background: #502488; }
.cheer-button:disabled { color: #604f74; background: #ece4f4; border-color: #b9a7ce; }
.heart { font-size: 1.2rem; line-height: 1; }
@media (prefers-reduced-motion: no-preference) {
  .celebrate .heart { animation: heart-pop .45s ease-out; }
  @keyframes heart-pop { 45% { transform: scale(1.45); } }
}
.community-notice { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: .9rem; }
.community-notice strong { font-size: 1rem; }
.community-notice p, .page-footer, .preview, #status, #search-note { color: var(--muted); }
.community-notice p { margin-top: .25rem; font-size: .94rem; }
.preview, #status:not(:empty), #search-note:not(:empty) { margin: .35rem 0 1rem; }
#retry { margin-bottom: 1rem; }
.page-footer { border-top: 1px solid var(--line); padding-block: 1.4rem; font-size: .85rem; }
.page-footer .frame { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 2rem); background: #0b1226; color: white; padding: .75rem 1rem; pointer-events: none; opacity: 0; z-index: 3; }
.toast.show { opacity: 1; }
dialog { width: min(29rem,calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 1.5rem; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); }
dialog::backdrop { background: #230f3ac9; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; font-size: .92rem; color: var(--muted); }
.dialog-head button { border: 0; background: transparent; color: var(--ink); font-size: 1.65rem; width: 2.75rem; height: 2.75rem; }
dialog h2 { margin-block: .3rem .95rem; font-size: 2.2rem; }
dialog label { display: block; margin-top: .75rem; font-weight: 650; }
dialog label small { font-weight: 400; }
dialog input, dialog textarea { width: 100%; padding: .65rem; margin-top: .25rem; color: var(--ink); background: #17213a; border: 1px solid #53678f; }
dialog textarea { resize: vertical; }
.character-count, #posting-rules, .dialog-note { color: var(--muted); font-size: .88rem; }
.character-count { text-align: right; }
.send-message { width: 100%; margin-block: 1rem .35rem; }
.dialog-note { text-align: center; }
#message-error { color: #982d35; }
@media (max-width: 640px) {
  
  .header-row { min-height: 3.55rem; }

  h1 { font-size: clamp(2.85rem, 10vw, 4rem); }
  .section-head { align-items: stretch; flex-direction: column; gap: .75rem; }
  .search { width: 100%; }
  .teams-section { padding-block: 2.1rem; }
  .team { padding: 1rem; }
}

.search, .team, .community-notice, dialog, .toast { border-radius: .65rem; }
.team { border-top-width: 1px; background: #1c203e; }
.team.supported { background: #2b2c50; }
.monogram { border-radius: .55rem; }
.search input, dialog input, dialog textarea { color: var(--ink); }
input::placeholder, textarea::placeholder { color: #aebdd9; }
.team-actions button, .send-message, #retry { border-radius: .4rem; border-color: #465676; }
.cheer-button, .send-message, #retry { color: #251634; background: var(--violet); }
.cheer-button:hover:not(:disabled), .send-message:hover, #retry:hover { background: #dfcaff; }
.cheer-button:disabled { color: #bac5e0; background: #28334c; border-color: #465576; }
.write-message { background: #252940; color: #e4eaff; }
.toast { border: 1px solid #9b82ac; background: #292136; }
dialog { border: 1px solid #63759f; background: #17213a; }
#message-error { color: #ffb9c2; }

.teams-section { padding-block: clamp(1.6rem, 2.8vw, 2.8rem); }
.section-head { margin-bottom: .8rem; }
.section-head h2, .wall h2 { font: 680 clamp(1.55rem, 2.35vw, 2.3rem)/1.15 var(--display); letter-spacing: -.055em; }
#team-total { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.campus-queries { display: flex; flex-wrap: wrap; gap: .45rem; margin-block: .9rem; }
.campus-queries button { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.45rem; padding: .25rem .7rem; border-radius: 2rem; border: 1px solid var(--line); color: var(--muted); font-size: .86rem; background: #191d36; }
.campus-queries button:hover { border-color: #7184b5; }
.campus-queries button[aria-pressed=true] { border-color: #9399e5; background: #34365e; color: white; }
.campus-queries .campus-mark { --mark-size: 1.55rem; }
.preview, #search-note, #status { font-size: .86rem; }
.team { border-radius: 1rem; gap: .7rem; padding: 1.05rem 1.15rem; }
.team h3 { letter-spacing: -.035em; }
.count { color: var(--muted); font-size: .8rem; }
.monogram { position: relative; overflow: visible; border-radius: 50%; }
.monogram > * { grid-area: 1 / 1; }
.monogram .campus-mark { z-index: 1; }
.monogram .team-emblem:not([hidden]) { z-index: 2; }
.has-campus .monogram .team-emblem:not([hidden]) { justify-self: end; align-self: end; width: 1.15rem; height: 1.15rem; }
.team-actions { padding-top: .3rem; }
.team-actions button { border-radius: .6rem; }
.cheer-button, .send-message, #retry { background: #c0b9ff; color: #18203d; }
.team-members { font-size: .87rem; }
@media (max-width: 640px) {
  .hero .lead { font-size: .86rem; }
  .section-head { gap: .65rem; }
  .campus-queries { gap: .34rem; }
  .campus-queries button { min-height: 2.35rem; padding: .15rem .57rem; font-size: .8rem; }
}
@media (max-width: 640px) {
  .campus-queries { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); }
  .campus-queries button { justify-content: center; padding-inline: .15rem; gap: .25rem; }
  .campus-queries .campus-mark { --mark-size: 1.32rem; }
}
@media (max-width: 359px) {
  .campus-queries button { font-size: .74rem; }
  .campus-queries .campus-mark { --mark-size: 1.05rem; }
}
