﻿:root {
  --night: #060d22;
  --midnight: #121c39;
  --royal: #2956c8;
  --gold: #e7bf5a;
  --gold-soft: #f4db9b;
  --mist: #d4ddfb;
  --ink: #f5f7ff;
  --line: rgba(231, 191, 90, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.4;
  background:
    radial-gradient(circle at 8% 0%, rgba(41, 86, 200, 0.32) 0%, transparent 34%),
    radial-gradient(circle at 92% 10%, rgba(142, 42, 42, 0.24) 0%, transparent 24%),
    linear-gradient(165deg, #060d22 0%, #0b1530 45%, #0e1b3d 100%);
}

.hero {
  padding: 1.5rem 1rem 1.6rem;
  border-bottom: 2px solid var(--gold);
  background:
    linear-gradient(180deg, rgba(231, 191, 90, 0.08), transparent 40%),
    linear-gradient(155deg, #101a35 0%, #0c142b 58%, #16142d 100%);
}

.main-menu {
  width: min(1160px, 93vw);
  margin: 0 auto 0.8rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.menu-item {
  text-decoration: none;
  color: #fff2ca;
  border: 1px solid rgba(231, 191, 90, 0.45);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.83rem;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.menu-item.active {
  background: rgba(231, 191, 90, 0.16);
}

.menu-item.subtle {
  opacity: 0.8;
}

.menu-item:hover {
  transform: translateY(-1px);
  border-color: rgba(231, 191, 90, 0.8);
  background: rgba(231, 191, 90, 0.1);
}

.kicker {
  margin: 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.18rem;
  color: var(--gold-soft);
  font-size: 0.8rem;
}

.hero h1 {
  margin: 0.4rem auto 0.35rem;
  text-align: center;
  width: min(900px, 94vw);
  font-size: clamp(1.35rem, 2.7vw, 2.1rem);
  color: #fff6de;
}

.subtitle {
  margin: 0 auto;
  text-align: center;
  width: min(840px, 94vw);
  color: var(--mist);
}

.kinshima-link {
  margin: 0.8rem auto 0;
  display: block;
  width: fit-content;
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: #fff2ca;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.kinshima-link:hover {
  background: rgba(231, 191, 90, 0.15);
  transform: translateY(-1px);
}

.layout {
  width: min(1160px, 93vw);
  margin: 1.1rem auto 2rem;
  display: grid;
  gap: 1rem;
}

.panel {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.038) 0%, rgba(255, 255, 255, 0.012) 100%),
    linear-gradient(175deg, var(--midnight) 0%, #11192f 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(2px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.panel:hover {
  border-color: rgba(231, 191, 90, 0.45);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.36);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

h2,
h3 {
  margin: 0 0 0.55rem;
  color: #ffefc4;
}

h3 {
  font-size: 0.98rem;
  letter-spacing: 0.02rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #eef2ff;
}

input,
select,
button,
canvas {
  border-radius: 9px;
}

input,
select,
button {
  border: 1px solid #4e629e;
  padding: 0.52rem 0.62rem;
  font-size: 0.92rem;
  background: #1b294f;
  color: #f7f8fc;
  min-height: 40px;
}

input::placeholder {
  color: #aeb9df;
}

input:focus,
select:focus,
button:focus {
  outline: 2px solid rgba(231, 191, 90, 0.65);
  outline-offset: 1px;
}

button {
  background: linear-gradient(180deg, #2d57c6, #233f8f);
  color: #fff6dd;
  border-color: #4f6fcb;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

button:hover {
  background: linear-gradient(180deg, #3562d3, #27489f);
  filter: brightness(1.03);
  transform: translateY(-1px);
}

button.ghost {
  background: linear-gradient(180deg, #8e2a2a, #6d1d1d);
  border-color: #b14c4c;
}

button.ghost:hover {
  background: linear-gradient(180deg, #a23333, #7e2020);
}

form,
.filters,
.admin-grid {
  display: grid;
  gap: 0.75rem;
}

#score-form,
.filters {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.inline-form {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: end;
}

.actions {
  display: flex;
  align-items: end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.panel-head .actions {
  align-items: center;
}

.panel-head .actions label {
  font-size: 0.78rem;
  gap: 0.2rem;
  min-width: 120px;
}

#admin-results-body .actions {
  align-items: center;
}

#admin-results-body input,
#admin-results-body select {
  min-width: 110px;
  width: 100%;
  padding: 0.4rem 0.45rem;
  font-size: 0.84rem;
}

#admin-results-body .admin-result-season {
  min-width: 68px;
}

#admin-results-body .admin-result-score {
  min-width: 72px;
  width: 84px;
}

#admin-results-body .admin-result-note {
  min-width: 170px;
}

#admin-results-total {
  margin: 0;
}

.admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}

.admin-score-card {
  margin-bottom: 0.9rem;
  border: 1px solid rgba(231, 191, 90, 0.72);
  box-shadow: 0 0 0 1px rgba(231, 191, 90, 0.28), 0 14px 30px rgba(0, 0, 0, 0.34);
  background:
    linear-gradient(180deg, rgba(231, 191, 90, 0.18), rgba(255, 255, 255, 0.02)),
    rgba(8, 14, 30, 0.8);
  padding: 1rem;
}

.admin-score-card #score-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.admin-score-card h3 {
  color: #ffe7a3;
  margin-bottom: 0.35rem;
}

.admin-score-zone {
  position: relative;
  margin-bottom: 1.6rem;
  padding: 0.35rem 0 1.15rem;
}

.admin-score-zone::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(231, 191, 90, 0.68) 18%, rgba(231, 191, 90, 0.68) 82%, transparent 100%);
}

.score-help {
  margin: 0 0 0.7rem;
  color: #d7e1ff;
}

.score-submit-row {
  grid-column: 1 / -1;
  justify-content: center;
  align-items: center;
  margin-top: 0.35rem;
}

.score-submit-btn {
  min-width: 260px;
  min-height: 52px;
  padding: 0.8rem 1.2rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01rem;
  border: 1px solid rgba(231, 191, 90, 0.72);
  box-shadow: 0 8px 20px rgba(12, 22, 52, 0.48);
}

.admin-separator {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.05rem 0 0.95rem;
  color: #f3ddb1;
  font-size: 0.78rem;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
}

.admin-separator::before,
.admin-separator::after {
  content: "";
  height: 1px;
  background: rgba(231, 191, 90, 0.45);
  flex: 1;
}

.admin-card,
.chart-card {
  border: 1px solid rgba(231, 191, 90, 0.24);
  border-radius: 10px;
  padding: 0.8rem;
  background: rgba(6, 12, 26, 0.42);
}

.admin-panel .admin-card h3 {
  margin-bottom: 0.75rem;
}

.admin-panel .inline-form {
  margin-bottom: 0.6rem;
}

.admin-results-panel {
  margin-top: 1rem;
  padding: 1rem;
  border-color: rgba(231, 191, 90, 0.45);
  background:
    linear-gradient(180deg, rgba(231, 191, 90, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(6, 12, 26, 0.55);
}

.admin-results-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 0.8rem 0 0.7rem;
}

.admin-results-toolbar label {
  min-width: 180px;
}

.admin-results-pagination {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.admin-results-pagination .note {
  margin: 0;
  min-width: 90px;
  text-align: center;
}

.admin-lock {
  border: 1px dashed rgba(231, 191, 90, 0.45);
  border-radius: 10px;
  padding: 0.85rem;
  background: rgba(9, 14, 31, 0.45);
}

.note {
  color: #b8c3eb;
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
}

.error {
  color: #ffb2b2;
  margin: 0.2rem 0 0;
}

.feedback {
  margin: 0 0 0.8rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.92rem;
}

.feedback.success {
  color: #d5ffd5;
  background: rgba(34, 109, 48, 0.35);
  border-color: rgba(100, 220, 115, 0.5);
}

.feedback.error {
  color: #ffd8d8;
  background: rgba(130, 33, 33, 0.33);
  border-color: rgba(220, 99, 99, 0.52);
}

.hidden {
  display: none;
}

.charts-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

canvas {
  width: 100%;
  height: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(231, 191, 90, 0.2);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  border-bottom: 1px solid rgba(231, 191, 90, 0.2);
  padding: 0.52rem 0.5rem;
  text-align: left;
}

th {
  background: rgba(231, 191, 90, 0.11);
  color: #fff1c4;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.018);
}

tbody tr:hover {
  background: rgba(231, 191, 90, 0.08);
}

.team-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
}

.team-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.65);
}

