@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;700&family=Orbitron:wght@500;700&display=swap');

:root {
  --bg-0: #f3f5f4;
  --bg-1: #dde6e2;
  --ink-0: #162321;
  --ink-1: #253734;
  --muted: #5f7370;
  --brand: #0f9d8b;
  --brand-2: #155b8a;
  --warn: #c53f35;
  --card: rgba(255, 255, 255, 0.9);
  --line: rgba(22, 35, 33, 0.2);
  --shadow: 0 14px 32px rgba(21, 50, 47, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink-0);
  font-family: 'Chakra Petch', sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(15, 157, 139, 0.24), transparent 28%),
    radial-gradient(circle at 85% 80%, rgba(21, 91, 138, 0.2), transparent 25%),
    linear-gradient(120deg, var(--bg-0), var(--bg-1));
  min-height: 100vh;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.03em;
}

a {
  color: var(--brand-2);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.88rem;
}

.kicker {
  margin-bottom: 8px;
  font-size: 0.86rem;
  color: var(--brand-2);
  letter-spacing: 0.08em;
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.login-shell {
  width: min(580px, 92vw);
}

.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.error-banner {
  background: rgba(197, 63, 53, 0.1);
  border: 1px solid rgba(197, 63, 53, 0.35);
  border-radius: 10px;
  padding: 10px;
  margin: 14px 0;
  color: #78211b;
}

.google-wrap {
  margin-top: 12px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.page-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.page-nav .current {
  border-color: rgba(15, 157, 139, 0.45);
  background: rgba(15, 157, 139, 0.12);
}

.role {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 157, 139, 0.12);
  border: 1px solid rgba(15, 157, 139, 0.35);
  border-radius: 999px;
  padding: 2px 10px;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  padding: 18px;
}

.workspace-stack {
  display: grid;
  gap: 16px;
}

.single-panel-layout {
  padding: 18px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.panel.compact {
  align-self: start;
}

label {
  font-size: 0.88rem;
  color: var(--ink-1);
  margin-bottom: 4px;
  display: block;
}

select,
input,
button {
  font-family: inherit;
}

input[type='checkbox'] {
  accent-color: var(--brand);
}

select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.85);
}

input[type='text'] {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
}

.btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 13px;
  cursor: pointer;
  background: #fff;
  color: var(--ink-0);
  transition: transform 120ms ease, filter 120ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.primary {
  border-color: rgba(15, 157, 139, 0.45);
  background: linear-gradient(120deg, #11ad96, #1d6e9f);
  color: #fff;
}

.btn.wide {
  display: block;
  text-align: center;
  text-decoration: none;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.75);
}

.btn.small {
  font-size: 0.85rem;
  padding: 6px 10px;
}

.server-toolbar {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.server-checklist {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.server-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.server-option label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  cursor: pointer;
}

.server-option-name {
  font-weight: 700;
}

.server-option-path {
  font-size: 0.74rem;
  color: var(--muted);
  word-break: break-all;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 10px;
}

.section-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.gameini-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.gameini-editors {
  display: grid;
  gap: 12px;
}

.gameini-block {
  display: grid;
  gap: 6px;
}

.gameini-block textarea {
  width: 100%;
  min-height: 180px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  resize: vertical;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.88rem;
}

.request-list {
  display: grid;
  gap: 10px;
}

.request-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.catalog-actions {
  display: flex;
  justify-content: flex-start;
}

.unknown-mods-wrap {
  margin-bottom: 6px;
}

.mod-card.unknown {
  border-color: rgba(197, 63, 53, 0.55);
  background: rgba(197, 63, 53, 0.08);
}

.mod-card.unknown .mod-name,
.mod-card.unknown .mod-id,
.mod-card.unknown .mod-presence {
  color: #8a241d;
}

.mod-groups {
  display: grid;
  gap: 16px;
}

.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.mod-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  overflow: hidden;
  display: grid;
  grid-template-rows: 140px auto;
}

.mod-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(140deg, #e4ecea, #f8f9f8);
}

.mod-info {
  padding: 10px;
}

.mod-name {
  font-weight: 700;
}

.mod-id {
  margin: 4px 0 8px;
  font-size: 0.74rem;
  color: var(--muted);
  word-break: break-all;
}

.mod-presence {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.mod-actions {
  display: flex;
  gap: 8px;
}

.mod-actions .btn {
  flex: 1;
}

.modal-shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1000;
}

.modal-shell[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 28, 27, 0.5);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.modal-form {
  display: grid;
  gap: 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  vertical-align: middle;
}

