:root {
  color-scheme: dark;
  --bg: #04120b;
  --panel: #081b10;
  --panel-2: #0b2617;
  --text: #eafff1;
  --muted: #8bb89b;
  --line: rgba(132, 255, 164, 0.18);
  --green: #44ff88;
  --lime: #baff5d;
  --danger: #ff6b8a;
  --shadow: 0 0 28px rgba(68, 255, 136, 0.22);
  font-family: "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(68, 255, 136, 0.18), transparent 30rem),
    linear-gradient(180deg, #031008 0%, #06130c 45%, #020705 100%);
  color: var(--text);
}

button, input, textarea {
  font: inherit;
}

.shell {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.hero {
  position: relative;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  padding: 20px 0 24px;
  overflow: hidden;
}

.eyebrow {
  margin: 0;
  color: var(--lime);
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 800;
  font-size: 0.78rem;
}

h1, h2, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(3rem, 10vw, 6rem);
  line-height: 1;
  text-shadow: 0 0 28px rgba(68, 255, 136, 0.42);
}

h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

.lead {
  max-width: 620px;
  margin-bottom: 0;
  color: #c6f6d8;
  font-size: 1.05rem;
  line-height: 1.45;
}

.hero-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: min(100%, 620px);
}

.daily-info {
  margin: 0;
  color: var(--lime);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 0 16px rgba(186, 255, 93, 0.25);
}

.ufo {
  position: absolute;
  top: 26px;
  right: 8px;
  width: 220px;
  height: 220px;
  pointer-events: none;
  filter: drop-shadow(0 0 25px rgba(68, 255, 136, 0.45));
}

.saucer {
  position: absolute;
  top: 34px;
  left: 38px;
  width: 168px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(180deg, #d7ffe2, #2d8d58 48%, #0b2215 52%, #79ff9f);
  box-shadow: inset 0 -10px 24px rgba(0, 0, 0, 0.35), 0 0 30px rgba(68, 255, 136, 0.45);
}

.saucer span {
  position: absolute;
  top: -24px;
  left: 54px;
  width: 58px;
  height: 42px;
  border-radius: 50% 50% 38% 38%;
  background: rgba(193, 255, 211, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.beam {
  position: absolute;
  top: 84px;
  left: 76px;
  width: 96px;
  height: 170px;
  background: linear-gradient(180deg, rgba(186, 255, 93, 0.38), rgba(68, 255, 136, 0));
  clip-path: polygon(28% 0, 72% 0, 100% 100%, 0% 100%);
}

.balance, .panel, .event-card, .players-panel, .modal-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 38, 23, 0.92), rgba(8, 27, 16, 0.92));
  box-shadow: var(--shadow);
}

.balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(100%, 340px);
  padding: 14px 16px;
  border-radius: 8px;
}

.balance span {
  color: var(--muted);
}

.balance strong {
  font-size: 1.35rem;
  color: var(--lime);
}

button, .link-button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.text-link {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--lime);
  font-weight: 800;
  box-shadow: none;
}

.text-link:hover {
  color: var(--green);
}

.primary {
  background: linear-gradient(180deg, #267d4e, #155435);
  border-color: rgba(88, 209, 137, 0.58);
  color: #f5fff8;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(38, 125, 78, 0.24);
}

.ghost {
  background: #1a2820;
  border-color: rgba(154, 190, 168, 0.22);
  color: #edf8f1;
}

.primary:hover { background: linear-gradient(180deg, #31945e, #1a6841); }
.ghost:hover { background: #24372c; border-color: rgba(113, 206, 149, 0.42); }

.primary:active, .ghost:active {
  transform: translateY(1px);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
}

.tabs, .subtabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  gap: 8px;
  padding: 10px 0;
  margin: -4px 0 6px;
  background: linear-gradient(180deg, rgba(4, 18, 11, 0.98), rgba(4, 18, 11, 0.78));
  backdrop-filter: blur(10px);
}

.tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.subtabs {
  position: static;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 12px;
  padding: 0;
  background: transparent;
}

.tab, .subtab {
  background: rgba(68, 255, 136, 0.08);
  border-color: var(--line);
  color: var(--muted);
  font-weight: 800;
}

.tab.active, .subtab.active {
  background: #23442f;
  color: #f5fff8;
  box-shadow: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.events {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(244px, 1fr));
  gap: 12px;
  align-items: start;
  grid-auto-flow: dense;
}

#events.events {
  display: block;
  columns: 244px;
  column-gap: 12px;
}

#events.events .event-card {
  display: inline-flex;
  width: 100%;
  margin: 0 0 12px;
  break-inside: avoid;
}

@media (min-width: 1320px) {
  #events.events {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    columns: auto;
  }

  #events.events .event-card {
    display: flex;
    margin: 0;
  }
}

