:root {
  color-scheme: light;
  --bg: #f3f0ea;
  --panel: #ffffff;
  --text: #24211d;
  --muted: #746b5f;
  --line: #ded6c9;
  --accent: #386641;
  --accent-strong: #294d31;
  --danger: #b42318;
  --ok: #287044;
  --warm: #b7783b;
  --soft: #faf8f3;
  --shadow: 0 14px 34px rgba(57, 47, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0)),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 0 18px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf9;
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 102, 65, 0.14);
}

input {
  min-height: 44px;
  padding: 0 12px;
}

.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 40px;
}

.login-view {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 32px;
  position: relative;
}

.login-panel::before {
  content: "";
  display: block;
  width: 46px;
  height: 4px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--warm);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--warm);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 24px;
  font-size: 32px;
  line-height: 1.15;
}

label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.login-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 8px;
}

.form-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 14px;
}

.form-message.ok {
  color: var(--ok);
}

.hidden {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.topbar h1 {
  margin-bottom: 0;
}

.account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
}

.live-stat {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf9;
  padding: 6px 10px;
  white-space: nowrap;
}

.account span {
  overflow-wrap: anywhere;
}

.ghost {
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--text);
  box-shadow: none;
}

.ghost:hover {
  background: var(--soft);
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin-bottom: 18px;
}

.score-rule {
  margin: 0 0 14px;
  border-left: 4px solid var(--warm);
  border-radius: 6px;
  background: rgba(255, 253, 249, 0.78);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.submitted-notice {
  margin: 0 0 14px;
  border: 1px solid rgba(40, 112, 68, 0.24);
  border-radius: 6px;
  background: rgba(40, 112, 68, 0.08);
  color: var(--ok);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 800;
}

.logo-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 10px 24px rgba(57, 47, 35, 0.08);
}

.logo-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border: 1px solid #ece4d8;
  border-radius: 6px;
  background: var(--soft);
  padding: 18px;
  overflow: visible;
}

.logo-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

.score-label {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.score-input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
}

.score-input:disabled {
  background: #f1eee7;
  color: #6f695f;
  cursor: not-allowed;
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.score-input[type="number"] {
  appearance: textfield;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
}

.actions .form-message {
  margin: 0;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.admin-summary > div,
.admin-section,
.admin-logo-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(57, 47, 35, 0.06);
}

.admin-summary > div {
  padding: 16px;
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-summary strong {
  font-size: 28px;
  line-height: 1;
}

.admin-section {
  margin-top: 18px;
  padding: 16px;
}

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

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

.section-title .form-message {
  margin: 0;
}

.admin-logo-list {
  display: grid;
  gap: 14px;
}

.admin-logo-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 14px;
}

.admin-logo-media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border: 1px solid #ece4d8;
  border-radius: 6px;
  background: var(--soft);
  overflow: hidden;
}

.admin-logo-media img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.admin-logo-content h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stat-grid div {
  border: 1px solid #ece4d8;
  border-radius: 6px;
  background: var(--soft);
  padding: 10px;
}

.stat-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat-grid strong {
  font-size: 20px;
}

.extreme-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.extreme-list p {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  margin: 0;
}

.extreme-list strong {
  color: var(--text);
}

.extreme-list span {
  overflow-wrap: anywhere;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  background: #fffdf9;
  font-size: 14px;
}

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

th {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td {
  overflow-wrap: anywhere;
}

.empty-cell,
.empty-state {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding: 20px 0;
  }

  .login-panel {
    padding: 22px;
  }

  .login-row,
  .actions,
  .topbar,
  .account {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }

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

  .admin-summary,
  .admin-logo-card,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    align-items: stretch;
    flex-direction: column;
  }
}
