/* -----------------------------------------------
   Twitch Check-In Extension — Panel UI
   300 × 500 viewport
----------------------------------------------- */

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

[hidden] { display: none !important; }

:root {
  --bg:            #0a0a0f;
  --bg-card:       #13131a;
  --bg-elevated:   #1a1a24;
  --bg-hover:      #1f1f2e;
  --border:        rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.12);
  --text:          #f0f0f5;
  --text-muted:    #8b8b9e;
  --text-faint:    #4a4a5e;
  --accent:        #9147ff;
  --accent-light:  #b27aff;
  --accent-glow:   rgba(145,71,255,0.35);
  --accent-hover:  #7c38e0;
  --gold:          #f0a500;
  --gold-glow:     rgba(240,165,0,0.3);
  --gold-hover:    #d49200;
  --green:         #00c96b;
  --red:           #ff4444;
  --font:          'Inter', 'Segoe UI', system-ui, sans-serif;
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     14px;
  --shadow:        0 4px 24px rgba(0,0,0,0.5);
  --shadow-glow:   0 0 24px var(--accent-glow);
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Scrollbar ───────────────────────────────── */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

/* ── Header ──────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, #16101f 0%, #0f0f18 100%);
  border-bottom: 1px solid var(--border);
  padding: 0;
  height: 48px;
  flex-shrink: 0;
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: stretch;
}

.site-header__split {
  flex: 1;
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 0;
}

.site-header__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: filter 0.15s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  padding: 0 14px;
}

.site-header__btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.site-header__btn--checkin {
  background: linear-gradient(135deg, var(--accent) 0%, #7c2af0 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(145,71,255,0.4), inset 0 1px 0 rgba(255,255,255,0.12);
}

.site-header__btn--checkin:hover:not(:disabled) {
  filter: brightness(1.15);
}

.site-header__btn--boosted {
  background: linear-gradient(135deg, var(--gold) 0%, #c98a00 100%);
  color: #0a0a0f;
  box-shadow: none;
}

.site-header__btn--boosted:hover:not(:disabled) {
  filter: brightness(1.15);
}

.site-header__btn:active:not(:disabled) {
  filter: brightness(0.9);
}

.site-header__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Header status (checked-in / offline message) ── */

.site-header__status {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding: 0 16px;
}

.site-header__status strong {
  color: var(--accent-light);
  font-weight: 800;
}

/* ── Main content area ───────────────────────── */

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 16px 14px;
  gap: 12px;
  overflow-y: auto;
}

/* ── Loading state ───────────────────────────── */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 0;
  flex: 1;
}

.loading-state p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Buttons ─────────────────────────────────── */

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

button::after, .btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, transparent 60%);
  pointer-events: none;
}

/* Primary (accent) */
.btn {
  background: linear-gradient(135deg, var(--accent) 0%, #7c2af0 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(145,71,255,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
  box-shadow: 0 4px 20px rgba(145,71,255,0.55);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 6px rgba(145,71,255,0.3);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Boosted button */
.btn-boosted {
  background: linear-gradient(135deg, var(--gold) 0%, #c98a00 100%);
  color: #0a0a0f;
  box-shadow: 0 2px 12px rgba(240,165,0,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-boosted:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffd060 0%, var(--gold) 100%);
  box-shadow: 0 4px 20px rgba(240,165,0,0.5);
  transform: translateY(-1px);
}

.btn-boosted:active:not(:disabled) {
  transform: translateY(0);
}

/* Small button */
.btn-sm {
  width: auto;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: none;
  transform: none;
}

.btn-ghost::after { display: none; }

/* ── Button group ────────────────────────────── */

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* ── Hero check-in section ───────────────────── */

.checkin-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 0 8px;
  text-align: center;
}

.checkin-hero__pulse {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(145,71,255,0.25) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  position: relative;
}

.checkin-hero__pulse::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(145,71,255,0.3);
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { transform: scale(0.95); opacity: 0.6; }
  70%  { transform: scale(1.1);  opacity: 0; }
  100% { transform: scale(1.1);  opacity: 0; }
}

.checkin-hero__icon {
  font-size: 26px;
  line-height: 1;
}

.checkin-hero__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.checkin-hero__sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Check-in badge (already checked in) ─────── */

.checkin-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(145,71,255,0.15) 0%, rgba(145,71,255,0.05) 100%);
  border: 1px solid rgba(145,71,255,0.3);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-light);
  text-align: center;
}

