:root {
  --bg: #0d0e0d;
  --panel: rgba(25, 26, 23, .92);
  --panel-2: #20211d;
  --line: rgba(210, 178, 96, .22);
  --gold: #d8b66b;
  --gold-bright: #f0d48e;
  --text: #f4f0e7;
  --muted: #aaa79d;
  --green: #247a4b;
  --red: #8b3535;
  --shadow: 0 24px 80px rgba(0,0,0,.34);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background:
    radial-gradient(ellipse at 50% -20%, rgba(190,147,67,.17), transparent 48%),
    linear-gradient(145deg, #101210, #0a0b0a 72%);
  font-family: "DM Sans", system-ui, sans-serif;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .15;
  background-image: radial-gradient(rgba(255,255,255,.16) .55px, transparent .55px);
  background-size: 6px 6px; mask-image: linear-gradient(to bottom, black, transparent 80%);
}
.ambient { position: fixed; width: 420px; height: 420px; border-radius: 50%; filter: blur(100px); opacity: .09; pointer-events: none; }
.ambient-one { background: #cda24c; top: 10%; left: -250px; }
.ambient-two { background: #9d7e35; right: -250px; top: 48%; }
.topbar, .site-footer { width: min(1120px, calc(100% - 36px)); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.topbar { height: 76px; border-bottom: 1px solid rgba(255,255,255,.07); position: relative; z-index: 1; }
.brand { display: flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; letter-spacing: .14em; font-weight: 600; font-size: 12px; }
.brand b { color: var(--gold); }
.brand-mark { font-size: 23px; color: var(--gold); }
.edition, .site-footer { color: #87857d; font-size: 10px; letter-spacing: .16em; }
.app-shell { width: min(920px, calc(100% - 32px)); min-height: calc(100vh - 140px); margin: 28px auto 48px; position: relative; z-index: 1; }
.loading-panel { padding: 100px 0; text-align: center; color: var(--muted); }
.loader { width: 30px; height: 30px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; margin: auto; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero { padding: 42px 16px 32px; text-align: center; }
.eyebrow { color: var(--gold); font-size: 10px; letter-spacing: .27em; font-weight: 700; text-transform: uppercase; }
.hero h1 { font: 700 clamp(34px, 7vw, 68px)/1.04 "Playfair Display", Georgia, serif; letter-spacing: .015em; margin: 18px 0 6px; color: var(--gold-bright); text-shadow: 0 7px 34px rgba(209,165,82,.13); }
.hero .year { color: white; font: 600 clamp(24px, 4vw, 38px) "Playfair Display", Georgia, serif; letter-spacing: .25em; margin: 0 0 18px; }
.hero-copy { color: var(--muted); max-width: 590px; line-height: 1.75; margin: 0 auto; font-size: 14px; }
.hero-rule { width: 90px; height: 1px; margin: 25px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.panel { background: linear-gradient(145deg, rgba(29,30,26,.97), rgba(19,20,18,.97)); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: clamp(20px, 4vw, 36px); }
.panel + .panel { margin-top: 18px; }
.panel-title { font: 600 25px "Playfair Display", Georgia, serif; margin: 0 0 8px; }
.panel-subtitle { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 0 0 22px; }
.field-label { display: block; color: #e8dfcb; font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.input, .select, .textarea {
  width: 100%; color: var(--text); background: #141512; border: 1px solid rgba(214,182,107,.28);
  border-radius: 10px; padding: 13px 14px; outline: none; font: inherit; font-size: 14px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216,182,107,.10); }
.select option { background: #171814; color: var(--text); }
.textarea { min-height: 100px; resize: vertical; line-height: 1.6; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { margin-bottom: 16px; }
.notice { border: 1px solid rgba(216,182,107,.22); background: rgba(216,182,107,.07); color: #e8dec6; border-radius: 12px; padding: 14px 16px; font-size: 13px; line-height: 1.7; margin: 18px 0; }
.notice strong { color: var(--gold-bright); }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn {
  border: 1px solid transparent; border-radius: 10px; padding: 13px 19px; min-height: 46px;
  font: 700 12px "DM Sans", sans-serif; letter-spacing: .07em; cursor: pointer; transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { color: #17140c; background: linear-gradient(135deg, #f1d995, #b98f3f); box-shadow: 0 8px 24px rgba(177,135,56,.16); }
.btn-ghost { color: var(--text); background: transparent; border-color: rgba(255,255,255,.15); }
.btn-green { background: #237b4b; color: white; }
.btn-red { background: #8e3434; color: white; }
.btn-small { padding: 9px 12px; min-height: 36px; font-size: 11px; }
.admin-link { display: inline-block; color: #aaa28f; font-size: 11px; text-decoration: none; margin-top: 20px; border-bottom: 1px dotted #6d6146; padding-bottom: 3px; }
.admin-link:hover { color: var(--gold); }
.progress-wrap { margin: 10px 0 20px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .08em; color: var(--muted); margin-bottom: 9px; }
.progress-track { height: 4px; background: #30312b; border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #9d7735, #f0d48e); transition: width .25s ease; }
.category-kicker { color: var(--gold); font-size: 10px; letter-spacing: .18em; font-weight: 700; }
.category-title { font: 600 clamp(25px, 5vw, 36px)/1.14 "Playfair Display", Georgia, serif; margin: 11px 0 9px; }
.category-desc { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 0 0 22px; }
.selection-hint { color: var(--gold-bright); font-size: 12px; padding: 10px 12px; border-radius: 9px; background: rgba(216,182,107,.07); display: inline-block; margin-bottom: 15px; }
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.option {
  min-height: 54px; display: flex; align-items: center; gap: 11px; padding: 13px 14px;
  background: #171814; border: 1px solid rgba(255,255,255,.085); border-radius: 11px;
  cursor: pointer; transition: .17s ease; color: #e9e5dc; font-size: 13px; line-height: 1.5;
}
.option:hover { border-color: rgba(216,182,107,.45); background: #1e1f1a; }
.option.selected { border-color: var(--gold); background: rgba(216,182,107,.10); box-shadow: inset 0 0 0 1px rgba(216,182,107,.14); }
.option input { accent-color: var(--gold); flex: 0 0 auto; width: 16px; height: 16px; }
.rank-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rank-card { background: #171814; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; padding: 12px; }
.rank-card .name { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.rank-card .rank-caption { color: var(--muted); font-size: 11px; margin-bottom: 7px; }
.recipient-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.recipient-card { padding: 13px; border-radius: 11px; background: #171814; border: 1px solid rgba(255,255,255,.08); }
.recipient-card label { display: block; color: var(--gold-bright); font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.recipient-card .textarea { min-height: 86px; font-size: 12px; }
.error-box, .success-box { border-radius: 10px; padding: 12px 14px; margin-top: 14px; font-size: 13px; line-height: 1.6; }
.error-box { background: rgba(148,53,53,.13); border: 1px solid rgba(190,75,75,.35); color: #f3c3c3; }
.success-box { background: rgba(49,137,84,.13); border: 1px solid rgba(74,170,111,.35); color: #bce9ca; }
.review-list { display: grid; gap: 10px; }
.review-item { background: #171814; border: 1px solid rgba(255,255,255,.07); border-radius: 11px; padding: 13px 15px; }
.review-item strong { display: block; color: var(--gold-bright); font-size: 12px; margin-bottom: 6px; }
.review-item span { color: #d5d0c7; font-size: 12px; line-height: 1.6; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.76); display: grid; place-items: center; padding: 18px; z-index: 20; }
.modal { width: min(460px, 100%); background: #191a16; border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); text-align: center; }
.modal h2 { font: 600 26px "Playfair Display", Georgia, serif; margin: 0 0 12px; }
.modal p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.modal .button-row { justify-content: center; }
.success-hero { text-align: center; padding: 60px 20px; }
.success-hero .seal { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 20px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-bright); font-size: 30px; }
.success-hero h1 { font: 600 34px "Playfair Display", Georgia, serif; color: var(--gold-bright); }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin: 20px 0; }
.tab { border: 1px solid rgba(255,255,255,.12); border-radius: 30px; padding: 8px 13px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.tab.active { background: rgba(216,182,107,.12); border-color: var(--gold); color: var(--gold-bright); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.stat { background: #171814; border: 1px solid rgba(255,255,255,.08); padding: 16px; border-radius: 12px; }
.stat strong { display: block; font: 700 26px "Playfair Display", serif; color: var(--gold-bright); }
.stat span { color: var(--muted); font-size: 10px; letter-spacing: .09em; }
.result-category { background: #171814; border: 1px solid rgba(255,255,255,.08); padding: 16px; border-radius: 12px; margin-top: 12px; }
.result-category h3 { margin: 0 0 12px; font: 600 18px "Playfair Display", serif; color: var(--gold-bright); }
.result-line { display: flex; gap: 10px; align-items: center; margin: 9px 0; font-size: 12px; }
.result-line .candidate { width: 170px; flex-shrink: 0; }
.bar-track { flex: 1; height: 7px; background: #30312b; border-radius: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #9c7739, #efd38b); }
.result-line .count { width: 26px; text-align: right; color: var(--gold-bright); font-weight: 700; }
.message-section { margin-top: 17px; }
.message-section h3 { font: 600 18px "Playfair Display", serif; color: var(--gold-bright); }
.message-card { background: #171814; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 12px 14px; margin: 8px 0; color: #ded9cf; font-size: 13px; line-height: 1.65; }
.top5-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 17px; }
.top5-card { min-height: 110px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #23221c, #151612); padding: 16px; text-align: center; animation: pop .45s ease both; }
.top5-card .number { color: var(--gold); font-size: 10px; letter-spacing: .2em; }
.top5-card strong { font: 600 22px "Playfair Display", Georgia, serif; margin-top: 8px; }
@keyframes pop { from { opacity: 0; transform: translateY(9px) scale(.97); } to { opacity: 1; transform: none; } }
.final-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 12px; }
.final-table th, .final-table td { border-bottom: 1px solid rgba(255,255,255,.09); padding: 12px 9px; text-align: left; }
.final-table th { color: var(--gold); font-size: 10px; letter-spacing: .1em; }
.final-table td { color: #e8e2d7; }
.final-table tr { cursor: pointer; }
.final-table tr:hover td { background: rgba(216,182,107,.05); }
.detail-box { padding: 14px; border: 1px solid var(--line); border-radius: 12px; margin-top: 14px; background: #151612; }
.hidden { display: none !important; }
.site-footer { min-height: 56px; border-top: 1px solid rgba(255,255,255,.06); }
.small-muted { color: var(--muted); font-size: 11px; line-height: 1.6; }
@media (max-width: 640px) {
  .topbar { height: 64px; }
  .app-shell { margin-top: 16px; }
  .hero { padding: 28px 8px 22px; }
  .field-grid, .option-grid, .rank-list, .recipient-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .result-line .candidate { width: 125px; }
  .site-footer { flex-direction: column; justify-content: center; gap: 6px; padding: 16px 0; text-align: center; }
  .final-table { font-size: 11px; }
  .final-table th, .final-table td { padding: 10px 5px; }
}
