:root {
  --pink:#d72a70;
  --pink-dark:#a91751;
  --pink-soft:#fff0f6;
  --purple:#564486;
  --purple-dark:#403167;
  --ink:#282333;
  --muted:#746b76;
  --line:#efd8e3;
  --white:#fff;
  --shadow:0 12px 34px rgba(169,23,81,.10);
}
* { box-sizing:border-box; }
html { width:100%; overflow-x:hidden; background:#fff7fb; }
body {
  margin:0;
  width:100%;
  min-width:0;
  overflow-x:hidden;
  color:var(--ink);
  background:
    radial-gradient(circle at 100% 0%, rgba(215,42,112,.12), transparent 30%),
    linear-gradient(180deg,#ffe8f2 0,#fff7fb 380px,#fff 100%);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  -webkit-text-size-adjust:100%;
}
button,input,select { font:inherit; }
button,a { -webkit-tap-highlight-color:transparent; }
button { touch-action:manipulation; }
img { max-width:100%; display:block; }
[hidden] { display:none !important; }

.judge-app { width:100%; max-width:540px; margin:0 auto; padding:0 12px 108px; }
.judge-topbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:13px 2px 8px;
}
.brand-mark { display:block; width:min(58vw,235px); min-width:0; }
.brand-mark img { width:100%; height:auto; }
.back-link {
  flex:0 0 auto;
  text-decoration:none;
  color:var(--pink-dark);
  background:rgba(255,255,255,.78);
  border:1px solid rgba(215,42,112,.12);
  border-radius:999px;
  padding:9px 11px;
  font-size:12px;
  font-weight:900;
  backdrop-filter:blur(8px);
}

.staff-hero {
  position:relative;
  overflow:hidden;
  padding:21px 18px;
  border-radius:26px;
  color:#fff;
  background:linear-gradient(145deg,#ad164f 0%,var(--pink) 64%,#eb5a98 100%);
  box-shadow:0 16px 38px rgba(169,23,81,.23);
}
.staff-hero::after {
  content:"";
  position:absolute;
  width:150px;
  height:150px;
  right:-72px;
  bottom:-82px;
  border:25px solid rgba(255,255,255,.08);
  border-radius:50%;
}
.staff-kicker { position:relative; z-index:1; font-size:9px; letter-spacing:.15em; font-weight:950; opacity:.92; }
.staff-hero h1 { position:relative; z-index:1; margin:8px 0 5px; font-size:30px; line-height:1; letter-spacing:-.03em; }
.staff-hero p { position:relative; z-index:1; margin:0; max-width:420px; font-size:12px; line-height:1.5; color:rgba(255,255,255,.92); }

.pin-card {
  margin-top:18px;
  padding:22px 16px;
  border:1px solid rgba(215,42,112,.10);
  border-radius:21px;
  background:#fff;
  box-shadow:var(--shadow);
  text-align:center;
}
.pin-icon {
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  margin:0 auto;
  border-radius:15px;
  background:var(--pink-soft);
  color:var(--pink-dark);
  font-size:22px;
}
.pin-card h2 { margin:10px 0 5px; font-size:21px; }
.pin-card p { margin:0 auto 15px; color:var(--muted); font-size:12px; }
.pin-input {
  width:100%;
  border:2px solid #edd5e0;
  border-radius:14px;
  padding:13px 12px;
  outline:none;
  text-align:center;
  font-size:22px;
  font-weight:950;
  letter-spacing:.32em;
}
.pin-input:focus { border-color:var(--pink); box-shadow:0 0 0 4px rgba(215,42,112,.08); }
.primary {
  width:100%;
  margin-top:10px;
  border:0;
  border-radius:14px;
  padding:14px 12px;
  background:linear-gradient(135deg,var(--pink),#e84a8e);
  color:#fff;
  font-weight:950;
  cursor:pointer;
}
.inline-primary { margin:0; }
.pin-message { min-height:18px; margin-top:7px; color:var(--pink-dark); font-size:11px; font-weight:800; }

.judge-tabs {
  position:sticky;
  top:0;
  z-index:12;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  margin-top:15px;
  padding:5px;
  border:1px solid #efd9e3;
  border-radius:17px;
  background:rgba(255,255,255,.94);
  box-shadow:0 7px 20px rgba(169,23,81,.08);
  backdrop-filter:blur(12px);
}
.judge-tab {
  min-width:0;
  border:0;
  border-radius:13px;
  padding:12px 7px;
  background:transparent;
  color:var(--muted);
  font-size:12px;
  line-height:1.15;
  font-weight:950;
  cursor:pointer;
  overflow-wrap:anywhere;
}
.judge-tab.active { background:linear-gradient(135deg,var(--pink),#e84a8e); color:#fff; box-shadow:0 5px 14px rgba(215,42,112,.18); }

.section {
  display:grid;
  grid-template-columns:32px minmax(0,1fr);
  gap:9px 10px;
  margin-top:20px;
}
.section-label {
  grid-row:1 / span 2;
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:var(--pink);
  color:#fff;
  font-size:12px;
  font-weight:950;
}
.section-copy { min-width:0; }
.section h2 { margin:0; font-size:19px; line-height:1.15; }
.help { margin:3px 0 0; color:var(--muted); font-size:10px; line-height:1.4; }
.class-grid,
.height-grid,
.small-only { grid-column:1 / -1; }
.class-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.class-btn {
  min-width:0;
  border:1px solid #f0dce5;
  border-radius:16px;
  padding:13px 10px;
  background:#fff;
  color:var(--ink);
  text-align:left;
  font-weight:900;
  box-shadow:0 5px 16px rgba(169,23,81,.055);
  cursor:pointer;
}
.class-btn span { display:block; margin-top:5px; color:var(--muted); font-size:9px; line-height:1.35; font-weight:650; }
.class-btn.active { border-color:rgba(215,42,112,.65); background:linear-gradient(180deg,#fff9fb,var(--pink-soft)); color:var(--pink-dark); }
.height-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.height-btn {
  min-width:0;
  border:1px solid #ebcedb;
  border-radius:14px;
  padding:12px 8px;
  background:#fff;
  color:var(--pink-dark);
  font-weight:950;
  cursor:pointer;
}
.height-btn.active { border-color:var(--pink); background:linear-gradient(135deg,var(--pink),#e84a8e); color:#fff; box-shadow:0 6px 16px rgba(215,42,112,.16); }
.small-only { padding:12px 13px; border:1px solid #efcfdd; border-radius:14px; background:#fff; color:var(--pink-dark); font-size:11px; font-weight:900; }

.runner-header { display:flex; align-items:flex-end; justify-content:space-between; gap:10px; margin:22px 0 10px; }
.runner-header > div:first-child { min-width:0; }
.runner-header .kicker { color:var(--pink-dark); font-size:9px; text-transform:uppercase; letter-spacing:.14em; font-weight:950; }
.runner-header h2 { margin:4px 0 0; font-size:21px; line-height:1.14; overflow-wrap:anywhere; }
.runner-count { flex:0 0 auto; padding:7px 9px; border-radius:999px; background:#fff; color:var(--muted); font-size:10px; font-weight:800; }

.runner-list { display:flex; flex-direction:column; gap:10px; }
.runner-card {
  min-width:0;
  padding:14px;
  border:1px solid #f0dbe4;
  border-radius:19px;
  background:#fff;
  box-shadow:0 6px 18px rgba(169,23,81,.055);
}
.runner-title { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.runner-name { min-width:0; }
.runner-name strong { display:block; font-size:16px; line-height:1.2; overflow-wrap:anywhere; }
.runner-name span { display:block; margin-top:3px; color:var(--muted); font-size:11px; overflow-wrap:anywhere; }
.run-number { flex:0 0 auto; min-width:34px; height:30px; display:grid; place-items:center; border-radius:10px; background:var(--pink-soft); color:var(--pink-dark); font-size:10px; font-weight:950; }
.score-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin-top:12px; }
.field { min-width:0; }
.field label { display:block; margin:0 0 5px 2px; color:var(--muted); font-size:9px; font-weight:950; text-transform:uppercase; letter-spacing:.07em; }
.field input { width:100%; min-width:0; border:1px solid #e7d6de; border-radius:12px; padding:12px 9px; background:#fff; outline:none; font-size:16px; font-weight:850; }
.field input:focus { border-color:var(--pink); box-shadow:0 0 0 3px rgba(215,42,112,.09); }
.fault-stepper { display:grid; grid-template-columns:38px minmax(0,1fr) 38px; gap:5px; }
.step { border:0; border-radius:10px; background:#f8edf2; color:var(--pink-dark); font-size:18px; font-weight:950; cursor:pointer; }
.status-group { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-top:10px; }
.status-btn { min-width:0; border:1px solid #ead6df; border-radius:11px; padding:10px 4px; background:#fff; color:var(--muted); font-size:10px; line-height:1.2; font-weight:950; cursor:pointer; overflow-wrap:anywhere; }
.status-btn.active[data-status="finished"] { background:#e8f7ee; border-color:#9ed7b0; color:#267744; }
.status-btn.active[data-status="eliminated"] { background:#ffecec; border-color:#f2abab; color:#a72a2a; }
.status-btn.active[data-status="withdrawn"] { background:#f1eff5; border-color:#cdc5d7; color:#5f536e; }

.add-panel { margin-top:13px; padding:12px; border:1px dashed #dfa9c1; border-radius:17px; background:rgba(255,255,255,.70); }
.add-toggle { width:100%; border:0; background:transparent; color:var(--pink-dark); font-weight:950; padding:5px; cursor:pointer; }
.add-form { display:grid; gap:8px; margin-top:10px; }
.add-form input { width:100%; min-width:0; border:1px solid #e7d6de; border-radius:12px; padding:11px 10px; outline:none; }
.add-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.secondary { border:1px solid #e5c4d2; border-radius:12px; padding:11px 8px; background:#fff; color:var(--pink-dark); font-weight:850; cursor:pointer; }

.awards-entry-intro {
  display:grid;
  grid-template-columns:48px minmax(0,1fr);
  gap:11px;
  align-items:center;
  margin-top:19px;
  padding:15px;
  border:1px solid #efd7e1;
  border-radius:19px;
  background:#fff;
  box-shadow:0 6px 18px rgba(169,23,81,.05);
}
.award-entry-icon { width:48px; height:48px; display:grid; place-items:center; border-radius:14px; background:#fff0c9; color:#886300; font-size:22px; }
.awards-entry-intro > div:last-child { min-width:0; }
.awards-entry-intro h2 { margin:0; font-size:19px; }
.awards-entry-intro p { margin:4px 0 0; color:var(--muted); font-size:10px; line-height:1.45; }
.award-entry-list { display:flex; flex-direction:column; gap:10px; margin-top:11px; }
.award-entry-card { min-width:0; padding:13px; border:1px solid #f0dbe4; border-radius:18px; background:#fff; box-shadow:0 5px 16px rgba(169,23,81,.05); }
.award-entry-title { display:grid; grid-template-columns:34px minmax(0,1fr); gap:9px; align-items:center; }
.award-entry-number { width:34px; height:34px; display:grid; place-items:center; border-radius:11px; background:var(--pink-soft); color:var(--pink-dark); font-size:10px; font-weight:950; }
.award-entry-title h3 { margin:0; font-size:14px; line-height:1.25; overflow-wrap:anywhere; }
.award-slots { display:flex; flex-direction:column; gap:9px; margin-top:11px; }
.award-slot { min-width:0; display:grid; gap:8px; padding:10px; border-radius:13px; background:#fff8fb; }
.award-slot-title { color:var(--pink-dark); font-size:9px; font-weight:950; text-transform:uppercase; letter-spacing:.07em; }
.award-slot label { min-width:0; display:block; }
.award-slot label > span { display:block; margin:0 0 4px 2px; color:var(--muted); font-size:8px; font-weight:950; text-transform:uppercase; letter-spacing:.07em; }
.award-slot input { width:100%; min-width:0; border:1px solid #e7d6de; border-radius:11px; padding:11px 9px; background:#fff; outline:none; font-size:16px; font-weight:750; }
.award-slot input:focus { border-color:var(--pink); box-shadow:0 0 0 3px rgba(215,42,112,.09); }

.save-bar { position:fixed; left:0; right:0; bottom:0; z-index:20; border-top:1px solid #efd7e1; background:rgba(255,255,255,.96); backdrop-filter:blur(12px); }
.save-inner { width:100%; max-width:540px; margin:0 auto; padding:10px 12px calc(10px + env(safe-area-inset-bottom)); display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:10px; }
.save-copy { min-width:0; }
.save-copy strong { display:block; font-size:11px; overflow-wrap:anywhere; }
.save-copy span { display:block; margin-top:2px; color:var(--muted); font-size:9px; }
.save-button { border:0; border-radius:13px; padding:13px 15px; background:linear-gradient(135deg,var(--pink),#e84a8e); color:#fff; font-weight:950; white-space:nowrap; cursor:pointer; }
.save-button.saved { background:#3a8a58; }

@media (max-width:360px) {
  .judge-app { padding-left:9px; padding-right:9px; }
  .brand-mark { width:185px; }
  .back-link { font-size:11px; padding:8px 9px; }
  .class-grid { grid-template-columns:1fr; }
  .score-grid { grid-template-columns:1fr; }
  .status-group { grid-template-columns:1fr; }
  .save-inner { grid-template-columns:1fr; }
  .save-button { width:100%; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { scroll-behavior:auto !important; transition:none !important; }
}