.checkin-badge__icon { font-size: 16px; }

.checkin-badge__rank {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

/* ── Checked-in position (post check-in) ─────── */

.checkin-position {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(145,71,255,0.12) 0%, rgba(145,71,255,0.04) 100%);
  border: 1px solid rgba(145,71,255,0.25);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.checkin-position__rank {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-light);
}

/* ── Status text ─────────────────────────────── */

.status {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* ── Offline ─────────────────────────────────── */

.offline-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  text-align: center;
  flex: 1;
}

.offline-icon {
  font-size: 40px;
  line-height: 1;
  filter: grayscale(0.4);
}

.offline-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.offline-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ── Leaderboard tabs ────────────────────────── */

.lb-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 10px;
}

.lb-tab {
  flex: 1;
  width: auto;
  padding: 5px 8px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lb-tab::after { display: none; }

.lb-tab:hover:not(.lb-tab--active) {
  background: var(--bg-hover);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.lb-tab--active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 6px rgba(145,71,255,0.4);
}

.lb-tab--active:hover {
  transform: none;
  box-shadow: 0 1px 6px rgba(145,71,255,0.4);
}

.lb-panel--hidden { display: none; }

/* ── Leaderboard ─────────────────────────────── */

.lb-section { width: 100%; }
.lb-panel { width: 100%; }

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

.lb-row {
  transition: background-color 0.1s ease;
}

.lb-row:hover td {
  background-color: var(--bg-hover);
}

.lb-row td {
  padding: 7px 6px;
  font-size: 12.5px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.lb-row:last-child td { border-bottom: none; }

.lb-rank {
  width: 30px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Medal colours for top 3 */
.lb-row:nth-child(1) .lb-rank { color: #ffd700; }
.lb-row:nth-child(2) .lb-rank { color: #c0c0c0; }
.lb-row:nth-child(3) .lb-rank { color: #cd7f32; }

.lb-name {
  padding-left: 4px;
  color: var(--text);
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-value {
  width: 36px;
  text-align: right;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
}

.lb-you td {
  background: linear-gradient(90deg, rgba(145,71,255,0.08) 0%, transparent 100%);
}

.lb-you .lb-rank,
.lb-you .lb-name,
.lb-you .lb-value {
  color: var(--accent-light) !important;
  font-weight: 700;
}

.lb-gap td {
  text-align: center;
  font-size: 10px;
  color: var(--text-faint);
  padding: 3px 0;
  border-bottom: none;
  letter-spacing: 0.1em;
}

.lb-empty {
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  padding: 12px 0;
}

/* ── Leaderboard carousel ────────────────────── */

.lb-carousel {
  width: 100%;
}

.lb-carousel__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 4px;
}

.lb-carousel__title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-nav-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lb-nav-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: none;
  box-shadow: none;
}

.lb-carousel__panel {
  width: 100%;
}

.lb-row {
  cursor: pointer;
}

/* ── Viewer stats modal ──────────────────────── */

.viewer-stats-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-stats-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.viewer-stats-modal__card {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 20px 16px 16px;
  width: calc(100% - 32px);
  max-width: 260px;
  box-shadow: var(--shadow);
}

.viewer-stats-modal__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.viewer-stats-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.viewer-stats-modal__close:hover {
  color: var(--text);
  background: var(--bg-elevated);
  transform: none;
  box-shadow: none;
}

.viewer-stats-modal__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.viewer-stats-modal__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-strong);
}

.viewer-stats-modal__avatar--fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 2px solid var(--border-strong);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-light);
}

.viewer-stats-modal__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  word-break: break-word;
}

.viewer-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.viewer-stats-grid__item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.viewer-stats-grid__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.viewer-stats-grid__value {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-light);
  font-variant-numeric: tabular-nums;
  align-self: flex-end;
  text-align: center;
  width: 100%;
}

.viewer-stats-modal__error {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 16px 0 8px;
}

/* ── Share identity ──────────────────────────── */

.identity-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 16px;
  text-align: center;
}

.identity-icon { font-size: 36px; }

.identity-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.identity-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ── Form elements ───────────────────────────── */

input, textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 10px;
}

input:focus, textarea:focus { border-color: var(--accent); }


