/* ================================================================
   LUDEX DESIGN SYSTEM — WarTable
   Palette: Obsidian / Hazard / Signal
   Fonts: Chakra Petch · Space Grotesk · JetBrains Mono
================================================================ */

/* ===== 1. TOKENS ===== */
:root {
  /* Ink palette */
  --ink:        #0a0b0d;
  --ink-2:      #111316;
  --ink-3:      #1a1d22;
  --bone:       #eef0ea;
  --bone-2:     #d6d9d1;
  --steel:      #7f8a95;
  --steel-2:    #4a5260;

  /* Accent colors */
  --hazard:     #ff3b2f;
  --hazard-2:   #d42a1f;
  --signal:     #d9ff3e;
  --amber:      #ffb400;
  --cyan:       #6ef0ff;
  --magenta:    #ff3ecb;

  /* Typography */
  --font-display: 'Chakra Petch', 'Eurostile', sans-serif;
  --font-ui:      'Space Grotesk', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Motion */
  --transition: 0.18s ease;

  /* Borders */
  --border-dim:    rgba(255,255,255,0.06);
  --border-mid:    rgba(255,255,255,0.12);
  --border-bright: rgba(255,255,255,0.20);

  /* Cut corner size */
  --cut: 12px;

  /* ── Legacy aliases so app.js inline styles keep working ── */
  --clr-bg:             var(--ink);
  --clr-sidebar:        var(--ink-2);
  --clr-surface:        var(--ink-2);
  --clr-surface-bright: var(--ink-3);
  --clr-primary:        var(--hazard);
  --clr-primary-bright: var(--hazard);
  --clr-primary-dim:    rgba(255,59,47,0.12);
  --clr-text:           var(--bone);
  --clr-text-muted:     var(--steel);
  --clr-text-dim:       var(--steel-2);
  --clr-success:        var(--signal);
  --clr-success-dim:    rgba(217,255,62,0.12);
  --clr-danger:         var(--hazard);
  --clr-red-dim:        rgba(255,59,47,0.10);
  --clr-red-bright:     var(--hazard-2);
  --clr-gold:           var(--hazard);
  --clr-gold-pale:      rgba(255,59,47,0.15);
  --clr-gold-glow:      rgba(255,59,47,0.25);
  --clr-border:         var(--border-dim);
  --clr-border-bright:  var(--border-mid);
  --clr-border-ornate:  rgba(255,59,47,0.20);
  --clr-bg-card:        var(--ink-2);
  --clr-bg-elevated:    var(--ink-3);
  --clr-green:          var(--signal);
  --clr-red:            var(--hazard);
  --grad-primary:       linear-gradient(135deg, var(--hazard) 0%, var(--hazard-2) 100%);
  --shadow-neon:        0 0 16px rgba(255,59,47,0.30);
  --radius-sm:          2px;
  --radius-md:          4px;
  --radius-lg:          0px;
  --glass-blur:         blur(0px);
}

/* ===== 2. UTILITY CLASSES ===== */
.cut-tr-bl {
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

.f-display { font-family: var(--font-display); }
.f-ui      { font-family: var(--font-ui); }
.f-mono    { font-family: var(--font-mono); }

.mono-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--steel);
}

/* ===== 3. RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
svg[aria-hidden="true"] { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* Remove tap highlight e delay em todos os elementos interativos */
a, button, input, select, textarea, label, [role="button"], .btn, .day-card,
.room-tab, .table-card, .custom-select, .custom-select__option, .color-chip,
.detail__player--empty, .nav__link, .mobile-menu-toggle {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ===== 4. BASE ===== */
html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-ui);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== 5. LAYOUT ===== */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle topo grid */
.dashboard-layout::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Hazard glow orb — top-right only, very faint */
.dashboard-layout::after {
  content: '';
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  top: -120px;
  right: -120px;
  background: var(--hazard);
  filter: blur(200px);
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

@keyframes glowPulse {
  from { opacity: 0.03; }
  to   { opacity: 0.07; }
}

/* ===== 6. SIDEBAR ===== */
.sidebar {
  width: 260px;
  background: var(--ink-2);
  border-right: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar__logo {
  padding: 28px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-dim);
}

.logo__icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(238,240,234,0.25);
  flex-shrink: 0;
  color: var(--bone);
}

.logo__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--bone);
  text-transform: uppercase;
}

.logo__accent { color: var(--hazard); }

.sidebar__nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--steel);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  transition: all var(--transition);
  border: 1px solid transparent;
  position: relative;
}

.nav__link:hover {
  background: rgba(255,255,255,0.04);
  color: var(--bone);
  border-color: var(--border-dim);
}

.nav__link.active {
  background: rgba(255,59,47,0.10);
  color: var(--bone);
  border-color: rgba(255,59,47,0.30);
  border-left: 2px solid var(--hazard);
}

.nav__icon { font-size: 1rem; }

.sidebar__footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-dim);
}

/* ===== 7. MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

.content-header {
  padding: 32px 40px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--ink-2);
  border-bottom: 1px solid var(--border-dim);
}

.content-header__actions {
  display: flex;
  gap: 10px;
}

.content-header__title h1 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bone);
}

.content-header__subtitle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--steel);
  margin-top: 4px;
}

.content-body {
  flex: 1;
  padding: 0 40px 48px;
}

/* ===== 8. BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

/* Primary — hazard red with diagonal cut */
.btn--primary {
  background: var(--hazard);
  color: var(--ink);
  border: none;
}
.btn--primary:hover {
  background: var(--hazard-2);
  filter: brightness(1.1);
}

/* Outline / secondary */
.btn--outline {
  background: transparent;
  color: var(--bone);
  border-color: var(--border-mid);
}
.btn--outline:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-bright);
}
.btn--outline.active {
  background: rgba(255,59,47,0.10);
  border-color: var(--hazard);
  color: var(--hazard);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--steel);
  border-color: transparent;
}
.btn--ghost:hover {
  background: rgba(255,255,255,0.04);
  color: var(--bone);
}

