:root {
  --bg: #060914;
  --bg-soft: #0b1120;
  --panel: #101827;
  --panel-2: #111d2f;
  --line: rgba(104, 240, 255, 0.22);
  --line-strong: rgba(104, 240, 255, 0.5);
  --text: #edf7ff;
  --muted: #9ab0c8;
  --cyan: #68f0ff;
  --blue: #4c8dff;
  --lime: #a7ff5f;
  --magenta: #ff5fd2;
  --danger: #ff657c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(104, 240, 255, 0.13), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(255, 95, 210, 0.1), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: "Kanit", sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--cyan);
}

.app-shell {
  color: var(--text);
}

.admin-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 20px;
  background: rgba(8, 13, 27, 0.92);
  border-right: 1px solid var(--line);
}

.brand-block {
  display: grid;
  gap: 4px;
  padding: 12px 10px 28px;
}

.brand-name {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
}

.brand-subtitle,
.eyebrow,
.hint-text,
.muted-cell {
  color: var(--muted);
}

.brand-subtitle,
.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 10px;
}

.side-link {
  display: block;
  padding: 13px 14px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 8px;
}

.side-link:hover,
.side-link.active {
  color: var(--text);
  background: rgba(104, 240, 255, 0.08);
  border-color: var(--line);
  box-shadow: inset 0 0 18px rgba(104, 240, 255, 0.08);
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.admin-name {
  color: var(--muted);
}

.main-panel {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 9, 20, 0.74);
  backdrop-filter: blur(12px);
}

.topbar h1,
.section-head h2,
.panel h3,
.player-header h1,
.login-copy h1,
.player-card h1,
.game-hero h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--lime);
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--lime);
  box-shadow: 0 0 18px rgba(167, 255, 95, 0.85);
}

.content-wrap {
  width: min(1440px, 100%);
  padding: 34px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 34px;
}

.metric-card,
.panel,
.form-panel,
.table-shell,
.login-panel,
.player-card,
.score-stage,
.game-hero {
  background: linear-gradient(180deg, rgba(16, 24, 39, 0.96), rgba(9, 16, 31, 0.96));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 22px;
}

.metric-card span {
  color: var(--muted);
}

.metric-card strong {
  color: var(--cyan);
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1;
  text-shadow: 0 0 18px rgba(104, 240, 255, 0.38);
}

.section-head,
.panel-head,
.control-row,
.hero-meta,
.form-actions,
.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-head {
  margin-bottom: 18px;
}

.btn {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 600;
}

.btn-neon {
  color: #03111b;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  border: 0;
  box-shadow: 0 0 22px rgba(104, 240, 255, 0.28);
}

.btn-neon:hover,
.btn-neon:focus {
  color: #03111b;
  filter: brightness(1.08);
}

.btn-outline-neon {
  color: var(--cyan);
  border-color: var(--line-strong);
  background: rgba(104, 240, 255, 0.04);
}

.btn-outline-neon:hover,
.btn-outline-neon:focus {
  color: var(--text);
  border-color: var(--cyan);
  background: rgba(104, 240, 255, 0.14);
}

.btn-outline-danger-neon {
  color: var(--danger);
  border-color: rgba(255, 101, 124, 0.5);
  background: rgba(255, 101, 124, 0.04);
}

.btn-outline-danger-neon:hover,
.btn-outline-danger-neon:focus {
  color: var(--text);
  border-color: var(--danger);
  background: rgba(255, 101, 124, 0.14);
}

.status-action-btn {
  min-width: 112px;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, filter 120ms ease;
}

.btn-status-open-active {
  color: #03111b;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  border: 0;
  box-shadow: 0 0 22px rgba(104, 240, 255, 0.28);
}

