:root {
  color-scheme: light;
  --bg: #eef5ec;
  --panel: #ffffff;
  --ink: #17211b;
  --muted: #667269;
  --line: #d9dfd8;
  --red: #d9273e;
  --green: #146c43;
  --blue: #1f5f9e;
  --gold: #f3b13d;
  --danger: #b4232d;
  --shadow: 0 16px 44px rgba(23, 33, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 160px, transparent 0 72px, rgba(255, 255, 255, 0.22) 73px 75px, transparent 76px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 8%, rgba(255, 255, 255, 0.02) 8% 16%),
    linear-gradient(135deg, rgba(217, 39, 62, 0.18), transparent 34%),
    linear-gradient(225deg, rgba(31, 95, 158, 0.2), transparent 34%),
    linear-gradient(180deg, #0f6b3d 0 230px, rgba(15, 107, 61, 0.74) 231px, var(--bg) 520px),
    var(--bg);
  background-size:
    100% 320px,
    152px 100%,
    auto,
    auto,
    auto,
    auto;
  background-repeat:
    no-repeat,
    repeat-x,
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat;
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background:
    url("./축구공.png")
    center / contain no-repeat;
  box-shadow: 0 18px 36px rgba(23, 33, 27, 0.16);
}

body::before {
  width: 96px;
  height: 96px;
  top: 64px;
  right: 6.5vw;
  transform: rotate(-13deg);
}

body::after {
  width: 48px;
  height: 48px;
  top: 318px;
  left: 23vw;
  opacity: 0.48;
  transform: rotate(18deg);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.94);
}

input,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: end;
  padding: 42px 0 30px;
  color: var(--ink);
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin-top: 8px;
  max-width: 720px;
  width: fit-content;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: 0;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.88)) drop-shadow(0 12px 18px rgba(15, 107, 61, 0.22));
  position: relative;
}

.hero h1 span {
  display: block;
}

.title-red {
  color: var(--red);
}

.title-blue {
  color: var(--blue);
}

.hero h1::after {
  content: "";
  display: block;
  width: min(440px, 82%);
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red) 0 46%, var(--blue) 46% 100%);
  box-shadow: 0 8px 18px rgba(31, 95, 158, 0.18);
}

.hero-copy {
  max-width: 680px;
  margin-top: 16px;
  color: #24382d;
  font-size: 1.05rem;
  line-height: 1.6;
  font-weight: 700;
}

.hero-score {
  min-height: 138px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  padding: 20px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.78)),
    repeating-linear-gradient(45deg, rgba(20, 108, 67, 0.12) 0 8px, transparent 8px 16px);
  box-shadow: var(--shadow);
}

.hero-score span {
  color: var(--green);
  font-weight: 700;
}

.hero-score strong {
  display: block;
  margin-top: 18px;
  color: var(--green);
  font-size: 2.8rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow);
}

.identity-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  gap: 20px;
  align-items: center;
  padding: 22px;
}

.identity-panel p,
.tool-box p,
.danger-zone p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.name-form,
.admin-login {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.name-form label {
  color: var(--muted);
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  margin-top: 20px;
}

.prediction-panel,
.ranking-panel,
.admin-panel {
  padding: 22px;
}

.section-head,
.tool-head,
.danger-zone {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.member-badge {
  border-radius: 999px;
  padding: 8px 12px;
  background: #edf4ef;
  color: var(--green);
  font-weight: 800;
  white-space: nowrap;
}

.match-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 18px;
}

.match-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(140deg, var(--green), var(--red), var(--gold)) border-box;
  overflow: hidden;
  position: relative;
}

.match-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--red), #fff, var(--green), var(--gold));
}

.match-card.locked {
  background:
    linear-gradient(180deg, #fff 0%, #f8fbf7 100%) padding-box,
    linear-gradient(140deg, var(--gold), var(--green)) border-box;
}

.match-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.match-title {
  margin-top: 8px;
  font-size: 1.25rem;
}

.match-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  align-items: stretch;
  margin-top: 16px;
}

.pick-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pick-button {
  border: 1px solid var(--line);
  background: #f8faf8;
  color: var(--ink);
  display: grid;
  gap: 2px;
  place-items: center;
  padding: 8px 10px;
}

.pick-button small {
  color: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  opacity: 0.84;
}

.pick-button.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.pick-button.is-result:not(.active) {
  border-color: rgba(243, 177, 61, 0.85);
  background: #fff6df;
}