.user-card-shell {
  max-width: 760px;
}

.status-banner {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
  margin: 10px 0 14px;
}

.status-banner.success {
  border-color: rgba(15, 157, 139, 0.55);
  background: rgba(15, 157, 139, 0.1);
  color: #155247;
}

.status-banner.error {
  border-color: rgba(197, 63, 53, 0.5);
  background: rgba(197, 63, 53, 0.1);
  color: #78211b;
}

.verify-form {
  display: grid;
  gap: 10px;
}

.verify-actions {
  display: flex;
  justify-content: flex-end;
}

.portal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.portal-panel {
  display: block;
}

.portal-panel[hidden] {
  display: none;
}

.btn.danger {
  border-color: rgba(197, 63, 53, 0.5);
  color: #8a241d;
}

.market-actions-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.market-tabs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 10px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.listing-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.listing-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.listing-card-header h4 {
  margin: 0;
  font-size: 1rem;
}

.species-badge {
  display: inline-flex;
  border: 1px solid rgba(15, 157, 139, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  color: var(--ink-1);
}

.listing-price {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  display: grid;
  text-align: right;
}

.listing-price small {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.72rem;
  color: var(--muted);
}

.growth-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.growth-bar-wrap {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(21, 91, 138, 0.12);
  overflow: hidden;
}

.growth-bar-fill {
  height: 100%;
  background: linear-gradient(120deg, #11ad96, #1d6e9f);
}

.growth-bar-fill.full {
  background: linear-gradient(120deg, #19b25f, #0f9d8b);
}

.growth-label,
.growth-pct {
  font-size: 0.8rem;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stat-cell {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.65);
}

.stat-cell-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.stat-cell-value {
  font-size: 0.92rem;
  color: var(--ink-0);
}

.listing-footer {
  display: flex;
  gap: 8px;
  align-items: end;
  justify-content: space-between;
}

.listing-meta {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
}

body.webportal-user {
  font-family: 'Outfit', sans-serif;
  color: #e6edf3;
  background:
    radial-gradient(1200px 600px at -10% -20%, #10223a 0%, transparent 50%),
    radial-gradient(700px 500px at 110% 10%, #21262d 0%, transparent 55%),
    linear-gradient(145deg, #0d1117 0%, #161b22 100%);
}

.webportal-user h1,
.webportal-user h2,
.webportal-user h3,
.webportal-user h4,
.webportal-user .btn {
  font-family: 'Space Grotesk', sans-serif;
}

.webportal-user .topbar {
  border-bottom: 1px solid rgba(230, 237, 243, 0.14);
  background: rgba(13, 17, 23, 0.68);
}

.webportal-user .muted,
.webportal-user .small {
  color: #9aa7b6;
}

.webportal-user .panel {
  border: 1px solid rgba(230, 237, 243, 0.18);
  background: rgba(22, 27, 34, 0.86);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.45);
}

.webportal-user .role {
  border: 1px solid rgba(47, 129, 247, 0.45);
  background: rgba(47, 129, 247, 0.14);
  color: #e6edf3;
}

.webportal-user .btn {
  border: 1px solid rgba(230, 237, 243, 0.22);
  background: rgba(48, 54, 61, 0.8);
  color: #e6edf3;
}

.webportal-user .btn:hover:not(:disabled) {
  filter: brightness(1.03);
}

.webportal-user .btn.current,
.webportal-user .btn.primary {
  border-color: rgba(47, 129, 247, 0.45);
  background: #2f81f7;
  color: #f0f6fc;
}

.webportal-user .btn.ghost {
  background: rgba(48, 54, 61, 0.8);
}

.webportal-user input[type='text'],
.webportal-user input[type='number'],
.webportal-user input[type='email'],
.webportal-user select {
  border: 1px solid rgba(230, 237, 243, 0.24);
  background: rgba(13, 17, 23, 0.9);
  color: #e6edf3;
}

.webportal-user .status-banner {
  border: 1px solid rgba(230, 237, 243, 0.18);
  background: rgba(13, 17, 23, 0.45);
}

.webportal-user .status-banner.success {
  border-color: rgba(63, 185, 80, 0.45);
  background: rgba(63, 185, 80, 0.1);
  color: #8be9fd;
}

.webportal-user .status-banner.error {
  border-color: rgba(218, 54, 51, 0.48);
  background: rgba(218, 54, 51, 0.1);
  color: #ff7b72;
}

.webportal-user .listing-card,
.webportal-user .stat-cell,
.webportal-user .request-item,
.webportal-user .filter-bar,
.webportal-user .market-tabs {
  border-color: rgba(230, 237, 243, 0.18);
  background: rgba(22, 27, 34, 0.86);
}

.webportal-user .species-badge {
  background: rgba(99, 102, 241, 0.12);
  color: #2f81f7;
  border-color: rgba(47, 129, 247, 0.38);
}

.webportal-user .listing-price,
.webportal-user .listing-card-header h4 {
  color: #2f81f7;
}

.webportal-user .growth-bar-wrap {
  background: rgba(230, 237, 243, 0.18);
}

.webportal-user .growth-bar-fill {
  background: linear-gradient(90deg, #22c55e, #a3e635);
}

.webportal-user .growth-bar-fill.full {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.webportal-user .user-card-shell {
  max-width: 1100px;
}

/* ---- Crash / Lift-Off game ---- */
.crash-container { max-width: 860px; margin: 0 auto; }
.crash-game { background: rgba(22,27,34,0.86); border: 1px solid rgba(230,237,243,0.18); border-radius: 12px; padding: 2rem; text-align: center; }
.crash-balance-line { display: flex; justify-content: space-between; align-items: center; margin: 1rem 0; padding: 1rem; background: rgba(47,129,247,0.1); border-radius: 8px; border-left: 3px solid #2f81f7; color: #9aa7b6; font-size: 0.95rem; }
.crash-balance-line span { color: #2f81f7; font-weight: 700; }
.crash-multiplier-wrap { border: 2px solid rgba(230,237,243,0.18); border-radius: 12px; background: rgba(13,17,23,0.8); padding: 1.5rem; margin: 1rem 0; }
.crash-multiplier { font-family: 'Space Grotesk', sans-serif; font-size: 3.5rem; font-weight: 700; color: #8be9fd; letter-spacing: 0.04em; margin: 0; }
.crash-multiplier.crashed { color: #ff7b72; }
.crash-status { color: #9aa7b6; font-size: 1rem; margin: 0.75rem 0 0; }
#liftGraph { width: 100%; height: 200px; display: block; margin-top: 0.8rem; background: rgba(13,17,23,0.55); border: 1px solid rgba(230,237,243,0.18); border-radius: 10px; }
.crash-form-section { background: rgba(13,17,23,0.5); padding: 1.5rem; border-radius: 8px; margin-top: 1.5rem; text-align: left; }
.crash-form-section label { display: block; margin-bottom: 0.8rem; color: #9aa7b6; font-size: 0.92rem; }
.crash-form-section input { width: 100%; margin-top: 0.4rem; }
.crash-button-row { display: flex; gap: 0.8rem; margin-top: 1rem; }
.crash-button-row button { flex: 1; }
.crash-bet-info { margin-top: 1rem; padding: 1rem; background: rgba(139,233,253,0.1); border-radius: 8px; border-left: 3px solid #8be9fd; color: #9aa7b6; font-size: 0.9rem; }
#crashCashoutBtn.armed { border-color: rgba(56,189,248,0.85); box-shadow: 0 0 0 1px rgba(56,189,248,0.35), 0 0 20px rgba(56,189,248,0.25); color: #8be9fd; }
.crash-players-card { background: rgba(13,17,23,0.46); border: 1px solid rgba(230,237,243,0.18); border-radius: 10px; padding: 0.85rem; margin-top: 1.2rem; }
.crash-players-card h3 { margin: 0 0 0.55rem; font-size: 0.95rem; color: #e6edf3; }
.crash-players-head, .crash-players-row { display: grid; grid-template-columns: minmax(140px,1fr) 110px 170px; gap: 0.6rem; align-items: center; }
.crash-players-head { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: #9aa7b6; padding: 0.3rem 0.2rem; border-bottom: 1px solid rgba(230,237,243,0.15); }
.crash-players-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; }
.crash-players-row { padding: 0.42rem 0.2rem; border-bottom: 1px dashed rgba(230,237,243,0.12); color: #9aa7b6; font-size: 0.86rem; }
.crash-players-row:last-child { border-bottom: none; }
.pill-live { color: #8be9fd; }
.pill-queued { color: #d2a8ff; }
.pill-bust { color: #ff7b72; }
.pill-profit { color: #3fb950; }

/* ---- Topbar nav active state for portal tabs ---- */
.webportal-user .page-nav .btn.current {
  background: rgba(47, 129, 247, 0.18);
  border-color: rgba(47, 129, 247, 0.5);
  color: #e6edf3;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