.btn-status-closed-active {
  color: #2a030a;
  background: linear-gradient(135deg, #ff7a8e, var(--danger));
  border: 0;
  box-shadow: 0 0 22px rgba(255, 101, 124, 0.24);
}

.btn-status-draft-active {
  color: #03111b;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border: 0;
  box-shadow: 0 0 22px rgba(76, 141, 255, 0.24);
}

.btn-status-close_draft-active {
  color: #03111b;
  background: linear-gradient(135deg, #ffd166, var(--cyan));
  border: 0;
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.24);
}

.btn-show-score-active {
  color: #03111b;
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  border: 0;
  box-shadow: 0 0 22px rgba(104, 240, 255, 0.26);
}

.btn-status-open-active:hover,
.btn-status-open-active:focus,
.btn-status-closed-active:hover,
.btn-status-closed-active:focus,
.btn-status-draft-active:hover,
.btn-status-draft-active:focus,
.btn-status-close_draft-active:hover,
.btn-status-close_draft-active:focus,
.btn-show-score-active:hover,
.btn-show-score-active:focus {
  filter: brightness(1.08);
}

.btn-status-inactive {
  color: var(--muted);
  background: rgba(154, 176, 200, 0.06);
  border: 1px solid rgba(154, 176, 200, 0.32);
  box-shadow: none;
}

.btn-status-inactive:hover,
.btn-status-inactive:focus {
  color: var(--text);
  background: rgba(154, 176, 200, 0.14);
  border-color: rgba(154, 176, 200, 0.55);
}

.table-shell {
  overflow: hidden;
}

.table-shell.embedded {
  box-shadow: none;
}

.neon-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--line);
  color: var(--text);
}

.neon-table th {
  color: var(--muted);
  font-weight: 500;
}

.neon-table td,
.neon-table th {
  padding: 15px 18px;
}

.player-table-name {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 160px;
}

.player-table-avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-2);
  box-shadow: 0 0 15px rgba(104, 240, 255, 0.16);
}

.color-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  vertical-align: -3px;
  border: 1px solid rgba(237, 247, 255, 0.72);
  border-radius: 999px;
}

.code-pill,
.type-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.code-pill {
  color: var(--cyan);
  background: rgba(104, 240, 255, 0.09);
  border: 1px solid var(--line);
}

.type-pill {
  color: var(--text);
  background: rgba(76, 141, 255, 0.12);
  border: 1px solid rgba(76, 141, 255, 0.38);
}

.type-boat_race {
  color: var(--lime);
  background: rgba(167, 255, 95, 0.09);
  border-color: rgba(167, 255, 95, 0.34);
}

.type-pull_rope {
  color: #ffd36a;
  background: rgba(255, 211, 106, 0.09);
  border-color: rgba(255, 211, 106, 0.34);
}

.type-showroom {
  color: var(--magenta);
  background: rgba(255, 95, 210, 0.09);
  border-color: rgba(255, 95, 210, 0.34);
}

.status-pill {
  color: var(--muted);
  background: rgba(154, 176, 200, 0.1);
  border: 1px solid rgba(154, 176, 200, 0.24);
}

.status-open {
  color: var(--lime);
  background: rgba(167, 255, 95, 0.1);
  border-color: rgba(167, 255, 95, 0.35);
}

.status-closed {
  color: var(--danger);
  background: rgba(255, 101, 124, 0.1);
  border-color: rgba(255, 101, 124, 0.35);
}

.status-draft {
  color: var(--cyan);
  background: rgba(104, 240, 255, 0.08);
  border-color: var(--line);
}

.status-close_draft {
  color: #ffd166;
  background: rgba(255, 209, 102, 0.1);
  border-color: rgba(255, 209, 102, 0.36);
}

.auth-wrap,
.player-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 34px;
  width: min(980px, 100%);
  padding: 36px;
}

.login-copy {
  align-self: center;
}

.login-copy h1 {
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 7vw, 4.8rem);
}

.login-copy p:last-child {
  max-width: 560px;
  color: var(--muted);
  font-size: 1.1rem;
}

.neon-form .form-label {
  color: var(--text);
}

.form-control,
.form-select {
  min-height: 46px;
  color: var(--text);
  background-color: rgba(5, 11, 24, 0.84);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
  color: var(--text);
  background-color: rgba(5, 11, 24, 0.96);
  border-color: var(--cyan);
  box-shadow: 0 0 0 0.2rem rgba(104, 240, 255, 0.12);
}

.form-control::placeholder {
  color: rgba(154, 176, 200, 0.72);
}

.form-panel {
  padding: 26px;
}

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

.game-type-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 92px;
  padding: 16px;
  cursor: pointer;
  background: rgba(5, 11, 24, 0.58);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.game-type-option:hover,