.team-logo {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.empty {
  color: #b8c3eb;
  font-style: italic;
}

.tiny-admin-link {
  color: #d8e1ff;
  font-size: 0.78rem;
  text-decoration: none;
  opacity: 0.78;
}

.tiny-admin-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.site-footer {
  width: min(1160px, 93vw);
  margin: 0 auto 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #aebbe8;
  font-size: 0.8rem;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.admin-panel .panel-head h2 {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .hero {
    padding-top: 1rem;
  }

  .panel {
    padding: 0.82rem;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  #score-form,
  .filters,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .actions {
    width: 100%;
  }

  .actions button {
    width: 100%;
  }

  table {
    min-width: 520px;
  }

  .site-footer {
    margin-bottom: 1.5rem;
  }

  .admin-score-card #score-form {
    grid-template-columns: 1fr;
  }

  .admin-score-zone {
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
  }

  .score-submit-btn {
    width: 100%;
    min-width: 0;
    min-height: 50px;
  }

  .admin-results-toolbar {
    align-items: stretch;
  }

  .admin-results-pagination {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .hero {
    padding: 0.9rem 0.75rem 1.2rem;
  }

  .main-menu,
  .layout,
  .site-footer {
    width: min(1160px, 95vw);
  }

  .menu-item {
    padding: 0.28rem 0.58rem;
    font-size: 0.78rem;
  }

  .admin-card {
    padding: 0.62rem;
  }

  .admin-results-panel {
    padding: 0.72rem;
  }

  table {
    min-width: 460px;
  }

  .team-logo {
    width: 18px;
    height: 18px;
  }

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

  .chart-card {
    padding: 0.62rem;
  }

  canvas {
    min-height: 230px;
  }
}

@media (max-width: 640px) {
  .main-menu {
    justify-content: center;
  }

  .responsive-table {
    min-width: 0;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table tr {
    margin-bottom: 0.36rem;
    padding: 0.24rem 0.34rem;
    border: 1px solid rgba(231, 191, 90, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
  }

  .responsive-table td {
    border-bottom: 1px dashed rgba(231, 191, 90, 0.2);
    padding: 0.2rem 0.12rem;
    text-align: right;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.76rem;
    line-height: 1.2;
  }

  .responsive-table td:last-child {
    border-bottom: 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    text-align: left;
    font-weight: 700;
    color: #fff1c4;
    white-space: nowrap;
    font-size: 0.72rem;
  }

  .responsive-table .team-badge {
    justify-content: flex-end;
    gap: 0.28rem;
  }

  .responsive-table .team-logo {
    width: 14px;
    height: 14px;
  }

  .responsive-table .team-dot {
    width: 0.44rem;
    height: 0.44rem;
  }

  .admin-results-panel .panel-head .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-results-panel .panel-head .actions label {
    min-width: 0;
  }

  .admin-results-panel .table-wrap {
    overflow: visible;
  }

  .responsive-admin-table {
    min-width: 0;
  }

  .responsive-admin-table td {
    text-align: left;
    display: block;
    padding: 0.26rem 0.12rem;
  }

  .responsive-admin-table td::before {
    display: block;
    margin-bottom: 0.18rem;
  }

  .responsive-admin-table td input,
  .responsive-admin-table td select {
    width: 100%;
    min-width: 0;
  }

  .responsive-admin-table .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    width: 100%;
  }

.responsive-admin-table .actions button {
    width: 100%;
    min-height: 34px;
    padding: 0.38rem 0.42rem;
    font-size: 0.78rem;
  }

  .admin-results-toolbar {
    gap: 0.45rem;
  }

  .admin-results-toolbar label {
    min-width: 0;
    width: 100%;
  }

  .admin-results-pagination {
    gap: 0.35rem;
  }
}

.admin-subpage-link {
  display: inline-flex;
  margin-bottom: 0.8rem;
}

.fast-add-panel {
  max-width: 760px;
  margin: 0 auto;
}

.fast-add-shell {
  display: grid;
  gap: 0.85rem;
}

.fast-context {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.fast-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.5rem;
  border: 1px solid rgba(231, 191, 90, 0.34);
  border-radius: 999px;
  background: rgba(9, 16, 36, 0.55);
  color: #f5e7bf;
  font-size: 0.76rem;
  line-height: 1.2;
}

.fast-group {
  border: 1px solid rgba(231, 191, 90, 0.27);
  border-radius: 12px;
  padding: 0.72rem;
  background: rgba(7, 13, 29, 0.46);
}

.fast-group h3 {
  margin-bottom: 0.48rem;
}

.fast-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.fast-stage-head h3 {
  margin-bottom: 0;
}

.fast-stage-hint {
  margin: 0.22rem 0 0.5rem;
}

#fast-stage-content {
  min-height: 140px;
  align-content: start;
}

.fast-season-row {
  display: grid;
  grid-template-columns: 78px 1fr 78px;
  gap: 0.55rem;
  align-items: end;
}

.fast-season-input-wrap input {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.03rem;
}

.fast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.46rem;
}

.fast-grid-tight {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.fast-choice-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.36rem;
  min-height: 44px;
  font-size: 0.86rem;
  border: 1px solid rgba(116, 140, 210, 0.85);
  background: linear-gradient(180deg, #1e305f, #17274e);
  text-align: center;
  white-space: normal;
  word-break: break-word;
}

.fast-choice-btn.is-active {
  border-color: rgba(231, 191, 90, 0.86);
  box-shadow: 0 0 0 1px rgba(231, 191, 90, 0.35);
  background: linear-gradient(180deg, #2b4f9f, #233f7f);
}

.fast-team-logo {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.34);
}

.fast-choice-btn span {
  min-width: 0;
}

.fast-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.66);
}

.fast-score-box {
  display: grid;
  grid-template-columns: 86px 1fr 86px;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.46rem;
}

.fast-stage-actions {
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.fast-stage-actions .fast-submit {
  min-height: 44px;
}

.fast-stage-actions button {
  min-height: 46px;
}

.fast-category-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.fast-col {
  border: 1px solid rgba(231, 191, 90, 0.22);
  border-radius: 10px;
  padding: 0.48rem;
  background: rgba(8, 15, 32, 0.38);
}

.fast-col h4 {
  margin: 0 0 0.45rem;
  font-size: 0.86rem;
  color: #ffe7a3;
}

.fast-score-value {
  margin: 0;
  text-align: center;
  font-size: clamp(1.35rem, 4.8vw, 1.9rem);
  font-weight: 800;
  letter-spacing: 0.04rem;
  color: #fff5d8;
  border: 1px solid rgba(231, 191, 90, 0.52);
  border-radius: 10px;
  padding: 0.45rem 0.2rem;
  background: linear-gradient(180deg, rgba(231, 191, 90, 0.19), rgba(255, 255, 255, 0.03));
}

.fast-reset-btn {
  width: 100%;
}

.fast-submit {
  min-height: 54px;
  font-size: 1rem;
  font-weight: 800;
  border: 1px solid rgba(231, 191, 90, 0.72);
}

.fast-submit:disabled {
  cursor: not-allowed;
  opacity: 0.66;
  filter: grayscale(0.15);
}

.fast-form-bridge {
  display: none;
}

@media (max-width: 560px) {
  .fast-season-row {
    grid-template-columns: 68px 1fr 68px;
  }

  .fast-score-box {
    grid-template-columns: 70px 1fr 70px;
  }

  .fast-grid,
  .fast-grid-tight {
    grid-template-columns: 1fr 1fr;
  }

  .fast-choice-btn {
    min-height: 50px;
    font-size: 0.82rem;
    padding: 0.5rem 0.42rem;
  }

  #fast-stage-content {
    min-height: 180px;
  }

  .fast-category-columns {
    grid-template-columns: 1fr;
  }

  .fast-stage-actions {
    grid-template-columns: 1fr;
  }

  .fast-pill {
    font-size: 0.72rem;
  }
}

@media (max-width: 420px) {
  .fast-season-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.42rem;
  }

  .fast-season-input-wrap {
    grid-column: 1 / -1;
  }

  .fast-grid,
  .fast-grid-tight {
    grid-template-columns: 1fr;
  }

  #fast-stage-content {
    min-height: 0;
  }
}