/* Signal — acid green */
.btn--signal {
  background: var(--signal);
  color: var(--ink);
  border: none;
}
.btn--signal:hover { filter: brightness(1.1); }

/* Google login */
.btn--google {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-ui);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  width: 100%;
  border: none;
  padding: 12px 16px;
}
.btn--google:hover { background: #fff; }

.btn--sm { padding: 7px 14px; font-size: 0.65rem; }
.btn--lg { padding: 14px 28px; font-size: 0.85rem; }
.btn--full { width: 100%; }

.btn[disabled], .btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ===== 9. TAGS / STATUS BADGES ===== */
.badge, .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid currentColor;
}

.badge--signal, .badge--success {
  color: var(--signal);
  background: rgba(217,255,62,0.08);
}
.badge--hazard, .badge--danger, .badge--full {
  color: var(--hazard);
  background: rgba(255,59,47,0.08);
}
.badge--steel, .badge--empty {
  color: var(--steel);
  background: rgba(127,138,149,0.08);
}
.badge--amber {
  color: var(--amber);
  background: rgba(255,180,0,0.08);
}

/* ===== 10. GLASS CARD (removed glass, kept surface) ===== */
.glass-card {
  background: var(--ink-2);
  border: 1px solid var(--border-dim);
}

/* ===== 11. DAY SELECTOR ===== */
.day-selector {
  padding: 20px 40px 0;
  background: var(--ink-2);
  border-bottom: 1px solid var(--border-dim);
}

.day-selector__container {
  overflow: hidden;
}

.day-strip__month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
}

.day-strip__month-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone);
  min-width: 140px;
  text-align: center;
}

.day-strip__nav-btn {
  background: transparent;
  border: 1px solid var(--border-dim);
  color: var(--steel);
  font-size: 1.2rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.day-strip__nav-btn:hover {
  border-color: var(--border-mid);
  color: var(--bone);
  background: rgba(255,255,255,0.04);
}

.day-strip__today-btn {
  margin-left: 12px;
  background: transparent;
  border: 1px solid var(--hazard);
  color: var(--hazard);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(255, 59, 47, 0.1);
}

.day-strip__today-btn:hover {
  background: var(--hazard);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 59, 47, 0.4);
  transform: translateY(-1px);
}

.day-strip__today-btn.is-current {
  opacity: 0.4;
  border-color: var(--steel);
  color: var(--steel);
  box-shadow: none;
}

.day-strip__today-btn.is-current:hover {
  opacity: 1;
  border-color: var(--hazard);
  color: var(--hazard);
  background: transparent;
}


.day-strip__empty {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel-2);
  padding: 16px 0;
}

.day-selector__strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 16px;
  scrollbar-width: none;
}
.day-selector__strip::-webkit-scrollbar { display: none; }

.day-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border-dim);
  cursor: pointer;
  transition: all var(--transition);
  min-width: 64px;
  flex-shrink: 0;
  user-select: none;
}

.day-card:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border-mid);
}

.day-card.active {
  background: var(--hazard);
  border-color: var(--hazard);
}

.day-card__weekday {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 2px;
}

.day-card.active .day-card__weekday { color: rgba(10,11,13,0.75); }

.day-card__number {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--bone);
}

.day-card.active .day-card__number { color: var(--ink); }

/* ===== 12. FILTERS LEGEND ===== */
.filters-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 40px;
  background: rgba(255,255,255,0.015);
  border-bottom: 1px solid var(--border-dim);
  flex-wrap: wrap;
  position: relative;
  z-index: 100;
}

.legend__container {
  display: flex;
  gap: 14px;
  align-items: center;
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--steel);
}

.legend__dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
}

.legend__dot--empty  { background: var(--steel); }
.legend__dot--open   { background: var(--signal); }
.legend__dot--full   { background: var(--hazard); }

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

.filter-input {
  min-width: 200px;
}

.view-toggles {
  display: flex;
  gap: 0;
  margin-left: auto;
  border: 1px solid var(--border-mid);
}

.view-toggles .btn {
  border: none;
  border-right: 1px solid var(--border-dim);
  font-size: 0.62rem;
  padding: 7px 12px;
  background: transparent;
  color: var(--steel);
}
.view-toggles .btn:last-child { border-right: none; }
.view-toggles .btn:hover { background: rgba(255,255,255,0.04); color: var(--bone); }
.view-toggles .btn.active {
  background: var(--hazard);
  color: var(--ink);
}

/* Rooms nav — oculto até implementar múltiplos salões */
.rooms-nav {
  display: none; /* remover quando escalar para múltiplos salões */
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: var(--ink-2);
  border-bottom: 1px solid var(--border-dim);
}

.rooms-nav__tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.rooms-nav__tabs::-webkit-scrollbar { display: none; }

.room-tab {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 18px;
  color: var(--steel);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.room-tab:hover { color: var(--bone); }
.room-tab.active {
  color: var(--bone);
  border-bottom-color: var(--hazard);
}

.rooms-nav__actions {
  display: flex;
  gap: 6px;
  padding: 8px 0;
}

/* ===== 13. TABLES GRID ===== */
.tables-section { padding: 0; }

.tables__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 24px 40px;
}

/* ───── TABLE CARD ───── */
.table-card {
  background: var(--ink-2);
  border: 1px solid var(--border-dim);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}

.table-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

/* Fundo sólido e bordas dependendo do status */
.table-card--empty { 
  background: var(--ink-2); 
  border-left: 3px solid var(--steel-2); 
}
.table-card--open { 
  background: #1a2214; 
  border-left: 3px solid var(--signal); 
}
.table-card--full { 
  background: #2a1616; 
  border-left: 3px solid var(--hazard); 
}

