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

body {
  background: #0d0d0d;
  color: #e8d9b0;
  font-family: Arial, sans-serif;
  min-height: 100vh;
}

/* ── Navbar ── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #080808;
  padding: 0 24px;
  height: 52px;
  border-bottom: 1px solid #3a2e00;
}

.nav-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo { height: 36px; width: auto; }

.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: #C9A84C; text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: #f0cc7a; }
.nav-user { font-size: 14px; color: #a6e3a1; }

/* ── Flash messages ── */
.flash {
  margin: 12px 24px 0;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 14px;
}
.flash-info    { background: #1a1500; color: #C9A84C; }
.flash-success { background: #1e3a2f; color: #a6e3a1; }
.flash-error,
.flash-danger  { background: #3a1e1e; color: #f38ba8; }

/* ── Main ── */
main { padding: 32px 24px; }

/* ── Forms (auth) ── */
.form-card {
  max-width: 420px;
  margin: 0 auto;
  background: #111111;
  border: 1px solid #3a2e00;
  border-radius: 8px;
  padding: 32px;
}

.auth-logo {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 8px;
}

.auth-tagline {
  text-align: center;
  font-size: 13px;
  color: #7a6a40;
  font-style: italic;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.form-card h1 {
  font-size: 24px;
  margin-bottom: 24px;
  color: #C9A84C;
  text-align: center;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  color: #9a8a60;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 9px 12px;
  background: #0d0d0d;
  border: 1px solid #3a2e00;
  border-radius: 4px;
  color: #e8d9b0;
  font-size: 14px;
  outline: none;
}

.form-group input:focus { border-color: #C9A84C; }

.form-error { color: #f38ba8; font-size: 12px; margin-top: 4px; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.1s;
}
.btn:hover { filter: brightness(0.85); }
.btn-primary { background: #C9A84C; color: #0d0d0d; }
.btn-full    { width: 100%; text-align: center; }
.btn-green   { background: #a6e3a1; color: #0d0d0d; }
.btn-red     { background: #f38ba8; color: #0d0d0d; }

.form-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: #5a4e30;
}
.form-footer a { color: #C9A84C; text-decoration: none; }

/* ── Lobby ── */
.lobby-container { max-width: 640px; }
.lobby-container h1 { font-size: 28px; color: #C9A84C; margin-bottom: 20px; }

/* ── Profile stats ── */
.stat-row { display: flex; gap: 24px; margin-bottom: 20px; }
.stat-box {
  background: #111111;
  border: 1px solid #3a2e00;
  border-radius: 6px;
  padding: 16px 24px;
  text-align: center;
}
.stat-box .stat-value { font-size: 28px; font-weight: bold; color: #C9A84C; }
.stat-box .stat-label { font-size: 12px; color: #5a4e30; margin-top: 2px; }

/* ── Queue ── */
.queue-section { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.queue-status  { font-size: 13px; color: #C9A84C; }

/* ── Online players ── */
.online-section { margin-top: 28px; }
.online-section h2 { font-size: 18px; color: #e8d9b0; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.online-badge { background: #1e1800; color: #C9A84C; font-size: 13px; font-weight: bold; padding: 2px 8px; border-radius: 10px; border: 1px solid #3a2e00; }
.online-empty { color: #5a4e30; font-size: 13px; padding: 8px 0; }
.player-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: #111111; border: 1px solid #3a2e00; border-radius: 6px; margin-bottom: 6px; }
.player-name { flex: 1; font-size: 14px; color: #e8d9b0; }
.player-elo      { font-size: 13px; color: #C9A84C; font-weight: bold; min-width: 40px; text-align: right; }
.player-gambits  { font-size: 12px; color: #C9A84C; min-width: 50px; text-align: right; }
.invite-btn  { font-size: 12px; padding: 5px 12px; background: #1e1800; color: #C9A84C; border: 1px solid #3a2e00; border-radius: 4px; cursor: pointer; transition: filter .1s; }
.invite-btn:hover { filter: brightness(1.3); }
.you-badge { font-size: 11px; color: #5a4e30; font-weight: normal; }

/* ── Modal overlay ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-box { background: #111111; border: 1px solid #3a2e00; border-radius: 10px; padding: 28px 32px; width: 420px; max-width: 95vw; }
.modal-title { font-size: 22px; font-weight: bold; color: #C9A84C; margin-bottom: 4px; }
.modal-sub   { font-size: 14px; color: #9a8a60; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }

/* ── Preset cards ── */
.preset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 16px; }
.preset-card { background: #0d0d0d; border: 2px solid #3a2e00; border-radius: 6px; padding: 10px 6px 8px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.preset-card:hover { border-color: #C9A84C; background: #141200; }
.preset-card.selected { border-color: #C9A84C; background: #1e1800; }
.preset-name { font-size: 11px; font-weight: bold; color: #e8d9b0; margin-top: 6px; }
.preset-desc { font-size: 10px; color: #5a4e30; margin-top: 2px; }
/* Tiny SVG-less icons — simple colored blocks */
.preset-icon { width: 36px; height: 36px; margin: 0 auto; border-radius: 3px; }
.preset-icon-arena_12 { background: #3a2e00; border: 2px solid #C9A84C; }
.preset-icon-fortress  { background: #1e1800; border: 4px solid #3a2e00; }
.preset-icon-cross     { background: #0d0d0d; background-image: linear-gradient(#C9A84C 0 100%), linear-gradient(90deg, #C9A84C 0 100%); background-size: 40% 100%, 100% 40%; background-position: center; background-repeat: no-repeat; }
.preset-icon-diamond   { background: #0d0d0d; position: relative; overflow: hidden; }
.preset-icon-diamond::after { content: ''; position: absolute; inset: 6px; background: #C9A84C; transform: rotate(45deg); border-radius: 2px; }

/* ── Setting rows ── */
.setting-group { margin-bottom: 4px; }
.setting-label { font-size: 13px; color: #9a8a60; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.setting-select { background: #0d0d0d; border: 1px solid #3a2e00; border-radius: 4px; color: #e8d9b0; font-size: 13px; padding: 5px 8px; outline: none; }
.setting-select:focus { border-color: #C9A84C; }
.budget-slider { flex: 1; accent-color: #C9A84C; }
.budget-val    { color: #C9A84C; font-weight: bold; }
.gambits-val   { color: #C9A84C; font-weight: bold; }
.budget-preview { font-size: 12px; color: #9a8a60; text-align: center; margin: -6px 0 10px; min-height: 16px; }
.setting-input { background: #0d0d0d; border: 1px solid #3a2e00; border-radius: 4px; color: #C9A84C; font-size: 14px; font-weight: bold; padding: 5px 8px; width: 90px; outline: none; }
.setting-input:focus { border-color: #C9A84C; }

/* ── Invite status / incoming summary ── */
.invite-status { font-size: 13px; padding: 6px 10px; border-radius: 4px; background: #0d0d0d; margin-top: 4px; }
.invite-summary { background: #0d0d0d; border: 1px solid #3a2e00; border-radius: 6px; padding: 10px 14px; margin: 8px 0; }
.sum-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.sum-label { color: #5a4e30; }
.inc-expire { text-align: center; font-size: 12px; color: #C9A84C; margin-top: 10px; }

/* ── Game history table ── */
.game-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.game-table th, .game-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #3a2e00; }
.game-table th  { color: #5a4e30; font-weight: normal; }
.game-table a   { color: #C9A84C; text-decoration: none; }
.result-win  { color: #a6e3a1; font-weight: bold; }
.result-loss { color: #f38ba8; font-weight: bold; }
.result-draw { color: #C9A84C; font-weight: bold; }

/* ── Feedback modal ── */
.feedback-type-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #e8d9b0;
  cursor: pointer;
}
.feedback-type-label input[type="radio"] {
  accent-color: #C9A84C;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ── Mobile responsive ── */
@media (max-width: 640px) {
  main { padding: 16px 12px; }

  /* Lobby */
  .lobby-container { max-width: 100%; }
  .lobby-container h1 { font-size: 22px; margin-bottom: 14px; }
  .stat-row { flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  .stat-box { flex: 1; min-width: 70px; padding: 10px 8px; }
  .stat-box .stat-value { font-size: 20px; }
  .queue-section { flex-wrap: wrap; gap: 10px; }
  .queue-section .btn { font-size: 14px; padding: 10px 20px; }
  .player-row { gap: 8px; padding: 8px; }

  /* Modals — full width on mobile */
  .modal-box { width: 95vw; padding: 20px 16px; }
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-actions { flex-wrap: wrap; }

  /* Auth forms */
  .form-card { padding: 20px 16px; }

  /* Navbar */
  .nav-logo { height: 28px; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 13px; }
}
