:root {
  --pitch: #0B3D2E;
  --ground: #EEF3F0;
  --ink: #10231B;
  --muted: #4A5F55;
  --on-pitch: #CDE5DA;
  --line: #DCE5E0;
  --gold: #FFD166;
  --a: #E85D04;
  --a-text: #B84300;
  --b: #0353A4;
  --display: 'Do Hyeon', 'Noto Sans KR', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: 'Noto Sans KR', system-ui, sans-serif; line-height: 1.45; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: var(--ground); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #FFB000; outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
.loading { padding: 64px 16px; text-align: center; color: var(--muted); }

.top { display: flex; flex-direction: column; gap: 14px; padding: 20px 16px 16px; background: var(--pitch); color: #fff; }
.brand { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.brand h1 { font: 400 40px/1.1 var(--display); }
.brand p { font-size: 14px; font-weight: 500; color: var(--on-pitch); }
.my-school { display: flex; flex-direction: column; align-items: flex-end; min-height: 44px; padding: 0; border: 0; background: none; color: #fff; text-align: right; }
.my-school small { font-size: 12px; color: var(--on-pitch); }
.my-school strong { font: 400 22px/1.2 var(--display); color: var(--gold); }
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #5E8F7D; border-radius: 6px; overflow: hidden; }
.levels button { height: 44px; border: 0; background: transparent; color: #fff; font-size: 15px; font-weight: 500; }
.levels button[aria-current="true"] { background: #fff; color: var(--pitch); font-weight: 900; }

.content { display: flex; flex-direction: column; gap: 16px; padding: 16px; }
.card { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: #fff; border-radius: 8px; }
.card-dark { background: var(--pitch); color: #fff; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h2 { font: 400 26px/1.2 var(--display); }
.pill { flex-shrink: 0; padding: 3px 8px; border-radius: 4px; background: var(--pitch); color: #fff; font-size: 12px; font-weight: 700; }
.hint { font-size: 14px; font-weight: 500; text-align: center; }
.small { font-size: 13px; color: var(--muted); }

.versus { display: grid; grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); align-items: center; gap: 6px; }
.versus > div { display: flex; flex-direction: column; gap: 6px; }
.versus h3 { font: 400 20px/1.2 var(--display); text-align: center; }
.side-a { color: var(--a-text); }
.side-b { color: var(--b); }
.vs { font: 400 22px/1 var(--display); text-align: center; }
.tray { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; padding: 4px; background: #C9D6CF; border-radius: 8px; }
.slot { grid-column: span 2; display: flex; align-items: center; justify-content: center; height: 36px; background: #fff; border-radius: 4px; }
.slot.wide { grid-column: span 3; height: 42px; }
.food { display: block; width: 22px; height: 15px; border-radius: 5px; }
.slot.wide .food { width: 34px; height: 22px; }
.food.rice { background: #E9E2CC; border-radius: 60% 60% 20% 20%; }
.food.noodle { background: #E9C46A; border-radius: 40%; }
.food.soup { background: #D9432F; border-radius: 50%; }
.food.main { background: #D9964A; }
.food.kimchi { background: #C8502B; border-radius: 40% 60% 50% 45%; }
.food.dessert { background: #F48FB1; border-radius: 40%; }

.compare { display: flex; flex-direction: column; }
.compare > div { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); align-items: center; gap: 4px; min-height: 40px; padding: 4px 0; border-top: 1px solid var(--line); text-align: center; font-size: 14px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.compare span:nth-child(2) { font-size: 12px; font-weight: 500; color: var(--muted); }

.vote { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.vote button { height: 48px; border: 3px solid transparent; border-radius: 6px; font-size: 15px; font-weight: 900; }
.vote .a { background: var(--a); color: var(--ink); }
.vote .b { background: var(--b); color: #fff; }
.vote button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.vote button:disabled { opacity: 1; cursor: default; }
.vote button.dim { background: var(--line); color: var(--muted); }

.score-line { font: 400 26px/1.2 var(--display); }
.btn { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; border-radius: 6px; font-size: 15px; font-weight: 700; text-decoration: none; }
.btn-primary { border: 0; background: var(--pitch); color: #fff; font-weight: 900; min-height: 50px; font-size: 16px; }
.btn-outline { border: 2px solid var(--pitch); background: transparent; color: var(--pitch); }
.btn-light { border: 1px solid #fff; background: transparent; color: #fff; }
.link-btn { min-height: 44px; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: underline; }
.mini-mascot { flex-shrink: 0; width: 72px; height: 72px; padding: 6px; background: #fff; border-radius: 50%; }

.tabs { display: flex; gap: 6px; }
.tabs button { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 14px; font-weight: 500; }
.tabs button[aria-pressed="true"] { border-color: var(--pitch); background: var(--pitch); color: #fff; font-weight: 700; }
.ranks { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ranks li { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 6px 0; border-top: 1px solid var(--line); }
.ranks .no { width: 24px; flex-shrink: 0; font: 400 22px/1 var(--display); color: var(--pitch); }
.ranks .who { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 15px; font-weight: 500; }
.ranks .who small { font-size: 12px; font-weight: 400; color: var(--muted); }
.ranks .pts { flex-shrink: 0; font-size: 15px; font-weight: 700; }
.foot { display: flex; flex-direction: column; gap: 4px; padding: 0 16px 32px; font-size: 12px; color: var(--muted); }

.reveal-top { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 16px 20px; background: var(--pitch); color: #fff; text-align: center; }
.reveal-top p { font-size: 14px; font-weight: 500; color: var(--on-pitch); }
.reveal-top h1 { font: 400 36px/1.15 var(--display); }
.big-mascot { width: 170px; height: 170px; margin-top: 8px; padding: 18px; background: #fff; border-radius: 50%; }
.result-row { display: flex; flex-direction: column; gap: 6px; }
.result-row > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.result-row h2 { font: 400 21px/1.2 var(--display); }
.result-row strong { font: 400 26px/1.2 var(--display); }
.track { height: 28px; background: var(--line); border-radius: 4px; overflow: hidden; }
.fill { width: 0; height: 100%; transition: width 1s ease-out; }
.fill.a { background: var(--a); }
.fill.b { background: var(--b); }
@media (prefers-reduced-motion: reduce) { .fill { transition: none; } }

.sheet { display: flex; flex-direction: column; gap: 12px; padding: 20px 16px; }
.sheet h1 { font: 400 30px/1.2 var(--display); }
.sheet label { font-size: 14px; font-weight: 700; }
.sheet input { width: 100%; height: 48px; padding: 0 12px; border: 2px solid var(--pitch); border-radius: 6px; background: #fff; font-size: 16px; }
.school-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.school-list button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 56px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; text-align: left; font-size: 15px; font-weight: 700; }
.school-list small { font-size: 12px; font-weight: 400; color: var(--muted); }