/* Hide background image — LUDEX uses flat ink surfaces */
.table-card__bg { display: none; }

.table-card__content {
  position: relative;
  z-index: 1;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.table-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-card__title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel);
}

/* Status badges */
.table-card__status-badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.table-card__status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
  flex-shrink: 0;
}
.table-card__status-badge--empty  { color: var(--steel); }
.table-card__status-badge--open   { color: var(--signal); }
.table-card__status-badge--full   { color: var(--hazard); }

.table-card__system-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.system-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

.table-card__system {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bone);
}

.table-card__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.table-card__info-item {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--steel);
}

.table-card__players {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-dim);
  margin-top: auto;
}

.player-avatars {
  display: flex;
  gap: 4px;
}

.player-avatar-mini {
  width: 26px;
  height: 26px;
  background: var(--hazard);
  color: var(--ink);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  overflow: hidden;
  flex-shrink: 0;
}
.player-avatar-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== 14. MAP VIEW ===== */
.map-section { padding: 0 40px 48px; }

.map__container { max-width: 1200px; }

/* Header row: room label + edit button */
.map__canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 10px;
}

.map__room-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--steel);
}

.map__canvas-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Edit button active state */
#btn-edit-map.active {
  border-color: var(--hazard);
  color: var(--hazard);
  background: rgba(255,59,47,0.08);
}

/* Viewport: floor-plan canvas */
.map__viewport {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background-color: #0c0e11;
  border: 1px solid var(--border-mid);
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 20px 20px, 20px 20px;
  overflow: hidden;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.4);
}

/* Crosshair cursor on canvas when add-tool is active */
.map__viewport.cursor-crosshair { cursor: crosshair; }
.map__viewport.cursor-erase     { cursor: cell; }

.map__canvas {
  position: absolute;
  inset: 0;
}

/* ── Floating edit toolbar ── */
.map__toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(12,14,17,0.92);
  border: 1px solid var(--border-mid);
  padding: 6px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.map-tool {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--steel);
  cursor: pointer;
  transition: all 0.12s;
  flex-shrink: 0;
}
.map-tool:hover {
  color: var(--bone);
  border-color: var(--border-mid);
  background: rgba(255,255,255,0.04);
}
.map-tool.active {
  color: var(--hazard);
  border-color: rgba(255,59,47,0.5);
  background: rgba(255,59,47,0.08);
}
.map-tool--erase:hover,
.map-tool--erase.active {
  color: var(--hazard);
  border-color: rgba(255,59,47,0.5);
}

.map-tool-sep {
  height: 1px;
  background: var(--border-dim);
  margin: 2px 0;
}
.map-tool:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Table elements ── */
.map-table {
  position: absolute;
  min-width: 88px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 14px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  border: 1px solid var(--steel-2);
  background: var(--ink-2);
  color: var(--steel);
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s, color 0.12s;
  user-select: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 10;
}
.map-table:hover {
  border-color: var(--border-bright);
  color: var(--bone);
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  z-index: 2;
}
.map-table--open {
  border-color: var(--signal);
  background: #1a2214;
  color: var(--signal);
}
.map-table--full {
  border-color: var(--hazard);
  background: #2a1616;
  color: var(--hazard);
}
.map-table.editing    { cursor: grab; }
.map-table.erase-mode { cursor: crosshair; }
.map-table.erase-mode:hover {
  border-color: var(--hazard) !important;
  background: rgba(255,59,47,0.14) !important;
  color: var(--hazard) !important;
}

.map-table__num {
  font-size: 1rem;
  line-height: 1;
  font-weight: 800;
}

.map-table__label {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
  line-height: 1;
}

.map-table__delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-family: var(--font-mono);
  color: var(--hazard);
  border: 1px solid rgba(255,59,47,0.4);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.12s, background 0.12s;
  line-height: 1;
}
.map-table__delete:hover {
  opacity: 1;
  background: rgba(255,59,47,0.18);
}

/* Seat dots above/below table label */
.map-table__seats {
  font-size: 5px;
  letter-spacing: 5px;
  opacity: 0.3;
  line-height: 1;
  padding: 0 2px;
}

/* ===== 15. MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.93);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--ink-2);
  border: 1px solid rgba(255,59,47,0.25);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  /* display flex separa overflow do clip-path — evita artefato de renderização */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  animation: slideUp 0.2s ease forwards;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUpSheet {
  from { opacity: 0; transform: translateY(60px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-wide { max-width: 700px; }

.modal__header {
  padding: 20px 52px 18px 24px; /* right padding makes room for abs close btn */
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
}

.modal__label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hazard);
  margin-bottom: 4px;
}

.modal__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.modal__subtitle {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
  margin-top: 4px;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--steel);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all var(--transition);
  z-index: 2;
}
.modal__close:hover { border-color: var(--hazard); color: var(--hazard); }

.modal__body { padding: 22px 24px; flex: 1; overflow-y: auto; overflow-x: hidden; }

.modal__footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border-dim);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ===== 16. FORMS ===== */
.modal__form {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal__form .btn--full {
  margin-top: 6px;
}

.form-section { margin-bottom: 20px; }

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--hazard);
}

.filter-input,
input[type="text"],
input[type="number"],
input[type="datetime-local"],
input[type="time"],
textarea,
select {
  background: var(--ink);
  border: 1px solid var(--border-mid);
  padding: 10px 14px;
  color: var(--bone);
  width: 100%;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
  color-scheme: dark;
  border-radius: 0;
}

.filter-input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--hazard);
  background: rgba(255,59,47,0.04);
}

textarea { resize: vertical; min-height: 80px; }

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%237f8a95'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
select:focus {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%23ff3b2f'/></svg>");
}
select option { background: var(--ink-2); }