#myBets.events {
  grid-template-columns: repeat(auto-fit, minmax(315px, 1fr));
}

.event-card {
  position: relative;
  border-radius: 8px;
  padding: 14px;
}

.event-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: stretch;
  margin-top: 12px;
}

.report-button {
  min-height: 40px;
  width: 42px;
  padding: 0;
  border-radius: 8px;
  border-color: rgba(255, 134, 91, 0.42);
  background: linear-gradient(180deg, rgba(255, 149, 82, 0.3), rgba(184, 55, 42, 0.3));
  color: #ffd0a8;
  font-size: 1rem;
  box-shadow: 0 0 18px rgba(255, 108, 68, 0.18);
}

.report-button:hover {
  border-color: rgba(255, 174, 105, 0.7);
  background: linear-gradient(180deg, rgba(255, 170, 82, 0.42), rgba(209, 66, 48, 0.42));
  color: #fff0d8;
}

.space-card {
  min-height: 168px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  cursor: pointer;
}

.space-card:hover {
  border-color: rgba(186, 255, 93, 0.52);
}

.space-card .status {
  grid-column: 1 / -1;
  white-space: normal;
}

.space-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.space-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--lime), var(--green) 52%, #06130c 56%);
  box-shadow: 0 0 18px rgba(68, 255, 136, 0.36);
  object-fit: cover;
}

.space-back-row {
  grid-column: 1 / -1;
}

.local-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px auto;
  gap: 8px;
  margin: 10px 0 14px;
}

.space-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 12px; }
.manager-form { display: grid; gap: 10px; align-content: start; }
.manager-form h3 { margin: 6px 0 0; }
.compact-grid, .currency-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.currency-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.owned-events { display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.owned-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.owned-actions { display: flex; gap: 6px; flex-wrap: wrap; }
button.danger { border-color: #b55a35; background: #6f2f20; color: #ffd9c9; }

.players-panel {
  border-radius: 8px;
  padding: 12px;
}

.players-page {
  max-width: none;
}

.players-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.players-layout > .panel,
.players-layout > .players-panel {
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
}

.players-layout > .profile-public {
  align-self: stretch;
}

.players-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.players-head h2 {
  font-size: 1rem;
}

.players-head input {
  padding: 10px;
  min-height: 40px;
}

.user-list {
  display: grid;
  gap: 8px;
}

.user-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 36px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 18, 11, 0.64);
  cursor: pointer;
}

.user-row:hover {
  border-color: rgba(186, 255, 93, 0.52);
  background: rgba(16, 60, 33, 0.72);
}

.user-row.selected {
  border-color: var(--green);
  background: rgba(16, 60, 33, 0.82);
  box-shadow: inset 3px 0 0 var(--lime);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--lime), var(--green) 52%, #06130c 56%);
  box-shadow: 0 0 16px rgba(68, 255, 136, 0.34);
  object-fit: cover;
}

.user-info {
  min-width: 0;
}

.user-info strong,
.user-info span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.user-info strong {
  font-size: 0.88rem;
}

.user-info span,
.users-more {
  color: var(--muted);
  font-size: 0.78rem;
}

.users-more {
  margin: 10px 2px 0;
}

.money-button,
.icon-button {
  min-height: 36px;
  width: 36px;
  padding: 0;
  border-color: var(--line);
  border-radius: 50%;
  color: var(--lime);
  background: rgba(68, 255, 136, 0.1);
  font-weight: 900;
}

.money-button:hover,
.icon-button:hover {
  color: #ffffff;
  background: #2b7049;
}

.market-card {
  min-height: 155px;
  height: auto;
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.market-card:not(.expanded) {
  justify-content: space-between;
}

.market-card.expanded {
  min-height: 0;
}

.market-card.expanded > .event-actions {
  display: none;
}

.event-info > .event-actions-bottom {
  margin-top: 0;
}

.market-card .event-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  min-height: 0;
}

