:root {
  --ink: #172033;
  --muted: #697386;
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e3e8f1;
  --red: #e6332a;
  --yellow: #f8c52c;
  --green: #16a064;
  --blue: #1c58a8;
  --shadow: 0 18px 45px rgba(26, 37, 61, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(248, 197, 44, 0.20), transparent 30%),
    linear-gradient(180deg, #fff8de 0%, var(--bg) 250px);
}

a {
  color: inherit;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 88px;
}

.hero {
  padding: 18px 18px 18px;
  color: #fff;
  background: linear-gradient(135deg, #d8252c, #f5b51f 50%, #168f62);
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: var(--shadow);
}

.hero__brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero__logo {
  width: 118px;
  height: 118px;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  padding: 0;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.22));
}

.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero h1 {
  margin: 3px 0 0;
  font-size: 31px;
  line-height: 1.05;
}

.hero__cup {
  margin-top: 12px;
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-weight: 700;
}

.main-content {
  padding: 16px;
}

.user-pill {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 14px;
}

.user-pill a {
  float: right;
  font-weight: 700;
  color: var(--red);
  text-decoration: none;
}

.panel,
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(33, 44, 72, 0.07);
}

.panel {
  padding: 16px;
  margin-bottom: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 21px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.button,
button {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

.button.primary {
  background: linear-gradient(135deg, var(--red), #ff8b1f);
}

.button.secondary {
  color: var(--ink);
  background: #eef2f7;
}

.button.success {
  background: var(--green);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.rank-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}

.rank-card.top {
  border-color: rgba(248, 197, 44, 0.9);
  background: linear-gradient(135deg, #fff7d9, #fff);
}

.rank-pos {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: #edf2fa;
  font-weight: 900;
}

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

.game-card {
  padding: 14px;
  margin-bottom: 12px;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.tag {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf2f7;
  color: #3b4960;
  font-size: 12px;
  font-weight: 700;
}

.match-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  font-weight: 900;
  font-size: 17px;
}

.match-line span:last-child {
  text-align: right;
}

.score-inputs {
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  font: inherit;
  background: #fff;
}

input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 800;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.notice {
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 12px;
  background: #eef8f2;
  color: #12633f;
  font-weight: 700;
}

.notice.error {
  background: #fff0ef;
  color: #b4231f;
}

.sponsors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: center;
}

.support-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
}

.sponsors a {
  display: grid;
  place-items: center;
  min-height: 112px;
}

.sponsors img {
  width: 100%;
  height: 112px;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  border: 0;
  padding: 0;
  filter: drop-shadow(0 8px 14px rgba(23, 32, 51, 0.16));
}

.prize-hero {
  overflow: hidden;
  padding: 0;
}

.prize-hero img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.prize-hero__text {
  padding: 16px;
}

.prize-hero__text h2 {
  margin: 10px 0 8px;
  font-size: 23px;
  line-height: 1.12;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 4px;
  padding: 8px 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  z-index: 5;
}

.bottom-nav a {
  padding: 10px 5px;
  text-align: center;
  text-decoration: none;
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.bottom-nav a.active {
  color: #fff;
  background: var(--ink);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  background: rgba(11, 18, 31, 0.52);
  z-index: 10;
}

.modal.open {
  display: flex;
}

.modal__body {
  width: min(100%, 760px);
  margin: 0 auto;
  background: #fff;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 18px;
  max-height: 82vh;
  overflow: auto;
}

.admin-layout {
  padding: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

@media (min-width: 620px) {
  .hero h1 {
    font-size: 34px;
  }

  .main-content {
    padding: 20px;
  }
}

@media (max-width: 520px) {
  .hero__logo {
    width: 96px;
    height: 96px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .sponsors {
    grid-template-columns: 1fr;
  }

  .sponsors img {
    height: 132px;
  }
}