/* ===== 17. CUSTOM SELECT (Portal-based z-index fix) ===== */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select {
  position: relative;
  cursor: pointer;
  background: var(--ink);
  border: 1px solid var(--border-mid);
  transition: border-color var(--transition);
}

.custom-select:hover { border-color: var(--border-bright); }
.custom-select.open  { border-color: var(--hazard); }

.custom-select__trigger {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--bone);
  font-family: var(--font-ui);
  font-size: 0.88rem;
}

.custom-select__trigger::after {
  content: '▾';
  font-size: 0.75rem;
  color: var(--steel);
  transition: transform var(--transition);
}

.custom-select.open .custom-select__trigger::after {
  transform: rotate(180deg);
  color: var(--hazard);
}

/* Options container — appended to body portal (see ui.js) */
.custom-select__options {
  position: fixed;
  background: var(--ink-2);
  border: 1px solid var(--hazard);
  border-top: none;
  z-index: 99999;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.8), 0 0 12px rgba(255,59,47,0.15);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--steel-2) transparent;
}

.custom-select__options.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.custom-select__option {
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--steel);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all var(--transition);
}

.custom-select__option:hover {
  background: rgba(255,59,47,0.08);
  color: var(--bone);
  border-left-color: var(--hazard);
}

.custom-select__option.selected {
  background: rgba(255,59,47,0.10);
  color: var(--hazard);
  border-left-color: var(--hazard);
  font-weight: 600;
}

.custom-select__group-label {
  padding: 8px 14px 4px;
  font-family: var(--font-mono, monospace);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--steel-2);
  pointer-events: none;
  border-top: 1px solid var(--border-dim);
  margin-top: 4px;
}
.custom-select__group-label:first-child {
  border-top: none;
  margin-top: 0;
}

.native-select { display: none !important; }

/* ===== 18. USER MENU ===== */
.user-menu { position: relative; }

.user-menu__trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  width: 100%;
  cursor: pointer;
  transition: all var(--transition);
  background: transparent;
  color: var(--bone);
}
.user-menu__trigger:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border-dim);
}

.user-menu__avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.header__avatar {
  width: 34px;
  height: 34px;
  background: var(--hazard);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  overflow: hidden;
  position: relative;
}
.header__avatar img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.user-status-dot {
  width: 8px;
  height: 8px;
  background: var(--signal);
  border: 1.5px solid var(--ink-2);
  border-radius: 50%;
  position: absolute;
  bottom: -1px;
  right: -1px;
}

.user-menu__info { flex: 1; text-align: left; overflow: hidden; }

.user-name {
  display: block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--bone);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-status {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--signal);
}

.user-menu__dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--ink-3);
  border: 1px solid var(--border-mid);
  padding: 6px;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
  display: none;
  z-index: 1000;
}
.user-menu.active .user-menu__dropdown {
  display: block;
  animation: slideUp 0.15s ease;
}

.user-menu__header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-dim);
  margin-bottom: 4px;
}
.user-menu__header strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--bone);
}
.user-menu__header small {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--steel);
  letter-spacing: 0.1em;
}

.user-menu__divider {
  height: 1px;
  background: var(--border-dim);
  margin: 4px 0;
}

.user-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 2px solid transparent;
}
.user-menu__item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--bone);
  border-left-color: var(--border-mid);
}
.user-menu__item--danger { color: var(--hazard); }
.user-menu__item--danger:hover {
  background: rgba(255,59,47,0.08);
  border-left-color: var(--hazard);
}

/* ===== 19. TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink-3);
  border: 1px solid var(--border-mid);
  border-left: 4px solid var(--hazard);
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone);
  box-shadow: 0 12px 32px rgba(0,0,0,0.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast__icon {
  color: var(--hazard);
  display: flex;
  align-items: center;
}

.toast--share {
  border-left-color: var(--clr-primary);
  background: var(--ink-2);
}

.toast--share .toast__icon {
  color: var(--clr-primary);
}

/* ===== 20. COMMUNITY SECTION ===== */
.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 24px 40px;
}

.player-card {
  background: var(--ink-2);
  border: 1px solid var(--border-dim);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  transition: border-color var(--transition);
}
.player-card:hover { border-color: var(--border-mid); }

.player-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-card__avatar {
  width: 44px;
  height: 44px;
  background: var(--hazard);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}
.player-card__avatar img { width: 100%; height: 100%; object-fit: cover; }

.player-card__name {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bone);
}

.player-card__role {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--steel);
  margin-top: 2px;
}

.player-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-dim);
}

.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-cell__label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--steel);
}
.stat-cell__value {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--bone);
}
.stat-cell__value--win  { color: var(--signal); }
.stat-cell__value--lose { color: var(--hazard); }

/* ===== 21. PROFILE MODAL ===== */
.profile-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
}

.profile__avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.profile__avatar {
  width: 100px;
  height: 100px;
  background: var(--hazard);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.profile__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile__avatar:hover::after {
  content: 'EDIT';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--signal);
}

/* ===== 22. CROPPER MODAL ===== */
.cropper-container { background: #000; position: relative; }
.cropper-canvas { display: block; }

/* ===== 23. DETAIL MODAL ===== */
#modal-detail-content h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bone);
  margin-bottom: 16px;
}

#modal-detail-content .detail-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--hazard);
  margin-bottom: 4px;
}

#modal-detail-content .detail-value {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--bone-2);
  margin-bottom: 12px;
}

/* ===== 24. MOBILE MENU ===== */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 201; /* acima do sidebar (150) e do overlay (99) */
  background: var(--ink-2);
  border: 1px solid var(--border-mid);
  padding: 10px;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), left 0.22s ease;
}
.mobile-menu-toggle.active {
  left: calc(260px + 10px);
  background: var(--ink-2);
  border-color: var(--border-mid);
}
.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--bone);
  transition: transform 0.22s ease, opacity 0.18s ease, width 0.18s ease;
  transform-origin: center;
}
/* Animação hamburger → X */
.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 99;
}