.market-card .event-head > div:first-child {
  display: contents;
}

.market-card .event-head .event-id {
  grid-column: 1;
  grid-row: 1;
}

.market-card .event-head .status {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

.market-card .event-head h2 {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 0;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
  line-height: 1.13;
  letter-spacing: 0;
}

.market-card .outcomes {
  margin-top: 10px;
}

.event-info {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.info-toggle {
  width: 100%;
  min-height: 40px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.82rem;
}

.event-head + .event-actions {
  margin-top: auto;
}

.bet-card .outcome {
  margin-top: 0;
}

.bet-card {
  min-height: 0;
  height: auto;
  display: grid;
  gap: 10px;
}

.bet-card .event-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  min-height: 0;
}

.bet-card .event-head h2 {
  min-height: 0;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
  line-height: 1.16;
}

.bet-card .outcome {
  margin-top: 0;
}

.status-badge {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(68, 255, 136, 0.08);
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: 0.82rem;
  line-height: 1.15;
}

.event-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.event-head h2 {
  font-size: 1rem;
  line-height: 1.25;
}

.event-id {
  color: var(--lime);
  font-weight: 900;
}

.daily-boost-badge {
  min-height: 24px;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  border-color: rgba(186, 255, 93, 0.55);
  background: #256d45;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 950;
  box-shadow: 0 0 14px rgba(68, 255, 136, 0.5);
  vertical-align: middle;
}

.daily-boost-badge-wild {
  border-color: rgba(255, 255, 255, 0.75);
  background:
    radial-gradient(circle at 30% 25%, #ffffff, transparent 18%),
    radial-gradient(circle at 70% 35%, #baff5d, transparent 24%),
    linear-gradient(135deg, #eafff1, var(--lime) 28%, var(--green) 55%, #13ffbf);
  box-shadow: 0 0 12px rgba(186, 255, 93, 0.75), 0 0 30px rgba(68, 255, 136, 0.62);
  animation: boostPulse 1.35s ease-in-out infinite;
}

@keyframes boostPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-1px) scale(1.08); }
}

.status {
  color: var(--muted);
  white-space: nowrap;
}

.outcomes {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.outcome-bet {
  display: grid;
  gap: 8px;
}

.outcome-bet + .outcome-bet {
  position: relative;
  padding-top: 13px;
}

.outcome-bet + .outcome-bet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(132, 255, 164, 0.34), transparent);
}

.outcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border-radius: 8px;
  background: rgba(4, 18, 11, 0.64);
  border: 1px solid var(--line);
  overflow: hidden;
}

.outcome > div {
  min-width: 0;
}

.odds {
  color: var(--lime);
  font-weight: 900;
}

.bet-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 0;
}

.description {
  margin-top: 8px;
  color: var(--muted);
}

.description summary {
  cursor: pointer;
  color: var(--lime);
  font-weight: 800;
}

