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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0d1117;
  color: #e6edf3;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 24px 16px 16px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-bottom: 2px solid #c9a927;
}

header h1 {
  font-size: 1.8rem;
  color: #c9a927;
  letter-spacing: 2px;
}

.subtitle {
  color: #8b949e;
  margin-top: 6px;
  font-size: 0.9rem;
}

/* Filters */
.filters {
  background: #161b22;
  border-bottom: 1px solid #30363d;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.filter-toggle {
  display: none;
  width: 100%;
  padding: 10px;
  background: #21262d;
  color: #e6edf3;
  border: 1px solid #30363d;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

.filter-content {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group > label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #8b949e;
  letter-spacing: 1px;
  font-weight: 600;
}

.filter-group input[type="text"],
.filter-group input[type="number"] {
  background: #0d1117;
  border: 1px solid #30363d;
  color: #e6edf3;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.filter-group input:focus {
  border-color: #c9a927;
}

.buyin-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.buyin-range input { width: 90px; }
.buyin-range span { color: #8b949e; }

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid #30363d;
  transition: all 0.2s;
  user-select: none;
}

.chip:has(input:checked) { border-color: transparent; }
.chip.wsop:has(input:checked) { background: #c9a927; color: #000; }
.chip.wsop-online:has(input:checked) { background: #2f81f7; color: #fff; }
.chip.venetian:has(input:checked) { background: #da3633; color: #fff; }
.chip.wynn:has(input:checked) { background: #238636; color: #fff; }
.chip.aria:has(input:checked) { background: #b8860b; color: #fff; }
.chip.mod:has(input:checked) { background: #30363d; color: #e6edf3; }

.chip input { display: none; }

.btn-clear {
  align-self: flex-end;
  padding: 8px 16px;
  background: transparent;
  color: #c9a927;
  border: 1px solid #c9a927;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-clear:hover { background: #c9a927; color: #000; }

/* Results bar */
.results-bar {
  padding: 8px 16px;
  background: #161b22;
  color: #8b949e;
  font-size: 0.85rem;
  border-bottom: 1px solid #30363d;
}

/* Table */
.table-container {
  overflow-x: auto;
  padding: 0 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  background: #161b22;
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  color: #8b949e;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid #30363d;
  user-select: none;
  transition: color 0.2s;
  position: sticky;
  top: 0;
}

thead th:hover { color: #c9a927; }
thead th.active-sort { color: #c9a927; }

tbody tr {
  border-bottom: 1px solid #21262d;
  transition: background 0.15s;
}

tbody tr:hover { background: #161b22; }

tbody td {
  padding: 10px;
  vertical-align: middle;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-wsop { background: #c9a92733; color: #c9a927; }
.badge-wsop-online { background: #2f81f733; color: #58a6ff; }
.badge-venetian { background: #da363333; color: #f85149; }
.badge-wynn { background: #23863633; color: #3fb950; }
.badge-aria { background: #b8860b33; color: #daa520; }

.badge-mod {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #30363d;
  color: #e6edf3;
}

.buyin-cell { font-weight: 600; color: #3fb950; }
.date-cell { white-space: nowrap; }
.latereg-cell { color: #8b949e; }

/* Cards (mobile) */
.card-container {
  display: none;
  padding: 8px;
  gap: 8px;
}

.card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 12px;
  border-left: 4px solid #30363d;
}

.card.local-wsop { border-left-color: #c9a927; }
.card.local-wsop-online { border-left-color: #2f81f7; }
.card.local-venetian { border-left-color: #da3633; }
.card.local-wynn { border-left-color: #238636; }
.card.local-aria { border-left-color: #b8860b; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.card-nome {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
}

.card-buyin {
  font-weight: 700;
  color: #3fb950;
  white-space: nowrap;
}

.card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  color: #8b949e;
}

.card-details span { display: flex; align-items: center; gap: 3px; }

/* Date Picker */
.dp-wrapper { position: relative; }

.date-picker-btn {
  background: #0d1117;
  border: 1px solid #30363d;
  color: #e6edf3;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s;
  text-align: left;
  white-space: nowrap;
}
.date-picker-btn:hover { border-color: #c9a927; }

.date-picker-popup {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.date-picker-popup.dp-open { display: block; }

.dp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.dp-titles {
  display: flex;
  gap: 80px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #e6edf3;
}
.dp-nav {
  background: transparent;
  border: none;
  color: #8b949e;
  cursor: pointer;
  font-size: 1.4rem;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}
.dp-nav:hover { color: #c9a927; background: #21262d; }

.dp-calendars { display: flex; gap: 24px; }

.dp-month {
  display: grid;
  grid-template-columns: repeat(7, 36px);
  gap: 1px;
  text-align: center;
}
.dp-month .dp-weekday {
  font-size: 0.7rem;
  color: #8b949e;
  padding: 4px 0;
  font-weight: 600;
}
.dp-month .dp-day {
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.1s;
}
.dp-day:hover { background: #30363d; }
.dp-day.dp-empty { pointer-events: none; }
.dp-day.dp-today { font-weight: 700; color: #c9a927; }
.dp-day.dp-start,
.dp-day.dp-end { background: #2f81f7; color: #fff; font-weight: 700; }
.dp-day.dp-start { border-radius: 4px 0 0 4px; }
.dp-day.dp-end { border-radius: 0 4px 4px 0; }
.dp-day.dp-start.dp-end { border-radius: 4px; }
.dp-day.dp-in-range { background: #2f81f733; }

.dp-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.dp-clear {
  padding: 6px 14px;
  background: transparent;
  color: #c9a927;
  border: 1px solid #c9a927;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.dp-clear:hover { background: #c9a927; color: #000; }

/* Responsive */
@media (max-width: 768px) {
  header h1 { font-size: 1.3rem; }
  .filter-toggle { display: block; }
  .filter-content { display: none; flex-direction: column; padding-top: 12px; }
  .filter-content.open { display: flex; }
  .table-container { display: none; }
  .card-container { display: flex; flex-direction: column; }
  .buyin-range input { width: 80px; }
}

@media (min-width: 769px) {
  .card-container { display: none !important; }
  .table-container { display: block !important; }
}