/* ===== 25. SECTION VISIBILITY ===== */
.section-hidden { display: none !important; }
.admin-only     { display: none; }

/* ===== 26. SCROLLBAR ===== */
::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--steel-2); }
::-webkit-scrollbar-thumb:hover { background: var(--steel); }

/* ===== 27. RESPONSIVE ===== */
/* ===================================================
   RESPONSIVO — TABLET  (≤ 1024px)
   =================================================== */
@media (max-width: 1024px) {
  .tables__grid    { grid-template-columns: repeat(2, 1fr); }
  .community-grid  { grid-template-columns: repeat(2, 1fr); }
}

/* ===================================================
   RESPONSIVO — MOBILE  (≤ 768px)
   =================================================== */
@media (max-width: 768px) {
  /* — Sidebar / nav — */
  .mobile-menu-toggle { display: flex; }
  .view-toggles { display: none; }
  .sidebar { transform: translateX(-100%); z-index: 150; }
  .sidebar.active { transform: translateX(0); box-shadow: 20px 0 40px rgba(0,0,0,0.8); }
  .sidebar-overlay { display: block; }
  .main-content { margin-left: 0 !important; width: 100%; }

  /* — Layout spacing — */
  .content-header { padding: 68px 16px 16px; }
  .content-body,
  .tables__grid,
  .community-grid { padding: 12px 12px 48px; }
  .day-selector   { padding: 12px 14px 0; }
  .filters-legend { padding: 10px 14px; }
  .rooms-nav      { padding: 0 14px; }

  /* — Grids — */
  .tables__grid   { grid-template-columns: 1fr; gap: 10px; }
  .community-grid { grid-template-columns: 1fr; }
  .profile-grid   { grid-template-columns: 1fr; }
  .form-row       { grid-template-columns: 1fr; gap: 12px; }

  /* — Botões: mínimo 48px de altura (touch target) — */
  .btn {
    min-height: 48px;
    font-size: 0.8rem;
    padding: 12px 20px;
  }
  .btn--sm {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.72rem;
  }
  .btn--lg {
    min-height: 52px;
    padding: 15px 24px;
    font-size: 0.88rem;
  }

  /* — Inputs/selects: font 1rem evita zoom automático no iOS — */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="datetime-local"],
  input[type="time"],
  textarea,
  select,
  .filter-input {
    font-size: 1rem;
    min-height: 48px;
    padding: 13px 14px;
  }
  textarea { min-height: 90px; }

  /* — Custom select — */
  .custom-select__trigger {
    min-height: 48px;
    padding: 13px 14px;
    font-size: 1rem;
  }
  .custom-select__option {
    padding: 14px 16px;
    font-size: 0.95rem;
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  .custom-select__group-label { padding: 10px 16px 6px; font-size: 0.65rem; }

  /* — Day strip: carrossel preenche 100% da largura — */
  .day-selector__container { overflow: visible; }
  .day-selector__strip {
    overflow-x: visible;   /* cards distribuem igualmente sem scroll */
  }
  .day-strip__nav-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.4rem;
    flex-shrink: 0;
  }
  .day-card {
    flex: 1;               /* distribui o espaço igualmente entre os cards */
    min-width: 0;          /* permite encolher dentro do flex */
    padding: 10px 6px;
    min-height: 62px;
    justify-content: center;
    text-align: center;
  }
  .day-card__weekday { font-size: 0.6rem; }
  .day-card__number  { font-size: 1.2rem; }
  .day-strip__month-label { font-size: 0.75rem; letter-spacing: 0.15em; }
  .day-strip__month-nav   { gap: 8px; }

  /* — Filtros: busca full-width + 2 selects lado a lado — */
  .filters-legend {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 14px 12px;
  }
  /* busca ocupa a linha toda */
  .filters__container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .filters__group {
    flex: 1 1 100%;       /* busca: linha completa */
    min-width: 0;
  }
  .filters__group:not(:first-child) {
    flex: 1 1 calc(50% - 4px); /* selects: lado a lado */
    min-width: 0;
  }
  /* garante que o custom-select-wrapper cresce junto */
  .filters__group .custom-select-wrapper,
  .filters__group .custom-select { width: 100%; }
  .filter-input { min-width: unset; width: 100%; }

  /* legenda compacta em linha */
  .legend__container {
    order: 2;
    flex-wrap: wrap;
    gap: 4px 12px;
    border-top: 1px solid var(--border-dim);
    padding-top: 8px;
  }
  .legend__item { font-size: 0.65rem; }

  /* — Fontes: legibilidade geral no mobile — */
  .modal__title          { font-size: 1.2rem; }
  .modal__subtitle       { font-size: 0.72rem; letter-spacing: 0.12em; }
  .modal__label          { font-size: 0.7rem;  }
  .form-group label      { font-size: 0.72rem; letter-spacing: 0.11em; }
  .detail__info-label    { font-size: 0.7rem;  letter-spacing: 0.12em; }
  .detail__info-value    { font-size: 1rem;    }
  .detail__system        { font-size: 1.2rem;  }
  .detail__table-name    { font-size: 0.7rem;  }
  .detail__players-label { font-size: 0.7rem;  }
  .detail__player-name   { font-size: 0.95rem; }
  .table-card__title     { font-size: 0.8rem;  }
  .table-card__system    { font-size: 0.9rem;  }
  .table-card__info-item { font-size: 0.72rem; }
  .table-card__status-badge { font-size: 0.66rem; }
  .result-note           { font-size: 0.85rem; }
  .result-radio__label   { font-size: 0.68rem; padding: 6px 10px; }

  /* — Rooms nav — */
  .room-tab {
    min-height: 48px;
    padding: 14px 14px;
    font-size: 0.72rem;
  }
  .rooms-nav__actions .btn { min-height: 36px; padding: 8px 12px; }

  /* — Modal: bottom sheet — */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    max-width: 100%;
    max-height: 94vh;
    border-bottom: none;
    border-left: none;
    border-right: none;
    clip-path: none;
    border-radius: 16px 16px 0 0;
    border-top: 2px solid rgba(255,59,47,0.35);
  }
  /* animação de baixo para cima (bottom sheet) */
  .modal { animation: slideUpSheet 0.25s ease forwards; }
  /* handle visual de drag */
  .modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border-mid);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }
  .modal__header { padding: 12px 52px 16px 18px; }
  .modal__body   { padding: 18px; }
  .modal__form   { padding: 16px 18px 20px; gap: 14px; }
  .profile-form  { padding: 16px 18px 20px; }
  #modal-detail-content { padding: 18px 18px 22px; gap: 14px; }

  /* — Ações do detail: 100% largura, empilhadas — */
  .detail__actions {
    flex-direction: column;
    gap: 8px;
  }
  .detail__actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* — Linhas de jogador no detail: altura confortável — */
  .detail__player {
    padding: 12px 14px;
    min-height: 52px;
  }
  .detail__player--empty { min-height: 54px; }

  /* — Profile avatar edit label — */
  .profile__avatar-edit {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* — Chips de cor no perfil: maior area de toque — */
  .color-chip {
    width: 32px;
    height: 32px;
  }

  /* — Footer — */
  .footer { padding: 16px; }
  .community__container { padding: 20px 14px; }
  .detail__info-grid { grid-template-columns: 1fr; }
  .result-player-row { flex-wrap: wrap; }
  .result-player-row__options { width: 100%; justify-content: flex-end; }

  /* — Garante que variantes de tamanho do modal também são 100% no mobile — */
  .modal--sm,
  .modal-wide { max-width: 100% !important; }
}

