/* ===== RESET + BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', Arial, sans-serif; }
.hidden { display: none !important; }

/* ===== CSS VARIABLES ===== */
:root {
  --bg: #0f0a1e;
  --bg2: #1a1035;
  --card: #ffffff;
  --primary: #e74c3c;
  --primary-dark: #c0392b;
  --accent: #f39c12;
  --success: #27ae60;
  --danger: #e74c3c;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --border: #e0e0e0;
  --shadow: 0 4px 20px rgba(0,0,0,0.25);
}

/* ===== LOGIN PAGE ===== */
.login-body {
  background: linear-gradient(135deg, #0f0a1e 0%, #1a1035 50%, #2d1b69 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-wrap {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-logo { font-size: 56px; margin-bottom: 8px; }

.login-title {
  color: white;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.login-subtitle {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  margin-top: 4px;
  margin-bottom: 28px;
}

.login-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

/* Tabs */
.tab-bar {
  display: flex;
  border-bottom: 2px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 14px;
  background: #f8f8f8;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
}

.tab-btn.active {
  background: white;
  color: var(--primary);
  border-bottom: 3px solid var(--primary);
  margin-bottom: -2px;
}

.tab-pane {
  padding: 24px;
}

.pane-desc {
  color: var(--text-light);
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #555;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input {
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  transition: border-color 0.2s;
  width: 120px;
}

.input:focus { outline: none; border-color: var(--primary); }
.input.full-width { width: 100%; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
}

.btn.full-width { width: 100%; }

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: white; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #c0392b; }

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }

/* Quick select chips */
.quick-select {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.chip {
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== FEEDBACK ===== */
.error-msg {
  background: #fdecea;
  color: #c0392b;
  border: 1px solid #f5c6cb;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}

.loading-msg {
  color: var(--text-light);
  font-size: 13px;
  text-align: center;
  padding: 8px 0;
  margin-bottom: 8px;
}

/* ===== HEADER ===== */
.header {
  background: linear-gradient(135deg, #1a0a2e 0%, #2d1b69 100%);
  border-bottom: 3px solid var(--accent);
  padding: 14px 24px;
}
.header-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 32px; }
.header h1 { color: white; font-size: 20px; font-weight: 800; }
.header p { color: rgba(255,255,255,0.55); font-size: 12px; margin-top: 2px; }

/* ===== HOST BODY ===== */
.host-body {
  background: var(--bg);
  min-height: 100vh;
}

.host-main {
  max-width: 900px;
  margin: 28px auto;
  padding: 0 24px;
}

/* ── Header back link ── */
.header-back {
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  margin-right: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.header-back:hover { background: rgba(255,255,255,0.1); color: white; }

/* ── Page card ── */
.page-card {
  background: white;
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.page-card--flush { padding: 0; overflow: hidden; }

/* ── Page sections ── */
.page-section { margin-bottom: 28px; }
.page-section:last-child { margin-bottom: 0; }
.page-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.page-section-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ── How it works list ── */
.how-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.how-list li {
  font-size: 14px;
  color: var(--text);
  padding-left: 20px;
  position: relative;
}
.how-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

/* ── Large button ── */
.btn-lg { padding: 14px 24px; font-size: 16px; font-weight: 700; border-radius: 10px; }

/* ── Print info row ── */
.print-info-row {
  display: flex;
  gap: 24px;
  padding: 16px 0;
}
.print-info-item { display: flex; flex-direction: column; gap: 2px; }
.print-info-num { font-size: 28px; font-weight: 800; color: var(--primary); }
.print-info-label { font-size: 11px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.4px; }

/* ── Field hint ── */
.field-hint { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* ── Games list rows (full-page version) ── */
.tab-list-content { padding: 8px 20px 16px; }
.game-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.game-list-row:last-child { border-bottom: none; }
.game-list-row.game-ended { opacity: 0.6; }
.glr-left { display: flex; flex-direction: column; gap: 5px; }
.glr-no { font-size: 22px; font-weight: 800; color: var(--text); font-family: 'Courier New', monospace; letter-spacing: 2px; }
.glr-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-light); }
.glr-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Check Tickets page layout ── */
.check-area { margin-bottom: 20px; }
.check-main {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
}
.check-players-panel,
.check-ticket-panel {
  background: white;
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.check-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.check-panel-count { font-weight: 400; color: var(--text-light); font-size: 12px; }
.check-players-list { max-height: 500px; overflow-y: auto; }
.check-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.check-player-row:last-child { border-bottom: none; }
.check-player-row:hover,
.check-player-row--active { background: #fff5f5; }
.check-player-row--active .check-tno { color: var(--primary-dark); }
.check-ticket-panel { padding: 16px; }
.check-verify-row { display: flex; gap: 8px; margin-bottom: 12px; }
.check-empty-hint {
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  padding: 40px 20px;
  line-height: 1.6;
}

/* Paper ticket badge in player list */
.check-offline-badge {
  font-size: 11px;
  background: #fff8e1;
  color: #f57f17;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 600;
  border: 1px solid #ffe082;
}

/* Print page separator */
.print-mode-sep {
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
  margin: 12px 0;
}

/* Game name in header status line */
.hdr-gamename {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  background: rgba(255,255,255,0.12);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Game name in games list */
.glr-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.5px;
  margin-left: 8px;
  text-transform: uppercase;
}

/* Ticket title input + preview */
.ticket-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.ticket-title-input {
  flex: 1;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 15px;
}
.ticket-title-preview {
  background: #c0392b;
  color: white;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 4px;
  padding: 6px 14px;
  border-radius: 6px;
  white-space: nowrap;
  min-width: 110px;
  text-align: center;
}

/* Standalone reprint banner (top of page) */
.reprint-banner {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-left: 4px solid var(--primary);
}
.reprint-banner-info { display: flex; align-items: center; gap: 12px; }
.reprint-banner-icon { font-size: 24px; }
.reprint-banner-title { font-size: 13px; font-weight: 700; color: var(--text); }
.reprint-banner-meta  { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* Existing offline tickets reprint box (inside game card) */
.reprint-existing {
  background: #f0f7ff;
  border: 1px solid #bbdefb;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.reprint-existing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.reprint-existing-title { font-size: 14px; font-weight: 700; color: #1565c0; }
.reprint-existing-meta  { font-size: 12px; color: #1976d2; margin-top: 3px; }

/* Game banner on print page */
.game-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 20px;
}
.game-banner-label { font-size: 12px; color: #2e7d32; font-weight: 600; }
.game-banner-no { font-size: 20px; font-weight: 800; color: #1b5e20; font-family: 'Courier New', monospace; letter-spacing: 2px; flex: 1; }

/* ── Dashboard 4-card grid ── */
.dash-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.dash-card {
  background: white;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 22px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  position: relative;
  text-decoration: none;
}
.dash-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); text-decoration: none; }
.dash-card--active { border-color: var(--primary); background: #fff5f5; }

.dash-card-icon  { font-size: 32px; }
.dash-card-label { font-size: 14px; font-weight: 700; color: var(--text); }
.dash-card-desc  { font-size: 11px; color: var(--text-light); }
.dash-card-badge {
  position: absolute; top: 10px; right: 12px;
  background: var(--primary); color: white;
  font-size: 11px; font-weight: 700;
  border-radius: 99px; padding: 1px 7px;
  min-width: 20px; text-align: center;
}

/* ── Dashboard content pane ── */
.dash-content {
  background: white;
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.dash-pane { display: block; }

.pane-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.pane-title-bar h2 { font-size: 16px; font-weight: 700; color: var(--text); }

.pane-body { padding: 20px; }

/* ── Games pane tabs ── */
.pane-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.pane-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
}
.pane-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.pane-tab:hover:not(.active) { background: #f0f0f0; }

.games-tab-content { padding: 8px 20px 16px; }

/* ── Check Tickets pane ── */
.check-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 10px;
}
.check-game-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.check-game-btn {
  background: white;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  transition: all 0.15s;
}
.check-game-btn:hover { border-color: var(--primary); background: #fff5f5; }
.check-game-btn--active { border-color: var(--primary); background: #fff5f5; }
.check-game-no { font-size: 18px; font-weight: 800; color: var(--text); font-family: 'Courier New', monospace; letter-spacing: 2px; }
.check-game-meta { font-size: 11px; color: var(--text-light); }

.check-split {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
}
.check-players-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.check-players-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}
.check-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.check-player-row:last-child { border-bottom: none; }
.check-player-row:hover { background: #f5f5f5; }
.check-tno { font-family: 'Courier New', monospace; font-weight: 700; font-size: 13px; color: var(--primary); min-width: 40px; }
.check-pname { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.check-marks-badge { font-size: 11px; font-weight: 700; background: #e8f5e9; color: #2e7d32; padding: 2px 7px; border-radius: 99px; }
.check-eye { font-size: 14px; color: var(--text-light); }

.check-verify-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

/* Games section (legacy, kept for game.html) */
.games-section {
  background: white;
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

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

.section-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.empty-state {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  padding: 24px;
}

/* Game row */
.game-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.game-row:last-child { border-bottom: none; }
.game-row.game-ended { opacity: 0.6; }

.game-row-no {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
}

.game-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.game-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-grey  { background: #f5f5f5; color: #757575; }
.badge-blue  { background: #e3f2fd; color: #1565c0; }

/* Panel (bulk print) */
.panel {
  background: white;
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

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

.panel-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.panel-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  gap: 16px;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 16px; font-weight: 700; }

.modal-body { padding: 20px; }

.modal-gameno {
  text-align: center;
  background: linear-gradient(135deg, #1a0a2e, #2d1b69);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.modal-gameno-label {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.modal-gameno-value {
  color: var(--accent);
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 8px;
  font-family: 'Courier New', monospace;
}

.modal-gameno-hint {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  margin-top: 8px;
}

.modal-status {
  font-size: 13px;
  margin-bottom: 14px;
  color: var(--text-light);
}

.modal-players-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-players-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.player-row:last-child { border-bottom: none; }

.player-no {
  width: 20px;
  color: var(--text-light);
  font-weight: 700;
}

.player-name {
  flex: 1;
  font-weight: 600;
  color: var(--text);
}

.player-time {
  color: var(--text-light);
  font-size: 11px;
}

.modal-footer { margin-top: 8px; }

/* ===== TICKET PAGE (landscape) ===== */
.ticket-body {
  background: #1a1035;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Rotate warning (portrait only) */
.rotate-warning {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  color: white;
  gap: 16px;
}

.rotate-icon { font-size: 60px; animation: rotate-hint 2s ease-in-out infinite; }
@keyframes rotate-hint { 0%,100%{transform:rotate(0deg)} 50%{transform:rotate(90deg)} }

.rotate-text {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
}

/* Ticket screen (landscape) */
.ticket-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: relative;
}

.ticket-top-bar {
  background: #1a1035;
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border-bottom: 2px solid #e74c3c;
}

.tkt-separator { color: rgba(255,255,255,0.3); }
.tkt-status { margin-left: auto; }

.ticket-grid-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  overflow: hidden;
  background: #1a1035;
}

.tkt-loading {
  color: rgba(255,255,255,0.5);
  font-size: 16px;
}

/* The ticket table */
.tkt-grid {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 2px solid #999;
  border-radius: 6px;
  overflow: hidden;
  background: white;
}

.tkt-grid tr {
  height: calc(100% / 3);
}

/* Portrait: don't stretch — let cell width drive the height */
@media (orientation: portrait) {
  .ticket-grid-wrap {
    flex: 0 0 auto;
    align-self: stretch;
    justify-content: stretch;
  }

  .tkt-grid {
    height: auto;
    width: 100%;
  }

  .tkt-grid tr {
    height: auto;
  }

  .tkt-cell {
    height: calc((100vw - 16px) / 9 * 1.1);
  }
}

.tkt-cell {
  border: 2px solid #bbb;
  text-align: center;
  vertical-align: middle;
  width: 11.11%;
  cursor: default;
  transition: background 0.15s, transform 0.1s;
  position: relative;
}

.tkt-filled {
  background: #fffde7;
  cursor: pointer;
}

.tkt-filled:active { transform: scale(0.95); }

.tkt-empty {
  background: #eeeeee;
}

/* Marked cell */
.tkt-marked {
  background: #2e7d32 !important;
}
.tkt-marked .tkt-num { color: #ffffff !important; }

.tkt-num {
  display: block;
  color: #1a237e;
  font-size: clamp(18px, 3.5vw, 38px);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.ticket-bottom-bar {
  background: #111;
  color: rgba(255,255,255,0.3);
  font-size: 11px;
  text-align: center;
  padding: 5px;
  flex-shrink: 0;
}

/* ── Ticket deleted overlay ── */
#deleted-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 5, 20, 0.88);
  z-index: 100;
  padding: 24px;
}

.deleted-card {
  background: #1c1035;
  border: 2px solid #e74c3c;
  border-radius: 16px;
  padding: 32px 28px;
  text-align: center;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(231, 76, 60, 0.3);
}

.deleted-icon {
  font-size: 48px;
  margin-bottom: 12px;
  filter: grayscale(1) opacity(0.6);
}

.deleted-title {
  color: #e74c3c;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
}

.deleted-msg {
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.deleted-btn {
  display: inline-block;
  background: #e74c3c;
  color: white;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.deleted-btn:hover {
  background: #c0392b;
  transform: translateY(-1px);
}

/* Ticket number in top bar */
.tkt-ticketno {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: #f39c12;
  font-size: 13px;
  letter-spacing: 1px;
}

/* Player row ticket number */
.player-ticketno {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #e74c3c;
  width: 40px;
  flex-shrink: 0;
}

/* Verify section */
.verify-section {
  margin: 16px 0;
  padding: 14px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.verify-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.verify-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.verify-input {
  width: 100px !important;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 15px !important;
  text-transform: uppercase;
}

.verify-result {
  margin-top: 12px;
}

.verify-error {
  color: #c0392b;
  font-size: 13px;
  padding: 8px;
  background: #fdecea;
  border-radius: 6px;
}

.verify-found {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.verify-player-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.verify-ticketno-badge {
  background: #e74c3c;
  color: white;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ===== HOST TICKET PREVIEW (same look as player's ticket) ===== */
.host-ticket-preview {
  border: 2px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 4px;
}

.htp-header {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  color: white;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.htp-title {
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 4px;
}

.htp-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.htp-name {
  font-size: 13px;
  font-weight: 600;
}

.htp-no {
  background: rgba(0,0,0,0.25);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.htp-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.htp-cell {
  border: 1px solid #ddd;
  text-align: center;
  vertical-align: middle;
  height: 44px;
}

.htp-filled {
  background: #fffde7;
}

.htp-num {
  display: block;
  color: #1a237e;
  font-weight: 800;
  font-size: 17px;
}

.htp-empty {
  background: #f0f0f0;
}

/* Clickable player rows */
.player-row-clickable {
  cursor: pointer;
  transition: background 0.15s;
}

.player-row-clickable:hover {
  background: #f0f7ff;
}

.player-view-icon {
  margin-left: auto;
  font-size: 14px;
  opacity: 0.5;
}

.player-row-clickable:hover .player-view-icon {
  opacity: 1;
}

/* ===== GAME PAGE ===== */
.game-page-main {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

/* Game info bar */
.game-info-bar {
  background: linear-gradient(135deg, #1a0a2e, #2d1b69);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.gin-label {
  display: block;
  color: rgba(255,255,255,0.5);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.gin-value {
  display: block;
  color: var(--accent);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 6px;
  font-family: 'Courier New', monospace;
}

.game-info-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-pill {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-active { background: rgba(46,204,113,0.2); color: #2ecc71; }
.stat-ended  { background: rgba(231,76,60,0.2);  color: #e74c3c; }

/* Player list card */
.player-list-card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.plc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  flex-wrap: wrap;
}

.plc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.player-search-input {
  flex: 1;
  min-width: 160px;
  padding: 7px 12px !important;
  font-size: 13px !important;
  width: auto !important;
  border-radius: 6px;
}

.player-list-body {
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}

/* Each player row on game page */
.gp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.12s;
  font-size: 14px;
}

.gp-row:last-child { border-bottom: none; }
.gp-row:hover { background: #f0f7ff; }
.gp-row-active { background: #fff8e1 !important; border-left: 3px solid var(--accent); }

.gp-idx {
  width: 28px;
  color: #bbb;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  text-align: right;
}

.gp-ticketno {
  width: 46px;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 13px;
  color: var(--primary);
  flex-shrink: 0;
}

.gp-name {
  flex: 1;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gp-time {
  font-size: 11px;
  color: var(--text-light);
  flex-shrink: 0;
}

.gp-eye {
  font-size: 13px;
  opacity: 0.35;
  flex-shrink: 0;
}

.gp-row:hover .gp-eye { opacity: 1; }

.gp-name-click {
  cursor: pointer;
}
.gp-name-click:hover {
  color: var(--primary);
  text-decoration: underline;
}

.gp-del-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 3px 5px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  flex-shrink: 0;
  line-height: 1;
}

.gp-row:hover .gp-del-btn {
  opacity: 1;
}

.gp-del-btn:hover {
  background: #fdecea;
}

/* Ticket viewer card (right column) */
.ticket-viewer-card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: sticky;
  top: 20px;
}

.tvc-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}

.tvc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.tvc-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tvc-hint {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}

.verify-result-area {
  /* same as verify-result */
}

.verify-loading {
  color: var(--text-light);
  font-size: 13px;
  padding: 8px 0;
}

/* Header extras */
.header-divider {
  color: rgba(255,255,255,0.2);
  font-size: 18px;
  margin: 0 4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .game-page-main {
    grid-template-columns: 1fr;
  }
  .ticket-viewer-card {
    position: static;
  }
  .player-list-body {
    max-height: 400px;
  }
}

@media (max-width: 600px) {
  .host-actions { grid-template-columns: 1fr; }
  .dash-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash-card { padding: 16px 12px; }
  .dash-card-icon { font-size: 26px; }
  .check-split { grid-template-columns: 1fr; }
  .check-main { grid-template-columns: 1fr; }
  .check-players-list { max-height: 260px; }
  .glr-meta { gap: 6px; font-size: 12px; }
  .form-row { flex-direction: column; }
  .game-row { flex-wrap: wrap; }
  .game-page-main { padding: 0 12px; margin: 12px auto; }
  .gin-value { font-size: 28px; letter-spacing: 4px; }
}

/* ===== CLAIM BAR (ticket page) ===== */
/* ===== TICKET BLOCK (wraps one ticket + its claim button) ===== */
.ticket-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.ticket-block-label {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 0 2px;
}

/* Multi-ticket: wrap becomes scrollable column */
.ticket-grid-wrap--multi {
  flex-direction: column !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 20px;
  padding: 12px 8px !important;
}

.ticket-grid-wrap--multi .ticket-block {
  flex-shrink: 0;
}

/* ===== INLINE CLAIM BUTTON (below each ticket) ===== */
.ticket-claim-bar {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}

.claim-btn-inline {
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 40px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(231,76,60,0.45);
  transition: all 0.2s;
}

.claim-btn-inline:active { transform: scale(0.96); }
.claim-btn-inline.claimed { background: #27ae60; box-shadow: 0 3px 12px rgba(39,174,96,0.45); }
.claim-btn-inline:disabled { opacity: 0.7; cursor: default; }

/* Shared claim bar at bottom of multi-ticket screen */
.ticket-claim-bar--shared {
  padding: 14px 0 20px;
}

/* ===== EXTRA TICKET BUTTON ===== */
.extra-ticket-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px 24px;
  gap: 8px;
}

.extra-ticket-hint {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  margin: 0;
  text-align: center;
}

.extra-ticket-btn {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px dashed rgba(255,255,255,0.3);
  border-radius: 50px;
  padding: 9px 28px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.extra-ticket-btn:hover {
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}

.extra-ticket-btn:active { transform: scale(0.97); }
.extra-ticket-btn:disabled { opacity: 0.5; cursor: default; }

/* ===== CLAIM PICKER OVERLAY ===== */
#claim-picker-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end;
}

#claim-picker-overlay.hidden { display: none; }

.claim-sheet {
  width: 100%; background: #1a1a2e;
  border-radius: 20px 20px 0 0;
  padding: 24px 16px 32px;
}

.claim-sheet h3 { color: #fff; text-align: center; margin: 0 0 8px; font-size: 17px; font-weight: 800; }

.claim-sheet-sub {
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  text-align: center;
  margin: 0 0 20px;
  line-height: 1.5;
}

.claim-confirm-btn {
  display: block; width: 100%;
  background: #e74c3c; color: #fff;
  border: none;
  border-radius: 12px; padding: 16px;
  font-size: 16px; font-weight: 700;
  margin-bottom: 10px; cursor: pointer;
  transition: background 0.15s;
}
.claim-confirm-btn:active { background: #c0392b; }

.claim-cancel-btn {
  display: block; width: 100%;
  background: transparent; color: #aaa;
  border: 1px solid #333;
  border-radius: 12px; padding: 12px;
  font-size: 14px; cursor: pointer;
}

/* ===== CLAIMS SECTION (host game page) ===== */
.section-card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}

.section-title {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
}

#claims-list {
  padding: 10px 12px;
  max-height: 280px;
  overflow-y: auto;
}

.badge-count {
  background: #e74c3c; color: #fff;
  border-radius: 50%; font-size: 11px;
  padding: 1px 6px; margin-left: 6px;
  font-weight: 700;
}

.claim-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.claim-card:hover { background: #fff3cd; }

.claim-type-badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
  white-space: nowrap;
  background: #e74c3c; color: #fff;
  flex-shrink: 0;
}

.claim-player { flex: 1; font-size: 13px; font-weight: 600; color: #1a1a2e; }
.claim-tkt { color: #888; font-weight: 400; margin-left: 4px; }

.claim-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.claim-marks { font-size: 11px; color: #27ae60; font-weight: 700; }
.claim-time { font-size: 11px; color: #888; }

.gp-claim-badge { color: #e74c3c; font-size: 12px; margin-left: 4px; }

/* ===== TPP SELECTOR (tickets per player in create game modal) ===== */
.tpp-section { padding: 8px 0 20px; }
.tpp-label {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-bottom: 4px;
}
.tpp-hint {
  font-size: 12px; color: var(--text-light);
  margin-bottom: 16px;
}
.tpp-selector {
  display: flex; gap: 12px;
}
.tpp-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 8px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}
.tpp-btn:hover { border-color: var(--primary); }
.tpp-btn.active {
  border-color: var(--primary);
  background: #fff5f5;
}
.tpp-num {
  font-size: 28px; font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.tpp-btn.active .tpp-num { color: var(--primary); }
.tpp-sub {
  font-size: 11px; color: var(--text-light);
  margin-top: 4px;
}
.tpp-actions { padding-top: 4px; }

/* ===== HOST TICKET PREVIEW — crossed cell ===== */
.htp-crossed {
  background: #2e7d32 !important;
}

.htp-crossed .htp-num {
  color: #fff !important;
}

.htp-grid-label {
  font-size: 11px; font-weight: 700; color: #888;
  text-align: center; letter-spacing: 1px;
  padding: 6px 0 2px; text-transform: uppercase;
}