.game-type-option:has(input:checked) {
  border-color: var(--cyan);
  background: rgba(104, 240, 255, 0.09);
}

.game-type-option input {
  margin-top: 4px;
  accent-color: var(--cyan);
}

.game-type-option span {
  display: grid;
  gap: 4px;
}

.game-type-option small {
  color: var(--muted);
}

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

.boat-settings-panel {
  margin-bottom: 18px;
}

.thumbnail-editor {
  display: grid;
  gap: 14px;
}

.thumbnail-editor-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.thumbnail-preview-card,
.thumbnail-crop-shell {
  min-height: 180px;
  background: rgba(5, 11, 24, 0.58);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.thumbnail-preview-card {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--muted);
}

.thumbnail-preview-card img {
  width: 144px;
  height: 144px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.thumbnail-crop-shell {
  height: 360px;
  overflow: hidden;
}

.thumbnail-crop-shell img {
  display: block;
  max-width: 100%;
}

.thumbnail-editor-actions {
  display: flex;
  justify-content: flex-start;
}

.thumbnail-remove-check {
  color: var(--muted);
}

.wide-form {
  width: 100%;
}

.form-actions {
  justify-content: flex-end;
  margin-top: 24px;
}

.compact-actions {
  margin-top: 16px;
}

.game-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  padding: 26px;
  margin-bottom: 18px;
}

.game-hero.has-thumbnail {
  grid-template-columns: 180px minmax(0, 1fr) 220px;
}

.game-thumbnail-panel img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.game-hero p {
  color: var(--muted);
}

.game-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.game-title-row h2 {
  overflow-wrap: anywhere;
}

.qr-panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
}

.qr-panel img {
  width: 180px;
  height: 180px;
  padding: 10px;
  background: white;
  border-radius: 8px;
}

.control-row {
  justify-content: flex-start;
  margin-bottom: 18px;
}

.dashboard-columns,
.api-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.4fr);
  gap: 18px;
}

.api-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  padding: 22px;
}

.panel-wide {
  grid-column: 1 / -1;
}

.link-test-form {
  display: grid;
  gap: 18px;
}

.link-test-actions {
  justify-content: flex-start;
  margin-top: 0;
}

.link-test-status {
  min-height: 24px;
  color: var(--muted);
}

.link-test-status.is-success {
  color: var(--lime);
}

.link-test-status.is-warning {
  color: #ffd166;
}

.link-test-status.is-error {
  color: #ff657c;
}

.link-test-results {
  display: grid;
  gap: 10px;
}

.link-test-result-row {
  display: grid;
  grid-template-columns: 56px 92px 220px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(104, 240, 255, 0.14);
  border-radius: 8px;
  background: rgba(104, 240, 255, 0.045);
}

.link-test-open-link {
  min-height: 36px;
  align-content: center;
  white-space: normal;
}

.link-test-result-row code {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.9rem;
}

.load-test-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.load-test-metrics {
  margin: 18px 0;
}

.load-test-player-link-card {
  margin-bottom: 18px;
}

.load-test-api-docs-card {
  margin-bottom: 18px;
}

.load-test-history-panel {
  margin-bottom: 18px;
}

.load-test-history-panel[hidden] {
  display: none;
}

.load-test-connection-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.load-test-connection-controls[hidden] {
  display: none;
}

.load-test-connection-controls > span {
  color: var(--muted);
  font-weight: 800;
}

.load-test-connection-controls .is-active {
  color: var(--bg);
  background: linear-gradient(135deg, var(--cyan), var(--green));
  border-color: transparent;
  box-shadow: 0 0 20px rgba(104, 240, 255, 0.28);
}

.load-test-api-docs-card[open] .api-doc-toggle {
  font-size: 0;
}

.load-test-api-docs-card[open] .api-doc-toggle::after {
  content: "Close";
  font-size: 0.95rem;
}

.load-test-api-docs-summary {
  cursor: pointer;
  list-style: none;
}

.load-test-api-docs-summary::-webkit-details-marker {
  display: none;
}

.api-doc-stack {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.api-doc-stack h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 0.95rem;
}

.load-test-history-list {
  display: grid;
  gap: 14px;
}