/* ===================================================
   RESPONSIVO — MOBILE PEQUENO  (≤ 480px)
   =================================================== */
@media (max-width: 480px) {
  /* — Cabeçalho — */
  .content-header { padding: 60px 14px 14px; }
  .content-header__title h1 { font-size: 1.35rem; letter-spacing: 0.06em; }
  .content-header__subtitle { font-size: 0.65rem; }

  /* — Grids — */
  .tables__grid,
  .community-grid { padding: 10px 10px 48px; gap: 8px; }

  /* — Day strip — */
  .day-selector        { padding: 10px 12px 0; }
  .day-selector__strip { gap: 4px; }
  .day-card            { padding: 9px 8px; min-height: 56px; }
  .day-card__number    { font-size: 1.1rem; }
  .day-card__weekday   { font-size: 0.56rem; }
  .day-strip__month-nav { padding-bottom: 8px; }
  .day-strip__nav-btn  { width: 36px; height: 36px; min-width: 36px; min-height: 36px; font-size: 1.2rem; }

  /* — Filtros 480px — */
  .filters-legend { padding: 8px 12px 10px; gap: 6px; }
  .filters__group:not(:first-child) { flex: 1 1 calc(50% - 4px); }

  /* — Legibilidade: fontes legíveis em tela pequena — */
  .form-group label         { font-size: 0.7rem;  letter-spacing: 0.1em; }
  .modal__subtitle          { font-size: 0.7rem;  letter-spacing: 0.1em; }
  .modal__label             { font-size: 0.68rem; }
  .modal__title             { font-size: 1.15rem; }
  .table-card__info-item    { font-size: 0.7rem;  }
  .table-card__title        { font-size: 0.78rem; }
  .table-card__system       { font-size: 0.9rem;  }
  .detail__info-label       { font-size: 0.68rem; letter-spacing: 0.12em; }
  .detail__info-value       { font-size: 0.95rem; }
  .detail__system           { font-size: 1.15rem; }
  .detail__table-name       { font-size: 0.68rem; }
  .detail__players-label    { font-size: 0.68rem; }
  .detail__player-name      { font-size: 0.9rem;  }
  .result-note              { font-size: 0.8rem;  }
  .result-radio__label      { font-size: 0.65rem; padding: 6px 10px; }
  .table-card__status-badge { font-size: 0.65rem; padding: 4px 8px; }
  .legend__item             { font-size: 0.68rem; }
  .day-card__weekday        { font-size: 0.6rem;  }

  /* — Cards de mesa — */
  .table-card__content { padding: 14px 14px; gap: 8px; }

  /* — Modais — */
  .modal__header { padding: 16px 48px 14px 16px; }
  .modal__form   { padding: 16px 16px 18px; }
  .modal__body   { padding: 16px; }
  #modal-detail-content { padding: 16px 16px 20px; }
}

/* ===== 28. MODAL SIZE VARIANTS ===== */
.modal--sm { max-width: 400px; }

/* ===== 29. DETAIL MODAL CONTENT ===== */
#modal-detail-content {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.detail__system {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--bone);
}

.detail__table-name {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--steel);
  margin-top: -8px;
}

.detail__info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-dim);
  border: 1px solid var(--border-dim);
}

.detail__info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--ink);
}

.detail__info-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hazard);
}

.detail__info-value {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bone);
}

.detail__desc {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--steel);
  font-style: italic;
  padding: 10px 14px;
  border-left: 2px solid var(--border-mid);
  background: var(--ink);
}

.detail__players-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail__players-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail__players-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--steel);
}

.detail__players-count {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--hazard);
  font-weight: 600;
}

.detail__players-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail__player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--ink);
  border: 1px solid var(--border-dim);
  position: relative;
  transition: all 0.2s;
}

.detail__player:hover {
  border-color: var(--hazard);
}