:root {
  --bg-primary:    #0e0e10;
  --bg-card:       #1f1f23;
  --border-color:  #2d2d35;
  --text-primary:  #efeff1;
  --text-muted:    #adadb8;
  --accent:        #9147ff;
  --accent-hover:  #772ce8;
  --boosted:       #f0a500;
  --boosted-hover: #c98a00;
  --font:          'Inter', 'Segoe UI', system-ui, sans-serif;
  --radius:        8px;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

/* ── Layout ─────────────────────────────────── */

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 20px 16px;
}

/* ── Card ────────────────────────────────────── */

.card {
  width: 100%;
  max-width: 268px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
}

/* ── Typography ──────────────────────────────── */

h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 12px;
}

/* ── Buttons ─────────────────────────────────── */

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  background-color: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

button:hover,
.btn:hover {
  background-color: var(--accent-hover);
}

button:disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Form elements ───────────────────────────── */

input,
select,
textarea {
  width: 100%;
  padding: 8px 10px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  outline: none;
  margin-bottom: 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ── Divider ─────────────────────────────────── */

.divider {
  width: 100%;
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 14px 0;
}

/* ── Status / feedback text ──────────────────── */

.status {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* ── Offline message ─────────────────────────── */

.offline-message {
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 16px;
  line-height: 1.5;
}

/* ── Checked-in badge ────────────────────────── */

.checkin-badge {
  font-size: 14px;
  color: var(--accent);
  text-align: center;
  margin-bottom: 16px;
}

.checkin-badge strong {
  color: var(--text-primary);
}

/* ── Leaderboard ─────────────────────────────── */

.lb-section {
  width: 100%;
  margin-bottom: 16px;
}

.lb-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

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

.lb-row td {
  padding: 5px 4px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.lb-row:last-child td {
  border-bottom: none;
}

.lb-rank {
  width: 32px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: left;
}

.lb-name {
  color: var(--text-primary);
}

.lb-value {
  width: 40px;
  text-align: right;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.lb-you td {
  color: var(--accent) !important;
  font-weight: 600;
}

.lb-gap td {
  text-align: center;
  font-size: 11px;
  color: var(--border-color);
  padding: 2px 0;
  border-bottom: none;
}

.lb-empty {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
  margin-bottom: 0;
}

/* ── Header ──────────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.site-header__logo {
  font-size: 18px;
  color: var(--accent);
}

.site-header__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

/* ── Footer ──────────────────────────────────── */

.site-footer {
  width: 100%;
  padding: 10px 16px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  text-align: center;
  margin-top: auto;
}

.site-footer p {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ── Button group ────────────────────────────── */

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
}

/* ── Boosted button variant ──────────────────── */

.btn-boosted {
  background-color: var(--boosted);
}

.btn-boosted:hover {
  background-color: var(--boosted-hover);
}

/* Current panel shell overrides.
   Keep these last so the check-in actions fill the Twitch extension header. */
body.extension-panel {
  overflow: hidden;
}

body.extension-panel #app {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-y: auto;
}

body.config-page #app {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  align-items: stretch;
  width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
  height: 56px;
  padding: 0;
  gap: 0;
  background: linear-gradient(180deg, #16101f 0%, #0f0f18 100%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.site-header__inner {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
  height: 100%;
}

body.extension-panel .site-header {
  height: 96px;
}

body.extension-panel .site-header.site-header--settings {
  height: 40px;
}

body.extension-panel .site-header__inner {
  flex-direction: column;
}

.site-header__top {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header__actions {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
}

.site-header--settings .site-header__actions {
  display: none;
}

.site-header__settings {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.site-header__settings:hover {
  background: rgba(255, 255, 255, 0.12);
}

.site-header__controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-header__search {
  width: 110px;
  height: 26px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 11px;
  outline: none;
  margin: 0;
  transition: border-color 0.15s, background-color 0.15s;
}

.site-header__search::placeholder {
  color: var(--text-faint);
}

.site-header__search:focus {
  border-color: var(--accent);
  background: rgba(145, 71, 255, 0.08);
}

/* hide the native clear button on search inputs */
.site-header__search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  display: none;
}

.site-header__split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: 100%;
  height: 100%;
}

.site-header__btn {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.site-header__btn--checkin,
.site-header__btn--checkin:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent) 0%, #7c2af0 100%);
  color: #fff;
}

.site-header__btn--boosted,
.site-header__btn--boosted:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold) 0%, #c98a00 100%);
  color: #0a0a0f;
}

.site-header__btn:hover:not(:disabled) {
  filter: brightness(1.12);
}

