/* Club 11 — Dark Navy Poker Theme */
:root {
  --bg: #0a0a0a;
  --bg2: #151515;
  --bg3: #222222;
  --fg: #e0e0e0;
  --fg-muted: #888888;
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.1);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --yellow: #f59e0b;
  --yellow-bg: rgba(245, 158, 11, 0.1);
  --gold: #d4af37;
  --gold-bg: rgba(212, 175, 55, 0.12);
  --gray: #6b7280;
  --cyan: #06b6d4;
  --font: 'Outfit', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 10px;
  --transition: 0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, p, ul, ol, li, figure, figcaption, blockquote, dl, dd { margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

.screen {
  max-width: 600px;
  width: 100%;
  padding: 1rem;
  margin-left: auto;
  margin-right: auto;
}
.hidden { display: none !important; }

/* Login centered vertically on desktop */
#login:not(.hidden) {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Skeleton ── */
.skeleton-screen {
  width: 100%; max-width: 600px; padding: 1rem;
}
.sk-header, .sk-card {
  background: var(--bg2);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  animation: pulse 1.5s infinite;
}
.sk-header { height: 56px; }
.sk-card { height: 80px; }
.sk-card.short { height: 48px; width: 60%; }
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* ── Login ── */
.login-box {
  text-align: center;
  padding: 3rem 1.5rem;
}
.login-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.4));
}
.login-box h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login-sub {
  color: var(--fg-muted);
  margin: 0.5rem 0 1.5rem;
}
.pin-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  gap: 12px;
  margin-bottom: 1rem;
}
.pin-dots span {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--fg-muted);
  transition: var(--transition);
}
.pin-dots span.filled {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}
#pin-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.error-msg {
  color: var(--red);
  margin-top: 1rem;
  font-size: 0.9rem;
  min-height: 1.4em;
}

/* ── Buttons ── */
.btn {
  font-family: var(--font);
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  font-size: 0.9rem;
}
.btn:active { transform: scale(0.98); }
.btn-green { background: var(--gold); color: #0a0a0a; font-weight: 700; }
.btn-green:hover { box-shadow: 0 0 12px rgba(212, 175, 55, 0.4); }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--fg-muted); }
.btn-ghost:hover { color: var(--fg); }
.btn-outline {
  background: transparent;
  border: 1.5px dashed var(--fg-muted);
  color: var(--fg-muted);
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.75rem;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-icon {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color var(--transition);
}
.btn-icon:hover { color: var(--fg); }
.btn-sm {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  border-radius: 4px;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg2);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}
.header-left { display: flex; align-items: center; gap: 0.5rem; }
.header-left .logo { font-size: 1.4rem; }
.header-left h1 { font-size: 1.1rem; font-weight: 600; }
.header-center { font-weight: 600; font-size: 1rem; color: var(--purple); }
.header-right { display: flex; align-items: center; gap: 0.75rem; }
.save-status { font-size: 0.75rem; color: var(--green); font-family: var(--mono); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  background: var(--bg2);
  border-radius: var(--radius);
  overflow: hidden;
}
.tab {
  flex: 1;
  padding: 0.65rem;
  background: none;
  border: none;
  color: var(--fg-muted);
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--fg); border-bottom-color: var(--gold); background: var(--bg3); }
.tab:hover { color: var(--fg); }

/* ── Summary Cards ── */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.summary-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 0.75rem;
  text-align: center;
}
.summary-card .label { font-size: 0.7rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.summary-card .value { font-family: var(--mono); font-size: 1.1rem; font-weight: 600; margin-top: 0.25rem; }

/* ── Event Cards ── */
.event-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.event-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.event-card:active { transform: scale(0.98); }
.event-name { font-weight: 600; }
.event-meta { font-size: 0.8rem; color: var(--fg-muted); font-family: var(--mono); }
.event-players { font-size: 0.75rem; color: var(--cyan); }

/* ── Overlay ── */
.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 2rem;
}
.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}
.overlay-panel {
  position: relative;
  background: var(--bg);
  width: 95%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--bg3);
}
.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.overlay-header h2 { font-size: 1.1rem; }
.overlay-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* ── Player Accordion ── */
.player-card {
  background: var(--bg2);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.player-card:hover { box-shadow: 0 0 0 1px var(--bg3); }
.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background var(--transition);
}
.player-header:hover { background: var(--bg3); }
.player-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gold-bg);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  font-weight: 700;
  font-size: 0.9rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}
.player-name-saldo {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0.75rem;
}
.player-saldo {
  font-family: var(--mono);
  font-size: 0.85rem;
  margin-left: auto;
}
.player-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1rem;
}
.player-card.open .player-body {
  max-height: 800px;
  padding: 0 1rem 1rem;
}

/* ── Form Fields ── */
.field-group {
  margin-bottom: 0.75rem;
}
.field-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}
.field-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
input[type="text"],
input[type="number"],
input[type="date"],
input[type="tel"] {
  background: var(--bg);
  border: 1px solid var(--bg3);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  width: 100%;
  transition: border-color var(--transition);
}
input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

/* ── Inline form ── */
.inline-form {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 0.75rem;
}
.inline-form input { margin-bottom: 0.5rem; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

/* ── Saldo colors ── */
.winst { color: var(--green); }
.verlies { color: var(--red); }
.tegoed { color: var(--yellow); }
.settled { color: var(--gray); }

/* ── Balance summary ── */
.balance-box {
  background: var(--bg);
  border-radius: 6px;
  padding: 0.75rem;
  margin-top: 0.5rem;
}
.balance-row {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0;
  font-size: 0.85rem;
}
.balance-row .bal-label { color: var(--fg-muted); }
.balance-row .bal-value { font-family: var(--mono); }
.balance-divider {
  border: none;
  border-top: 1px solid var(--bg3);
  margin: 0.4rem 0;
}
.balance-status {
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem;
  border-radius: 6px;
  margin-top: 0.5rem;
}

/* ── Debt overview ── */
.debt-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform var(--transition), box-shadow var(--transition);
}
.debt-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.debt-naam { font-weight: 600; }
.debt-amount { font-family: var(--mono); font-size: 1rem; }

/* ── Delete confirm ── */
.delete-confirm {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--red-bg);
  border-radius: 6px;
}
.delete-confirm span { font-size: 0.8rem; color: var(--red); flex: 1; }

/* ── Warning ── */
.warning {
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  margin-top: 0.3rem;
}
.warning.under { background: var(--yellow-bg); color: var(--yellow); }
.warning.over { background: var(--red-bg); color: var(--red); }

/* ── Section title ── */
.section-title {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--fg-muted);
}

/* ── Responsive ── */
@media (max-width: 380px) {
  .summary-cards { grid-template-columns: 1fr 1fr; }
  .overlay-stats { grid-template-columns: 1fr 1fr; }
  header h1 { font-size: 1rem; }
}
