/* Casino-Look: dunkler Filz, Gold-Akzente — aber freundlich & lesbar */
:root {
  --bg: #0c1210;
  --felt: #123326;
  --surface: #16211c;
  --surface-2: #1d2b24;
  --border: #2c4237;
  --gold: #e3b341;
  --gold-bright: #f5cd5f;
  --green: #3ddc84;
  --red: #ff6b6b;
  --text: #ecf3ee;
  --muted: #93a89c;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(ellipse 80% 60% at 50% -10%, var(--felt) 0%, var(--bg) 70%) fixed var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
}

/* ---- Dauerhafter Spaß-Hinweis ---- */
.disclaimer {
  background: linear-gradient(90deg, #7a5c14, #a37b1e, #7a5c14);
  color: #fff8e5;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
  letter-spacing: 0.02em;
}

/* ---- Navigation ---- */
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem;
  background: rgba(10, 16, 13, 0.85);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
}
.brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.03em;
  text-shadow: 0 0 18px rgba(227, 179, 65, 0.35);
}
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 0.9rem; }
.nav-links a { color: var(--text); text-decoration: none; font-weight: 500; }
.nav-links a:hover { color: var(--gold-bright); }

.chip-badge {
  background: linear-gradient(180deg, #2a3d33, #1c2b24);
  border: 1px solid var(--gold);
  color: var(--gold-bright) !important;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.06s, filter 0.15s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(0.97); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #241a03;
  box-shadow: 0 2px 10px rgba(227, 179, 65, 0.35);
}
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.85rem; }
.linklike { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 0; }
.linklike:hover { color: var(--gold-bright); }
.inline-form { display: inline; }

/* ---- Layout ---- */
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 1.2rem; }
footer { text-align: center; padding: 1.5rem 1rem; border-top: 1px solid var(--border); margin-top: 2rem; }
footer p { margin: 0.2rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden { display: none; }
.win { color: var(--green); font-weight: 700; }
.lose { color: var(--red); }

.hero { text-align: center; padding: 1.5rem 0 0.5rem; }
.hero h1 { margin-bottom: 0.3rem; }
.suit { color: var(--gold); }
.balance-big { font-size: 2rem; font-weight: 800; color: var(--gold-bright); margin: 0.3rem 0; }

/* ---- Flash-Meldungen ---- */
.flash {
  max-width: 1080px;
  margin: 0.8rem auto 0;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
}
.flash-success { background: rgba(61, 220, 132, 0.12); border: 1px solid var(--green); color: var(--green); }
.flash-error { background: rgba(255, 107, 107, 0.12); border: 1px solid var(--red); color: var(--red); }
.flash-info { background: rgba(227, 179, 65, 0.1); border: 1px solid var(--gold); color: var(--gold-bright); }

/* ---- Karten & Thread-Grid ---- */
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
}
.thread-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; margin-top: 1rem; }
.thread-card { display: block; color: var(--text); text-decoration: none; transition: transform 0.12s, border-color 0.12s; }
.thread-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.thread-card h3 { margin: 0.5rem 0 0.1rem; }
.thread-card p { margin: 0.15rem 0; }
.card-top { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.card-stats { display: flex; justify-content: space-between; margin-top: 0.5rem; align-items: center; }
.pot { color: var(--gold-bright); font-weight: 700; }

.badge { font-size: 0.75rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 999px; border: 1px solid var(--border); background: rgba(0, 0, 0, 0.25); white-space: nowrap; }
.badge-open { color: var(--green); border-color: var(--green); }
.badge-locked { color: var(--gold); border-color: var(--gold); }
.badge-settled { color: var(--muted); }
.badge-vis { color: var(--muted); }
.badge-user-active { color: var(--green); border-color: var(--green); }
.badge-user-pending { color: var(--gold); border-color: var(--gold); }
.badge-user-banned { color: var(--red); border-color: var(--red); }

.filter-tabs { display: flex; gap: 0.4rem; margin-top: 1.2rem; flex-wrap: wrap; }
.filter-tabs a { color: var(--muted); text-decoration: none; padding: 0.35rem 0.9rem; border-radius: 999px; border: 1px solid var(--border); font-weight: 600; font-size: 0.9rem; }
.filter-tabs a.active, .filter-tabs a:hover { color: var(--gold-bright); border-color: var(--gold); }

.empty { text-align: center; padding: 3rem 1rem; }

/* ---- Thread-Detail ---- */
.thread-page h1 { margin: 0.4rem 0 0.2rem; }
.thread-desc { white-space: pre-line; background: rgba(0, 0, 0, 0.18); border-left: 3px solid var(--gold); padding: 0.7rem 1rem; border-radius: 0 8px 8px 0; }
.pot-banner {
  text-align: center;
  font-size: 1.15rem;
  background: linear-gradient(90deg, transparent, rgba(227, 179, 65, 0.12), transparent);
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  padding: 0.6rem;
  margin: 1rem 0;
}
.outcomes h2, .bets-list h2 { margin-bottom: 0.6rem; }
.outcome { padding: 0.6rem 0.2rem; }
.outcome-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.outcome-label { font-weight: 700; font-size: 1.05rem; }
.outcome-quote { color: var(--gold-bright); font-weight: 800; font-variant-numeric: tabular-nums; }
.outcome-winner { background: rgba(61, 220, 132, 0.08); border-radius: 8px; padding: 0.6rem; }
.stake-bar { height: 8px; background: rgba(0, 0, 0, 0.35); border-radius: 999px; overflow: hidden; margin: 0.3rem 0 0.15rem; }
.stake-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); border-radius: 999px; transition: width 0.4s; }

