:root {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: #111e32;
  background: #edf2f8;
  line-height: 1.55;
  --navy: #102442;
  --blue: #164bb4;
  --border: #d1dae7;
  --muted: #495a71;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.shell { width: min(100% - 2rem, 54rem); margin-inline: auto; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.top-inner { display: flex; justify-content: space-between; align-items: center; min-height: 3.75rem; }
.brand, .nav-link { color: var(--navy); text-decoration: none; }
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 850; font-size: 1.15rem; }
.mark { width: 1.45rem; aspect-ratio: 1; border: 1px solid #acc1e9; border-radius: 50%; background: linear-gradient(135deg, #245ed1 50%, #fff 50%); }
.nav-link { padding: .45rem .6rem; border-radius: .4rem; font-size: .92rem; font-weight: 700; }
.nav-link:hover, .text-button:hover { background: #eaf1fc; }
main.shell { padding-block: 1.4rem 3rem; }
.hero { display: grid; align-items: center; background: var(--navy); min-height: 14rem; border-radius: 1.35rem; position: relative; overflow: hidden; isolation: isolate; color: #fff; }
.hero-copy { padding: clamp(1.4rem, 5vw, 2.75rem); }
.eyebrow { color: #b9d4ff; font-weight: 750; margin: 0 0 .55rem; }
h1 { font-size: clamp(2.4rem, 7vw, 4.35rem); line-height: 1.06; margin: 0; letter-spacing: -.07em; }
.hero-copy > :last-child { margin: 1rem 0 0; color: #deeaff; }
.field { position: absolute; z-index: -1; right: -2rem; top: 17%; width: 53%; min-width: 12rem; height: 90%; background: linear-gradient(90deg,#2162db 50%,#dce9ff 50%); border: .6rem solid #5982cc; opacity: .72; border-radius: .6rem; rotate: -18deg; }
.field::before { position: absolute; content: ""; inset: 8%; border: 2px solid #fff9; }
.field::after { position: absolute; content: ""; top: 8%; bottom: 8%; left: 50%; border-left: 2px solid #fff9; }
.field span { display: block; position: absolute; width: 25%; aspect-ratio: 1; border: 2px solid #fff9; border-radius: 50%; top: 50%; left: 50%; translate: -50% -50%; }
.tabs { display: flex; gap: .4rem; padding: .3rem; margin: 1.2rem 0 .7rem; background: #dce7f8; border-radius: .75rem; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .64; }
button[aria-busy="true"] { cursor: wait; }
.tab { width: 50%; background: transparent; border: 0; border-radius: .55rem; color: var(--navy); padding: .65rem; font-weight: 750; }
.tab[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 5px #14325825; }
.panel { padding: clamp(1.1rem, 4vw, 2rem); background: white; border: 1px solid var(--border); border-radius: 1rem; margin-top: .8rem; }
h2, h3 { line-height: 1.25; margin: 0 0 .55rem; letter-spacing: -.035em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.18rem; }
p { margin: .5rem 0; }
.muted, .small { color: var(--muted); }
.small { font-size: .88rem; }
form { display: grid; gap: 1rem; margin-top: 1.2rem; }
label { display: grid; gap: .35rem; min-width: 0; font-weight: 700; font-size: .96rem; }
input, select, textarea { width: 100%; min-height: 2.85rem; padding: .55rem .7rem; border: 1px solid #aab9cd; border-radius: .5rem; color: var(--navy); background-color: #fff; }
textarea { resize: vertical; }
select { appearance: none; padding-right: 1.7rem; background-image: linear-gradient(45deg, transparent 50%, #344b70 50%), linear-gradient(135deg, #344b70 50%, transparent 50%); background-position: right .92rem center, right .57rem center; background-size: .35rem .35rem; background-repeat: no-repeat; }
input[readonly] { background: #f4f7fb; font-size: .85rem; }
:focus-visible { outline: 3px solid #2d61c8; outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.primary, .secondary, .text-button { padding: .65rem 1rem; border-radius: .5rem; border: 1px solid transparent; font-weight: 750; min-height: 2.75rem; }
.primary { background: var(--blue); color: #fff; }
.primary:hover:not(:disabled) { background: #103b91; }
.secondary { background: #f2f6fd; color: #173866; border-color: #becde2; }
.secondary:hover:not(:disabled) { background: #e4eefc; }
.text-button { background: transparent; color: #193c73; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.result-actions { margin-top: .8rem; }
#dashboard .actions, #go-result { margin-top: .8rem; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .9rem; }
.notice { border-radius: .5rem; padding: .65rem .8rem; background: #e2ebfc; color: var(--navy); overflow-wrap: anywhere; margin: .8rem 0; }
.notice.error { background: #fff0ed; color: #922512; border: 1px solid #e5a295; }
.result-content { margin-top: 1rem; padding: 1rem; border: 1px solid var(--border); background: #f6f8fc; border-radius: .65rem; }
.result-content.blue { background: #e6efff; color: #143875; border-color: #9cbbea; }
.result-content.white { background: #fff; border-color: #8e9db2; }
.team-list { columns: 2; padding-left: 1.25rem; }
.team-list li, td { overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; margin-top: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .6rem .4rem; border-bottom: 1px solid #e0e7f0; }
th { white-space: nowrap; background: #edf2fa; }
td .text-button { min-height: 2rem; padding: .2rem .4rem; }
.draw-actions { margin-top: 1.2rem; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-top: 1rem; }
.summary section { min-width: 0; padding: .8rem; border-radius: .5rem; border: 1px solid #bac9df; }
.summary section:first-child { background: #e3edfd; }
.admin-team-list { padding-left: 1.2rem; margin-block: .8rem 0; }
.admin-team-list li { padding-block: .25rem; overflow-wrap: anywhere; }
.admin-team-list li + li { border-top: 1px solid #cad6e9; }
.admin-team-list small { display: block; color: var(--muted); }
.game-list { list-style: none; padding: 0; margin: 0; }
.game-list li + li { border-top: 1px solid var(--border); }
.game-row, .game-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .7rem; }
.game-row { width: 100%; text-align: left; border: 0; border-radius: .45rem; padding: .85rem .65rem; background: transparent; color: var(--navy); font-weight: 750; }
.game-row:hover { background: #eaf1fc; }
.game-row > *, .game-heading > * { min-width: 0; overflow-wrap: anywhere; }
.mvp { flex-shrink: 0; max-width: 48%; padding: .15rem .55rem; border-radius: .45rem; background: #f8edce; color: #573c00; font-size: .875rem; font-weight: 750; text-align: right; }
.game-info dt { font-weight: 750; margin-top: .9rem; }
.game-info dd { margin: .2rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-menu { align-items: center; gap: .5rem; margin-bottom: 0; }
.admin-menu .tabs { flex: 1; margin: 1rem 0 .25rem; }
.admin-game-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .4rem 0; }
.admin-game-row .game-row, .question-row span { overflow-wrap: anywhere; }
.visibility-button { white-space: nowrap; }
.quiz-panel { margin: 1rem 0; padding: .85rem 0; border-top: 1px solid var(--border); }
.quiz-entry { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.quiz-entry label { flex: 1 1 12rem; }
.question-list { padding-left: 1.5rem; }
.question-list li { margin: .55rem 0; }
.question-controls { display: inline-flex; gap: .25rem; flex-wrap: wrap; margin-left: .6rem; }
.quiz-heading { align-items: center; gap: .5rem; }
.danger-button { color: #a2251b; }
.quiz-teams { margin: .65rem 0; }
.quiz-names { padding-inline-start: 1.2rem; overflow-wrap: anywhere; }
.quiz-round { margin: .55rem 0; }
.quiz-round summary { cursor: pointer; font-weight: 650; }
#game-form .game-actions, #game-form .notice, #mvp-status { margin: 0; }
@media (max-width: 32rem) {
  .field { right: -4rem; opacity: .37; }
  .shell { width: calc(100% - 1.25rem); }
  th, td { padding-inline: .26rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
