/* ─── Glass Cards ─── */
.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  animation: card-enter 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.card-header h2 {
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.06em;
}

.card-header h3 {
  font-size: 0.95rem;
  color: var(--gold);
}

/* ─── Buttons ─── */
.btn {
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 11px 22px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  font-weight: 700;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}

.btn--gold {
  background: linear-gradient(135deg, var(--gold) 0%, #ffd740 100%);
  color: #000;
  box-shadow: 0 2px 12px rgba(245, 197, 24, 0.2);
}

/* Shine sweep on hover */
.btn--gold::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 200%;
  height: 200%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.25) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
  pointer-events: none;
}

.btn--gold:hover:not(:disabled) {
  box-shadow: 0 4px 20px rgba(245, 197, 24, 0.4), 0 0 40px rgba(245, 197, 24, 0.15);
  transform: translateY(-1px);
}

.btn--gold:hover:not(:disabled)::after {
  transform: translateX(50%);
}

.btn--gold:active:not(:disabled) {
  transform: translateY(0);
}

.btn--green {
  background: linear-gradient(135deg, var(--green) 0%, #34d399 100%);
  color: #000;
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.2);
}

.btn--green:hover:not(:disabled) {
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn--red {
  background: linear-gradient(135deg, var(--red) 0%, #fb7185 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(244, 63, 94, 0.2);
}

.btn--red:hover:not(:disabled) {
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.35);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--gray-dark);
  color: var(--gray);
}

.btn--outline:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 15px rgba(245, 197, 24, 0.1);
}

.btn--sm {
  padding: 6px 14px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.btn--block {
  width: 100%;
  display: block;
}

/* ─── Badges ─── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-display);
}

.badge--active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge--eliminated {
  background: rgba(244, 63, 94, 0.15);
  color: var(--red);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge--winner {
  background: rgba(245, 197, 24, 0.15);
  color: var(--gold);
  border: 1px solid rgba(245, 197, 24, 0.3);
  box-shadow: 0 0 10px rgba(245, 197, 24, 0.1);
}

.badge--open {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge--locked {
  background: rgba(244, 63, 94, 0.15);
  color: var(--red);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge--correct {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge--incorrect {
  background: rgba(244, 63, 94, 0.12);
  color: var(--red);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

/* ─── Tables ─── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th {
  text-align: left;
  padding: 10px 8px;
  color: var(--gray);
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  font-weight: 600;
}

td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.25);
  transition: background 0.2s;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

tr.eliminated td {
  opacity: 0.35;
  text-decoration: line-through;
}

/* ─── Forms ─── */
input, select, textarea {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--gray-dark);
  border-radius: var(--radius);
  color: var(--white);
  width: 100%;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.1);
}

input::placeholder, textarea::placeholder {
  color: var(--gray-dark);
}

label {
  display: block;
  font-size: 0.78rem;
  color: var(--gray);
  margin-bottom: 5px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.form-group { margin-bottom: 14px; }

/* ─── Chip Display ─── */
.chip-display {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--gold);
  font-weight: 600;
}

.chip-icon::before {
  content: '🪙';
  margin-right: 4px;
}

/* ─── Speller Row ─── */
.speller-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.25);
  transition: background 0.2s;
}

.speller-row:last-child { border-bottom: none; }

.speller-row:hover {
  background: rgba(255, 255, 255, 0.02);
  padding-left: 4px;
  padding-right: 4px;
  margin-left: -4px;
  margin-right: -4px;
  border-radius: 6px;
}

.speller-name { font-weight: 600; font-size: 0.95rem; }

.speller-odds {
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 0.9rem;
}

/* ─── Leaderboard ─── */
.lb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.25);
  transition: background 0.2s;
}

.lb-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.lb-rank {
  width: 32px;
  font-family: var(--font-mono);
  color: var(--gray);
  font-size: 0.85rem;
}

.lb-rank--1 { color: var(--gold); font-weight: 600; filter: drop-shadow(0 0 4px rgba(245,197,24,0.5)); }
.lb-rank--2 { color: #c0c0c0; font-weight: 600; }
.lb-rank--3 { color: #cd7f32; font-weight: 600; }

.lb-name { flex: 1; font-weight: 500; }

.lb-value {
  font-family: var(--font-mono);
  color: var(--gold);
  font-weight: 600;
}

/* ─── Odds Bar ─── */
.odds-bar-bg {
  background: rgba(15, 20, 35, 0.8);
  border-radius: 4px;
  height: 6px;
  margin-top: 4px;
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.3);
}

.odds-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold), #ffd740);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.odds-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: bar-shimmer 2.5s ease-in-out infinite;
}

@keyframes bar-shimmer {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

/* ─── Bet Card ─── */
.bet-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--gray-dark);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.bet-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.bet-card--active {
  border-left: 3px solid var(--green);
  box-shadow: -4px 0 12px rgba(16, 185, 129, 0.1);
}

.bet-card--lost {
  border-left: 3px solid var(--red);
  opacity: 0.45;
}

.bet-card--won {
  border-left: 3px solid var(--gold);
  box-shadow: -4px 0 12px rgba(245, 197, 24, 0.1);
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card-solid);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--white);
  padding: 14px 28px;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--error {
  border: 1px solid var(--red);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(244, 63, 94, 0.15);
}

.toast--success {
  border: 1px solid var(--green);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.15);
}

/* ─── Utilities ─── */
.section { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-gray { color: var(--gray); }
.text-sm { font-size: 0.8rem; }

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 28px;
  color: var(--gray);
  font-size: 0.9rem;
  font-style: italic;
}

/* ─── Spinner ─── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--gray-dark);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .container { padding: 12px; }
  .card { padding: 14px; }
  .btn { padding: 9px 16px; font-size: 0.78rem; }
  h1 { font-size: 1.6rem !important; }
}