.load-test-history-round {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(104, 240, 255, 0.18);
  border-radius: 8px;
  background: rgba(104, 240, 255, 0.045);
}

.load-test-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.load-test-history-head h4 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 1.05rem;
}

.load-test-history-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.load-test-history-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.load-test-history-summary strong {
  color: var(--cyan);
}

.load-test-history-table {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.load-test-history-row {
  display: grid;
  grid-template-columns: 72px 150px minmax(130px, 1fr) 140px 130px;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--muted);
  background: rgba(7, 18, 34, 0.72);
  border: 1px solid rgba(104, 240, 255, 0.13);
  border-radius: 8px;
}

.load-test-history-row-head {
  min-height: 32px;
  background: transparent;
  border-color: rgba(104, 240, 255, 0.22);
  color: var(--text);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.load-test-history-row strong,
.load-test-history-row code {
  color: var(--cyan);
}

.load-test-list {
  display: grid;
  gap: 8px;
  max-height: 640px;
  overflow: auto;
  padding-right: 4px;
}

.load-test-row {
  display: grid;
  grid-template-columns: 64px 140px 130px 120px minmax(130px, 1fr) minmax(110px, auto) minmax(130px, auto) minmax(120px, auto);
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(104, 240, 255, 0.045);
  border: 1px solid rgba(104, 240, 255, 0.14);
  border-radius: 8px;
}

.load-test-row-head {
  min-height: 34px;
  background: transparent;
  border-color: rgba(104, 240, 255, 0.22);
  color: var(--text);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.load-test-row-head button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 900;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.load-test-row-head button:hover,
.load-test-row-head button.is-active {
  color: var(--cyan);
}

.load-test-row-head [data-sort-arrow] {
  color: var(--cyan);
  font-size: 0.95rem;
  line-height: 1;
}

.load-test-row strong,
.load-test-row code {
  color: var(--cyan);
}

.load-test-row [data-row-status] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 86px;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-weight: 800;
  line-height: 1;
}

.load-test-row[data-status="queued"] [data-row-status] {
  color: #b8c7da;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.28);
}

.load-test-row[data-status="connecting"] [data-row-status],
.load-test-row[data-status="socket retrying"] [data-row-status] {
  color: #ffd166;
  background: rgba(255, 209, 102, 0.13);
  border-color: rgba(255, 209, 102, 0.38);
}

.load-test-row[data-status="waiting open"] [data-row-status],
.load-test-row[data-status="waiting score"] [data-row-status],
.load-test-row[data-status="stopped"] [data-row-status] {
  color: #8fc5ff;
  background: rgba(143, 197, 255, 0.12);
  border-color: rgba(143, 197, 255, 0.34);
}

.load-test-row[data-status="confirmed"] [data-row-status] {
  color: #6df6ff;
  background: rgba(104, 240, 255, 0.13);
  border-color: rgba(104, 240, 255, 0.42);
}

.load-test-row[data-status="submitted"] [data-row-status] {
  color: #a7ff5f;
  background: rgba(167, 255, 95, 0.14);
  border-color: rgba(167, 255, 95, 0.42);
}

.load-test-row[data-status="clicking"] [data-row-status] {
  color: #ffffff;
  background: rgba(167, 255, 95, 0.18);
  border-color: rgba(167, 255, 95, 0.48);
}

.load-test-row[data-status="failed"] [data-row-status] {
  color: #ff7d94;
  background: rgba(255, 101, 124, 0.14);
  border-color: rgba(255, 101, 124, 0.46);
}

.load-test-row [data-row-connection-status] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 86px;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 900;
  line-height: 1;
}

.load-test-row[data-connection-status="waiting"] [data-row-connection-status] {
  color: #8fc5ff;
  background: rgba(143, 197, 255, 0.12);
  border: 1px solid rgba(143, 197, 255, 0.34);
}

.load-test-row[data-connection-status="prepared"] [data-row-connection-status] {
  color: #ffd166;
  background: rgba(255, 209, 102, 0.13);
  border: 1px solid rgba(255, 209, 102, 0.38);
}

.load-test-row[data-connection-status="playing"] [data-row-connection-status] {
  color: #a7ff5f;
  background: rgba(167, 255, 95, 0.14);
  border: 1px solid rgba(167, 255, 95, 0.42);
}