.site-header__status {
  width: 100%;
  height: 100%;
  padding: 0 16px;
  background: var(--bg-card);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.1;
}

.site-header__status strong {
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
}

.site-header__inner:has(.site-header__icon) {
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
}

.viewer-settings-page {
  padding: 0;
  width: 100%;
}

.site-header__inner:has(#save-config) {
  justify-content: space-between;
}

.site-header__brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-header__icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex: 0 0 auto;
}

/* Leaderboard tabs use the same full, confident surface language as the header. */
.lb-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0;
  width: calc(100% + 28px);
  min-height: 42px;
  padding: 0;
  margin: -16px -14px 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #16101f 0%, #0f0f18 100%);
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.lb-tab {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
  box-shadow: inset -1px 0 0 var(--border);
  transition: filter 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.lb-tab:last-child {
  box-shadow: none;
}

.lb-tab:hover:not(.lb-tab--active) {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  filter: brightness(1.08);
}

.lb-tab--active,
.lb-tab--active:hover {
  background: linear-gradient(135deg, var(--accent) 0%, #7c2af0 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  filter: none;
}

/* Leaderboard rows need visible structure in the compact extension viewport. */
.lb-panel {
  width: 100%;
}

.lb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
}

.lb-row td {
  padding: 9px 8px;
  background: rgba(255,255,255,0.035);
  border-top: 1px solid rgba(255,255,255,0.055);
  border-bottom: 1px solid rgba(0,0,0,0.35);
  color: var(--text);
}

.lb-row:nth-child(even) td {
  background: rgba(255,255,255,0.06);
}

.lb-row:hover td {
  background: rgba(145,71,255,0.14);
}

.lb-row td:first-child {
  border-left: 1px solid rgba(255,255,255,0.055);
}

.lb-row td:last-child {
  border-right: 1px solid rgba(255,255,255,0.055);
}

.lb-rank {
  width: 42px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.lb-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  min-width: 0;
}

.lb-name-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-avatar {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 0 10px rgba(145,71,255,0.22);
}

.lb-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), rgba(178,122,255,0.9));
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.lb-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-boosted-badge {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd866, #ff7ad9 55%, #8ff7ff);
  color: #160e00;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(240,165,0,0.44);
}

.lb-value {
  width: 48px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.lb-you td,
.lb-you:nth-child(even) td {
  background: linear-gradient(90deg, rgba(145,71,255,0.26) 0%, rgba(145,71,255,0.1) 100%);
  border-color: rgba(178,122,255,0.35);
}

.lb-you .lb-rank,
.lb-you .lb-name,
.lb-you .lb-value {
  color: #fff !important;
}

.lb-boosted td,
.lb-boosted:nth-child(even) td {
  position: relative;
  background:
    linear-gradient(90deg, rgba(240,165,0,0.34) 0%, rgba(255,107,203,0.22) 52%, rgba(121,242,255,0.16) 100%);
  border-top-color: rgba(255,216,102,0.52);
  border-bottom-color: rgba(255,122,217,0.32);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    0 0 18px rgba(240,165,0,0.18);
}

.lb-boosted .lb-rank,
.lb-boosted .lb-name,
.lb-boosted .lb-value {
  color: #fff !important;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(240,165,0,0.52);
}

.lb-boosted .lb-avatar {
  border-color: rgba(255,216,102,0.95);
  box-shadow:
    0 0 0 2px rgba(255,107,203,0.28),
    0 0 18px rgba(240,165,0,0.72),
    0 0 26px rgba(121,242,255,0.34);
}

.lb-gap td {
  padding: 3px 0 1px;
  background: transparent;
  border: 0;
  color: var(--text-faint);
  text-align: center;
}

.lb-empty {
  padding: 18px 0;
  color: var(--text-muted);
  text-align: center;
}

/* ── Boosted Check-In Modal ──────────────────── */

.boost-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.boost-modal.is-open {
  display: flex;
}

.boost-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
}

.boost-modal__card {
  position: relative;
  z-index: 1;
  width: 100%;
  background: linear-gradient(160deg, #1c1229 0%, #13131a 100%);
  border: 1px solid rgba(240, 165, 0, 0.35);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  box-shadow: 0 -8px 40px rgba(240, 165, 0, 0.18), 0 -2px 16px rgba(0, 0, 0, 0.6);
  animation: slide-up 0.22s cubic-bezier(0.34, 1.3, 0.64, 1) both;
}

@keyframes slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.boost-modal__icon {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(240, 165, 0, 0.7));
  animation: zap-pulse 1.4s ease-in-out infinite alternate;
}