.pick-button:disabled {
  cursor: default;
  filter: none;
}

.submit-pick {
  width: 100%;
  margin-top: 14px;
  background: var(--red);
}

.submit-pick:disabled {
  background: #8d9790;
  cursor: default;
  filter: none;
}

.result-card {
  display: grid;
  place-items: center;
  border: 1px solid rgba(20, 108, 67, 0.18);
  border-radius: 8px;
  padding: 10px 8px;
  background:
    linear-gradient(180deg, rgba(20, 108, 67, 0.08), rgba(243, 177, 61, 0.13)),
    #fff;
  text-align: center;
}

.result-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.result-card strong {
  color: var(--red);
  font-size: 1.42rem;
  line-height: 1.1;
}

.result-card em {
  color: var(--green);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.score-predictor {
  display: grid;
  grid-template-columns: auto max-content max-content;
  gap: 8px 12px;
  align-items: center;
  margin-top: 14px;
  border: 1px solid rgba(20, 108, 67, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbf7;
}

.score-predictor > span {
  color: var(--green);
  font-weight: 900;
}

.score-predictor label {
  display: grid;
  grid-template-columns: auto 56px;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.score-predictor input {
  width: 100%;
}

.match-footer {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.match-footer span:first-child {
  color: #4f5d54;
}

.match-footer span:not(:first-child) {
  font-weight: 800;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ranking-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.vote-stats {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.vote-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.vote-stat-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.vote-stat-head strong {
  color: var(--red);
}

.vote-stat-head span {
  color: var(--green);
  font-weight: 900;
}

.vote-stat p {
  margin-top: 6px;
  color: var(--ink);
  font-weight: 800;
}

.vote-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.vote-chips span {
  border-radius: 999px;
  padding: 5px 8px;
  background: #edf4ef;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 900;
}

.rank-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.rank-item.payer-highlight {
  border-color: rgba(180, 35, 45, 0.42);
  background:
    linear-gradient(90deg, rgba(180, 35, 45, 0.1), rgba(243, 177, 61, 0.16)),
    #fff;
}

.rank-item.payer-highlight .rank-number {
  background: var(--red);
  color: #fff;
}

.rank-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  font-weight: 900;
}

.rank-name {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.rank-points {
  color: var(--green);
  font-weight: 900;
}

.payer-label {
  grid-column: 2 / -1;
  justify-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(180, 35, 45, 0.12);
  color: var(--danger);
  font-size: 0.76rem;
  font-weight: 900;
}

.admin-panel {
  margin-top: 20px;
}

.admin-tools {
  margin-top: 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tool-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.tool-box label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
}

.weight-inputs {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.weight-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 14px;
  background: #f8fbf7;
}

.weight-group legend {
  padding: 0 6px;
  color: var(--green);
  font-weight: 900;
}

.weight-group label {
  margin-top: 0;
}

.tool-box button {
  margin-top: 16px;
}

.wide {
  margin-top: 16px;
}

.result-row {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.admin-score-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.history-rows {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 10px;
}

.remove-row,
#clearHistory,
.member-delete button {
  background: var(--danger);
}

.danger-zone {
  margin-top: 16px;
  border: 1px solid rgba(180, 35, 45, 0.34);
  border-radius: 8px;
  padding: 18px;
  background: #fff7f7;
}

.member-delete {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  padding: 12px;
}

@media (max-width: 900px) {
  .hero,
  .identity-panel,
  .workspace,
  .admin-grid,
  .match-grid {
    grid-template-columns: 1fr;
  }

  .hero-score {
    min-height: auto;
  }

  .workspace {
    gap: 16px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1160px);
    padding-top: 16px;
  }

  .hero {
    padding-top: 18px;
  }

  .identity-panel,
  .prediction-panel,
  .ranking-panel,
  .admin-panel {
    padding: 16px;
  }

  .name-form,
  .admin-login,
  .history-row,
  .section-head,
  .tool-head,
  .danger-zone {
    grid-template-columns: 1fr;
    display: grid;
    align-items: stretch;
  }

  .pick-group {
    grid-template-columns: 1fr;
  }

  .match-body {
    grid-template-columns: 1fr;
  }

  .score-predictor {
    grid-template-columns: 1fr;
  }

  .score-predictor label {
    grid-template-columns: auto 72px;
    justify-content: start;
  }

  .weight-group {
    grid-template-columns: 1fr 1fr;
  }
}
