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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background: #0f1117;
  color: #e1e4e8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

main.container {
  overflow-x: hidden;
}

/* Navbar */
.navbar {
  background: #161b22;
  border-bottom: 1px solid #30363d;
  height: 90px;
  position: sticky;
  top: 0;
  z-index: 1000;
  overflow: visible;
}

.nav-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  gap: 1.25rem;
}

.nav-brand {
  color: #58a6ff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  align-self: center;
  margin-right: auto;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  color: #8b949e;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #e1e4e8;
}

.nav-link-btn {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.nav-link-btn:hover {
  color: #e1e4e8;
}

/* Account popover menu */
.nav-account-wrapper {
  position: relative;
}

.nav-account-btn {
  background: none;
  border: 1px solid transparent;
  color: #8b949e;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s, border-color 0.2s;
}

.nav-account-btn:hover {
  background: #21262d;
  border-color: #30363d;
  color: #e1e4e8;
}

.nav-account-caret {
  font-size: 0.7rem;
  margin-left: 2px;
  opacity: 0.6;
}

.nav-account-popover {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  min-width: 160px;
  padding: 4px 0;
  z-index: 2000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.nav-account-popover.open {
  display: block;
}

.nav-popover-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  color: #c9d1d9;
  text-decoration: none;
  font-size: 0.85rem;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.nav-popover-item:hover {
  background: #21262d;
  color: #e1e4e8;
  text-decoration: none;
}

.nav-popover-divider {
  height: 1px;
  background: #30363d;
  margin: 4px 0;
}

.nav-popover-logout {
  color: #f85149;
}

.nav-popover-logout:hover {
  color: #f85149;
  background: rgba(248, 81, 73, 0.1);
}

/* Home logo */
.hero-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.home-logo {
  max-width: 80%;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Navbar logo */
.nav-logo {
  width: 110px;
  height: auto;
  border-radius: 4px;
  position: relative;
  top: 10px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

/* Main content */
main {
  flex: 1;
  padding: 2rem 0;
}

/* Typography */
h1, h2, h3, h4 {
  color: #e1e4e8;
  margin-bottom: 1rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

a {
  color: #58a6ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Cards */
.card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  color: #8b949e;
  font-size: 0.9rem;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #e1e4e8;
  font-size: 0.95rem;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: #58a6ff;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Disabled fields */
.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
  background: #161b22;          /* slightly lighter than normal bg */
  color: #8b949e;               /* muted text */
  border-color: #21262d;        /* softer border */
  cursor: not-allowed;
  opacity: 1;                   /* override default browser fade */
}




/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid #30363d;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-primary {
  background: #238636;
  color: #fff;
  border-color: #238636;
}

.btn-primary:hover {
  background: #2ea043;
  text-decoration: none;
}

.btn-danger {
  background: #da3633;
  color: #fff;
  border-color: #da3633;
}

.btn-danger:hover {
  background: #f85149;
  text-decoration: none;
}

.btn-secondary {
  background: #21262d;
  color: #c9d1d9;
}

.btn-secondary:hover {
  background: #30363d;
  text-decoration: none;
}

.btn-warning {
  background: #9e6a03;
  color: #fff;
  border-color: #9e6a03;
}

.btn-warning:hover {
  background: #bb8009;
  text-decoration: none;
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}

.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Events controls layout */
.events-controls {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.events-controls-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.view-subcontrols {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid #30363d;
}

.view-subcontrols-label {
  font-size: 0.75rem;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Search panel (unified location + filters) */
.search-panel {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.search-panel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.search-panel-row-extra {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #21262d;
}

.search-panel-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.search-panel-group-location {
  flex: 1;
  min-width: 180px;
  position: relative;
  padding-bottom: 1.4rem;
}

.search-panel-group-btn {
  align-self: flex-end;
}

.search-panel-label {
  font-size: 0.7rem;
  color: #8b949e;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-panel-input {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e1e4e8;
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
  width: 100%;
}

.search-panel-input:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.search-panel-input::placeholder {
  color: #484f58;
}

.search-panel-use-location {
  position: absolute;
  bottom: 0;
  left: 0;
  background: none;
  border: none;
  color: #58a6ff;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  text-align: left;
  line-height: 1;
}

.search-panel-use-location:hover {
  color: #79c0ff;
  text-decoration: underline;
}

.search-panel-select {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e1e4e8;
  padding: 0.45rem 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 90px;
}

.search-panel-select:focus {
  border-color: #58a6ff;
  outline: none;
}

.search-panel-dates {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.search-panel-date-input {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #c9d1d9;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  width: 110px;
  cursor: pointer;
}

.search-panel-date-input:focus {
  border-color: #58a6ff;
  outline: none;
}

.search-panel-date-sep {
  color: #8b949e;
  font-size: 0.8rem;
}

.search-panel-fee {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.search-panel-slider {
  flex: 1;
  accent-color: #58a6ff;
  min-width: 80px;
}

.search-panel-fee-label {
  color: #c9d1d9;
  font-size: 0.85rem;
  min-width: 40px;
}

.search-panel-checkbox {
  color: #c9d1d9;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  white-space: nowrap;
  padding: 0.35rem 0;
}

/* Type multi-select dropdown */
.type-multiselect {
  position: relative;
}

.type-multiselect-btn {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e1e4e8;
  padding: 0.45rem 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  min-width: 130px;
}

.type-multiselect-btn:hover {
  border-color: #484f58;
}

.type-multiselect-btn:focus {
  border-color: #58a6ff;
  outline: none;
}

.type-multiselect-chevron {
  font-size: 0.6rem;
  margin-left: auto;
  color: #8b949e;
  transition: transform 0.15s;
}

.type-multiselect.open .type-multiselect-chevron {
  transform: rotate(180deg);
}

.type-multiselect-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.type-multiselect-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 0.35rem 0;
  z-index: 100;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.type-multiselect.open .type-multiselect-dropdown {
  display: block;
}

.type-multiselect-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  color: #e1e4e8;
  font-size: 0.88rem;
  white-space: nowrap;
}

.type-multiselect-option:hover {
  background: #21262d;
}

.type-multiselect-option input[type="checkbox"] {
  display: none;
}

.type-multiselect-option.unchecked {
  opacity: 0.4;
}

/* Color-coded type dots */
.type-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Community event type dots */
.type-dot-swiss { background: #58a6ff; }
.type-dot-single_elimination { background: #f87171; }
.type-dot-double_elimination { background: #4ade80; }
.type-dot-round_robin { background: #fbbf24; }

/* Official event type dots */
.type-dot-nexus { background: #a78bfa; }
.type-dot-skirmish { background: #f87171; }
.type-dot-openplay { background: #4ade80; }
.type-dot-prerift { background: #fbbf24; }
.type-dot-other { background: #93c5fd; }

.type-dot.dot-hidden {
  display: none;
}

@media (max-width: 600px) {
  .search-panel {
    padding: 0.6rem 0.75rem;
  }

  .search-panel-row {
    gap: 0.5rem;
  }

  .search-panel-group-location {
    min-width: 100%;
  }

  .search-panel-group-btn {
    width: 100%;
  }

  .search-panel-group-btn .btn {
    width: 100%;
  }

  .search-panel-select {
    font-size: 0.85rem;
    min-width: 80px;
  }

  .search-panel-date-input {
    width: 95px;
    font-size: 0.8rem;
    padding: 0.3rem 0.4rem;
  }

  .search-panel-row-extra {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #21262d;
}

th {
  color: #8b949e;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
}

tr:hover {
  background: #161b22;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-draft { background: #21262d; color: #8b949e; }
.badge-registration { background: #0d419d; color: #79c0ff; }
.badge-active { background: #0f5323; color: #56d364; }
.badge-completed { background: #272c17; color: #e3b341; }
.badge-cancelled { background: #3d1e20; color: #f85149; }
.badge-eliminated { background: #3d2e1e; color: #f0883e; }

.badge-registered { background: #1a3a3a; color: #39d0d8; }

.badge-pending { background: #21262d; color: #8b949e; }
.badge-submitted { background: #0d419d; color: #79c0ff; }
.badge-confirmed { background: #1a3a1a; color: #7ee787; }
.badge-verified { background: #0f5323; color: #56d364; }

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #3d1e20;
  color: #f85149;
  border: 1px solid #f8514933;
}

.alert-success {
  background: #1a3a1a;
  color: #56d364;
  border: 1px solid #56d36433;
}

.alert-info {
  background: #0d2744;
  color: #79c0ff;
  border: 1px solid #79c0ff33;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #58a6ff;
}

.stat-label {
  font-size: 0.8rem;
  color: #8b949e;
  margin-top: 0.25rem;
}

/* UVS Stats search bar */
.uvs-search-bar-wrapper {
  position: relative;
  z-index: 500;
}

/* UVS Stats search dropdown */
.uvs-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 0 0 6px 6px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

.uvs-search-item {
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #21262d;
  display: flex;
  align-items: center;
}

.uvs-search-item:hover {
  background: #21262d;
}

.uvs-search-item:last-child {
  border-bottom: none;
}

/* Seating inputs */
.seating-input {
  width: 60px;
  text-align: center;
}

/* Match result inputs */
.result-inputs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.result-inputs input {
  width: 60px;
  text-align: center;
  padding: 0.4rem;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #e1e4e8;
}

.result-inputs span {
  color: #8b949e;
  font-size: 0.85rem;
}

/* Section spacing */
.section {
  margin-bottom: 2rem;
}

/* Footer */
.footer {
  border-top: 1px solid #30363d;
  padding: 1.5rem 0;
  text-align: center;
  color: #484f58;
  font-size: 0.8rem;
  margin-top: auto;
}

.footer-support {
  margin-top: 1rem;
  padding: 1rem 0;
  border-top: 1px solid #21262d;
}

.footer-support-blurb {
  color: #8b949e;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.footer-donate-btn {
  background: #0070ba;
  color: #fff !important;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: background 0.2s;
}

.footer-donate-btn:hover {
  background: #005ea6;
  text-decoration: none;
}

.footer-lizard-btn {
  background: #2ea043;
  color: #fff !important;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
  margin-top: 0.5rem;
  display: inline-block;
}

.footer-lizard-btn:hover {
  background: #238636;
  text-decoration: none;
}

.lizard-counter {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 0 6px;
  margin-left: 4px;
  font-size: 0.85em;
  min-width: 20px;
  display: inline-block;
  text-align: center;
}

.footer-disclaimer {
  margin-top: 1rem;
  padding: 1rem;
  border-top: 1px solid #21262d;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.footer-disclaimer p {
  color: #484f58;
  font-size: 0.7rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.footer-disclaimer a {
  color: #58a6ff;
  text-decoration: none;
}

.footer-disclaimer a:hover {
  text-decoration: underline;
}

/* Calendar */
.calendar-container {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 1rem;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
  table-layout: fixed;
}

.calendar-day-header {
  background: #0d1117;
  color: #8b949e;
  padding: 0.5rem 0.25rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  overflow: hidden;
}

.calendar-cell {
  background: #0d1117;
  min-height: 90px;
  max-height: 140px;
  padding: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  word-break: break-word;
}

.calendar-cell::-webkit-scrollbar {
  width: 4px;
}

.calendar-cell::-webkit-scrollbar-track {
  background: transparent;
}

.calendar-cell::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 2px;
}

.calendar-cell::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

.calendar-cell-empty {
  background: #0a0d12;
}

.calendar-today {
  outline: 2px solid #58a6ff;
  outline-offset: -2px;
}

.calendar-has-events {
  background: #111820;
}

.calendar-date {
  font-size: 0.8rem;
  color: #8b949e;
  margin-bottom: 2px;
}

.calendar-event {
  display: block;
  font-size: 0.7rem;
  padding: 2px 3px;
  border-radius: 3px;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.3;
  cursor: pointer;
  min-width: 0;
}

.calendar-event:hover {
  text-decoration: none;
  filter: brightness(1.2);
  white-space: normal;
  word-break: break-word;
}

.calendar-event-swiss {
  background: #0d2744;
  color: #58a6ff;
  border: 1px solid #1a3a5c;
}

.calendar-event-single_elimination {
  background: #2d1215;
  color: #f87171;
  border: 1px solid #991b1b;
}

.calendar-event-double_elimination {
  background: #0f2918;
  color: #4ade80;
  border: 1px solid #166534;
}

.calendar-event-round_robin {
  background: #2a2008;
  color: #fbbf24;
  border: 1px solid #92400e;
}

/* Official Events - Custom event type badges */
.badge-type-nexus {
  background: #1a1a3a;
  color: #a78bfa;
  border: 1px solid #4c1d95;
}

.badge-type-skirmish {
  background: #1a2332;
  color: #f87171;
  border: 1px solid #991b1b;
}

.badge-type-openplay {
  background: #0f2918;
  color: #4ade80;
  border: 1px solid #166534;
}

.badge-type-prerift {
  background: #2a2008;
  color: #fbbf24;
  border: 1px solid #92400e;
}

.badge-type-other {
  background: #1f2937;
  color: #93c5fd;
  border: 1px solid #374151;
}

.official-event-card:hover {
  border-color: #4c1d95;
}

/* Price badge in list view */
.official-event-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fbbf24;
  background: #1c1a0e;
  border: 1px solid #854d0e;
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-end;
}

/* Price in popover */
.official-popover-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fbbf24;
  background: #1c1a0e;
  border: 1px solid #854d0e;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  margin-top: 0.75rem;
  display: inline-block;
}

/* Mobile: calendar */
@media (max-width: 600px) {
  .calendar-container {
    padding: 0.5rem;
    overflow-x: hidden;
  }

  .calendar-grid {
    width: 100%;
  }

  .calendar-cell {
    min-height: 50px;
    max-height: 90px;
    padding: 1px;
  }

  .calendar-day-header {
    padding: 0.25rem 0;
    font-size: 0.65rem;
  }

  .calendar-date {
    font-size: 0.7rem;
  }

  .calendar-event {
    font-size: 0.6rem;
    padding: 1px 2px;
    line-height: 1.2;
  }

  .official-event-card .card-header {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* Date picker */
.datepicker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.datepicker-hint {
  text-align: center;
  font-size: 0.8rem;
  color: #8b949e;
  margin-bottom: 0.5rem;
}

.datepicker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.datepicker-day-header {
  font-size: 0.7rem;
  color: #8b949e;
  font-weight: 600;
  padding: 0.25rem;
}

.datepicker-cell {
  padding: 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #c9d1d9;
}

.datepicker-cell:hover {
  background: #21262d;
}

.datepicker-cell-empty {
  cursor: default;
}

.datepicker-cell-empty:hover {
  background: none;
}

.datepicker-selected {
  background: #1f6feb;
  color: #fff;
  font-weight: 600;
}

.datepicker-range-start {
  background: #1f6feb;
  color: #fff;
  font-weight: 600;
}

.datepicker-in-range {
  background: #1c2d4a;
  color: #93c5fd;
}

.official-popover {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.official-popover-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
}

.official-popover-content {
  position: relative;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 520px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 1;
}

.official-popover-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #8b949e;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.official-popover-close:hover {
  color: #e1e4e8;
}

.official-detail-table {
  width: 100%;
  border-collapse: collapse;
}

.official-detail-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #21262d;
  font-size: 0.9rem;
}

.official-detail-label {
  color: #8b949e;
  font-weight: 600;
  white-space: nowrap;
  width: 110px;
}

/* Official event action buttons (list view) */
.official-event-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.official-event-actions .btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
}

/* Roster / Standings popover (list view) */
.official-roster-popover {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.official-roster-popover-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
}

.official-roster-popover-content {
  position: relative;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1;
}

.official-roster-popover-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #8b949e;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.official-roster-popover-close:hover {
  color: #e1e4e8;
}

/* Roster / Standings table */
.roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.roster-table th {
  text-align: left;
  color: #8b949e;
  font-weight: 600;
  padding: 0.4rem 0.5rem;
  border-bottom: 2px solid #30363d;
  white-space: nowrap;
}

.roster-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #21262d;
  color: #c9d1d9;
}

.roster-table tr:hover td {
  background: #1c2129;
}

.roster-place {
  color: #8b949e;
  font-weight: 600;
  text-align: center;
  min-width: 30px;
}

.roster-loading {
  text-align: center;
  padding: 1.5rem;
  color: #8b949e;
}

/* Inline roster section in popover (calendar view) */
.official-popover-roster {
  margin-top: 1rem;
  border-top: 1px solid #30363d;
  padding-top: 0.75rem;
}

/* Avatars */
.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  flex-shrink: 0;
}

.avatar-sm {
  width: 20px;
  height: 20px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
}

.avatar-xl {
  width: 80px;
  height: 80px;
}

.player-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Deck grid on list page */
.deck-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* ── Utility classes ── */
.hidden { display: none; }
.flex-spacer { flex: 1; }

/* ── Deck list page ── */
.deck-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.deck-list-header h1 { margin-bottom: 0; }

.deck-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.deck-card-name-wrap {
  min-width: 0;
  flex: 1;
}
.deck-card-name-wrap h3 {
  margin-bottom: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deck-card-meta {
  color: #8b949e;
  font-size: 0.8rem;
}
.deck-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: 1rem;
}
.deck-card-updated {
  color: #484f58;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}
.deck-card-empty {
  text-align: center;
  padding: 3rem;
}
.deck-card-empty-msg {
  color: #8b949e;
  margin-bottom: 1rem;
}
.deck-stat-events-label {
  margin-right: 2px;
}
.deck-delete-confirm {
  display: inline-flex;
  gap: 0.25rem;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Deck editor modal styles ── */
.de-import-hint {
  font-size: 12px;
  color: #8b949e;
  margin: 8px 0;
}
.de-import-textarea {
  width: 100%;
  height: 200px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e1e4e8;
  font-size: 12px;
  padding: 8px;
  resize: vertical;
  font-family: monospace;
}
.de-modal-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: flex-end;
}
.de-deckimg-preview {
  overflow: auto;
  max-height: calc(90vh - 100px);
  text-align: center;
  margin: 8px 0;
}
.de-deckimg-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}
.de-deckimg-content {
  max-width: 90vw;
  max-height: 90vh;
}
.de-deckimg-img {
  max-width: 100%;
  border-radius: 6px;
}
.de-export-groups-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #c9d1d9;
  margin: 6px 0;
  cursor: pointer;
  user-select: none;
}
.de-chip-link {
  text-decoration: none;
}
.de-name-static {
  font-weight: 600;
  font-size: 1rem;
}

/* ── Collection editor modal styles ── */
.ce-contact-hint {
  font-size: 12px;
  color: #8b949e;
  margin: 8px 0;
}
.ce-contact-textarea {
  width: 100%;
  height: 120px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e1e4e8;
  font-size: 12px;
  padding: 8px;
  resize: vertical;
  font-family: inherit;
}

/* ═══════════════════════════════════════
   DECK EDITOR
   ═══════════════════════════════════════ */

#deck-editor {
  display: flex;
  flex-direction: column;
  margin: -2rem 0;
  min-height: calc(100vh - 120px);
}

.de-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #30363d;
  flex-shrink: 0;
}

.de-name-input {
  flex: 1;
  min-width: 0;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 7px 10px;
  color: #e1e4e8;
  font-size: 14px;
  font-weight: 800;
  outline: none;
}

.de-name-input:focus {
  border-color: #58a6ff;
}

.de-card-count {
  font-size: 12px;
  color: #8b949e;
  white-space: nowrap;
}

.de-panels {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

.de-mobile-toggle {
  display: none;
}

/* ── Card Browser (left panel) ── */
.de-browser {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #30363d;
  overflow: hidden;
  min-width: 0;
}

.de-search-bar {
  padding: 10px 12px 6px;
  flex-shrink: 0;
}

.de-search-input {
  width: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 9px 10px;
  color: #e1e4e8;
  font-size: 13px;
  outline: none;
}

.de-search-input:focus {
  border-color: #58a6ff;
}

.de-filter-bar {
  padding: 0 12px 8px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.de-chip-btn {
  border: 1px solid #30363d;
  background: #21262d;
  color: #8b949e;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.de-chip-btn:hover {
  background: #30363d;
  color: #e1e4e8;
}

.de-chip-btn.active {
  background: rgba(35, 134, 54, 0.2);
  color: #56d364;
  border-color: rgba(35, 134, 54, 0.3);
}

.de-chip-danger {
  color: #f85149 !important;
  background: rgba(248, 81, 73, 0.1) !important;
  border-color: rgba(248, 81, 73, 0.2) !important;
}

.de-sort-select {
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 5px 6px;
  color: #8b949e;
  font-size: 11px;
  outline: none;
  cursor: pointer;
}

.de-view-toggle {
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #30363d;
}

.de-toggle-btn {
  border: none;
  cursor: pointer;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
  background: transparent;
  color: #484f58;
}

.de-toggle-btn.active {
  background: #30363d;
  color: #e1e4e8;
}

.de-filters-panel {
  margin: 0 12px 8px;
  padding: 10px 12px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  flex-shrink: 0;
}

.de-filter-group {
  margin-bottom: 8px;
}

.de-filter-group:last-child {
  margin-bottom: 0;
}

.de-filter-label {
  font-size: 11px;
  font-weight: 800;
  color: #484f58;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.de-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.de-filter-chip {
  font-size: 11px !important;
  padding: 3px 8px !important;
}

.de-filter-chip.active {
  background: rgba(35, 134, 54, 0.2) !important;
  color: #56d364 !important;
  border-color: rgba(35, 134, 54, 0.3) !important;
}

.de-results-count {
  padding: 0 12px 6px;
  font-size: 11px;
  color: #484f58;
}

.de-results {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
}

.de-empty-msg {
  color: #484f58;
  padding: 20px;
  text-align: center;
  font-size: 12px;
}

/* ── Results Grid ── */
.de-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.de-result-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #161b22;
  border: 1px solid #30363d;
  cursor: pointer;
}

.de-result-card.in-deck {
  border-color: #238636;
  border-width: 2px;
}

.de-card-img {
  width: 100%;
  display: block;
  aspect-ratio: 488 / 680;
  object-fit: cover;
  background: #0d1117;
}

.de-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 4px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.de-card-name {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255,255,255,0.8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.de-add-btn {
  border: none;
  background: rgba(35, 134, 54, 0.3);
  color: #56d364;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.de-add-btn:hover {
  background: rgba(35, 134, 54, 0.5);
}

.de-add-btn:active {
  background: rgba(35, 134, 54, 0.7);
  transform: scale(0.95);
}

.de-in-deck-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #238636;
  color: #fff;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 900;
}

/* ── Results List ── */
.de-results-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.de-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #161b22;
  border: 1px solid #21262d;
}

.de-result-row.in-deck {
  border-color: rgba(35, 134, 54, 0.3);
  background: rgba(35, 134, 54, 0.05);
}

.de-result-thumb {
  width: 48px;
  height: 67px;
  border-radius: 4px;
  object-fit: cover;
  background: #0d1117;
  flex-shrink: 0;
  cursor: pointer;
}

.de-result-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.de-result-name {
  font-size: 12px;
  font-weight: 700;
  color: #e1e4e8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.de-result-meta {
  font-size: 10px;
  color: #484f58;
  margin-top: 1px;
}

.de-result-count {
  font-size: 12px;
  font-weight: 900;
  color: #56d364;
  min-width: 20px;
  text-align: center;
}

/* ── Deck Panel (right) ── */
.de-deck {
  width: 380px;
  min-width: 320px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0d1117;
}

.de-deck-header {
  padding: 8px 12px;
  border-bottom: 1px solid #21262d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.ce-deck-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
@media (min-width: 700px) {
  .ce-deck-controls {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
}

.de-deck-label {
  font-size: 12px;
  font-weight: 900;
  color: #484f58;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.de-cost-curve {
  padding: 8px 12px 6px;
  border-bottom: 1px solid #21262d;
  flex-shrink: 0;
}

.de-curve-label {
  font-size: 10px;
  font-weight: 800;
  color: #484f58;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.de-curve-bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 32px;
}

.de-curve-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 0;
  transition: background 0.15s;
}

.de-curve-col:hover {
  background: rgba(88, 166, 255, 0.1);
}

.de-curve-col.de-curve-selected {
  background: rgba(88, 166, 255, 0.15);
}

.de-curve-count {
  font-size: 8px;
  color: #8b949e;
  line-height: 1;
  min-height: 9px;
}

.de-curve-bar {
  width: 100%;
  background: #21262d;
  border-radius: 2px;
  transition: height 0.2s;
}

.de-curve-bar.active {
  background: rgba(35, 134, 54, 0.5);
}

.de-curve-bar.selected {
  background: #58a6ff !important;
}

.de-curve-num {
  font-size: 8px;
  color: #484f58;
  line-height: 1;
}

.de-curve-selected .de-curve-num {
  color: #58a6ff;
  font-weight: 900;
}

/* Legality ribbon */
.de-legality-ribbon {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  border-bottom: 1px solid #21262d;
}

.de-legality-legal {
  background: rgba(35, 134, 54, 0.15);
  color: #3fb950;
  border-left: 3px solid #3fb950;
}

.de-legality-illegal {
  background: rgba(248, 81, 73, 0.1);
  color: #f85149;
  border-left: 3px solid #f85149;
}

.de-legality-icon {
  font-weight: 900;
  margin-right: 4px;
}

.de-legality-reasons {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 11px;
  font-weight: 400;
  color: #f0908a;
  list-style: disc;
  line-height: 1.5;
}

.de-legality-reasons li {
  margin-bottom: 1px;
}

.de-competitive-ribbon {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  border-bottom: 1px solid #21262d;
}

.de-competitive-warning {
  background: rgba(210, 153, 34, 0.12);
  color: #d29922;
  border-left: 3px solid #d29922;
}

.de-competitive-reasons {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 11px;
  font-weight: 400;
  color: #e3b341;
  list-style: disc;
  line-height: 1.5;
}

.de-competitive-reasons li {
  margin-bottom: 1px;
}

.de-deck-contents {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

.de-section-header {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #484f58;
  text-transform: uppercase;
  padding: 4px 2px 6px;
}

/* Deck list view */
.de-deck-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #161b22;
  border: 1px solid #21262d;
  margin-bottom: 4px;
}

.de-deck-row-banned {
  border-color: #d29922;
  background: rgba(210, 153, 34, 0.08);
  box-shadow: inset 0 0 0 1px rgba(210, 153, 34, 0.15);
}

.de-deck-row-limited {
  border-color: #d29922;
  background: rgba(210, 153, 34, 0.05);
}

.de-deck-thumb {
  width: 40px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  background: #0d1117;
  flex-shrink: 0;
  cursor: pointer;
}

.de-deck-row-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.de-deck-row-name {
  font-size: 12px;
  font-weight: 700;
  color: #e1e4e8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.de-deck-row-id {
  font-size: 9px;
  color: #484f58;
}

.de-deck-row-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.de-deck-row-count {
  min-width: 18px;
  text-align: center;
  font-weight: 900;
  font-size: 12px;
  color: #e1e4e8;
}

.de-sm-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #30363d;
  background: #0d1117;
  color: #8b949e;
  cursor: pointer;
  font-weight: 900;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.de-sm-btn:hover {
  background: #21262d;
  color: #e1e4e8;
}

.de-sm-btn:active {
  background: #30363d;
  transform: scale(0.95);
}

.de-sm-btn-danger {
  color: #f85149 !important;
  background: rgba(248, 81, 73, 0.1) !important;
}

/* Deck grid view */
.de-deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.de-deck-grid-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #161b22;
  border: 1px solid #21262d;
}

.de-deck-grid-banned {
  border-color: #d29922;
  box-shadow: 0 0 6px rgba(210, 153, 34, 0.35);
}

.de-deck-grid-limited {
  border-color: #d29922;
  box-shadow: 0 0 4px rgba(210, 153, 34, 0.2);
}

.de-deck-grid-img {
  width: 100%;
  display: block;
  aspect-ratio: 488 / 680;
  object-fit: cover;
  background: #0d1117;
  cursor: pointer;
}

.de-deck-grid-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 11px;
  font-weight: 900;
}

.de-deck-grid-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 3px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

.de-tiny-btn {
  width: 28px;
  height: 26px;
  border-radius: 5px;
  border: none;
  background: rgba(0,0,0,0.50);
  color: rgba(255,255,255,0.80);
  cursor: pointer;
  font-weight: 900;
  font-size: 15px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.de-tiny-btn:active {
  background: rgba(0,0,0,0.70);
  transform: scale(0.95);
}

.de-tiny-btn-danger {
  color: #f85149;
}

/* Deck footer */
.de-deck-footer {
  padding: 8px 12px;
  border-top: 1px solid #21262d;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

/* ── Collection Check (Need button) ── */
.de-chip-collection {
  color: #d2a8ff;
  border-color: rgba(210, 168, 255, 0.3);
}

.de-chip-collection:hover {
  background: rgba(210, 168, 255, 0.1);
  border-color: rgba(210, 168, 255, 0.5);
}

.de-collcheck-modal {
  max-width: 640px;
}

.de-collcheck-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px 0;
}

.de-collcheck-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 2rem 1rem;
  color: #3fb950;
  font-size: 0.95rem;
  font-weight: 600;
}

.de-collcheck-success i {
  font-size: 1.4rem;
}

.de-collcheck-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0 12px;
  border-bottom: 1px solid #21262d;
  margin-bottom: 12px;
}

.de-collcheck-summary-count {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f0883e;
}

.de-collcheck-summary-unique {
  font-size: 0.78rem;
  color: #8b949e;
}

.de-collcheck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.de-collcheck-card {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.de-collcheck-card:hover {
  border-color: #d2a8ff;
  transform: translateY(-2px);
}

.de-collcheck-img {
  width: 100%;
  display: block;
  aspect-ratio: 488 / 680;
  object-fit: cover;
  background: #0d1117;
}

.de-collcheck-info {
  padding: 5px 7px 6px;
}

.de-collcheck-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: #e1e4e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.de-collcheck-qty {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 2px;
}

.de-collcheck-need {
  font-size: 0.68rem;
  font-weight: 700;
  color: #f0883e;
}

.de-collcheck-have {
  font-size: 0.62rem;
  color: #484f58;
}

@media (max-width: 600px) {
  .de-collcheck-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
  }
}

/* ── Zoom overlay ── */
.de-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
/* Card-detail zoom must sit above scanner / import overlays */
#de-zoom-overlay,
#ce-zoom-overlay {
  z-index: 10001;
}
 
.de-zoom-content {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.de-zoom-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.de-zoom-name {
  font-weight: 900;
  color: #e1e4e8;
  font-size: 14px;
}

.de-zoom-id {
  color: #484f58;
  font-size: 11px;
  margin-top: 2px;
}

.de-zoom-close {
  border: none;
  background: #21262d;
  color: #8b949e;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.de-zoom-img-wrap {
  display: flex;
  justify-content: center;
  margin: 12px 0;
  position: relative;
  touch-action: pan-y pinch-zoom;
}

.de-zoom-img {
  width: min(320px, 80vw);
  height: auto;
  border-radius: 10px;
  object-fit: cover;
  background: #0d1117;
}

.de-zoom-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  padding: 10px 0;
  border-top: 1px solid #21262d;
}

.de-zoom-meta-label {
  font-size: 11px;
  font-weight: 800;
  color: #484f58;
  text-transform: uppercase;
}

.de-zoom-meta-val {
  font-size: 12px;
  color: #8b949e;
}

.de-zoom-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #21262d;
  margin-bottom: 4px;
}

.de-zoom-count {
  min-width: 30px;
  text-align: center;
  font-weight: 900;
  font-size: 16px;
  color: #e1e4e8;
}

.de-zoom-label {
  font-size: 12px;
  color: #484f58;
}

/* ── Zoom pricing section ── */
.de-zoom-pricing {
  border-top: 1px solid #21262d;
  padding-top: 8px;
  margin-top: 4px;
}

.de-zoom-pricing-title {
  font-size: 11px;
  font-weight: 800;
  color: #58a6ff;
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.de-zoom-pricing .de-zoom-meta {
  border-top: none;
  padding-top: 0;
}

.de-price-up {
  color: #3fb950 !important;
}

.de-price-down {
  color: #f85149 !important;
}

.de-zoom-tcg-link {
  display: inline-block;
  font-size: 11px;
  color: #58a6ff;
  text-decoration: none;
  margin-top: 6px;
  margin-right: 12px;
}

.de-zoom-tcg-link:hover {
  text-decoration: underline;
}

/* ── Inline price in list views ── */
.de-price-inline {
  color: #3fb950;
  font-weight: 700;
}

/* ── Zoom navigation arrows ── */
.de-zoom-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(13, 17, 23, 0.7);
  border: 1px solid rgba(48, 54, 61, 0.6);
  color: #e1e4e8;
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
  width: 44px;
  height: 64px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.de-zoom-nav:hover {
  background: rgba(33, 38, 45, 0.9);
  color: #fff;
}

.de-zoom-nav-prev {
  left: -8px;
}

.de-zoom-nav-next {
  right: -8px;
}

@media (max-width: 600px) {
  .de-zoom-nav {
    /* Hide arrow buttons on mobile - use swipe instead */
    display: none;
  }
}

/* ── Deck value display ── */
.de-deck-value {
  font-size: 12px;
  color: #8b949e;
  padding: 4px 0;
  text-align: center;
  border-top: 1px solid #21262d;
}

.de-deck-value-amount {
  color: #3fb950;
  font-weight: 700;
}

.deck-value-row {
  color: #8b949e;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.25rem;
}

.deck-value-amount {
  color: #3fb950;
  font-weight: 700;
}

.deck-value-inline {
  font-size: 0.8rem;
}

/* ═══════════════════════════════════════
   EXPORT MODAL
   ═══════════════════════════════════════ */

.de-export-hint {
  font-size: 12px;
  color: #8b949e;
  margin: 8px 0;
}

.de-export-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  min-height: 36px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  margin-bottom: 8px;
}

.de-export-token {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #21262d;
  color: #e1e4e8;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: grab;
  user-select: none;
}

.de-export-token:active {
  cursor: grabbing;
}

.de-export-token-remove {
  cursor: pointer;
  color: #8b949e;
  font-size: 13px;
  line-height: 1;
  margin-left: 2px;
}

.de-export-token-remove:hover {
  color: #f85149;
}

.de-export-add-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-bottom: 10px;
}

.de-export-add-label {
  font-size: 11px;
  color: #8b949e;
  font-weight: 600;
  margin-right: 2px;
}

.de-export-preview {
  width: 100%;
  height: 160px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e1e4e8;
  font-size: 12px;
  padding: 8px;
  font-family: monospace;
  resize: vertical;
}

.de-export-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: flex-end;
}

.de-export-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #e1e4e8;
  cursor: pointer;
  user-select: none;
  margin-bottom: 8px;
}

.de-export-toggle-label input[type="checkbox"] {
  accent-color: #58a6ff;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.de-export-mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: #e1e4e8;
}

.de-export-mode-bar label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

.de-export-mode-bar input[type="radio"] {
  accent-color: #58a6ff;
  cursor: pointer;
}

/* ═══════════════════════════════════════
   CARD SCANNER MODAL
   ═══════════════════════════════════════ */

.de-scanner-modal {
  max-width: 480px;
  width: 90vw;
}

.de-scanner-video-wrap {
  position: relative;
  width: 100%;
  background: #0d1117;
  border-radius: 8px;
  overflow: hidden;
  margin: 8px 0;
  min-height: 160px;
  max-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.de-scanner-video-wrap video {
  width: 100%;
  height: 100%;
  max-height: 60vh;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.de-scanner-fallback {
  text-align: center;
  padding: 40px 20px;
  color: #8b949e;
  font-size: 13px;
}

.de-scanner-fallback p {
  margin: 4px 0;
}

.de-scanner-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: center;
}

.de-scanner-header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}

.de-scanner-state {
  text-align: center;
  padding: 20px 0;
  color: #8b949e;
}

.de-scanner-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #30363d;
  border-top-color: #58a6ff;
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: de-spin 0.8s linear infinite;
}

@keyframes de-spin {
  to { transform: rotate(360deg); }
}

.de-scanner-results-title {
  font-size: 13px;
  font-weight: 700;
  color: #e1e4e8;
  margin: 0 0 10px;
  text-align: left;
}

.de-scanner-results-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.de-scanner-match {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 8px;
}

.de-scanner-match-img {
  width: 52px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  background: #161b22;
  flex-shrink: 0;
  cursor: pointer;
}

.de-scanner-match-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.de-scanner-match-name {
  font-size: 13px;
  font-weight: 700;
  color: #e1e4e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.de-scanner-match-conf {
  font-size: 11px;
  color: #8b949e;
  margin-top: 2px;
}

.de-scanner-add-btn {
  flex-shrink: 0;
}

.de-scanner-no-match {
  color: #f85149;
  font-size: 13px;
  padding: 20px 0;
}

/* Card guide overlay — crop region shown on camera feed */
/* Sizing must stay in sync with capturePhoto() in deck-editor.js */
.de-scanner-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 70%;
  aspect-ratio: 5 / 7;
  max-width: 80%;
  transform: translate(-50%, -50%);
  border: 2px solid transparent;
  border-radius: 10px;
  outline: 9999px solid rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 2;
  box-sizing: border-box;
}

/* Dynamic tip label below the guide box (updated by JS) */
.de-scanner-tip {
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  transition: color 0.2s;
}
.de-scanner-tip.de-detected {
  color: rgba(63, 185, 80, 0.95);
}

/* Edge-detection overlay canvas — draws detected card outline */
.de-scanner-edge-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* Auto-suggestion popover on live camera feed */
.de-scanner-suggestions {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  z-index: 5;
  background: rgba(22, 27, 34, 0.92);
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 45%;
  overflow-y: auto;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.de-scanner-suggestion {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.de-scanner-suggestion:hover,
.de-scanner-suggestion:active {
  background: rgba(88, 166, 255, 0.15);
}

.de-scanner-suggestion-img {
  width: 32px;
  height: 45px;
  object-fit: cover;
  border-radius: 3px;
  background: #0d1117;
  flex-shrink: 0;
}

.de-scanner-suggestion-info {
  flex: 1;
  min-width: 0;
}

.de-scanner-suggestion-name {
  font-size: 12px;
  font-weight: 700;
  color: #e1e4e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.de-scanner-suggestion-conf {
  font-size: 10px;
  color: #8b949e;
  margin-top: 1px;
}

.de-scanner-suggestion-add {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
}

.de-scanner-suggestions-label {
  font-size: 10px;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 2px 2px;
  font-weight: 600;
}

.de-scanner-match-value {
  font-size: 12px;
  font-weight: 700;
  color: #3fb950;
  margin-top: 2px;
}

.de-scanner-card-value {
  color: #3fb950;
  font-weight: 700;
  margin-left: 6px;
}

.de-scanner-best-match {
  border-color: #3fb950;
}

/* Scanner settings bar */
.de-scanner-settings {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.de-scanner-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #e1e4e8;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.de-scanner-toggle-label input[type="checkbox"] {
  accent-color: #58a6ff;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.de-scanner-threshold-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.de-scanner-threshold-label {
  font-size: 11px;
  color: #8b949e;
  white-space: nowrap;
}

.de-scanner-threshold-wrap input[type="range"] {
  flex: 1;
  min-width: 60px;
  max-width: 140px;
  height: 4px;
  accent-color: #58a6ff;
  cursor: pointer;
}

.de-scanner-gear-btn {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s;
  display: none; /* hidden — settings always visible in bar */
}

.de-scanner-threshold-wrap.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .nav-links {
    gap: 0.75rem;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .calendar-container {
    overflow-x: hidden;
    padding: 0.5rem;
  }
  .calendar-grid {
    min-width: 0;
    width: 100%;
  }
  .calendar-cell {
    min-height: 50px;
    max-height: 90px;
    padding: 1px;
  }
  .calendar-day-header {
    padding: 0.25rem 0;
    font-size: 0.65rem;
  }
  .calendar-date {
    font-size: 0.7rem;
  }
  .calendar-event {
    font-size: 0.6rem;
    padding: 1px 2px;
  }
}

/* Deck editor responsive - tablet */
@media (max-width: 960px) {
  .de-browser {
    flex: 0 0 40%;
    max-width: 40%;
  }
  .de-deck {
    flex: 0 0 58%;
    max-width: 58%;
  }
  .de-deck-footer {
    flex-wrap: wrap;
    gap: 4px;
  }
  .de-deck-row-controls {
    flex-wrap: wrap;
    gap: 2px;
  }
}

/* Deck editor responsive - mobile */
@media (max-width: 699px) {
  .de-card-count { display: none !important; }
  .de-deck {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    border-right: none !important;
  }
  .de-browser {
    border-right: none !important;
    max-width: none !important;
  }
  .de-panels {
    flex-direction: column;
  }
  .de-topbar {
    flex-wrap: wrap;
  }
  .de-deck-footer {
    flex-wrap: wrap;
    gap: 4px;
  }
  .deck-card-actions {
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-left: 0;
    margin-top: 0.5rem;
  }
  .deck-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ═══════════════════════════════════════
   RIFTBOUND ICON FONT
   ═══════════════════════════════════════ */

@font-face {
  font-family: 'Riftbound Icons';
  src: url('/css/riftbound_FONT.ttf') format('truetype');
  font-display: swap;
}

.rb-icon {
  font-family: 'Riftbound Icons', sans-serif;
  font-style: normal;
  font-weight: normal;
  font-size: 1.1em;
  line-height: 1;
  vertical-align: middle;
}

/* ═══════════════════════════════════════
   WIDER LAYOUT FOR DECK EDITOR
   ═══════════════════════════════════════ */

main.de-wide {
  max-width: 1600px;
  padding: 0 0.5rem;
}

/* ═══════════════════════════════════════
   DECK TYPE BAR (editor)
   ═══════════════════════════════════════ */

.de-type-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #30363d;
  flex-shrink: 0;
}

.de-type-label {
  font-size: 11px;
  font-weight: 800;
  color: #484f58;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.de-type-select {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 5px 8px;
  color: #e1e4e8;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.de-type-select:focus {
  border-color: #58a6ff;
}

.de-type-separator {
  color: #484f58;
  font-weight: 800;
  font-size: 14px;
}

.de-subtype-input {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 5px 8px;
  color: #e1e4e8;
  font-size: 12px;
  outline: none;
  width: 140px;
}

.de-subtype-input:focus {
  border-color: #58a6ff;
}

.de-subtype-input::placeholder {
  color: #484f58;
}

/* ═══════════════════════════════════════
   KEYWORD FILTER CHIPS
   ═══════════════════════════════════════ */

.de-kw-green {
  background: #21705b !important;
  color: #fff !important;
  border-color: #21705b !important;
}

.de-kw-green.active {
  background: #2a9975 !important;
  color: #fff !important;
  border-color: #2a9975 !important;
  box-shadow: 0 0 0 2px rgba(33, 112, 91, 0.5);
}

.de-kw-pink {
  background: #ce356b !important;
  color: #fff !important;
  border-color: #ce356b !important;
}

.de-kw-pink.active {
  background: #e04d83 !important;
  color: #fff !important;
  border-color: #e04d83 !important;
  box-shadow: 0 0 0 2px rgba(206, 53, 107, 0.5);
}

.de-kw-gray {
  background: #6d6e6b !important;
  color: #fff !important;
  border-color: #6d6e6b !important;
}

.de-kw-gray.active {
  background: #8a8b88 !important;
  color: #fff !important;
  border-color: #8a8b88 !important;
  box-shadow: 0 0 0 2px rgba(109, 110, 107, 0.5);
}

.de-kw-olive {
  background: #94b131 !important;
  color: #000 !important;
  border-color: #94b131 !important;
}

.de-kw-olive.active {
  background: #a8c748 !important;
  color: #000 !important;
  border-color: #a8c748 !important;
  box-shadow: 0 0 0 2px rgba(148, 177, 49, 0.5);
}

/* ═══════════════════════════════════════
   CHOSEN + SIDEBOARD STYLES (deck editor)
   ═══════════════════════════════════════ */

.de-chosen-star {
  color: #f0c040;
  font-size: 13px;
}

.de-chosen-btn {
  font-size: 12px !important;
  color: #484f58 !important;
  background: transparent !important;
  border-color: transparent !important;
}

.de-chosen-btn.active {
  color: #f0c040 !important;
}

.de-chosen-btn:hover {
  color: #f0c040 !important;
}

.de-sb-btn {
  font-size: 9px !important;
  font-weight: 900 !important;
  color: #484f58 !important;
  background: transparent !important;
  border-color: transparent !important;
}

.de-sb-btn.active {
  color: #d2a8ff !important;
}

.de-sb-btn:hover {
  color: #d2a8ff !important;
}

.de-deck-row-chosen {
  border-color: rgba(240, 192, 64, 0.4) !important;
  background: rgba(240, 192, 64, 0.05) !important;
}

.de-deck-row-sb {
  border-color: rgba(210, 168, 255, 0.3) !important;
  background: rgba(210, 168, 255, 0.05) !important;
}

.de-section-sideboard {
  color: #d2a8ff !important;
}

.de-deck-grid-chosen {
  border-color: rgba(240, 192, 64, 0.5) !important;
}

.de-deck-grid-chosen-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  color: #f0c040;
  font-size: 16px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.de-grid-chosen-btn {
  position: absolute;
  top: 3px;
  left: 3px;
  background: rgba(0,0,0,0.6);
  border: none;
  border-radius: 4px;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  cursor: pointer;
  padding: 1px 4px;
  line-height: 1;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.de-grid-chosen-btn:hover {
  color: #f0c040;
  background: rgba(0,0,0,0.8);
}

.de-grid-chosen-btn.active {
  color: #f0c040;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.de-deck-grid-sb {
  border-color: rgba(210, 168, 255, 0.4) !important;
}

/* ═══════════════════════════════════════
   DECK LIST PAGE - TYPE BADGES + STATS
   ═══════════════════════════════════════ */

.deck-type-badge[data-deck-type="Aggro"] { background: #6e1a1a; color: #ff6b6b; }
.deck-type-badge[data-deck-type="MidRange"] { background: #4a3000; color: #ffa94d; }
.deck-type-badge[data-deck-type="Control"] { background: #0d2744; color: #79c0ff; }
.deck-type-badge[data-deck-type="Tempo"] { background: #1a3a3a; color: #39d0d8; }
.deck-type-badge[data-deck-type="Ramp"] { background: #1a3a1a; color: #7ee787; }
.deck-type-badge[data-deck-type="Combo"] { background: #3d1e42; color: #d2a8ff; }
.deck-type-badge[data-deck-type="Token"] { background: #272c17; color: #e3b341; }

/* W/L/D Stats row */
.deck-stats-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.deck-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
}

.deck-stat-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #30363d;
  background: #0d1117;
  color: #8b949e;
  cursor: pointer;
  font-weight: 900;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.deck-stat-btn:hover {
  background: #21262d;
  color: #e1e4e8;
}

.deck-stat-btn:active {
  background: #30363d;
  transform: scale(0.95);
}

.deck-stat-val {
  min-width: 22px;
  text-align: center;
  font-weight: 900;
  font-size: 1rem;
  color: #e1e4e8;
}

.deck-stat-wins { color: #56d364; }
.deck-stat-losses { color: #f85149; }
.deck-stat-draws { color: #8b949e; }

.deck-stat-label {
  font-size: 0.8rem;
  color: #484f58;
  font-weight: 700;
}

.deck-stat-separator {
  color: #30363d;
  font-size: 1rem;
  margin: 0 4px;
}

.deck-event-stats {
  font-size: 0.8rem;
  color: #8b949e;
}

.deck-event-val {
  font-weight: 700;
  color: #8b949e;
  margin-right: 2px;
}

/* ====== Event Header with QR ====== */
.event-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.event-header-info {
  flex: 1;
  min-width: 0;
}
.event-qr {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 4px;
  background: #161b22;
  display: flex;
  align-items: center;
  justify-content: center;
}
.event-qr svg {
  width: 100%;
  height: 100%;
}

/* ====== My Match Banner ====== */
.my-match-banner {
  background: linear-gradient(135deg, #1a3a5c 0%, #1a2744 100%);
  border: 2px solid #58a6ff;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  animation: banner-pulse 3s ease-in-out infinite;
}
@keyframes banner-pulse {
  0%, 100% { border-color: #58a6ff; box-shadow: 0 0 8px rgba(88, 166, 255, 0.15); }
  50% { border-color: #79b8ff; box-shadow: 0 0 20px rgba(88, 166, 255, 0.3); }
}
.my-match-banner-inner {
  text-align: center;
}
.my-match-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #58a6ff;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.my-match-details {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.my-match-table {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.my-match-table-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b949e;
}
.my-match-table-number {
  font-size: 2rem;
  font-weight: 800;
  color: #58a6ff;
  line-height: 1;
}
.my-match-vs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
}
.my-match-vs-text {
  color: #484f58;
  font-size: 1rem;
  font-weight: 400;
}
.my-match-player {
  color: #e1e4e8;
}
.my-match-row {
  background-color: rgba(88, 166, 255, 0.1);
}

/* ====== Bracket Visualization ====== */
.bracket-container {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 1rem 0;
  align-items: flex-start;
}
.bracket-round {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: space-around;
}
.bracket-round-header {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8b949e;
  text-align: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #21262d;
  font-weight: 600;
}
.bracket-match {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  overflow: hidden;
}
.bracket-match-complete {
  border-color: #238636;
}
.bracket-seed {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border-bottom: 1px solid #21262d;
  color: #8b949e;
}
.bracket-seed:last-child {
  border-bottom: none;
}
.bracket-winner {
  color: #3fb950;
  font-weight: 600;
  background: rgba(63, 185, 80, 0.08);
}
.bracket-score {
  font-weight: 700;
  min-width: 1.5rem;
  text-align: center;
}

/* ====== Printable / Display page ====== */
.display-page {
  background: #0d1117;
  min-height: 100vh;
  padding: 2rem;
}
.display-page .event-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #30363d;
}
.display-page .event-title-bar h1 {
  font-size: 2rem;
  color: #e1e4e8;
}
.display-matchups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.display-match-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}
.display-match-table {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #58a6ff;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.display-match-players {
  font-size: 1.3rem;
  font-weight: 600;
  color: #e1e4e8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.display-match-players .vs {
  color: #484f58;
  font-size: 1rem;
  font-weight: 400;
}

/* ====== Print styles ====== */
@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .display-page { background: #fff !important; padding: 0.5rem !important; }
  .display-page .event-title-bar { border-color: #ccc !important; }
  .display-page .event-title-bar h1 { color: #000 !important; }
  .display-match-card {
    background: #fff !important;
    border: 2px solid #000 !important;
    color: #000 !important;
    break-inside: avoid;
  }
  .display-match-table { color: #333 !important; }
  .display-match-players { color: #000 !important; }
  .display-match-players .vs { color: #666 !important; }
  .event-qr svg { filter: invert(1); }
  .badge { border: 1px solid #999 !important; background: #eee !important; color: #000 !important; }
}

/* ====== Tournament type indicator on event list cards ====== */
.tournament-type-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.tournament-type-badge-swiss {
  background: #0d2744;
  color: #58a6ff;
  border: 1px solid #1a3a5c;
}

.tournament-type-badge-single_elimination {
  background: #2d1215;
  color: #f87171;
  border: 1px solid #991b1b;
}

.tournament-type-badge-double_elimination {
  background: #0f2918;
  color: #4ade80;
  border: 1px solid #166534;
}

.tournament-type-badge-round_robin {
  background: #2a2008;
  color: #fbbf24;
  border: 1px solid #92400e;
}

@media (max-width: 600px) {
  .event-header {
    flex-direction: column;
  }
  .event-qr {
    align-self: center;
    width: 80px;
    height: 80px;
  }
  .my-match-details {
    flex-direction: column;
    gap: 0.75rem;
  }
  .bracket-container {
    gap: 1rem;
  }
  .bracket-round {
    min-width: 180px;
  }
}

/* ═══════════════════════════════════════
   Collection / Exchange Styles
   ═══════════════════════════════════════ */

/* Collection editor tabs */
.ce-tabs {
  display: flex;
  gap: 0;
  flex: 1;
}

.ce-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #8b949e;
  font-size: 0.85rem;
  font-family: inherit;
  padding: 6px 14px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.ce-tab:hover {
  color: #c9d1d9;
}

.ce-tab.active {
  color: #58a6ff;
  border-bottom-color: #58a6ff;
}

/* Collapse browser panel button */
.ce-collapse-btn {
  background: #21262d;
  border: 1px solid #30363d;
  border-left: none;
  border-right: none;
  color: #8b949e;
  cursor: pointer;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
}

.ce-collapse-btn:hover {
  background: #30363d;
  color: #e1e4e8;
}

.ce-collapse-btn i {
  transition: transform 0.2s;
}

.ce-collapse-btn.collapsed i {
  transform: rotate(180deg);
}

/* Collapsed browser state */
.de-panels.browser-collapsed .de-browser {
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  overflow: hidden;
  border-right: none;
}

.de-panels.browser-collapsed .de-deck {
  flex: 1;
  width: auto;
  max-width: none;
}

@media (max-width: 699px) {
  .ce-collapse-btn {
    display: none;
  }
}

/* Add button variants in search results — 3-col grid: row 1 = regular, row 2 = foil */
.ce-add-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.ce-add-btns .de-add-btn {
  width: 100%;
  min-width: 0;
}

.ce-add-coll {
  font-size: 11px !important;
  padding: 2px 6px !important;
  min-width: 30px;
  background: rgba(31, 64, 104, 0.6) !important;
  color: #58a6ff !important;
}

.ce-add-coll:hover {
  background: rgba(31, 64, 104, 0.9) !important;
}

.ce-add-coll:active {
  background: #1f4068 !important;
}

.ce-add-wish {
  font-size: 11px !important;
  padding: 2px 6px !important;
  min-width: 30px;
  background: #8957e5 !important;
}

.ce-add-wish:hover {
  background: #a371f7 !important;
}

/* Wishlist badge on search results */
.ce-wish-badge {
  bottom: auto !important;
  top: 4px !important;
  right: 4px !important;
  left: auto !important;
  background: #8957e5 !important;
}

/* Trade/wishlist row highlights */
.ce-row-trade {
  border-left: 3px solid #56d364;
}

.ce-row-willtrade {
  border-left: 3px solid #8957e5;
}

.ce-grid-trade {
  box-shadow: 0 0 0 2px #56d364;
}

.ce-grid-willtrade {
  box-shadow: 0 0 0 2px #8957e5;
}

/* Trade button */
.ce-trade-btn {
  color: #8b949e !important;
  font-size: 10px !important;
}

.ce-trade-btn.active {
  background: #238636 !important;
  color: #fff !important;
}

/* Will-trade button */
.ce-willtrade-btn {
  color: #8b949e !important;
  font-size: 10px !important;
}

.ce-willtrade-btn.active {
  background: #8957e5 !important;
  color: #fff !important;
}

/* WTT button for trade cards – green */
.ce-trade-wtt-btn {
  color: #8b949e !important;
  font-size: 10px !important;
}

.ce-trade-wtt-btn.active {
  background: #238636 !important;
  color: #fff !important;
}

/* Price inputs */
.ce-price-input {
  width: 70px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #e1e4e8;
  font-size: 11px;
  padding: 2px 6px;
  font-family: inherit;
}

.ce-price-input:focus {
  border-color: #58a6ff;
  outline: none;
}

/* Trade price and max price labels */
.ce-trade-price {
  color: #56d364;
  font-weight: 600;
}

.ce-max-price {
  color: #58a6ff;
  font-weight: 600;
}

.ce-willtrade-label {
  color: #a371f7;
  font-weight: 600;
  font-size: 0.8rem;
}

/* Zoom trade controls row */
.ce-zoom-trade-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #161b22;
  border-radius: 6px;
  margin: 4px 0;
  justify-content: space-between;
}

.ce-zoom-trade-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #c9d1d9;
  cursor: pointer;
}

.ce-zoom-trade-label input[type="checkbox"] {
  accent-color: #56d364;
}

/* ── Shop viewer ── */
.ce-shop-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #30363d;
  margin-bottom: 1rem;
}

.ce-shop-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #8b949e;
  font-size: 0.9rem;
  font-family: inherit;
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.ce-shop-tab:hover {
  color: #c9d1d9;
}

.ce-shop-tab.active {
  color: #58a6ff;
  border-bottom-color: #58a6ff;
}

.shop-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.shop-card {
  display: flex;
  gap: 10px;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.shop-card:hover {
  border-color: #58a6ff;
}

.shop-card-img {
  width: 60px;
  height: 84px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.shop-card-info {
  flex: 1;
  min-width: 0;
}

.shop-card-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: #e1e4e8;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-card-meta {
  font-size: 0.75rem;
  color: #8b949e;
  line-height: 1.4;
}

/* ── Exchange search listings ── */
.ex-listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.ex-listing {
  display: flex;
  gap: 10px;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 10px;
  transition: border-color 0.2s;
}

.ex-listing:hover {
  border-color: #58a6ff;
}

.ex-listing-img {
  width: 70px;
  height: 98px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
}

.ex-listing-info {
  flex: 1;
  min-width: 0;
}

.ex-listing-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: #e1e4e8;
  margin-bottom: 2px;
}

.ex-listing-meta {
  font-size: 0.75rem;
  color: #8b949e;
  margin-bottom: 4px;
}

.ex-listing-player {
  font-size: 0.75rem;
  color: #58a6ff;
  text-decoration: none;
  flex-shrink: 0;
  align-self: center;
  white-space: nowrap;
}

.ex-listing-player:hover {
  text-decoration: underline;
}

/* Responsive adjustments for shop/exchange */
@media (max-width: 600px) {
  .shop-card-grid {
    grid-template-columns: 1fr;
  }
  .ex-listing-grid {
    grid-template-columns: 1fr;
  }
  .ce-shop-tabs {
    flex-wrap: wrap;
    gap: 0;
  }
  .ce-shop-tabs #acv-search,
  .ce-shop-tabs #shop-sort,
  .ce-shop-tabs #acv-sort {
    margin-left: 0;
    margin-top: 8px;
    width: 100%;
    box-sizing: border-box;
  }
}

/* ═══════════════════════════════════════
   GROUP TYPE COLORS
   Collection = blue (#58a6ff)
   For Trade  = green (#56d364)
   Wishlist   = purple (#a371f7)
   ═══════════════════════════════════════ */

/* ── Type accent borders on rows ── */
.ce-type-collection {
  border-left: 3px solid #58a6ff;
}

.ce-type-trade {
  border-left: 3px solid #56d364;
}

.ce-type-wishlist {
  border-left: 3px solid #a371f7;
}

/* ── Section headers ── */
.ce-section-collection {
  border-left: 3px solid #58a6ff;
  color: #58a6ff;
}

.ce-section-trade {
  border-left: 3px solid #56d364;
  color: #56d364;
}

.ce-section-wishlist {
  border-left: 3px solid #a371f7;
  color: #a371f7;
}

/* ── Grid card type variants ── */
.ce-grid-collection {
  box-shadow: 0 0 0 2px #58a6ff44;
}

.ce-grid-trade {
  box-shadow: 0 0 0 2px #56d364;
}

.ce-grid-wishlist {
  box-shadow: 0 0 0 2px #a371f7;
}

.ce-grid-badge-trade {
  background: #238636 !important;
  color: #fff !important;
}

.ce-grid-badge-wish {
  background: #8957e5 !important;
  color: #fff !important;
}

/* ── Trade qty label inline ── */
.ce-trade-qty-label {
  font-size: 10px;
  color: #8b949e;
  margin-right: 2px;
}

.ce-trade-qty {
  color: #56d364;
  font-weight: 700;
}

/* ── Trade badge on search results ── */
.ce-trade-badge {
  bottom: auto !important;
  top: 24px !important;
  right: 4px !important;
  left: auto !important;
  background: #238636 !important;
}

/* ── +T button in search results ── */
.ce-add-trade {
  font-size: 11px !important;
  padding: 2px 6px !important;
  min-width: 30px;
  background: #238636 !important;
}

.ce-add-trade:hover {
  background: #2ea043 !important;
}

/* ── Foil variant buttons (+CF, +TF, +WF) ── same colors as regular, gold border */
.ce-add-foil-coll {
  font-size: 11px !important;
  padding: 2px 6px !important;
  min-width: 30px;
  background: rgba(31, 64, 104, 0.6) !important;
  color: #58a6ff !important;
  border: 1px solid rgba(227, 201, 110, 0.55) !important;
}

.ce-add-foil-coll:hover {
  background: rgba(31, 64, 104, 0.9) !important;
  border-color: rgba(227, 201, 110, 0.85) !important;
}

.ce-add-foil-coll:active {
  background: #1f4068 !important;
}

.ce-add-trade-foil {
  font-size: 11px !important;
  padding: 2px 6px !important;
  min-width: 30px;
  background: #238636 !important;
  border: 1px solid rgba(227, 201, 110, 0.55) !important;
}

.ce-add-trade-foil:hover {
  background: #2ea043 !important;
  border-color: rgba(227, 201, 110, 0.85) !important;
}

.ce-add-wish-foil {
  font-size: 11px !important;
  padding: 2px 6px !important;
  min-width: 30px;
  background: #8957e5 !important;
  border: 1px solid rgba(227, 201, 110, 0.55) !important;
}

.ce-add-wish-foil:hover {
  background: #a371f7 !important;
  border-color: rgba(227, 201, 110, 0.85) !important;
}

/* ── Foil badge ── */
.ce-foil-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e3c96e;
  background: #2d2a1a;
  border: 1px solid #e3c96e55;
  border-radius: 3px;
  padding: 0 4px;
  vertical-align: middle;
  margin-left: 3px;
}

/* ── Foil card shimmer / glow ── */
@keyframes ce-foil-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.ce-foil-card {
  position: relative;
  box-shadow: 0 0 6px 1px rgba(227, 201, 110, 0.25), inset 0 0 4px 0 rgba(227, 201, 110, 0.08);
  border: 1px solid rgba(227, 201, 110, 0.3);
}

.ce-foil-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(227, 201, 110, 0.07) 35%,
    rgba(255, 255, 255, 0.10) 45%,
    rgba(227, 201, 110, 0.07) 55%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: ce-foil-shimmer 4s ease-in-out infinite;
}

/* Foil shimmer on list rows */
.de-deck-row.ce-foil-card,
.de-result-row.ce-foil-card {
  box-shadow: inset 3px 0 0 rgba(227, 201, 110, 0.5), 0 0 4px 0 rgba(227, 201, 110, 0.15);
  border-left: none;
}

/* Foil glow on exchange listings */
.ex-listing.ce-foil-card {
  box-shadow: 0 0 8px 1px rgba(227, 201, 110, 0.2), inset 0 0 3px 0 rgba(227, 201, 110, 0.06);
}

/* Foil glow on shop cards */
.shop-card.ce-foil-card {
  box-shadow: 0 0 8px 2px rgba(227, 201, 110, 0.25);
}

/* Foil shimmer on zoomed card image — overlay matches image width */
.de-zoom-img-wrap.ce-foil-zoom-active::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, 80vw);
  border-radius: 10px;
  pointer-events: none;
  box-shadow: 0 0 20px 6px rgba(227, 201, 110, 0.35);
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(227, 201, 110, 0.12) 35%,
    rgba(255, 255, 255, 0.18) 45%,
    rgba(227, 201, 110, 0.12) 55%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: ce-foil-shimmer 3s ease-in-out infinite;
}

/* ── Foil checkbox toggle ── */
.ce-foil-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  font-size: 11px;
  color: #8b949e;
  user-select: none;
}

.ce-foil-toggle input[type="checkbox"] {
  accent-color: #e3c96e;
  cursor: pointer;
}

/* Foil variant convert button (→Foil / →Reg) */
.ce-foil-convert-btn {
  background: rgba(227, 201, 110, 0.12) !important;
  color: #e3c96e !important;
  border: 1px solid rgba(227, 201, 110, 0.3) !important;
  font-size: 10px !important;
  padding: 2px 5px !important;
}

.ce-foil-convert-btn:hover {
  background: rgba(227, 201, 110, 0.28) !important;
  border-color: rgba(227, 201, 110, 0.6) !important;
}

.ce-foil-label {
  color: #e3c96e;
  font-size: 10px;
}

/* ── TCG price inline in IDs ── */
.ce-zoom-tcg-price {
  color: #3fb950;
  font-weight: 600;
  font-size: 0.85em;
}

/* ── Shop card ID line ── */
.shop-card-id {
  font-size: 0.7rem;
  color: #8b949e;
  margin-bottom: 3px;
}

/* ── Exchange listing ID line ── */
.ex-listing-id {
  font-size: 0.7rem;
  color: #8b949e;
  margin-bottom: 2px;
}

/* ── Zoom group blocks ── */
.ce-zoom-group {
  border-radius: 6px;
  margin: 4px 0;
  overflow: hidden;
}

.ce-zoom-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
}

.ce-zoom-group-body {
  padding: 6px 10px 8px;
}

.ce-zoom-group-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Collection group – blue */
.ce-zoom-group-collection {
  background: #0d1f38;
  border: 1px solid #1f4068;
}

.ce-zoom-group-collection .ce-zoom-group-title {
  background: #1f4068;
  color: #58a6ff;
}

/* For Trade group – green */
.ce-zoom-group-trade {
  background: #0d2216;
  border: 1px solid #1e4a2a;
}

.ce-zoom-group-trade .ce-zoom-group-title {
  background: #1e4a2a;
  color: #56d364;
}

/* Wishlist group – purple */
.ce-zoom-group-wishlist {
  background: #1a1030;
  border: 1px solid #3d2270;
}

.ce-zoom-group-wishlist .ce-zoom-group-title {
  background: #3d2270;
  color: #a371f7;
}

/* Shop/exchange type borders */
.shop-card.ce-type-trade {
  border-left: 3px solid #56d364;
}

.shop-card.ce-type-wishlist {
  border-left: 3px solid #a371f7;
}

.ex-listing.ce-type-trade {
  border-left: 3px solid #56d364;
}

.ex-listing.ce-type-wishlist {
  border-left: 3px solid #a371f7;
}

/* ── Wishlist match results ── */
.ex-match-summary {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 1rem;
  color: #8b949e;
  font-size: 0.85rem;
}
.ex-match-summary strong {
  color: #58a6ff;
}
.ex-match-card {
  background: #0d1117;
  border: 1px solid #30363d;
  border-left: 3px solid #f0883e;
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
}
.ex-match-card-header {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  background: #161b22;
  border-bottom: 1px solid #21262d;
}
.ex-match-card-img {
  width: 56px;
  height: 78px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
}
.ex-match-card-info {
  flex: 1;
  min-width: 0;
}
.ex-match-sellers {
  padding: 8px 14px 10px;
}
.ex-match-sellers-title {
  font-size: 0.75rem;
  color: #8b949e;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ex-match-seller {
  background: #21262d;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 6px;
}
.ex-match-seller:last-child {
  margin-bottom: 0;
}
.ex-match-seller-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.ex-match-contact {
  font-size: 0.75rem;
  color: #c9d1d9;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #30363d;
}
.ex-match-contact-label {
  color: #8b949e;
  font-weight: 600;
}
@media (max-width: 600px) {
  .ex-match-card-header {
    padding: 8px 10px;
  }
  .ex-match-sellers {
    padding: 6px 10px 8px;
  }
}

/* ── Smaller price input variant ── */
.ce-price-input-sm {
  width: 52px;
}

/* Price line under card ID in list view */
.ce-list-price-line {
  font-size: 0.75rem;
  margin-top: 1px;
}

/* ── Count badges for search results (grid & list) ── */
.ce-grid-counts {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 4px;
}

.ce-count-badge {
  font-size: 10px;
  font-weight: 800;
  border-radius: 4px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
  line-height: 1.3;
  flex: 1;
}

.ce-count-badge.ce-count-empty {
  visibility: hidden;
  padding: 1px 5px;
  min-width: 16px;
}

.ce-count-coll {
  background: rgba(31, 64, 104, 0.7);
  color: #58a6ff;
}

.ce-count-trade {
  background: rgba(35, 134, 54, 0.5);
  color: #56d364;
}

.ce-count-wish {
  background: rgba(137, 87, 229, 0.4);
  color: #a371f7;
}

/* ── Search results list: button group with counts ── */
.ce-result-btn-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  flex-shrink: 0;
}

.ce-result-counts {
  display: flex;
  gap: 4px;
  justify-content: stretch;
}

.ce-result-counts .ce-count-badge {
  flex: 1;
}

.ce-result-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.ce-result-btns .de-add-btn {
  width: 100%;
  min-width: 0;
  font-size: 11px !important;
  padding: 3px 6px !important;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Pagination ── */
.ex-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 1.5rem;
  padding: 1rem 0;
}

.ex-page-info {
  color: #8b949e;
  font-size: 0.85rem;
}

.shop-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 1rem;
  padding: 0.5rem 0;
}

.shop-page-info {
  color: #8b949e;
  font-size: 0.85rem;
}

/* ── Responsive tables – prevent horizontal scroll ── */
.section table,
.card table {
  table-layout: fixed;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Rounds tables use auto layout so Status/Actions columns aren't squished */
.rounds-table {
  table-layout: auto;
}

.section table td,
.section table th,
.card table td,
.card table th {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rounds table columns: let player names compress, keep others sized to content */
.rounds-table th,
.rounds-table td {
  white-space: nowrap;
  overflow: visible;
}
.rounds-table .col-player {
  white-space: normal;
  word-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.card-header {
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .section table th,
  .section table td,
  .card table th,
  .card table td {
    padding: 0.4rem 0.35rem;
    font-size: 0.8rem;
  }

  .seating-input {
    width: 45px;
    padding: 0.3rem;
    font-size: 0.8rem;
  }

  .player-name img.avatar {
    display: none;
  }

  .badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
  }

  .btn-sm {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
  }
}

/* ====== Admin page ====== */
.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.admin-form-group label {
  display: block;
  font-size: 11px;
  color: #8b949e;
  margin-bottom: 2px;
}

.admin-form-group input,
.admin-form-group select {
  background: #0d1117;
  border: 1px solid #30363d;
  color: #e1e4e8;
  padding: 4px 8px;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
}

.admin-form-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 16px;
}

.admin-db-section {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.admin-db-section .admin-file-input {
  background: #0d1117;
  border: 1px solid #30363d;
  color: #e1e4e8;
  padding: 0.4rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  max-width: 100%;
}

/* ── Admin Player Search ── */
.admin-player-search {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 12px;
}

.admin-player-search-input {
  background: #0d1117;
  border: 1px solid #30363d;
  color: #e1e4e8;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  flex: 1;
  min-width: 0;
  max-width: 360px;
}

.admin-search-result-info {
  color: #8b949e;
  font-size: 13px;
  margin-bottom: 10px;
}

/* ── Admin Player List (card layout) ── */
.admin-player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-player-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 10px 12px;
}

.admin-player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.admin-player-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #58a6ff;
  text-decoration: none;
  flex-shrink: 0;
}

.admin-player-identity:hover {
  text-decoration: underline;
}

.admin-player-username {
  font-weight: 600;
  font-size: 0.9rem;
  color: #58a6ff;
  white-space: nowrap;
}

.admin-player-displayname {
  font-size: 0.8rem;
  color: #8b949e;
  white-space: nowrap;
}

.admin-player-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.admin-player-email {
  font-size: 0.8rem;
  color: #8b949e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.admin-player-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.admin-player-date {
  font-size: 0.75rem;
  color: #6e7681;
  white-space: nowrap;
}

.admin-player-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Linked Account Badges ── */
.admin-link-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.admin-link-google {
  background: rgba(66, 133, 244, 0.15);
  color: #4285f4;
  border: 1px solid rgba(66, 133, 244, 0.3);
}

.admin-link-discord {
  background: rgba(88, 101, 242, 0.15);
  color: #5865f2;
  border: 1px solid rgba(88, 101, 242, 0.3);
}

.admin-link-uvs {
  background: rgba(56, 211, 159, 0.15);
  color: #38d39f;
  border: 1px solid rgba(56, 211, 159, 0.3);
}

/* ── Admin Player Pagination ── */
.admin-player-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  padding: 8px 0;
}

.admin-page-info {
  color: #8b949e;
  font-size: 0.85rem;
}

.admin-empty-state {
  color: #8b949e;
  font-style: italic;
  padding: 1rem 0;
}

/* ── Admin Restriction Cards ── */
.admin-restriction-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-restriction-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 10px 12px;
}

.admin-restriction-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.admin-restriction-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-restriction-id {
  font-size: 0.85rem;
  color: #e1e4e8;
  background: #0d1117;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.admin-restriction-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #c9d1d9;
}

.admin-restriction-copies {
  font-size: 0.8rem;
  color: #d29922;
  white-space: nowrap;
}

.admin-restriction-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-restriction-reason {
  font-size: 0.8rem;
  color: #8b949e;
}

.admin-restriction-date {
  font-size: 0.75rem;
  color: #6e7681;
  white-space: nowrap;
}

/* ── Admin Role Form & Actions ── */
.admin-actions-cell {
  display: flex;
  gap: 4px;
}

.admin-role-form {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.admin-role-form select {
  background: #0d1117;
  border: 1px solid #30363d;
  color: #e1e4e8;
  padding: 0.2rem;
  border-radius: 4px;
}

@media (max-width: 640px) {
  .admin-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-form-group input,
  .admin-form-group select {
    width: 100%;
  }

  .admin-db-section {
    flex-direction: column;
  }

  .section h2 {
    font-size: 1.1rem;
  }

  /* Player card: stack vertically on mobile */
  .admin-player-card {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  .admin-player-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .admin-player-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .admin-player-email {
    max-width: 100%;
  }

  .admin-player-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
    border-top: 1px solid #21262d;
  }

  .admin-role-form {
    flex: 1;
    min-width: 0;
  }

  .admin-role-form select {
    flex: 1;
    min-width: 0;
  }

  .admin-player-search {
    flex-wrap: wrap;
  }

  .admin-player-search-input {
    max-width: 100%;
    width: 100%;
  }

  /* Restriction card: stack on mobile */
  .admin-restriction-card {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .admin-restriction-card .admin-restriction-delete {
    align-self: flex-start;
  }
}

/* ====== Entry Fee / Price Tags ====== */
.event-price-tag {
  display: inline-block;
  background: linear-gradient(135deg, #1a4731, #065f46);
  color: #34d399;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #059669;
  white-space: nowrap;
}

.event-price-free {
  background: linear-gradient(135deg, #1e293b, #1e3a5f);
  color: #60a5fa;
  border-color: #3b82f6;
}

/* ====== Collapsible Section Headers ====== */
.collapsible-header {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.collapsible-header:hover {
  color: #58a6ff;
}

.collapse-icon {
  font-size: 0.7rem;
  color: #8b949e;
  transition: transform 0.2s;
}

/* ====== Rich Text Content ====== */
.rich-text-content {
  color: #c9d1d9;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ====== Round Timer ====== */
.round-timer {
  font-variant-numeric: tabular-nums;
}

/* ====== Table scroll wrapper for mobile ====== */
.table-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.manage-players-table {
  min-width: 600px;
}

.rounds-table {
  min-width: 700px;
}

/* ====== Edit Player Row ====== */
tr[id^="edit-player-"] td {
  overflow: visible;
  position: relative;
}

/* ====== Legend Search Results ====== */
.legend-result-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #21262d;
}

.legend-result-item:hover {
  background: #21262d;
}

.legend-result-item:last-child {
  border-bottom: none;
}

.legend-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 2px;
}

/* ====== Collection Progress Tracker ====== */

#collection-progress {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.cp-hidden {
  display: none;
}

/* ── Top bar ── */
.cp-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.cp-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: #e1e4e8;
}

/* ── Hero summary card ── */
.cp-hero {
  background: linear-gradient(135deg, #0d1a2d 0%, #161b22 100%);
  border: 1px solid #1f3a5f;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.cp-hero-heading {
  font-size: 1.2rem;
  font-weight: 800;
  color: #e1e4e8;
  margin-bottom: 4px;
}

.cp-hero-pct {
  font-size: 0.9rem;
  font-weight: 600;
  color: #58a6ff;
  margin-bottom: 10px;
}

.cp-hero-bar-wrap {
  width: 220px;
  height: 8px;
  background: #0d1117;
  border-radius: 4px;
  overflow: hidden;
}

.cp-hero-bar {
  height: 100%;
  background: linear-gradient(90deg, #58a6ff, #3fb950);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.cp-hero-badge {
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.25);
  color: #58a6ff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 20px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Stat cards row ── */
.cp-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.cp-stat-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cp-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(88, 166, 255, 0.12);
  color: #58a6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.cp-stat-icon-foil {
  background: rgba(210, 168, 255, 0.12);
  color: #d2a8ff;
}

.cp-stat-label {
  font-size: 0.75rem;
  color: #8b949e;
  font-weight: 500;
}

.cp-stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #e1e4e8;
}

/* ── Sections ── */
.cp-section {
  margin-bottom: 1.5rem;
}

.cp-section-header {
  margin-bottom: 0.6rem;
}

.cp-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e1e4e8;
  border-bottom: 1px solid #21262d;
  padding-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cp-section-icon {
  font-size: 0.85rem;
  color: #8b949e;
}

/* ── Tracker rows ── */
.cp-trackers {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cp-tracker {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 10px 14px;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.cp-tracker:hover {
  border-color: #30363d;
  background: #1c2129;
}

.cp-tracker-clickable {
  cursor: pointer;
}

.cp-tracker.cp-complete {
  border-color: rgba(63, 185, 80, 0.3);
}

.cp-tracker.cp-complete:hover {
  border-color: rgba(63, 185, 80, 0.5);
}

.cp-tracker-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.cp-tracker-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e1e4e8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cp-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cp-tracker-nums {
  font-size: 0.82rem;
  color: #e1e4e8;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cp-pct-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 36px;
  text-align: center;
}

/* ── Progress bar ── */
.cp-progress {
  height: 6px;
  background: #0d1117;
  border-radius: 3px;
  overflow: hidden;
}

.cp-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
  min-width: 0;
}

/* ── Missing cards panel ── */
.cp-missing-panel {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 16px;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.cp-missing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cp-missing-title {
  font-size: 1rem;
  font-weight: 700;
  color: #e1e4e8;
}

.cp-missing-count {
  font-size: 0.8rem;
  color: #8b949e;
  margin-bottom: 12px;
}

.cp-missing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.cp-missing-card {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.cp-missing-card:hover {
  border-color: #58a6ff;
  transform: translateY(-2px);
}

.cp-missing-img {
  width: 100%;
  display: block;
  aspect-ratio: 488 / 680;
  object-fit: cover;
  background: #0d1117;
}

.cp-missing-info {
  padding: 5px 7px 6px;
}

.cp-missing-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: #e1e4e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-missing-id {
  font-size: 0.65rem;
  color: #484f58;
  margin-top: 1px;
}

/* ── Foil tag ── */
.cp-foil-tag {
  display: inline-block;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

/* ── All collected ── */
.cp-all-collected {
  text-align: center;
  color: #3fb950;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 2rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── Zoom effect text ── */
.cp-zoom-effect {
  font-size: 0.78rem;
  color: #8b949e;
  line-height: 1.5;
  padding: 8px 0;
  border-top: 1px solid #21262d;
  white-space: pre-wrap;
}

/* ── Filter bar ── */
.cp-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cp-filter-label {
  font-size: 0.8rem;
  color: #8b949e;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.cp-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #30363d;
  background: #161b22;
  color: #484f58;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}

.cp-filter-toggle.cp-filter-active {
  background: rgba(88, 166, 255, 0.1);
  border-color: rgba(88, 166, 255, 0.4);
  color: #58a6ff;
}

.cp-filter-toggle:hover {
  border-color: #58a6ff;
  color: #58a6ff;
}

.cp-filter-toggle.cp-filter-active:hover {
  background: rgba(88, 166, 255, 0.18);
}

/* ── Chase Cards section ── */
.cp-chase-section {
  background: linear-gradient(135deg, #0d1a2d 0%, #161b22 100%);
  border: 1px solid #1f3a5f;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 1.5rem;
}

.cp-chase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cp-chase-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: #58a6ff;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.cp-chase-add-btn:hover:not(:disabled) {
  background: rgba(88, 166, 255, 0.2);
  border-color: rgba(88, 166, 255, 0.5);
}

.cp-chase-add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cp-chase-empty {
  text-align: center;
  color: #484f58;
  padding: 20px 0 8px;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cp-chase-empty i {
  font-size: 1.5rem;
  color: #30363d;
}

.cp-chase-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.cp-chase-card {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s, transform 0.15s;
}

.cp-chase-card:hover {
  border-color: #30363d;
  transform: translateY(-2px);
}

.cp-chase-card.cp-chase-owned {
  border-color: rgba(63, 185, 80, 0.35);
}

.cp-chase-card.cp-chase-owned:hover {
  border-color: rgba(63, 185, 80, 0.6);
}

.cp-chase-img-wrap {
  position: relative;
  cursor: pointer;
}

.cp-chase-img {
  width: 100%;
  display: block;
  aspect-ratio: 488 / 680;
  object-fit: cover;
  background: #0d1117;
}

.cp-chase-owned-badge {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(63, 185, 80, 0.9);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 10px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.3px;
}

.cp-chase-info {
  padding: 7px 8px 8px;
}

.cp-chase-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #e1e4e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.cp-chase-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.65rem;
  margin-bottom: 4px;
}

.cp-chase-id {
  color: #484f58;
}

.cp-chase-rarity {
  font-weight: 700;
}

.cp-chase-hunting {
  font-size: 0.65rem;
  color: #f0883e;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cp-chase-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(13, 17, 23, 0.85);
  border: 1px solid #30363d;
  color: #8b949e;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 2;
}

.cp-chase-remove:hover {
  background: rgba(248, 81, 73, 0.15);
  border-color: #f85149;
  color: #f85149;
}

/* ── Chase picker modal ── */
.cp-chase-modal {
  position: fixed;
  inset: 0;
  background: rgba(1, 4, 9, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cp-chase-modal.cp-hidden {
  display: none;
}

.cp-chase-modal-inner {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cp-chase-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #21262d;
  flex-shrink: 0;
}

.cp-chase-modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e1e4e8;
  display: flex;
  align-items: center;
  gap: 7px;
}

.cp-chase-modal-search {
  padding: 10px 14px;
  border-bottom: 1px solid #21262d;
  flex-shrink: 0;
}

.cp-chase-search-input {
  width: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 8px 12px;
  color: #e1e4e8;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

.cp-chase-search-input:focus {
  border-color: #58a6ff;
}

.cp-chase-search-input::placeholder {
  color: #484f58;
}

.cp-chase-results {
  overflow-y: auto;
  padding: 8px 0;
  flex: 1;
}

.cp-chase-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.1s;
}

.cp-chase-result-item:hover {
  background: #1c2129;
}

.cp-chase-result-item.cp-chase-result-owned {
  opacity: 0.65;
}

.cp-chase-result-img {
  width: 36px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  background: #0d1117;
  flex-shrink: 0;
}

.cp-chase-result-info {
  flex: 1;
  min-width: 0;
}

.cp-chase-result-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e1e4e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-chase-result-sub {
  font-size: 0.72rem;
  color: #484f58;
  margin-top: 2px;
}

.cp-chase-result-owned-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #3fb950;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
}

.cp-chase-no-results {
  text-align: center;
  color: #484f58;
  font-size: 0.85rem;
  padding: 24px;
}

.cp-chase-more {
  text-align: center;
  color: #484f58;
  font-size: 0.75rem;
  padding: 8px 14px 4px;
  font-style: italic;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .cp-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  .cp-hero-bar-wrap {
    width: 100%;
  }

  .cp-hero-badge {
    align-self: flex-start;
  }

  .cp-stat-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .cp-stat-card {
    padding: 10px 12px;
  }

  .cp-stat-value {
    font-size: 0.95rem;
  }

  .cp-missing-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
  }

  .cp-tracker {
    padding: 8px 10px;
  }

  .cp-tracker-label {
    font-size: 0.78rem;
  }

  .cp-tracker-nums {
    font-size: 0.72rem;
  }

  .cp-chase-list {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
  }

  .cp-filter-bar {
    gap: 6px;
  }

  .cp-filter-toggle {
    font-size: 0.72rem;
    padding: 3px 10px;
  }
}

/* ══════════════════════════════════════════════
   CARD RATINGS  –  /ratings and /ratings/rate
   ══════════════════════════════════════════════ */

/* ── Page header ── */
.ratings-page-header {
  margin-bottom: 1.25rem;
}

.ratings-page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ratings-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #e1e4e8;
  margin: 0;
}

.ratings-page-subtitle {
  color: #8b949e;
  font-size: 0.875rem;
  margin: 0.35rem 0 0;
}

/* ── Controls bar ── */
.ratings-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.ratings-search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.ratings-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #484f58;
  font-size: 12px;
  pointer-events: none;
}

.ratings-search {
  width: 100%;
  padding: 7px 10px 7px 30px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e1e4e8;
  font-size: 13px;
  box-sizing: border-box;
}

.ratings-search:focus {
  outline: none;
  border-color: #58a6ff;
}

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

.ratings-sort-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ratings-sort-label {
  font-size: 12px;
  color: #8b949e;
  white-space: nowrap;
}

.ratings-select {
  padding: 6px 8px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e1e4e8;
  font-size: 12px;
  cursor: pointer;
}

.ratings-select:focus {
  outline: none;
  border-color: #58a6ff;
}

.ratings-view-toggle {
  display: flex;
  gap: 3px;
}

.ratings-view-btn {
  background: #21262d;
  border: 1px solid #30363d;
  color: #8b949e;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.15s;
}

.ratings-view-btn.active,
.ratings-view-btn:hover {
  background: #30363d;
  color: #e1e4e8;
}

/* ── Results meta ── */
.ratings-results-meta {
  font-size: 12px;
  color: #8b949e;
  margin-bottom: 10px;
}

.ratings-empty {
  color: #8b949e;
  padding: 2rem 0;
  text-align: center;
}

.ratings-loading {
  color: #8b949e;
  padding: 2rem;
  text-align: center;
}

/* ── Grid ── */
.rtg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  align-items: start;
}

/* Set header in grid (rate mode) */
.rc-set-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #21262d;
  margin-top: 10px;
}

.rc-set-header:first-child {
  margin-top: 0;
}

.rc-set-name {
  font-size: 13px;
  font-weight: 700;
  color: #e1e4e8;
}

.rc-set-progress {
  font-size: 11px;
  color: #8b949e;
}

/* Card tile */
.rtg-card-tile {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}

.rtg-card-tile:hover {
  border-color: #58a6ff;
  transform: translateY(-2px);
}

.rc-rated {
  border-color: #238636;
}

.rc-rated:hover {
  border-color: #3fb950;
}

.rtg-card-img-wrap {
  position: relative;
  line-height: 0;
}

.rtg-card-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px 6px 0 0;
  background: #0d1117;
}

/* Community avg badge */
.rtg-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 30px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.rtg-badge-none {
  background: #21262d !important;
  color: #484f58;
}

/* Your rating badge */
.rtg-my-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1f6feb;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  border: 2px solid #161b22;
}

.rtg-my-badge-inline {
  position: static;
  display: inline-flex;
  width: auto;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  border: none;
  height: auto;
}

/* Unrated dot */
.rc-unrated-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #484f58;
}

.rtg-card-info {
  padding: 7px 8px 8px;
}

.rtg-card-name {
  font-size: 12px;
  font-weight: 700;
  color: #e1e4e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.rtg-card-meta {
  font-size: 11px;
  color: #8b949e;
  margin-bottom: 4px;
}

.rc-tap-to-rate {
  color: #484f58;
  font-style: italic;
}

/* Star bar */
.rtg-star-bar {
  height: 4px;
  background: #21262d;
  border-radius: 2px;
  overflow: hidden;
}

.rtg-star-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

/* ── List / Table view ── */
.rtg-list {
  overflow-x: auto;
}

.rtg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rtg-table th {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid #30363d;
  color: #8b949e;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.rtg-list-row {
  border-bottom: 1px solid #21262d;
  cursor: pointer;
  transition: background 0.1s;
}

.rtg-list-row:hover {
  background: #161b22;
}

.rtg-list-row td {
  padding: 7px 10px;
  color: #8b949e;
  vertical-align: middle;
}

.rtg-list-thumb-cell {
  width: 44px;
  padding: 4px 6px !important;
}

.rtg-list-thumb {
  width: 38px;
  height: auto;
  border-radius: 4px;
  display: block;
  background: #0d1117;
}

.rtg-list-name {
  color: #e1e4e8 !important;
  font-weight: 600;
}

.rtg-list-id {
  font-size: 10px;
  color: #484f58;
  margin-top: 2px;
}

.rtg-list-avg {
  font-size: 15px;
  font-weight: 800;
  margin-right: 6px;
}

.rtg-list-myrating {
  white-space: nowrap;
}

/* ── Zoom overlay additions ── */
.rtg-zoom-section {
  padding: 10px 0;
  border-top: 1px solid #21262d;
}

.rtg-zoom-section:first-of-type {
  margin-top: 8px;
}

.rtg-zoom-section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #484f58;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.rtg-zoom-agg {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rtg-zoom-big-score {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
}

.rtg-zoom-agg-meta {
  flex: 1;
}

.rtg-zoom-agg-count {
  font-size: 11px;
  color: #8b949e;
  margin-bottom: 5px;
}

.rtg-zoom-no-ratings {
  color: #484f58;
  font-size: 12px;
  font-style: italic;
}

.rtg-zoom-avg-inline {
  font-weight: 800;
  font-size: 10px;
}

/* Rating pips (1-10 buttons) */
.rtg-zoom-rate-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.rtg-rate-pip {
  width: 32px;
  height: 32px;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #8b949e;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
  flex: 1;
  min-width: 28px;
}

.rtg-rate-pip:hover {
  background: #30363d;
  color: #e1e4e8;
  border-color: #8b949e;
}

.rtg-rate-pip-active {
  background: #1f6feb !important;
  border-color: #388bfd !important;
  color: #fff !important;
}

.rtg-rate-pip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rtg-zoom-your-note,
.rc-current-rating {
  font-size: 12px;
  color: #8b949e;
}

.rtg-remove-btn {
  background: none;
  border: none;
  color: #f85149;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.rtg-remove-btn:hover {
  color: #ff6b6b;
}

/* Distribution chart */
.rtg-dist-chart {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}

.rtg-dist-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.rtg-dist-label {
  width: 14px;
  text-align: right;
  color: #8b949e;
  font-weight: 700;
  flex-shrink: 0;
}

.rtg-dist-bar-track {
  flex: 1;
  height: 8px;
  background: #21262d;
  border-radius: 4px;
  overflow: hidden;
}

.rtg-dist-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.rtg-dist-count {
  width: 20px;
  text-align: right;
  color: #8b949e;
  flex-shrink: 0;
}

.rtg-zoom-dist-loading {
  color: #8b949e;
  font-size: 12px;
  text-align: center;
  padding: 8px 0;
}

/* Player ratings list */
.rtg-player-list-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #484f58;
  letter-spacing: 0.06em;
  margin: 10px 0 6px;
}

.rtg-player-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.rtg-player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  background: #161b22;
  border-radius: 4px;
  font-size: 12px;
}

.rtg-player-name {
  color: #e1e4e8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rtg-player-score {
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  margin-left: 8px;
}

/* Rate cards page extras */
.rc-rate-section {
  background: #0d1117;
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
  border: 1px solid #21262d;
}

.rc-zoom-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 4px;
}

.rc-zoom-progress-label {
  font-size: 11px;
  color: #8b949e;
  white-space: nowrap;
}

.rc-zoom-nav-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.rc-nav-btn {
  font-size: 13px;
  padding: 6px 14px;
}

/* Progress bar (rate page) */
.rc-progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.rc-progress-bar-track {
  flex: 1;
  height: 6px;
  background: #21262d;
  border-radius: 3px;
  overflow: hidden;
}

.rc-progress-bar-fill {
  height: 100%;
  background: #238636;
  border-radius: 3px;
  transition: width 0.4s;
}

.rc-progress-label {
  font-size: 12px;
  color: #8b949e;
  white-space: nowrap;
}

/* Community rating mini-badge in collection/deck zoom */
.rtg-community-mini {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  background: #21262d;
  border: 1px solid #30363d;
  color: #8b949e;
  vertical-align: middle;
  margin-left: 4px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.rtg-community-mini:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.rtg-community-mini.rtg-cm-good { color: #3fb950; border-color: #238636; }
.rtg-community-mini.rtg-cm-ok   { color: #d29922; border-color: #9e6a03; }
.rtg-community-mini.rtg-cm-bad  { color: #f85149; border-color: #da3633; }

/* Rating detail panel (shown when badge is clicked) */
.rtg-detail-container {
  display: none;
}

.rtg-detail-panel {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
}

.rtg-detail-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.rtg-detail-big-score {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.rtg-detail-out-of {
  font-size: 0.8rem;
  color: #484f58;
  font-weight: 600;
}

.rtg-detail-meta {
  font-size: 11px;
  color: #8b949e;
}

.rtg-detail-dist {
  margin-bottom: 10px;
}

.rtg-detail-loading {
  color: #8b949e;
  font-size: 12px;
  text-align: center;
  padding: 10px 0;
}

.rtg-detail-empty {
  color: #484f58;
  font-size: 12px;
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

.rtg-detail-players-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #484f58;
  letter-spacing: 0.06em;
  margin: 8px 0 5px;
}

.rtg-detail-players {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 180px;
  overflow-y: auto;
}

.rtg-detail-link {
  display: block;
  text-align: center;
  font-size: 11px;
  color: #58a6ff;
  text-decoration: none;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #21262d;
}

.rtg-detail-link:hover {
  text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .ratings-controls {
    gap: 6px;
  }

  .rtg-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }

  .rtg-zoom-big-score {
    font-size: 2rem;
  }

  .rtg-rate-pip {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .ratings-filter-group {
    width: 100%;
  }

  .ratings-select {
    flex: 1;
  }

  /* ── Mobile zoom overlay fixes ── */
  .de-zoom-overlay {
    align-items: flex-start;
    padding: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .de-zoom-content {
    max-height: none;
    margin: 8px auto;
    padding: 12px;
  }

  .de-zoom-img {
    width: min(280px, 75vw);
  }

  .de-zoom-img-wrap {
    margin: 8px 0;
  }

  .rc-rate-section {
    padding: 10px;
  }

  .rc-zoom-nav-hint {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}