@keyframes zap-pulse {
  from { transform: scale(1);    filter: drop-shadow(0 0 8px  rgba(240, 165, 0, 0.6)); }
  to   { transform: scale(1.12); filter: drop-shadow(0 0 18px rgba(240, 165, 0, 0.95)); }
}

.boost-modal__title {
  font-size: 18px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.01em;
  margin: 0;
  text-shadow: 0 0 20px rgba(240, 165, 0, 0.5);
}

.boost-modal__body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  max-width: 260px;
}

.boost-modal__body strong {
  color: var(--text);
  font-weight: 700;
}

.boost-modal__confirm {
  width: 100%;
  padding: 13px 16px;
  background: linear-gradient(135deg, var(--gold) 0%, #c98a00 100%);
  color: #0a0a0f;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(240, 165, 0, 0.45);
  transition: filter 0.15s ease, transform 0.1s ease;
  position: relative;
  overflow: hidden;
}

.boost-modal__confirm::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 55%);
  pointer-events: none;
}

.boost-modal__confirm:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.boost-modal__confirm:active {
  filter: brightness(0.92);
  transform: translateY(0);
}

.boost-modal__cancel {
  width: auto;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  box-shadow: none;
  transition: color 0.15s ease;
}

.boost-modal__cancel::after { display: none; }

.boost-modal__cancel:hover {
  color: var(--text);
  background: transparent;
  box-shadow: none;
  transform: none;
  filter: none;
}

/* Config page */
.config-panel {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.config-panel h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.config-save-btn {
  width: auto;
  min-width: 118px;
  min-height: 36px;
  padding: 8px 14px;
  flex: 0 0 auto;
}

.config-panel p {
  margin: 0;
}

.config-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: 100%;
}

.config-section[data-panel="checkIn"] {
  width: 100%;
  max-width: none;
  align-self: stretch;
}

.config-section[data-panel="checkIn"] > .moderation-group {
  width: 100%;
  max-width: none;
  align-self: stretch;
  justify-self: stretch;
}

.config-section--hidden {
  display: none;
}

.config-section h2 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.config-tabs {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.config-tab {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
  box-shadow: inset -1px 0 0 var(--border);
}

.config-tab:last-child {
  box-shadow: none;
}

.config-tab::after {
  display: none;
}

.config-tab:hover:not(.config-tab--active) {
  background: var(--bg-hover);
  color: var(--text);
  transform: none;
  box-shadow: inset -1px 0 0 var(--border);
}

.config-tab--active,
.config-tab--active:hover {
  background: linear-gradient(135deg, var(--accent) 0%, #7c2af0 100%);
  color: #fff;
  transform: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.config-tab__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 4px;
  background: #e53e3e;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  border-radius: 8px;
  vertical-align: middle;
}

.config-tab--active .config-tab__badge {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.config-tab__badge--user {
  margin-left: auto;
  margin-right: 2px;
  flex-shrink: 0;
}

.config-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.config-field span {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.config-field small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.config-field input,
.config-field textarea {
  margin: 0;
  resize: vertical;
}

.boost-slider-field {
  gap: 10px;
}

.boost-slider-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.boost-slider-label strong {
  color: var(--gold);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.boost-slider-field input[type="range"] {
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--gold);
}

.boost-slider-field input[type="range"]:focus {
  outline: none;
}

.boost-slider-field input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(240,165,0,0.9), rgba(145,71,255,0.75));
}

.boost-slider-field input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -6px;
  border: 2px solid #0a0a0f;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.45);
}

.boost-slider-field input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(240,165,0,0.9), rgba(145,71,255,0.75));
}

.boost-slider-field input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #0a0a0f;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.45);
}

.boost-slider-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}


.toggle-field.toggle-switch {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(240,165,0,0.35);
  border-radius: var(--radius);
  background: rgba(240,165,0,0.08);
}