.detail__player--host { 
  border-color: rgba(255, 59, 47, 0.4);
  background: rgba(255, 59, 47, 0.05);
}

.btn-kick {
  background: rgba(255, 59, 47, 0.1);
  color: var(--hazard);
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
  opacity: 0.7;
}

.btn-kick:hover {
  background: var(--hazard);
  color: var(--ink);
  opacity: 1;
  transform: scale(1.1);
}

.badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge--primary {
  background: var(--hazard);
  color: var(--ink);
}

.detail__player--empty { opacity: 0.45; border-style: dashed; }


.detail__player-avatar {
  width: 32px;
  height: 32px;
  background: var(--hazard);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.detail__player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail__player--empty .detail__player-avatar { background: var(--steel-2); }

.detail__player-name {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--bone-2);
}

.detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

/* ===== 30. PROFILE FORM ===== */
.profile-form {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.profile__avatar-section {
  padding: 20px;
  background: var(--ink);
  border: 1px solid var(--border-dim);
}

.profile__avatar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.profile__avatar-edit {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
  padding: 5px 14px;
  border: 1px solid var(--border-mid);
  cursor: pointer;
  transition: all var(--transition);
}
.profile__avatar-edit:hover {
  color: var(--bone);
  border-color: var(--border-bright);
}

.profile__avatar-hint {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel-2);
  text-align: center;
}

.profile__color-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-chip {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition), border-color var(--transition);
}
.color-chip:hover { transform: scale(1.18); }
.color-chip.active { border-color: var(--bone); }

input:disabled, select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== 31. CROPPER MODAL ===== */
.cropper {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cropper__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #000;
  overflow: hidden;
  max-height: 260px;
  cursor: grab;
}
.cropper__viewport:active { cursor: grabbing; }

.cropper__viewport img {
  position: absolute;
  transform-origin: center;
  max-width: none;
  pointer-events: none;
}

.cropper__overlay {
  position: absolute;
  inset: 0;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
  border-radius: 50%;
  pointer-events: none;
}

.cropper__controls { padding: 4px 0; }

.zoom-slider {
  width: 100%;
  accent-color: var(--hazard);
  cursor: pointer;
}

/* ===== 32. FOOTER ===== */
.footer {
  padding: 18px 40px;
  border-top: 1px solid var(--border-dim);
  margin-top: auto;
}

.footer__container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--steel);
}

.footer__copy {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--steel);
  text-align: center;
}

.footer__ludex {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--steel);
}

.footer__ludex-made {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
}

.footer__ludex-mark {
  color: var(--bone-2);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.footer__ludex-wordmark {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--bone);
}

/* ===== 33. TOAST (single-element, JS .show toggle) ===== */
#toast, #toast-share {
  position: fixed;
  right: 24px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink-3);
  border: 1px solid var(--border-mid);
  border-left: 2px solid var(--hazard);
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--bone);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  max-width: 320px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(16px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  animation: none;
}
#toast { bottom: 24px; }
#toast-share { bottom: 70px; }
#toast.show, #toast-share.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ===== 34. COMMUNITY SECTION ===== */
.community-section { padding: 0; }

.community__container {
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.community__title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bone);
}

.community__subtitle {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--steel);
  margin-top: -16px;
}

.community__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-dim);
  border: 1px solid var(--border-dim);
  max-width: 380px;
}

.community__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  background: var(--ink-2);
}

.community__stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--hazard);
}

.community__stat-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--steel);
}

