.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  position: relative;
  width: min(90vw, 420px);
  padding: 32px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.1rem;
  cursor: pointer;
}

.history-item.clickable {
  cursor: pointer;
}

.history-players.highlight {
  margin-top: 12px;
}
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: radial-gradient(circle at top, #1c1b46, #050608 55%);
  --card-bg: rgba(12, 13, 32, 0.85);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-highlight: rgba(97, 162, 255, 0.25);
  --text-main: #f5f7ff;
  --text-muted: rgba(245, 247, 255, 0.7);
  --accent: #7f5af0;
  --accent-strong: #ff5f9e;
  --success: #4ade80;
  --danger: #f87171;
  --glass-blur: blur(18px);
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  padding: 32px;
  line-height: 1.5;
  background-attachment: fixed;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  color: var(--accent-strong);
}

h1,
h2,
h3 {
  font-weight: 600;
  margin: 0 0 12px;
}

p {
  margin: 0 0 12px;
}

.page-shell {
  width: min(100%, 420px);
  margin: 0 auto;
}

.dashboard-shell {
  width: min(100%, 1100px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.game-page {
  width: min(100%, 1000px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur);
  position: relative;
  overflow: hidden;
}

.glass-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(255, 255, 255, 0.08));
  pointer-events: none;
  opacity: 0.8;
}

.glass-card > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.muted {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.input-field {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 1rem;
  transition: border 0.2s, transform 0.2s;
}

.input-field:not(select) {
  /* для input и textarea */
}

select.input-field {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23f5f7ff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

select.input-field:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237f5af0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

select.input-field option {
  background: var(--card-bg);
  color: var(--text-main);
  padding: 12px;
}

/* Стилизация для открытого select */
select.input-field:not([multiple]):focus {
  background-color: rgba(255, 255, 255, 0.06);
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn,
button {
  border: none;
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.btn:disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #9d7bff);
  color: #fff;
  box-shadow: 0 15px 30px rgba(127, 90, 240, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(100, 100, 120, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: linear-gradient(135deg, #ff4f8b, #ff9154);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

button.start {
  background: linear-gradient(135deg, var(--accent), #9d7bff);
  color: #fff;
  box-shadow: 0 15px 30px rgba(127, 90, 240, 0.35);
}

button.cashout {
  background: linear-gradient(135deg, #34d399, #059669);
  color: #02130c;
  box-shadow: 0 15px 30px rgba(34, 197, 94, 0.35);
}

.auth-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-intro h1 {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

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

.stat-grid,
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.stat-card h2 {
  font-size: 2.2rem;
  margin-bottom: 4px;
}

.stat-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-card .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  align-self: flex-start;
  width: fit-content;
}

.game-card button {
  margin-top: auto;
}

.crash-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.crash-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.crash-chart-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.coef-display h2 {
  margin: 4px 0 0;
  font-size: 2.4rem;
}

.history-card-wide {
  width: 100%;
}

.balance-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.player-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.history-card .history-item {
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  cursor: default;
}

.history-card .history-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.history-card .history-item:last-child {
  margin-bottom: 0;
}

.history-card .history-item.clickable {
  cursor: pointer;
}

.history-card .history-item.clickable:hover {
  background: rgba(127, 90, 240, 0.12);
  border-color: rgba(127, 90, 240, 0.25);
}

.history-players {
  padding-left: 18px;
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.wheel-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.wheel {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 10px solid rgba(255, 255, 255, 0.08);
  position: relative;
  background: rgba(0, 0, 0, 0.15);
}

.wheel canvas {
  width: 100%;
  height: 100%;
}

.pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 30px solid var(--accent-strong);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.legend-color {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-shell {
  width: min(100%, 1080px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table input {
  width: 120px;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.notice {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.message {
  text-align: center;
  font-weight: 600;
}

.message.success {
  color: var(--success);
}

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

.pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.8rem;
  margin-bottom: 12px;
  color: var(--text-muted);
}



.inline-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-form button {
  width: auto;
  padding: 10px 18px;
}

.link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.option-toggle {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.option-toggle .option-btn,
.dice-grid .dice-btn {
  width: 100%;
}

.option-btn.active,
.dice-btn.active {
  border-color: var(--accent);
  background: rgba(127, 90, 240, 0.18);
  box-shadow: 0 0 20px rgba(127, 90, 240, 0.2);
}

.dice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
}

.history-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-btn {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--accent-strong);
  border-bottom-color: var(--accent-strong);
}

.history-content {
  display: none;
}

.history-content.active {
  display: block;
}

.history-item.highlight {
  border: 1px solid rgba(127, 90, 240, 0.35);
  background: rgba(127, 90, 240, 0.08);
  border-radius: 14px;
  padding: 12px 16px;
}

.quick-bet-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.quick-bet-buttons .quick-btn {
  padding: 8px 12px;
  font-size: 0.85rem;
  width: 100%;
}

.range-display {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin: 4px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.roulette-wheel-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.roulette-wheel {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1;
  border-radius: 24px;
  padding: 18px;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.roulette-wheel-spin {
  position: absolute;
  bottom: 26.7px;
  right: 21.4px;
  transform: translate(-50%, -50%);
  width: calc(100% - 36px);
  height: calc(100% - 36px);
  border-radius: 50%;
  transition: transform 0s;
  will-change: transform;
}

.roulette-wheel-spin canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.roulette-wheel-pointer {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 26px solid var(--accent-strong);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
  pointer-events: none;
  z-index: 10;
}

.plinko-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: start;
}

@media (min-width: 900px) {
  .plinko-layout {
    grid-template-columns: 320px 1fr;
  }
  
  .plinko-controls {
    order: 1;
  }
  
  .plinko-board-card {
    order: 2;
  }
  
  .history-card {
    order: 3;
    grid-column: 1 / -1;
  }
}

.plinko-board-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.plinko-board {
  position: relative;
  width: min(100%, 600px);
  height: 600px;
  border-radius: 28px;
  background: radial-gradient(circle at top, rgba(127, 90, 240, 0.25), rgba(8, 8, 24, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  padding: 20px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.35);
  margin: 0 auto;
}

.plinko-pegs {
  position: absolute;
  inset: 20px;
  pointer-events: none;
}

#plinkoBallsContainer {
  position: absolute;
  inset: 20px;
  pointer-events: none;
  z-index: 10;
}

.plinko-row {
  position: absolute;
  width: 100%;
  left: 0;
}

.plinko-peg {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.plinko-ball {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, var(--accent-strong));
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 10;
}

.plinko-ball.hidden {
  opacity: 0;
}

.plinko-payouts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  justify-content: center;
  margin-top: 12px;
}

.plinko-slot {
  text-align: center;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  min-width: 50px;
  flex: 0 0 auto;
}

.plinko-slot.highlight {
  border-color: var(--accent-strong);
  background: rgba(127, 90, 240, 0.18);
  box-shadow: 0 0 10px rgba(127, 90, 240, 0.3);
}

@media (max-width: 900px) {
  body {
    padding: 20px 16px 40px;
  }

  .glass-card {
    border-radius: 18px;
    padding: 20px;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .wheel {
    width: 260px;
    height: 260px;
  }

  .page-shell,
  .dashboard-shell,
  .game-page,
  .admin-shell {
    width: 100%;
  }
}