.load-test-row[data-connection-status="ended"] [data-row-connection-status] {
  color: #ff7d94;
  background: rgba(255, 101, 124, 0.14);
  border: 1px solid rgba(255, 101, 124, 0.46);
}

.load-test-row[data-status="clicking"] {
  border-color: rgba(167, 255, 95, 0.35);
  background: rgba(167, 255, 95, 0.06);
}

.load-test-row[data-status="confirmed"],
.load-test-row[data-status="submitted"] {
  border-color: rgba(104, 240, 255, 0.34);
  background: rgba(104, 240, 255, 0.08);
}

.load-test-row[data-status="failed"] {
  border-color: rgba(255, 101, 124, 0.4);
  background: rgba(255, 101, 124, 0.08);
}

.load-code-player {
  display: grid;
  gap: 18px;
}

.api-choice-card {
  display: grid;
  align-content: space-between;
  gap: 18px;
}

.panel-head {
  margin-bottom: 16px;
}

.panel-head span {
  color: var(--muted);
}

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

.leader-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px;
  background: rgba(104, 240, 255, 0.045);
  border: 1px solid rgba(104, 240, 255, 0.14);
  border-radius: 8px;
}

.leader-row:first-child {
  border-color: rgba(167, 255, 95, 0.42);
  box-shadow: inset 0 0 20px rgba(167, 255, 95, 0.08);
}

.leader-row.is-me {
  border-color: rgba(255, 95, 210, 0.5);
  background: rgba(255, 95, 210, 0.08);
}

.rank {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--bg);
  background: var(--cyan);
  border-radius: 999px;
  font-weight: 700;
}

.name {
  overflow-wrap: anywhere;
}

.name small {
  display: block;
  color: var(--muted);
}

.score {
  color: var(--lime);
  font-size: 1.25rem;
}

.info-list {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px 16px;
  margin: 0;
}

.info-list dt {
  color: var(--muted);
  font-weight: 500;
}

.info-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.code-block {
  margin: 0;
  padding: 16px;
  color: var(--cyan);
  background: rgba(5, 11, 24, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
}

.player-card {
  width: min(680px, 100%);
  padding: 28px;
}

.join-card {
  text-align: center;
}

.player-copy {
  color: var(--muted);
}

.big-input {
  min-height: 58px;
  text-align: center;
  font-size: 1.2rem;
}

.player-game {
  display: grid;
  gap: 18px;
  width: min(760px, 100%);
}

.player-header {
  width: 100%;
}

.score-stage {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
}

.score-label {
  color: var(--muted);
  font-size: 1.1rem;
}

.score-number {
  color: var(--cyan);
  font-size: clamp(4rem, 18vw, 8rem);
  line-height: 0.95;
  text-shadow: 0 0 30px rgba(104, 240, 255, 0.35);
}

.tap-button {
  width: min(360px, 100%);
  min-height: 118px;
  color: #03111b;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  border: 0;
  border-radius: 8px;
  box-shadow: 0 0 28px rgba(104, 240, 255, 0.34);
  font-family: inherit;
  font-size: clamp(1.4rem, 6vw, 2rem);
  font-weight: 700;
  transition: transform 120ms ease, filter 120ms ease;
}

.tap-button:not(:disabled):active,
.tap-button.is-pressing {
  transform: scale(0.97);
  filter: brightness(1.08);
}

.tap-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7) brightness(0.72);
}

.button-test-player {
  width: min(760px, 100%);
}

.simulator-card {
  display: grid;
  gap: 18px;
}

.simulator-head,
.simulator-join-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.simulator-join-row {
  align-items: stretch;
}

.simulator-join-row .form-control {
  min-width: 0;
  text-align: left;
}

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

