:root {
  color-scheme: dark;
  font-family: "Poppins", sans-serif;
  background: #08120f;
  color: #f2fff8;
  --surface: rgba(17, 35, 29, 0.82);
  --surface-strong: #132a22;
  --line: rgba(174, 255, 208, 0.13);
  --muted: #94aa9f;
  --green: #00ff66;
  --green-soft: rgba(0, 255, 102, 0.12);
  --danger: #ff7a90;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 80% -10%, rgba(0, 255, 102, 0.13), transparent 38rem),
    linear-gradient(145deg, #07100d 0%, #0a1712 58%, #08120f 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.topbar,
.control-heading,
.stats-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar {
  margin-bottom: 28px;
}

.eyebrow,
.section-label {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: -0.035em;
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(6, 15, 12, 0.64);
  font-size: 0.78rem;
  font-weight: 600;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f5c451;
  box-shadow: 0 0 14px currentColor;
}

.connection[data-state="online"] {
  color: var(--green);
}

.connection[data-state="online"] .connection-dot {
  background: var(--green);
}

.connection[data-state="offline"] {
  color: var(--danger);
}

.connection[data-state="offline"] .connection-dot {
  background: var(--danger);
}

.control-card,
.stats-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(14px);
}

.control-card {
  padding: clamp(24px, 5vw, 42px);
  overflow: hidden;
}

.control-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
}

.control-card {
  position: relative;
}

#currentMultiplier {
  color: var(--green);
}

.control-note {
  max-width: 260px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
  text-align: right;
}

.multiplier-form {
  margin-top: 34px;
}

.multiplier-form label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

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

.number-input {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 14, 11, 0.72);
  color: var(--green);
  font-size: 1.1rem;
  font-weight: 700;
}

.number-input:focus-within {
  border-color: rgba(0, 255, 102, 0.58);
  box-shadow: 0 0 0 4px rgba(0, 255, 102, 0.08);
}

.number-input input {
  width: 100%;
  min-width: 0;
  padding: 15px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-weight: 600;
}

.apply-button,
.presets button,
.filters button {
  border: 1px solid var(--line);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.apply-button:hover,
.presets button:hover,
.filters button:hover {
  transform: translateY(-1px);
}

.apply-button {
  padding: 0 24px;
  border-color: var(--green);
  border-radius: 14px;
  background: var(--green);
  color: #04140b;
  font-weight: 700;
}

.apply-button:disabled,
.presets button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.presets button {
  padding: 13px 10px;
  border-radius: 12px;
  background: var(--green-soft);
  color: #c8ffdc;
  font-weight: 700;
}

.presets button:hover,
.presets button.active {
  border-color: rgba(0, 255, 102, 0.62);
  background: rgba(0, 255, 102, 0.2);
  color: #fff;
}

.form-message {
  min-height: 1.25rem;
  margin: 14px 0 -8px;
  color: var(--muted);
  font-size: 0.78rem;
}

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

.stats-card {
  margin-top: 20px;
  padding: clamp(24px, 5vw, 36px);
}

.filters {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 14, 11, 0.65);
}

.filters button {
  padding: 8px 12px;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.filters button.active {
  background: var(--surface-strong);
  color: var(--green);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 28px 0 18px;
}

.summary-grid article {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 14, 11, 0.5);
}

.summary-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.summary-grid strong {
  font-size: 1.25rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: rgba(5, 14, 11, 0.54);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.player-name {
  display: block;
  font-weight: 600;
}

.player-handle {
  color: var(--muted);
  font-size: 0.72rem;
}

.speed-value {
  color: var(--green);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.empty-row td {
  padding: 36px 18px;
  color: var(--muted);
  text-align: center;
}

.updated-at {
  margin: 13px 2px 0;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: right;
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding-top: 26px;
  }

  .topbar,
  .control-heading,
  .stats-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .control-note {
    max-width: none;
    text-align: left;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .apply-button {
    min-height: 52px;
  }

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

  .filters {
    width: 100%;
  }

  .filters button {
    flex: 1;
  }
}