.toggle-field.toggle-switch--plain {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.toggle-switch-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-switch-slider {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  background: #222;
  border-radius: 22px;
  transition: background 0.2s;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.toggle-switch-slider:before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.toggle-switch-input:checked + .toggle-switch-slider {
  background: linear-gradient(90deg, var(--gold), var(--accent));
}
.toggle-switch-input:checked + .toggle-switch-slider:before {
  transform: translateX(16px);
}
.toggle-switch-slider:focus {
  outline: 2px solid var(--accent);
}
.toggle-field.toggle-switch > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.toggle-field.toggle-switch strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.toggle-field.toggle-switch small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.sound-preview {
  width: 100%;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(145,71,255,0.14), rgba(255,255,255,0.035));
}

.sound-preview__body {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sound-preview__icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(145,71,255,0.22);
  color: var(--accent-light);
  font-size: 19px;
  flex: 0 0 auto;
}

.sound-preview__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sound-preview__text strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sound-preview__text span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.sound-preview__actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.sound-preview__actions .btn-sm {
  min-height: 32px;
  padding: 6px 10px;
}

.overlay-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px 34px;
  gap: 6px;
  align-items: center;
}

.overlay-link-row input {
  margin: 0;
  font-size: 12px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  box-shadow: none;
}

.icon-btn::after {
  display: none;
}

.icon-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.config-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.config-actions--grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.config-actions .btn {
  min-width: 0;
  min-height: 40px;
  padding: 9px 10px;
  white-space: normal;
  line-height: 1.1;
}

.saving-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.position-picker {
  width: min(100%, 280px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.position-picker__cell {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.035);
  box-shadow: none;
}

.position-picker__cell::after {
  display: none;
}

.position-picker__cell:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  transform: none;
  box-shadow: none;
}

.position-picker__cell--active {
  background: linear-gradient(135deg, var(--accent) 0%, #7c2af0 100%);
  border-color: rgba(178,122,255,0.85);
  box-shadow: 0 0 0 2px rgba(145,71,255,0.25);
}

.sound-preview p,
.config-status {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0;
}

.config-status {
  min-height: 18px;
  text-align: center;
}

.config-status--error {
  color: #ff6b6b;
}
/* ── Viewer Settings Page ─────────────────────── */

.checkin-customizer {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.checkin-customizer__hero {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px 12px;
  background: linear-gradient(135deg, rgba(145,71,255,0.12) 0%, rgba(145,71,255,0.04) 100%);
  border-bottom: 1px solid var(--border);
}

.checkin-customizer__hero-icon {
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
  margin-top: 1px;
  filter: drop-shadow(0 0 6px rgba(145,71,255,0.55));
}

.checkin-customizer__hero-text {
  min-width: 0;
}

.checkin-customizer__title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}

.checkin-customizer__subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.checkin-customizer__settings {
  display: flex;
  flex-direction: column;
}

.checkin-customizer__section-hdr {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
}

.checkin-customizer__section-hdr--standard { color: var(--accent-light); }

.checkin-customizer__section-hdr--boosted {
  color: var(--gold);
  margin-top: 4px;
}

/* ── Check-In Cards ───────────────────────────── */

.checkin-card {
  margin: 0 10px 10px;
  padding: 11px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.checkin-card__header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.checkin-card__label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.checkin-card__input {
  width: 100%;
  margin: 0 0 8px;
  font-size: 12px;
  padding: 7px 10px;
}

.checkin-card__reason {
  font-size: 11px;
  color: #f87171;
  margin: 0 0 8px;
  line-height: 1.4;
}

.checkin-card__reset {
  width: 100%;
  height: 28px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  box-shadow: none;
}

.checkin-card__reset::after { display: none; }

.checkin-card__reset:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.checkin-card__reset:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Sound Player ─────────────────────────────── */

.checkin-sound-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.checkin-sound-player__btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, #7c2af0 100%);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: 0 2px 10px rgba(145,71,255,0.35);
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.checkin-sound-player__btn::after { display: none; }

.checkin-sound-player__btn:hover {
  filter: brightness(1.15);
  transform: scale(1.07);
  box-shadow: 0 4px 16px rgba(145,71,255,0.5);
}

.checkin-sound-player__btn--boosted:not(.play-checkin-sound--custom) {
  background: linear-gradient(135deg, var(--gold) 0%, #c98a00 100%);
  box-shadow: 0 2px 10px rgba(240,165,0,0.35);
}

.checkin-sound-player__btn--boosted:not(.play-checkin-sound--custom):hover {
  box-shadow: 0 4px 16px rgba(240,165,0,0.5);
}

.play-checkin-sound--custom {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%) !important;
  box-shadow: 0 2px 10px rgba(52,211,153,0.35) !important;
}

.play-checkin-sound--custom:hover {
  box-shadow: 0 4px 16px rgba(52,211,153,0.5) !important;
}

.checkin-sound-player__info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.checkin-sound-player__name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-sound-player__limit {
  font-size: 10px;
  color: var(--text-muted);
}

.checkin-sound-player__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.checkin-sound-upload-btn,
.checkin-sound-clear-btn {
  height: 30px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: filter 0.15s, background-color 0.15s, color 0.15s;
  line-height: 1;
  width: 100%;
  box-shadow: none;
}

.checkin-sound-upload-btn::after,
.checkin-sound-clear-btn::after { display: none; }

.checkin-sound-upload-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #7c2af0 100%);
  color: #fff;
  border: none;
  box-shadow: 0 1px 6px rgba(145,71,255,0.3);
}

.checkin-sound-upload-btn:hover {
  filter: brightness(1.12);
  transform: none;
}

.checkin-sound-clear-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
}