.simulator-stat {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 14px;
  background: rgba(8, 17, 34, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.simulator-stat span {
  color: var(--muted);
  font-size: 0.9rem;
}

.simulator-stat strong {
  color: var(--cyan);
  font-size: clamp(1.35rem, 5vw, 2rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.simulator-result {
  padding: 18px;
}

.player-copy.is-error {
  color: var(--danger);
}

.showroom-control-stage {
  gap: 18px;
}

.joystick-pad {
  display: grid;
  grid-template-columns: repeat(3, 84px);
  grid-template-rows: repeat(3, 84px);
  gap: 10px;
  justify-content: center;
  touch-action: manipulation;
}

.joystick-button {
  display: inline-grid;
  place-items: center;
  width: 84px;
  height: 84px;
  color: #03111b;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  border: 0;
  border-radius: 8px;
  box-shadow: 0 0 22px rgba(104, 240, 255, 0.28);
  font: inherit;
  font-size: 2rem;
  font-weight: 800;
}

.joystick-button[data-joy="forward"] {
  grid-column: 2;
  grid-row: 1;
}

.joystick-button[data-joy="left"] {
  grid-column: 1;
  grid-row: 2;
}

.joystick-center {
  grid-column: 2;
  grid-row: 2;
  color: var(--cyan);
  background: rgba(104, 240, 255, 0.08);
  border: 1px solid var(--line-strong);
}

.joystick-button[data-joy="right"] {
  grid-column: 3;
  grid-row: 2;
}

.joystick-button[data-joy="back"] {
  grid-column: 2;
  grid-row: 3;
}

.joystick-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7) brightness(0.72);
}

.leaderboard-card {
  width: 100%;
}

.empty-state {
  display: grid;
  gap: 12px;
  justify-items: start;
  width: min(720px, 100%);
  padding: 28px;
  background: rgba(16, 24, 39, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.alert-danger {
  color: #ffdbe2;
  background: rgba(255, 101, 124, 0.12);
  border-color: rgba(255, 101, 124, 0.4);
}

.alert-success,
.neon-alert {
  color: #edffd9;
  background: rgba(167, 255, 95, 0.1);
  border-color: rgba(167, 255, 95, 0.36);
}

.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.table-actions form {
  margin: 0;
}

.inline-form {
  display: inline;
  margin: 0;
}

.table-load-more {
  display: flex;
  justify-content: center;
  padding-top: 16px;
}

.connection-event-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.connection-event-row {
  display: grid;
  grid-template-columns: 150px 80px minmax(0, 1fr) 180px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(104, 240, 255, 0.045);
  border: 1px solid rgba(104, 240, 255, 0.14);
  border-radius: 8px;
}

.connection-event-row code {
  color: var(--cyan);
  overflow-wrap: anywhere;
}

.game-list-thumbnail {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.delete-panel {
  max-width: 760px;
}

.delete-summary {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: rgba(255, 101, 124, 0.06);
  border: 1px solid rgba(255, 101, 124, 0.28);
  border-radius: 8px;
}

.delete-summary h3 {
  margin: 0 0 10px;
}

@media (max-width: 1100px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .metric-grid,
  .api-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .content-wrap,
  .topbar,
  .sidebar {
    padding: 20px;
  }

  .topbar,
  .section-head,
  .player-header,
  .game-hero,
  .login-panel {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head,
  .player-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid,
  .api-grid,
  .game-type-grid,
  .boat-position-fields,
  .thumbnail-editor-grid,
  .load-test-fields,
  .link-test-result-row {
    grid-template-columns: 1fr;
  }

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

  .load-test-history-head {
    flex-direction: column;
  }

  .load-test-history-summary {
    justify-content: flex-start;
  }

  .load-test-history-panel-actions {
    justify-content: flex-start;
  }

  .load-test-history-row {
    grid-template-columns: 1fr;
  }

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

  .thumbnail-preview-card {
    justify-items: start;
  }

  .login-panel {
    padding: 24px;
  }

  .game-hero {
    display: grid;
  }

  .game-hero.has-thumbnail {
    grid-template-columns: 1fr;
  }

  .hero-meta,
  .control-row,
  .form-actions,
  .game-title-row,
  .simulator-head,
  .simulator-join-row {
    align-items: stretch;
    flex-direction: column;
  }

  .control-row form,
  .control-row button,
  .simulator-join-row .btn,
  .form-actions .btn {
    width: 100%;
  }

  .simulator-stats {
    grid-template-columns: 1fr;
  }

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

  .neon-table {
    min-width: 920px;
  }

  .info-list {
    grid-template-columns: 1fr;
  }
}
