﻿:root {
  color-scheme: light;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  background: #f7f3ee;
  --ink: #1d1b16;
  --muted: #6e6559;
  --card: #ffffff;
  --accent: #ffb347;
  --accent-deep: #ff8c42;
  --win: #1e9e55;
  --lose: #d6453d;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #ffe9c7 0%, #f7f3ee 45%, #f2efe9 100%);
  color: var(--ink);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  gap: 16px;
}

.brand {
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.balance {
  font-weight: 600;
  font-size: 1.1rem;
  margin-top: 4px;
}

.name-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.name-field input {
  border: 1px solid #ddd2c0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.95rem;
  min-width: 180px;
}

.stream-card {
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stream-header h1 {
  font-size: 1.6rem;
}

.status {
  padding: 6px 14px;
  border-radius: 999px;
  background: #fef4dd;
  color: var(--accent-deep);
  font-weight: 600;
}

.stream-embed {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #f0e5d4;
}

.stream-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #1c1c1c;
}

.stream-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.stream-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f3f3f3;
  font-size: 1.1rem;
}

.bets {
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bets h2,
.admin h2 {
  font-size: 1.4rem;
}

.bet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.bet-card {
  border-radius: 18px;
  padding: 18px;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bet-card.win {
  background: #e8f7ee;
  border-color: rgba(30, 158, 85, 0.4);
}

.bet-card.lose {
  background: #fdeceb;
  border-color: rgba(214, 69, 61, 0.4);
}

.bet-btn {
  border: none;
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bet-btn .pct {
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
}

.bet-card.win .bet-btn {
  background: var(--win);
}

.bet-card.lose .bet-btn {
  background: var(--lose);
}

.bet-btn:disabled {
  background: #c9c9c9 !important;
  color: #5a5a5a;
  cursor: not-allowed;
}

.bet-input {
  border: 1px solid #ddd2c0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #fff;
}

.bet-feedback,
.admin-feedback {
  min-height: 20px;
  color: var(--muted);
}

.current-bet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #fff6e7;
  border-radius: 14px;
  border: 1px solid #f0e5d4;
  font-size: 0.95rem;
}

.cancel-btn {
  border: none;
  background: #f0d7b7;
  color: #392a1a;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.cancel-btn:disabled {
  background: #d7d7d7;
  color: #5a5a5a;
  cursor: not-allowed;
}

.leaderboard {
  margin-top: 8px;
  padding: 16px;
  background: #fff9ef;
  border-radius: 16px;
  border: 1px solid #f0e5d4;
}

.leaderboard h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.leader-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 20px;
}

.admin {
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-actions,
.result-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-btn {
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--accent);
  color: #392a1a;
  font-weight: 600;
  cursor: pointer;
}

.admin-btn:hover {
  background: var(--accent-deep);
  color: #fff;
}

.admin-result select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd2c0;
  min-width: 140px;
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.reset-link {
  background: none;
  border: none;
  color: var(--accent-deep);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.95rem;
}

.disclaimer {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 700px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .stream-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