.checkin-sound-clear-btn:hover:not(:disabled) {
  background: rgba(248,113,113,0.1);
  color: #f87171;
  border-color: rgba(248,113,113,0.35);
  transform: none;
  box-shadow: none;
}

.checkin-sound-clear-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Status badge ─────────────────────────────── */

.checkin-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.checkin-status-badge--approved {
  background: rgba(52,211,153,0.12);
  color: #34d399;
  border: 1px solid rgba(52,211,153,0.28);
}

.checkin-status-badge--pending {
  background: rgba(250,204,21,0.1);
  color: #facc15;
  border: 1px solid rgba(250,204,21,0.28);
}

.checkin-status-badge--rejected {
  background: rgba(248,113,113,0.1);
  color: #f87171;
  border: 1px solid rgba(248,113,113,0.28);
}

/* ── Inline status / counter (still used by JS) ─ */

.checkin-setting-row__message {
  display: block;
  min-width: 0;
  margin: -4px 0 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.checkin-setting-row__message:empty { display: none; }

.checkin-setting-row__message--error { color: #ff6b6b; }

.checkin-setting-row__counter {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.checkin-setting-row__counter--over { color: #ff6b6b; }

.checkin-message-editor { width: 100%; min-width: 0; }

/* ── Global status line ───────────────────────── */

.checkin-customizer__status {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  min-height: 24px;
}

/* ── Moderation group (config page) ──────────── */

.moderation-group {
  display: grid;
  gap: 12px;
  margin-top: 0;
  width: 100%;
  align-self: stretch;
}

.moderation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.config-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}

.moderation-item p {
  margin: 4px 0;
  word-break: break-word;
}

.moderation-item--viewer {
  display: grid;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-width: 0;
  max-width: none;
  align-self: stretch;
  justify-self: stretch;
  box-sizing: border-box;
}

.moderation-user-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.moderation-user-toggle__text {
  min-width: 0;
  display: grid;
  gap: 2px;
  flex: 1;
}

.moderation-user-toggle__text small {
  min-height: 1em;
  color: var(--text-muted);
}

.moderation-user-toggle__chevron {
  margin-left: auto;
  color: var(--text-muted);
}

.moderation-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.moderation-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  font-weight: 700;
}

.moderation-item__customs,
.moderation-custom-item {
  display: grid;
  gap: 8px;
  width: 100%;
}

.moderation-custom-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  width: 100%;
}

.moderation-custom-item__body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.moderation-custom-item__body small {
  display: block;
  color: var(--text-muted);
}

.moderation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn--sm {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  line-height: 1;
}

body.config-page .config-section[data-panel="checkIn"] {
  width: 100%;
  max-width: none;
  min-width: 0;
  align-self: stretch;
  box-sizing: border-box;
}

body.config-page .config-section[data-panel="checkIn"] .moderation-group {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
}

body.config-page .config-section[data-panel="checkIn"] .moderation-item--viewer {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
}

body.config-page .config-section[data-panel="checkIn"] .moderation-item__customs:not([hidden]) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
}

body.config-page .config-section[data-panel="checkIn"] .moderation-user-toggle {
  display: grid !important;
  grid-template-columns: 32px minmax(0, 1fr) auto auto !important;
  width: 100% !important;
  justify-content: stretch;
}

body.config-page .config-section[data-panel="checkIn"] .moderation-custom-item {
  width: 100% !important;
}