.description p {
  margin: 8px 0 0;
  color: #c6f6d8;
  line-height: 1.45;
  white-space: pre-line;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: rgba(2, 7, 5, 0.75);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.transfer-panel,
.profile-panel {
  max-width: 520px;
}

.profile-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.profile-layout .panel {
  margin-bottom: 0;
}

.profile-layout .profile-panel {
  max-width: none;
}

.profile-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-public {
  max-width: none;
}

.profile-top {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.profile-top h3 {
  font-size: 1.12rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.profile-top p {
  margin-top: 3px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.profile-top strong {
  color: var(--lime);
  white-space: nowrap;
}

.profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--lime), var(--green) 52%, #06130c 56%);
  box-shadow: 0 0 20px rgba(68, 255, 136, 0.38);
  object-fit: cover;
}

.profile-bio {
  color: #c6f6d8;
  line-height: 1.45;
  white-space: pre-line;
}

.profile-bio.muted {
  color: var(--muted);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stat-pill {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 18, 11, 0.62);
  align-content: space-between;
}

.stat-pill span,
.profile-swings {
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-pill strong {
  color: var(--text);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.profile-swings {
  display: grid;
  gap: 6px;
}

.recent-bets {
  display: grid;
  gap: 8px;
}

.recent-bets h4 {
  margin: 0;
  color: var(--text);
}

.recent-bet {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 18, 11, 0.56);
}

.recent-bet summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.recent-bet summary::-webkit-details-marker {
  display: none;
}

.recent-title {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.recent-bet[open] .recent-title {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.recent-bet strong {
  color: var(--lime);
  white-space: nowrap;
}

.recent-bet p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.outcome-grid {
  display: grid;
  gap: 10px;
}

.outcome-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 36px;
  gap: 10px;
  align-items: end;
}

.odds-helper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.odds-helper strong {
  min-width: 42px;
  color: var(--lime);
  padding-bottom: 12px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.admin-edit {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 18, 11, 0.42);
}

.admin-edit summary {
  cursor: pointer;
  color: var(--lime);
  font-weight: 900;
}

.admin-edit[open] summary {
  margin-bottom: 4px;
}

.admin-edit textarea {
  min-height: 170px;
}

.user-adjust {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 8px;
  margin-top: 14px;
}

.apply-icon-button {
  width: 46px;
  min-width: 46px;
  padding: 0;
  font-size: 1rem;
}

.resolve-button {
  width: auto;
  max-width: 82px;
  min-height: 38px;
  padding: 0 10px;
  white-space: nowrap;
}

.admin-shell .outcome .status {
  white-space: normal;
}

.played-at-row {
  margin-top: 12px;
}

.danger {
  background: rgba(255, 107, 138, 0.12);
  border-color: rgba(255, 107, 138, 0.35);
  color: #ffd5dd;
}

.refund-button {
  background: rgba(255, 137, 70, 0.14);
  border-color: rgba(255, 137, 70, 0.42);
  color: #ffd8bd;
}

.refund-button:hover {
  background: rgba(255, 107, 70, 0.24);
  border-color: rgba(255, 137, 70, 0.68);
}

.empty {
  color: var(--muted);
  padding: 18px 0;
}

.hidden {
  display: none !important;
}

.auth-notice {
  max-width: 620px;
  display: grid;
  gap: 12px;
}

.auth-notice p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

/* Compact admin workspace */
.admin-shell {
  width: min(1560px, 100%);
}

#adminAuth {
  width: min(520px, 100%);
  margin: 12vh auto 0;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 8px;
}

.admin-shell h1 {
  margin: 2px 0 0;
  font-size: 2.4rem;
}

.admin-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 10px;
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;
}

.admin-create-grid,
.admin-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.admin-form-panel {
  margin: 0;
  gap: 10px;
  padding: 14px;
  box-shadow: 0 0 16px rgba(68, 255, 136, 0.12);
}

.admin-shell input,
.admin-shell textarea,
.admin-shell select {
  padding: 9px 10px;
}

.admin-shell textarea {
  min-height: 76px;
}

.admin-inline-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.admin-filterbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-user-filterbar {
  grid-template-columns: minmax(220px, 520px) auto;
  align-items: center;
}

.admin-event-list,
.admin-report-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.admin-event-card {
  padding: 11px;
  box-shadow: 0 0 14px rgba(68, 255, 136, 0.1);
}

.admin-event-heading {
  min-width: 0;
}

.admin-event-heading h2 {
  display: -webkit-box;
  margin: 2px 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.admin-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-manage {
  margin-top: 9px;
  border-top: 1px solid var(--line);
}

.admin-manage > summary {
  padding-top: 9px;
  color: var(--lime);
  cursor: pointer;
  font-weight: 800;
}

.admin-manage-content {
  padding-top: 4px;
}

.admin-event-description {
  max-height: 7.2em;
  margin: 8px 0;
  overflow: auto;
  color: #c6f6d8;
  font-size: 0.84rem;
  line-height: 1.4;
  white-space: pre-line;
}

.admin-manage .admin-edit {
  margin-top: 8px;
}

.admin-manage .admin-edit textarea {
  min-height: 110px;
}

.admin-manage .outcomes {
  gap: 6px;
}

.admin-manage .outcome {
  padding: 7px 8px;
}

.admin-user-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.admin-user-card {
  min-width: 0;
  padding: 10px;
  box-shadow: 0 0 12px rgba(68, 255, 136, 0.09);
}

.admin-user-card .event-head {
  min-height: 42px;
}

.admin-user-card .event-id,
.admin-user-id {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-id {
  margin-top: 2px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
}

.admin-user-card .user-adjust {
  margin-top: 7px;
}

@media (max-width: 980px) {
  .admin-create-grid,
  .admin-access-grid,
  .admin-event-list,
  .admin-report-list {
    grid-template-columns: 1fr;
  }

  .admin-user-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.telegram-login {
  min-height: 46px;
  display: flex;
  align-items: center;
}

.auth-hint {
  font-size: 0.92rem;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
  filter: grayscale(0.35);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(440px, 100%);
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
}

@media (max-width: 620px) {
  .local-tools,
  .compact-grid,
  .currency-grid { grid-template-columns: 1fr; }
  .shell {
    padding: 14px;
  }

  .hero {
    min-height: 500px;
  }

  .ufo {
    top: 20px;
    right: 50%;
    transform: translateX(50%);
  }

  .event-head, .toolbar {
    align-items: flex-start;
  }

  .toolbar {
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions button {
    flex: 1;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-header {
    align-items: flex-start;
  }

  .admin-header .toolbar-actions {
    width: auto;
  }

  .admin-inline-options,
  .admin-filterbar,
  .admin-user-filterbar,
  .admin-user-list {
    grid-template-columns: 1fr;
  }

  .subtabs {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .profile-layout,
  .players-layout,
  .bet-row,
  .outcome-grid,
  .outcome-form-row,
  .odds-helper,
  .user-adjust,
  .profile-links {
    grid-template-columns: 1fr;
  }

  .market-card {
    min-height: auto;
  }

  .bet-card {
    min-height: auto;
  }

  .market-card .event-head,
  .market-card .event-head h2,
  .bet-card .event-head,
  .bet-card .event-head h2 {
    min-height: 0;
  }

  .profile-top {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .profile-top strong {
    grid-column: 1 / -1;
  }

  .profile-avatar {
    width: 48px;
    height: 48px;
  }

  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Compact market workspace */
body {
  background: #090d0b;
  overflow-x: hidden;
}

.shell {
  width: min(1500px, 100%);
  padding: 0 20px 28px;
}

.hero {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas:
    "title balance"
    "lead daily";
  align-items: center;
  gap: 5px 24px;
  padding: 17px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow: visible;
}

.brand-lockup { grid-area: title; display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { width: 52px; height: 52px; object-fit: contain; flex: 0 0 auto; }
.hero h1 { margin: 0; font-size: 2.8rem; line-height: 1; }
.hero .lead { grid-area: lead; max-width: 720px; font-size: 0.9rem; color: #aebbb3; }
.hero .balance { grid-area: balance; justify-self: end; width: 300px; padding: 10px 13px; box-shadow: none; }
.hero .balance strong { font-size: 1rem; }
.hero .hero-actions { grid-area: daily; justify-self: end; width: 300px; display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: center; gap: 9px; }
.hero .hero-actions button { min-height: 38px; padding: 0 13px; box-shadow: none; }
.hero .daily-info { min-width: 0; font-size: 0.76rem; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }

.balance, .panel, .event-card, .players-panel, .modal-card {
  background: #151a17;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.tabs {
  position: sticky;
  top: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0 -20px 12px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(9, 13, 11, 0.96);
}

.tab {
  min-height: 44px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #aab4ad;
}

.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.035); }
.tab.active {
  color: var(--text);
  background: transparent;
  border-bottom-color: var(--green);
  box-shadow: none;
}

#manageSpaceNav {
  color: #f5fff8;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.market-strip {
  display: grid;
  grid-template-columns: minmax(160px, auto) minmax(360px, 720px);
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 4px 0 14px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.market-strip .toolbar { margin: 0; }
.market-strip .toolbar h2 { font-size: 1.35rem; }
.market-strip .subtabs { margin: 0; }
.subtab { min-height: 38px; border-radius: 6px; background: #131815; }
.subtab.active { background: #294536; color: #f5fff8; box-shadow: none; border-color: rgba(68, 255, 136, 0.35); }

#events.events {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  columns: auto;
}

#events.events .event-card { display: flex; margin: 0; }
.event-card { border-radius: 7px; }
.market-card { min-height: 172px; padding: 14px; }
.market-card .event-head h2 { font-size: 0.94rem; line-height: 1.25; }
.market-card .event-head .status { color: #9ca9a1; }
.market-card .event-head .event-id { color: var(--green); }
.market-card .primary { box-shadow: none; }
.market-card:hover { border-color: rgba(68, 255, 136, 0.32); background: #18201b; }
.info-toggle { text-transform: none; }

@media (max-width: 1120px) {
  #events.events { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
  .hero .balance,
  .hero .hero-actions { width: 250px; }
  .hero .ufo { display: none; }
  #events.events { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .shell { padding: 0 12px 20px; }
  .hero {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-areas: "title" "lead" "balance" "daily";
    gap: 8px;
    padding: 14px 0;
  }
  .hero h1 { font-size: 2.35rem; }
  .brand-logo { width: 44px; height: 44px; }
  .hero .lead { font-size: 0.82rem; }
  .hero .balance,
  .hero .hero-actions { width: 100%; justify-self: stretch; }
  .hero .hero-actions { grid-template-columns: minmax(0, 1fr) auto; }
  .tabs {
    display: flex;
    grid-template-columns: none;
    gap: 0;
    margin: 0 -12px 10px;
    padding: 0 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; min-width: 112px; padding: 0 13px; }
  .market-strip { grid-template-columns: 1fr; gap: 8px; }
  .market-strip .toolbar { flex-direction: row; align-items: center; }
  .market-strip .subtabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #events.events { grid-template-columns: 1fr; }
}

/* Space workspace */
.space-workspace {
  padding-bottom: 28px;
}

.space-setup-card {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.space-setup-card #spaceForm {
  width: 100%;
  margin-top: 4px;
}

.space-page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  min-height: 76px;
  padding: 8px 0 14px;
}

.space-page-head h2 {
  margin: 3px 0 2px;
  font-size: 1.45rem;
}

.space-subtabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.space-subtab {
  min-height: 44px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #aeb8b1;
}

.space-subtab:hover:not(:disabled) {
  color: #f5fff8;
  background: rgba(255, 255, 255, 0.035);
}

.space-subtab.active {
  color: #f5fff8;
  border-bottom-color: var(--green);
  background: rgba(68, 255, 136, 0.055);
}

.space-panel {
  width: 100%;
}

.space-panel.hidden {
  display: none;
}

.space-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: #121714;
}

.space-stat {
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 13px 15px;
  border-right: 1px solid rgba(255, 255, 255, 0.09);
}

.space-stat:last-child { border-right: 0; }
.space-stat span { color: #9facA4; font-size: 0.78rem; }
.space-stat strong { color: #f5fff8; font-size: 1.15rem; }

.space-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: start;
}

.section-heading,
.outcomes-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.section-heading h3,
.outcomes-heading h3,
.space-reports h3 {
  margin: 0;
}

.space-reports {
  padding-left: 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
}

.space-reports > h3 { margin-bottom: 12px; }
.space-workspace .owned-events { max-height: none; }
.space-workspace .owned-row { background: #121714; }

.local-event-form,
.space-settings-form {
  width: min(880px, 100%);
  gap: 14px;
}

.local-event-form textarea { min-height: 112px; }
.space-settings-form textarea { min-height: 92px; }

.local-outcome-rows {
  display: grid;
  gap: 9px;
}

.local-outcome-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 42px;
  gap: 8px;
  align-items: end;
}

.local-outcome-row .icon-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  color: #ffd9c9;
  border-color: rgba(181, 90, 53, 0.7);
  background: #54281e;
}

@media (max-width: 820px) {
  .space-overview-grid { grid-template-columns: 1fr; gap: 22px; }
  .space-reports { padding: 18px 0 0; border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.09); }
  .space-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .space-stat:nth-child(2) { border-right: 0; }
  .space-stat:nth-child(-n + 2) { border-bottom: 1px solid rgba(255, 255, 255, 0.09); }
}

@media (max-width: 620px) {
  .space-page-head { min-height: 64px; }
  .space-subtab { min-width: 0; padding: 0 7px; font-size: 0.78rem; }
  .space-stats { margin-bottom: 18px; }
  .space-stat { min-height: 66px; padding: 11px; }
  .section-heading, .outcomes-heading { align-items: flex-start; }
  .local-outcome-row { grid-template-columns: minmax(0, 1fr) 106px 42px; }
  .owned-row { grid-template-columns: 1fr; }
}