.community__members {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ============================================================
   MODAL DE ENCERRAMENTO / RESULTADO
   ============================================================ */
.result-form { padding-bottom: 8px; }
.result-players { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 20px; }

.result-player-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--ink-2, #111);
  border: 1px solid var(--border-dim, #2a2a2a);
}
.result-player-row__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--clr-surface-bright, #222);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.result-player-row__avatar img { width: 100%; height: 100%; object-fit: cover; }
.result-player-row__name {
  flex: 1; font-family: var(--font-ui, 'Space Grotesk', sans-serif);
  font-size: .85rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-player-row__options { display: flex; gap: 6px; flex-shrink: 0; }

.result-radio { display: flex; align-items: center; cursor: pointer; }
.result-radio input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.result-radio__label {
  padding: 4px 8px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: .55rem; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.result-radio__label--win  { border-color: var(--signal, #d9ff3e); color: var(--signal, #d9ff3e); }
.result-radio__label--draw { border-color: var(--steel, #888);     color: var(--steel, #888); }
.result-radio__label--loss { border-color: var(--hazard, #ff3b2f); color: var(--hazard, #ff3b2f); }
.result-radio input:checked + .result-radio__label--win  { background: var(--signal, #d9ff3e); color: #000; }
.result-radio input:checked + .result-radio__label--draw { background: var(--steel, #888);     color: #fff; }
.result-radio input:checked + .result-radio__label--loss { background: var(--hazard, #ff3b2f); color: #fff; }
.result-note {
  font-family: var(--font-mono, monospace); font-size: .7rem;
  color: var(--steel, #888); padding: 16px 0;
}

/* ============================================================
   FEED DE GUERRA
   ============================================================ */
.war-feed-section { margin-top: 48px; }
.war-feed__header {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-dim, #2a2a2a);
}
.war-feed__title {
  font-family: var(--font-display, 'Chakra Petch', sans-serif);
  font-size: 1.1rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; margin: 0;
}
.war-feed__count {
  font-family: var(--font-mono, monospace); font-size: .6rem;
  letter-spacing: .15em; color: var(--steel, #888);
}
.war-feed__empty {
  font-family: var(--font-mono, monospace); font-size: .7rem;
  color: var(--steel, #888); padding: 32px 0; text-align: center;
}
.war-feed__list { display: flex; flex-direction: column; gap: 8px; }

.feed-item {
  padding: 14px 16px;
  background: var(--ink-2, #111);
  border: 1px solid var(--border-dim, #2a2a2a);
  border-left: 3px solid var(--border-mid, #444);
  display: flex; flex-direction: column; gap: 10px;
}
.feed-item__meta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.feed-item__system {
  font-family: var(--font-display, 'Chakra Petch', sans-serif);
  font-size: .8rem; font-weight: 600; letter-spacing: .04em;
}
.feed-item__date {
  font-family: var(--font-mono, monospace); font-size: .58rem;
  letter-spacing: .1em; color: var(--steel, #888);
}
.feed-item__players { display: flex; flex-direction: column; gap: 6px; }

.feed-player {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-left: 2px solid transparent;
}
.feed-player--win  { border-left-color: var(--signal, #d9ff3e); }
.feed-player--loss { border-left-color: var(--hazard, #ff3b2f); }
.feed-player--draw { border-left-color: var(--steel, #888); }
.feed-player__avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--clr-surface-bright, #222);
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.feed-player__avatar img { width: 100%; height: 100%; object-fit: cover; }
.feed-player__name {
  flex: 1; font-family: var(--font-ui, 'Space Grotesk', sans-serif);
  font-size: .8rem; font-weight: 500;
}
.feed-player__badge {
  font-family: var(--font-mono, monospace); font-size: .55rem;
  letter-spacing: .12em; font-weight: 700;
}
.feed-player--win  .feed-player__badge { color: var(--signal, #d9ff3e); }
.feed-player--loss .feed-player__badge { color: var(--hazard, #ff3b2f); }
.feed-player--draw .feed-player__badge { color: var(--steel, #888); }


/* ============================================================
   MAP NEW ELEMENTS (PAREDES E ZONAS)
   ============================================================ */
.map__zones-layer {
  position: absolute;
  inset: 0;
  z-index: 1; /* Abaixo das mesas (que geralmente são z-index >= 10) */
  opacity: 0.15;
  filter: drop-shadow(0 0 1px var(--signal));
  pointer-events: none; /* Para não bloquear cliques se não for editar */
}
.admin-only .map__zones-layer {
  pointer-events: auto;
}
.map__walls-layer {
  position: absolute;
  inset: 0;
  z-index: 5; /* Acima das salas, abaixo das mesas (10) */
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
  pointer-events: none;
}
.admin-only .map__walls-layer {
  pointer-events: auto;
}

.map-wall {
  position: absolute;
  background: var(--bone); /* Branco/Off-white sólido */
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.2s;
  /* Sem box-shadow individual, o filtro na layer faz a união perfeita! */
}
/* Sem opacidade para garantir união (seamless) sem manchas */
.map-wall.erase-mode:hover { background: var(--hazard, #ff3b2f); }

.map-zone {
  position: absolute;
  /* Sem bordas, para se unirem perfeitamente! */
  background: var(--signal, #d9ff3e);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto; /* Pode ser clicada na layer */
  transition: opacity 0.2s;
}
.map-zone__label {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--signal, #d9ff3e); /* Fica brilhante */
  text-transform: uppercase;
  pointer-events: none;
  background: var(--ink-1);
  padding: 4px 8px;
  border: 1px solid var(--signal);
  border-radius: 4px;
  opacity: 3; /* Forçar alta opacidade para compensar a layer (1/0.15 ~= 6.6) */
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0,0,0,1);
}
.map-zone.editing { opacity: 0.8; }
.map-zone.erase-mode:hover { background: var(--hazard, #ff3b2f); }

/* ===== FEEDBACK WIDGET ===== */
.feedback-widget {
    position: fixed;
    bottom: -260px;
    right: 24px;
    width: 280px;
    background: var(--ink-2, #111214);
    border: 1px solid var(--ink-4, #2a2c31);
    border-top: 2px solid var(--signal, #d9ff3e);
    padding: 16px;
    z-index: 9000;
    transition: bottom 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.feedback-widget.active { bottom: 24px; }

.feedback-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.feedback-widget__label {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--signal, #d9ff3e);
}
.feedback-widget__skip {
    background: none;
    border: none;
    color: var(--ink-6, #6b7280);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    transition: color 0.15s;
}
.feedback-widget__skip:hover { color: var(--text-primary, #fff); }

.feedback-widget__question {
    font-family: var(--font-ui, sans-serif);
    font-size: 0.85rem;
    color: var(--text-primary, #fff);
    margin: 0;
}
.feedback-widget__thumbs {
    display: flex;
    gap: 8px;
}
.feedback-widget__thumb {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--ink-3, #1a1c20);
    border: 1px solid var(--ink-4, #2a2c31);
    color: var(--text-secondary, #9ca3af);
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.feedback-widget__thumb--up:hover {
    background: color-mix(in srgb, var(--signal, #d9ff3e) 12%, transparent);
    border-color: var(--signal, #d9ff3e);
    color: var(--signal, #d9ff3e);
}
.feedback-widget__thumb--down:hover {
    background: color-mix(in srgb, var(--hazard, #ff3b2f) 12%, transparent);
    border-color: var(--hazard, #ff3b2f);
    color: var(--hazard, #ff3b2f);
}
.feedback-widget__comment {
    background: var(--ink-3, #1a1c20);
    border: 1px solid var(--ink-4, #2a2c31);
    color: var(--text-primary, #fff);
    font-family: var(--font-ui, sans-serif);
    font-size: 0.8rem;
    padding: 8px 10px;
    resize: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.feedback-widget__comment:focus {
    outline: none;
    border-color: var(--ink-6, #6b7280);
}
.feedback-widget__comment::placeholder { color: var(--ink-6, #6b7280); }

@media (max-width: 480px) {
    .feedback-widget {
        right: 12px;
        left: 12px;
        width: auto;
    }
}