.bet-box { margin: 1.2rem 0; }
.outcome-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.4rem; margin: 0.6rem 0; }
.outcome-pick { border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.8rem; cursor: pointer; }
.outcome-pick:hover { border-color: var(--gold); }
.amount-row { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; margin: 0.7rem 0; }
.amount-row input[type="number"] { width: 130px; }
.bet-form .btn-gold { margin-right: 0.8rem; }
.guest-hint { text-align: center; }

.manage-box { margin: 1.2rem 0; border-color: var(--gold); }
.manage-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; }
.manage-actions form { display: flex; gap: 0.5rem; align-items: center; }

/* ---- Tabellen ---- */
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 0.6rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: rgba(0, 0, 0, 0.3); color: var(--gold); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

.leaderboard .top-1 td { background: rgba(227, 179, 65, 0.12); font-weight: 700; }
.leaderboard .top-2 td { background: rgba(200, 200, 210, 0.07); }
.leaderboard .top-3 td { background: rgba(190, 120, 60, 0.08); }

/* ---- Formulare ---- */
.form-card, .auth-card { max-width: 620px; margin: 1.5rem auto; }
.auth-card { max-width: 420px; text-align: center; }
.auth-card form { text-align: left; }
label { display: block; margin: 0.8rem 0; font-weight: 600; }
input[type="text"], input[type="password"], input[type="number"], input[type="datetime-local"], textarea, select {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
input[readonly] { opacity: 0.6; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); margin: 1rem 0; padding: 0.8rem 1rem; }
legend { font-weight: 700; color: var(--gold-bright); padding: 0 0.4rem; }
#outcome-fields input { margin-bottom: 0.45rem; }
.radio-row, .check-row { font-weight: 400; margin: 0.45rem 0; display: flex; gap: 0.5rem; align-items: baseline; cursor: pointer; }
.radio-row input, .check-row input { width: auto; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 0.8rem; }
#restricted-panel { border-top: 1px dashed var(--border); margin-top: 0.6rem; padding-top: 0.4rem; }

/* ---- Admin ---- */
.admin-section { margin: 1.5rem 0; }
.pending-box { border-color: var(--gold); }
.pending-row { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; padding: 0.4rem 0; border-bottom: 1px dashed var(--border); }
.pending-row:last-child { border-bottom: none; }
.action-row { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.chips-input { width: 90px !important; display: inline-block; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.group-head { display: flex; justify-content: space-between; align-items: center; }
.group-head h3 { margin: 0; }
.member-list { list-style: none; padding: 0; margin: 0.6rem 0; }
.member-list li { display: flex; justify-content: space-between; padding: 0.2rem 0; border-bottom: 1px dashed var(--border); }
.group-create { display: flex; gap: 0.5rem; max-width: 420px; }

@media (max-width: 640px) {
  main { padding: 0.8rem; }
  .nav { padding: 0.6rem 0.8rem; }
  .manage-actions { flex-direction: column; align-items: stretch; }
}
