:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --border: #2d3f56;
  --text: #e8eef5;
  --muted: #8fa3b8;
  --accent: #3dd68c;
  --accent-dim: #2a9d62;
  --warn: #ffb020;
  --danger: #ff6b6b;
  --card-w: #f4f1ea;
  --card-text: #1a1a1a;
  /* Cartas de voto e distribuição revelada — mesma proporção */
  --poker-card-w: 52px;
  --poker-card-h: 72px;
  --poker-card-radius: 8px;
  --poker-card-font-size: 1.15rem;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --btn-primary-text: #073c2a;
  --btn-secondary-bg: #243044;
  --btn-secondary-hover-bg: #2c3d52;
  --btn-secondary-text: #e8eef5;
  font-family: "Segoe UI", system-ui, sans-serif;
}

body[data-theme="light"] {
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface2: #f6f8fb;
  --border: #cfd9e6;
  --text: #1f2b3d;
  --muted: #5c6e84;
  --accent: #0f9d6a;
  --accent-dim: #0a7650;
  --warn: #b57400;
  --danger: #b23838;
  --shadow: 0 8px 28px rgba(16, 43, 66, 0.12);
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: #ffffff;
  --btn-secondary-hover-bg: #edf2f8;
  --btn-secondary-text: #1f2b3d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1e3a4a 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.45;
}

body[data-theme="light"] {
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #d8e5f2 0%, var(--bg) 55%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(26, 35, 50, 0.75);
  backdrop-filter: blur(4px);
}

body[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.8);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

a.topbar-title {
  color: inherit;
  text-decoration: none;
}

a.topbar-title:hover {
  opacity: 0.88;
}

a.topbar-title:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.topbar-trailing {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  flex-shrink: 0;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  height: 2.1rem;
  padding: 0 0.75rem;
  border-radius: 7px;
  color: var(--text);
  border: 1px solid transparent;
}

.topbar-link-active {
  background: var(--surface2);
  border-color: var(--border);
}

.topbar-link:hover {
  background: var(--surface2);
  border-color: var(--border);
  text-decoration: none;
}

.topbar-theme-btn {
  height: 2.1rem;
  width: 2.1rem;
  padding: 0;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.topbar-theme-btn svg {
  display: block;
}

.topbar-theme-btn:hover {
  background: var(--btn-secondary-hover-bg);
}

.topbar-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 0.23rem;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}

.topbar-menu-toggle span {
  display: block;
  width: 1.05rem;
  height: 2px;
  margin: 0 auto;
  border-radius: 99px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

@media (max-width: 760px) {
  .topbar-inner {
    position: relative;
  }

  .topbar-trailing {
    gap: 0.45rem;
  }

  .topbar-trailing .topbar-theme-btn {
    width: 2.2rem;
    height: 2.2rem;
  }

  .topbar-menu-toggle {
    display: inline-flex;
  }

  .topbar-nav {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.45rem);
    min-width: min(16.5rem, calc(100vw - 2rem));
    padding: 0.6rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    z-index: 220;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }

  .topbar-link {
    width: 100%;
    height: 2.35rem;
    justify-content: flex-start;
  }

  body.topbar-menu-open .topbar-nav {
    display: flex;
  }

  body.topbar-menu-open .topbar-menu-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  body.topbar-menu-open .topbar-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.topbar-menu-open .topbar-menu-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}

.container-home {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 3rem);
}

.sub-home {
  margin-bottom: 1.5rem;
}

.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  flex: 1;
  align-content: start;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .home-actions {
    grid-template-columns: 1fr;
  }
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-height: 160px;
  padding: 1.5rem 1.35rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.action-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.action-card:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 214, 140, 0.35);
}

.action-card-primary:hover {
  border-color: var(--accent);
}

.action-card-secondary:hover {
  border-color: var(--muted);
}

.action-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 1rem;
  background: var(--surface2);
  color: var(--accent);
}

.action-card-secondary .action-card-icon {
  color: var(--muted);
}

.action-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.action-card-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  flex: 1;
  align-content: start;
  margin-bottom: 1.5rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.tool-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  font-size: 1.35rem;
  margin-bottom: 0.85rem;
  background: var(--surface2);
}

.tool-card-icon-poker {
  color: var(--accent);
}

.tool-card-icon-pomo {
  color: var(--warn);
  font-weight: 600;
}

.tool-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tool-card-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 1rem;
  flex: 1;
}

.tool-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.btn-compact {
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
  min-height: 2.25rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.tool-card-footer {
  font-size: 0.85rem;
  margin: 0;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

.tool-card-footer a {
  color: var(--muted);
}

.tool-card-footer a:hover {
  color: var(--accent);
}

.modal-wide {
  max-width: 480px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.sub {
  color: var(--muted);
  margin-bottom: 2rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 600;
}

.mod-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 1rem;
}

.mod-panel-head-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  flex: 1 1 auto;
  min-width: min(100%, 12rem);
}

.mod-panel-head-title h2 {
  margin: 0;
}

.mod-panel-head-tools {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.mod-head-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  line-height: 0;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.mod-head-icon-btn:hover {
  color: var(--accent);
  border-color: rgba(61, 214, 140, 0.55);
  background: rgba(61, 214, 140, 0.08);
}

body[data-theme="light"] .mod-head-icon-btn:hover {
  border-color: rgba(15, 157, 106, 0.45);
  background: rgba(15, 157, 106, 0.08);
}

.mod-head-icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mod-export-details {
  position: relative;
  flex-shrink: 0;
}

.mod-export-details[data-export-locked] {
  pointer-events: none;
  opacity: 0.5;
}

.mod-export-details[data-export-locked] .mod-export-summary {
  cursor: not-allowed;
}

.mod-export-details[data-export-locked] .mod-export-summary:hover {
  color: var(--muted);
  border-color: var(--border);
  background: var(--surface2);
}

body[data-theme="light"] .mod-export-details[data-export-locked] .mod-export-summary:hover {
  border-color: var(--border);
  background: var(--surface2);
}

.mod-export-summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  line-height: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.mod-export-summary:hover {
  color: var(--accent);
  border-color: rgba(61, 214, 140, 0.55);
  background: rgba(61, 214, 140, 0.08);
}

body[data-theme="light"] .mod-export-summary:hover {
  border-color: rgba(15, 157, 106, 0.45);
  background: rgba(15, 157, 106, 0.08);
}

.mod-export-summary::-webkit-details-marker {
  display: none;
}

.mod-export-summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mod-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 9.5rem;
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mod-export-menu .btn {
  width: 100%;
  justify-content: center;
}

#mod-panel .stories-panel {
  margin-top: 0;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 1rem;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 214, 140, 0.25);
}

.row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.row > * {
  flex: 1;
  min-width: 160px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(165deg, var(--accent), var(--accent-dim));
  color: var(--btn-primary-text);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover-bg);
  color: var(--btn-secondary-text);
}

.btn-danger {
  background: #5c2a2a;
  color: #ffc9c9;
  border: 1px solid #8a3a3a;
}

.btn-danger:hover {
  background: #7a3535;
}

body[data-theme="light"] .btn-danger {
  background: #f8e7e7;
  color: #8d2f2f;
  border-color: #dfb5b5;
}

body[data-theme="light"] .btn-danger:hover {
  background: #f2d9d9;
}

.btn-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.msg {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

.msg-error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ffb4b4;
}

body[data-theme="light"] .msg-error {
  background: rgba(178, 56, 56, 0.1);
  border-color: rgba(178, 56, 56, 0.28);
  color: #7b2525;
}

.msg-ok {
  background: rgba(61, 214, 140, 0.1);
  border: 1px solid rgba(61, 214, 140, 0.35);
  color: var(--accent);
}

/* Toast (feedback tipo toastr — sala, copiar link) */
.toast-host {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: auto;
  z-index: 10050;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  pointer-events: none;
  width: 100%;
  box-sizing: border-box;
  padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
}

.toast {
  pointer-events: none;
  max-width: min(calc(100vw - 1.5rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)), 22rem);
  margin: 0;
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  transform: translateY(-0.65rem) scale(0.98);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.toast.toast--success {
  color: #f0fff8;
  background: #1a7a52;
  border: 1px solid #146b47;
  border-top: 4px solid var(--accent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
}

body[data-theme="light"] .toast.toast--success {
  color: #ffffff;
  background: var(--accent);
  border: 1px solid #0c7d55;
  border-top: 4px solid #0a6848;
  box-shadow: 0 4px 18px rgba(16, 43, 66, 0.18);
}

.toast.toast--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
    transform: none;
  }

  .toast.toast--visible {
    transform: none;
  }
}

/* Sala */
.room-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.room-header-top {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  min-width: 0;
  width: 100%;
}

.room-title-inline {
  margin: 0;
  line-height: 1.2;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(1.05rem, 4.2vw, 1.65rem);
}

.room-header-actions .room-id-chip {
  margin-top: 0;
}

.room-id-chip--header-actions {
  max-width: min(100%, 18rem);
}

.room-id-chip {
  display: inline-flex;
  align-items: stretch;
  max-width: min(100%, 22rem);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

body[data-theme="light"] .room-id-chip {
  box-shadow: 0 1px 2px rgba(16, 43, 66, 0.08);
}

.room-id-chip-main {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.65rem 0.3rem 0.75rem;
  min-width: 0;
}

.room-id-chip-label {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}

.room-id-chip-value {
  display: block;
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-id-chip .btn-copy-link-in-chip {
  flex-shrink: 0;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.55rem;
  margin: 0;
  border: none;
  border-radius: 0;
  border-left: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .room-id-chip .btn-copy-link-in-chip {
  background: rgba(0, 0, 0, 0.04);
}

.room-id-chip .btn-copy-link-in-chip:hover {
  border-left-color: var(--border);
  background: rgba(61, 214, 140, 0.14);
  color: var(--accent);
}

body[data-theme="light"] .room-id-chip .btn-copy-link-in-chip:hover {
  background: rgba(15, 157, 106, 0.12);
}

.room-id-chip .btn-copy-link-in-chip:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(61, 214, 140, 0.45);
  position: relative;
  z-index: 1;
}

body[data-theme="light"] .room-id-chip .btn-copy-link-in-chip:focus {
  box-shadow: inset 0 0 0 2px rgba(15, 157, 106, 0.4);
}

.room-header-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

@media (max-width: 720px) {
  .room-header-top {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .room-header-top::-webkit-scrollbar {
    display: none;
  }

  .room-id-chip--header-actions {
    max-width: min(9.25rem, 36vw);
  }

  .room-header-actions .badge-mod {
    padding: 0.1rem 0.32rem;
    font-size: 0.6rem;
    letter-spacing: 0.03em;
  }

  .room-id-chip-main {
    padding: 0.22rem 0.4rem 0.22rem 0.5rem;
    gap: 0.3rem;
  }

  .room-id-chip-value {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }

  .room-id-chip .btn-copy-link-in-chip {
    padding: 0.25rem 0.38rem;
  }

  .room-id-chip .btn-copy-link-in-chip svg {
    width: 16px;
    height: 16px;
  }

  .mod-head-icon-btn {
    padding: 0.32rem;
  }

  .mod-head-icon-btn svg {
    width: 18px;
    height: 18px;
  }
}

.room-setting-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0.85rem 0;
  line-height: 1.45;
}

.room-setting-toggle input[type="checkbox"] {
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.panel-head-with-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 1rem;
}

.panel-head-with-meta h2 {
  margin: 0;
}

.room-timer-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  max-width: min(100%, 28rem);
}

.room-timer-bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: stretch;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

body[data-theme="light"] .room-timer-bar {
  box-shadow: 0 1px 2px rgba(16, 43, 66, 0.08);
}

.room-timer-bar__segment {
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
}

.room-timer-bar__segment:last-child {
  border-right: none;
}

.room-timer-bar__stepper {
  flex-shrink: 0;
  padding: 0;
}

.room-timer-bar__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.35rem 0.45rem;
  margin: 0;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

body[data-theme="light"] .room-timer-bar__step {
  background: rgba(0, 0, 0, 0.04);
}

.room-timer-bar__step:hover:not(:disabled) {
  background: rgba(61, 214, 140, 0.14);
  color: var(--accent);
}

body[data-theme="light"] .room-timer-bar__step:hover:not(:disabled) {
  background: rgba(15, 157, 106, 0.12);
}

.room-timer-bar__step:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.room-timer-bar__preset {
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.room-timer-bar__preset #timer-preset-display {
  color: var(--text);
  font-weight: 700;
}

.room-timer-bar__countdown {
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
}

.room-timer-bar__action {
  flex-shrink: 0;
  padding: 0;
}

.room-timer-bar__action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 2.5rem;
  padding: 0.35rem 0.55rem;
  margin: 0;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

body[data-theme="light"] .room-timer-bar__action-btn {
  background: rgba(0, 0, 0, 0.04);
}

.room-timer-bar__action-btn:hover:not(:disabled) {
  background: rgba(61, 214, 140, 0.14);
  color: var(--accent);
}

body[data-theme="light"] .room-timer-bar__action-btn:hover:not(:disabled) {
  background: rgba(15, 157, 106, 0.12);
}

.room-timer-bar__action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.room-timer-bar__action-btn .room-timer-action__play {
  display: inline-flex;
  color: var(--accent);
}

.room-timer-bar__action-btn .room-timer-action__clear {
  display: inline-flex;
}

@media (max-width: 540px) {
  .room-timer-cluster {
    max-width: 100%;
    justify-content: flex-start;
  }

  .room-timer-bar {
    width: 100%;
    justify-content: stretch;
  }

  .room-timer-bar__countdown {
    flex: 1 1 auto;
    justify-content: center;
  }
}

.room-timer-icon {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  flex-shrink: 0;
  line-height: 0;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-mod {
  background: rgba(255, 176, 32, 0.2);
  color: var(--warn);
  border: 1px solid rgba(255, 176, 32, 0.4);
}

.share-url {
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--muted);
  margin-top: 0.35rem;
}

.share-url-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.btn-copy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-copy-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(61, 214, 140, 0.08);
}

.btn-copy-link:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(61, 214, 140, 0.35);
}

.grid-room {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.25rem;
}

.grid-room > .panel {
  min-width: 0;
}

@media (max-width: 900px) {
  .grid-room {
    grid-template-columns: 1fr;
  }
}

#voting-panel {
  margin-top: 1.25rem;
}

.panel h2.voting-panel-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 600;
}

.mod-round-actions {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.story-box {
  background: var(--surface2);
  border-radius: 10px;
  padding: 1rem;
  border: 1px solid var(--border);
}

.story-box h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.story-current-title-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0;
  margin: 0 0 0.35rem;
}

.story-current-title-row .story-current-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

.story-current-title-row .reveal-badge {
  flex-shrink: 0;
  margin: 0;
  margin-top: 0.1rem;
  align-self: flex-start;
}

.story-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.status-line {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.status-line strong {
  color: var(--accent);
}

.divergence-high {
  color: var(--warn);
  font-weight: 700;
}

.summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.reveal-results {
  margin-top: 1rem;
}

.reveal-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  border: 1px solid rgba(61, 214, 140, 0.45);
  background: rgba(61, 214, 140, 0.1);
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
}

body[data-theme="light"] .reveal-badge {
  border-color: rgba(15, 157, 106, 0.4);
  background: rgba(15, 157, 106, 0.1);
}

.reveal-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 720px) {
  .reveal-stats-grid {
    grid-template-columns: 1fr;
  }
}

.reveal-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.reveal-stat-card.reveal-stat-warn {
  border-color: rgba(255, 176, 32, 0.55);
  background: rgba(255, 176, 32, 0.06);
}

.reveal-stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.reveal-stat-value {
  font-size: 2.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.reveal-stat-card.reveal-stat-warn .reveal-stat-value {
  color: var(--warn);
}

.reveal-no-numeric {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Distribuição: mesma estrutura (cabeçalho + grelha), visual alinhado ao restante do painel */
.reveal-distrib {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.reveal-distrib-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.reveal-distrib-head-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: rgba(61, 214, 140, 0.12);
  color: var(--accent);
  flex-shrink: 0;
}

.reveal-distrib-head-icon svg {
  display: block;
}

.reveal-distrib-head-text strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.reveal-distrib-head-sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

/* Mesmo ritmo que .cards — cada célula com proporção de carta (.card-btn) */
.reveal-distrib-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-start;
}

.reveal-dist-item {
  flex-shrink: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  cursor: default;
  text-align: center;
}

.reveal-dist-item:disabled {
  opacity: 1;
  color: var(--card-text);
  -webkit-text-fill-color: var(--card-text);
}

/* Valor grande ao centro; “N voto(s)” por baixo, mais discreto (como carta de distribuição) */
.reveal-dist-value {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--poker-card-font-size);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--card-text);
}

.reveal-dist-meta {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 400;
  line-height: 1.15;
  text-align: center;
  color: #5c5852;
  max-width: 100%;
  padding: 0 3px 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.timer-display {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.timer-display--green {
  color: var(--accent);
}

.timer-display--warn {
  color: var(--warn);
}

.timer-display--danger {
  color: var(--danger);
}

/* Participantes */
.user-list {
  list-style: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.user-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  min-width: 0;
}

.user-list-name {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-list-trailing {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.user-list--mod .user-list-remove-slot {
  flex: 0 0 5.5rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.user-list:not(.user-list--mod) .user-list-remove-slot {
  display: none;
}

.user-list li:last-child {
  border-bottom: none;
}

.user-list-right {
  flex-shrink: 0;
}

.voted-pill {
  display: inline-block;
  white-space: nowrap;
  vertical-align: middle;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(61, 214, 140, 0.15);
  color: var(--accent);
  box-sizing: border-box;
}

.voted-pill.wait {
  background: rgba(143, 163, 184, 0.15);
  color: var(--muted);
}

@media (max-width: 900px) {
  .user-list--mod .user-list-remove-slot {
    flex: 0 0 4.75rem;
  }

  .user-list--mod .user-list-remove-slot .btn-small {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* Cartas */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

/* Mesma “face” e modelo de caixa que button (padding/appearance) nos dois sítios */
.card-btn,
.reveal-dist-item {
  width: var(--poker-card-w);
  height: var(--poker-card-h);
  box-sizing: border-box;
  border-radius: var(--poker-card-radius);
  border: 2px solid #c4b8a8;
  background: linear-gradient(165deg, var(--card-w), #e8e0d4);
  color: var(--card-text);
  box-shadow: 0 4px 0 #a89880;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
}

.card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--poker-card-font-size);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  touch-action: manipulation;
  user-select: none;
}

.card-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #a89880;
}

.card-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.card-btn.selected {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.45), 0 4px 0 #6a9a7a;
}

.card-btn.revealed-match {
  outline: 2px solid var(--accent);
}

/* Moderador */
.mod-group {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.mod-group-compact {
  margin-bottom: 0.65rem;
}

.mod-group-title {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.mod-group-main {
  border-color: rgba(61, 214, 140, 0.35);
}

.mod-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.mod-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.mod-actions-row .btn {
  flex: 1 1 min(10rem, 100%);
  width: auto;
}

/* Destaque da ação principal sem competir visualmente com o resto do painel */
.mod-group-main .mod-actions-row .btn-primary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  box-shadow: none;
}

.mod-group-main .mod-actions-row .btn-primary:hover {
  filter: none;
  background: rgba(61, 214, 140, 0.12);
}

body[data-theme="light"] .mod-group-main .mod-actions-row .btn-primary:hover {
  background: rgba(15, 157, 106, 0.1);
}

.mod-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: saturate(0.55);
  transform: none;
}

#form-new-story textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 4.5rem;
}

.story-list-mini {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.stories-panel {
  margin-top: 0.9rem;
}

.stories-list {
  display: grid;
  gap: 0.55rem;
}

.story-item {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  min-width: 0;
  min-height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  padding: 0.5rem 0.75rem;
}

/* Painel moderador: colunas partilhadas entre TODAS as linhas (subgrid); sem isto cada cartão calcula larguras à parte e "Votos" desalinha */
#mod-panel .story-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto max-content max-content;
  align-items: center;
  column-gap: 0.65rem;
}

@supports (grid-template-columns: subgrid) {
  #mod-panel .stories-list {
    grid-template-columns: minmax(0, 1fr) auto max-content max-content;
    column-gap: 0.65rem;
    row-gap: 0.55rem;
  }

  #mod-panel .story-item {
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    column-gap: inherit;
  }
}

#mod-panel .story-item > .story-item-text {
  grid-column: 1;
  min-width: 0;
}

#mod-panel .story-item > .story-item-status {
  grid-column: 2;
  justify-self: end;
  align-self: center;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  min-width: 0;
}

/* Início da coluna 3: mesmo espaçamento após estado (evita “buraco” quando a coluna é larga por outra linha) */
#mod-panel .story-item > .story-item-vote {
  grid-column: 3;
  justify-self: stretch;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-width: 0;
}

#mod-panel .story-item > .story-item-actions {
  grid-column: 4;
  justify-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  width: 100%;
  min-width: 0;
}

#mod-panel .story-item-actions .btn[data-action="activate-story"] {
  width: auto;
  min-width: 0;
  flex-shrink: 0;
}

#mod-panel .story-item-action-btn {
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
  line-height: 1.25;
  font-weight: 600;
}

#mod-panel .story-activate-btn--inert {
  visibility: hidden;
  pointer-events: none;
}

#mod-panel .story-item-action-dash {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.25;
  font-weight: 500;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.story-item.active {
  border-color: rgba(61, 214, 140, 0.35);
  box-shadow: 0 0 0 1px rgba(61, 214, 140, 0.15);
}

.story-item-text {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.story-item-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-item-sep {
  flex-shrink: 0;
  padding: 0 0.2rem;
  color: var(--muted);
  font-size: 0.85rem;
  opacity: 0.85;
  user-select: none;
}

.story-item-badges {
  display: flex;
  flex-flow: row nowrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.story-badge {
  font-size: 0.72rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.story-badge-active {
  color: var(--accent);
  border-color: rgba(61, 214, 140, 0.4);
  background: rgba(61, 214, 140, 0.12);
}

.story-badge-revealed {
  color: var(--warn);
  border-color: rgba(255, 176, 32, 0.4);
  background: rgba(255, 176, 32, 0.12);
}

.story-badge--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.18rem 0.42rem;
  line-height: 0;
  vertical-align: middle;
}

.story-badge__svg {
  display: block;
  flex-shrink: 0;
}

.story-badge-vote-num {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.story-item-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.25;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Histórias da sala: no telemóvel só o título (mais espaço para o nome) */
@media (max-width: 720px) {
  #mod-panel .story-item-sep,
  #mod-panel .story-item-desc {
    display: none !important;
  }

  #mod-panel .story-item-title {
    flex: 1 1 auto;
    max-width: 100%;
  }
}

.story-item-actions {
  flex-shrink: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Chat */
.chat-box {
  max-height: 220px;
  overflow-y: auto;
  font-size: 0.88rem;
  padding: 0.5rem 0;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--surface2);
}

.chat-box::-webkit-scrollbar {
  width: 8px;
}

.chat-box::-webkit-scrollbar-track {
  margin: 4px 0;
  background: var(--surface2);
  border-radius: 100px;
}

.chat-box::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 100px;
  border: 2px solid var(--surface2);
  background-clip: padding-box;
}

.chat-box::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.chat-box::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.chat-line {
  margin-bottom: 0.45rem;
  color: var(--muted);
}

.chat-line b {
  color: var(--text);
}

.chat-line.chat-line--system {
  color: var(--danger);
  font-size: 0.82rem;
  line-height: 1.35;
}

.chat-line-system-label {
  font-weight: 700;
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chat-input-row input {
  flex: 1;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
}

.advanced-options {
  margin-top: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  background: var(--surface2);
}

.advanced-options summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  user-select: none;
  list-style: none;
}

.advanced-options summary::-webkit-details-marker {
  display: none;
}

.advanced-options summary::marker {
  content: none;
}

/* Seta dentro da caixa (o marcador nativo com list-style: outside ficava sobre a borda). */
.advanced-options summary::before {
  content: "";
  flex-shrink: 0;
  width: 0.35rem;
  height: 0.35rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-top: -0.1em;
  opacity: 0.9;
}

.advanced-options[open] summary::before {
  transform: rotate(45deg);
  margin-top: 0.15em;
}

.advanced-options summary:hover {
  color: var(--text);
}

.advanced-options .advanced-body {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  margin: 0;
}

.checkbox-label input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

footer.footer-mini {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2rem;
}

.container-home .footer-mini {
  margin-top: auto;
  padding-top: 1.5rem;
}

/* Pomodoro */
.pomodoro-page {
  padding-bottom: 2rem;
}

.pomodoro-sub {
  margin-bottom: 1.25rem;
}

.pomodoro-panel-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pomodoro-panel {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.pomodoro-mode-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.35rem;
}

@media (max-width: 520px) {
  .pomodoro-mode-row {
    grid-template-columns: 1fr;
  }
}

.pomodoro-mode-btn {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.65rem 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.pomodoro-mode-btn-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  flex: 1 1 auto;
  min-width: 0;
  z-index: 1;
}

.pomodoro-mode-btn-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  margin: -0.15rem -0.05rem -0.15rem 0;
  color: var(--muted);
  opacity: 0.32;
  pointer-events: none;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.pomodoro-mode-btn-icon svg {
  width: 100%;
  height: 100%;
}

.pomodoro-mode-btn-active[data-mode="work"] .pomodoro-mode-btn-icon {
  color: var(--accent);
  opacity: 0.55;
}

.pomodoro-mode-btn-active[data-mode="short"] .pomodoro-mode-btn-icon {
  color: #6eb0d4;
  opacity: 0.55;
}

body[data-theme="light"] .pomodoro-mode-btn-active[data-mode="short"] .pomodoro-mode-btn-icon {
  color: #3d7ea6;
}

.pomodoro-mode-btn-active[data-mode="long"] .pomodoro-mode-btn-icon {
  color: var(--warn);
  opacity: 0.52;
}

.pomodoro-mode-btn:hover:not(:disabled) .pomodoro-mode-btn-icon {
  opacity: 0.42;
}

.pomodoro-mode-btn-active:hover:not(:disabled) .pomodoro-mode-btn-icon {
  opacity: 0.62;
}

.pomodoro-mode-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(61, 214, 140, 0.08);
}

body[data-theme="light"] .pomodoro-mode-btn:hover:not(:disabled) {
  background: rgba(15, 157, 106, 0.08);
}

.pomodoro-mode-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pomodoro-mode-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.pomodoro-mode-btn-active {
  border-color: rgba(61, 214, 140, 0.55);
  box-shadow: 0 0 0 1px rgba(61, 214, 140, 0.2);
}

body[data-theme="light"] .pomodoro-mode-btn-active {
  border-color: rgba(15, 157, 106, 0.5);
  box-shadow: 0 0 0 1px rgba(15, 157, 106, 0.15);
}

.pomodoro-mode-min {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
}

/* Configurações do Pomodoro: discreto fechado; um pouco mais definido ao abrir */
.pomodoro-settings.advanced-options {
  margin-top: 0.2rem;
  margin-bottom: 0.65rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
}

.pomodoro-settings.advanced-options[open] {
  border-color: var(--border);
  background: var(--surface2);
  padding: 0.45rem 0.65rem;
}

.pomodoro-settings.advanced-options summary {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--muted);
  opacity: 0.72;
  gap: 0.35rem;
}

.pomodoro-settings.advanced-options summary:hover {
  color: var(--text);
  opacity: 0.88;
}

.pomodoro-settings.advanced-options[open] summary {
  opacity: 0.95;
  color: var(--muted);
}

.pomodoro-settings.advanced-options summary::before {
  width: 0.28rem;
  height: 0.28rem;
  border-right-width: 1.5px;
  border-bottom-width: 1.5px;
  opacity: 0.55;
}

.pomodoro-settings.advanced-options .advanced-body {
  margin-top: 0.45rem;
  padding-top: 0.5rem;
}

.pomodoro-settings-body .pomodoro-duration-row {
  margin-bottom: 0;
}

.pomodoro-settings-hint {
  margin: 0 0 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted);
}

.pomodoro-settings-group-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.pomodoro-durations-note {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.pomodoro-visual-block {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 1.25rem;
  min-height: min(16rem, 88vw);
}

.pomodoro-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.pomodoro-ring-wrap {
  position: relative;
  width: min(16rem, 88vw);
  height: min(16rem, 88vw);
}

.pomodoro-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.pomodoro-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.pomodoro-ring-fg {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s linear, stroke 0.2s ease;
}

.pomodoro-ring-fg--work {
  stroke: var(--accent);
}

.pomodoro-ring-fg--short {
  stroke: var(--muted);
}

.pomodoro-ring-fg--long {
  stroke: var(--warn);
}

@media (prefers-reduced-motion: reduce) {
  .pomodoro-ring-fg {
    transition: stroke 0.2s ease;
  }
}

.pomodoro-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  pointer-events: none;
}

.pomodoro-phase-label {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.pomodoro-time-display {
  margin: 0;
  font-size: clamp(2.4rem, 10vw, 3.1rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

/* Modo foco: contador em destaque com fundo “espelhado” (blur do que está atrás) */
.pomodoro-focus-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  backdrop-filter: blur(22px) saturate(1.35);
}

body[data-theme="light"] .pomodoro-focus-backdrop {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

body.pomodoro-focus-immersive {
  overflow: hidden;
}

body.pomodoro-focus-immersive .pomodoro-visual {
  position: fixed;
  left: 50%;
  top: 42%;
  z-index: 130;
  /* Desktop: ~2× o tamanho anterior (20rem), limitado pela largura/altura úteis da tela */
  width: min(40rem, min(calc(92vw - 2rem), 86vh));
  margin: 0;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), top 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.35));
}

body[data-theme="light"].pomodoro-focus-immersive .pomodoro-visual {
  filter: drop-shadow(0 10px 32px rgba(16, 43, 66, 0.18));
}

body.pomodoro-focus-immersive .pomodoro-ring-wrap {
  width: min(40rem, min(calc(92vw - 2rem), 86vh));
  height: min(40rem, min(calc(92vw - 2rem), 86vh));
}

body.pomodoro-focus-immersive .pomodoro-time-display {
  font-size: clamp(2.85rem, min(14vw, 12vh), 6rem);
}

@media (max-width: 760px) {
  body.pomodoro-focus-immersive .pomodoro-visual {
    top: 44%;
    width: min(19rem, 84vw);
  }

  body.pomodoro-focus-immersive .pomodoro-ring-wrap {
    width: min(19rem, 84vw);
    height: min(19rem, 84vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.pomodoro-focus-immersive .pomodoro-visual {
    transition: none;
  }
}

.pomodoro-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.pomodoro-btn-main {
  min-width: 8.5rem;
}

.pomodoro-settings-chime {
  margin: 0.85rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.pomodoro-settings-reset {
  margin: 0.85rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.pomodoro-settings-reset .pomodoro-settings-group-label {
  margin-bottom: 0.45rem;
}

.pomodoro-settings-reset .btn {
  margin-top: 0.15rem;
}

.pomodoro-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 380px) {
  .pomodoro-stats {
    grid-template-columns: 1fr;
  }
}

.pomodoro-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 5.25rem;
  padding: 1rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  text-align: center;
}

body[data-theme="light"] .pomodoro-stat-card {
  box-shadow: 0 2px 10px rgba(16, 43, 66, 0.08);
}

.pomodoro-stat-value {
  display: block;
  margin: 0;
  font-size: 2.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.pomodoro-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.25;
  max-width: 11rem;
}

/* Pomodoro — gamificação */
.pomodoro-game {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.pomodoro-game-heading {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.pomodoro-game-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.85rem 1rem;
  align-items: stretch;
}

@media (max-width: 420px) {
  .pomodoro-game-row {
    grid-template-columns: 1fr;
  }
}

.pomodoro-game-level {
  min-width: 0;
}

.pomodoro-game-level-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.pomodoro-game-level-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.pomodoro-game-level-label strong {
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pomodoro-game-xp-total {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pomodoro-xp-track {
  height: 0.45rem;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.pomodoro-xp-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  .pomodoro-xp-fill {
    transition: none;
  }
}

.pomodoro-xp-caption {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.pomodoro-streak {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--warn);
  align-self: center;
}

.pomodoro-streak-icon {
  display: flex;
  line-height: 0;
  opacity: 0.95;
}

.pomodoro-streak-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.pomodoro-streak-num {
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text);
}

.pomodoro-streak-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 6.5rem;
  line-height: 1.2;
}

.pomodoro-highlights {
  margin-top: 0.75rem;
}

.pomodoro-highlights-label {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.pomodoro-highlight-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  min-height: 1.5rem;
}

.pomodoro-highlight-chip {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.28rem;
  padding: 0.22rem 0.5rem 0.22rem 0.38rem;
  border-radius: 999px;
  border: 1px solid rgba(61, 214, 140, 0.45);
  background: rgba(61, 214, 140, 0.11);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

body[data-theme="light"] .pomodoro-highlight-chip {
  border-color: rgba(15, 157, 106, 0.4);
  background: rgba(15, 157, 106, 0.09);
  box-shadow: 0 1px 2px rgba(16, 43, 66, 0.06);
}

.pomodoro-highlight-chip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.92;
}

.pomodoro-highlight-svg {
  display: block;
  width: 0.92rem;
  height: 0.92rem;
}

.pomodoro-highlight-chip-text {
  max-width: 8.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pomodoro-achievements.advanced-options {
  margin-top: 0.5rem;
  margin-bottom: 0;
  padding: 0.2rem 0.35rem;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
}

.pomodoro-achievements.advanced-options[open] {
  border-color: var(--border);
  background: var(--surface2);
  padding: 0.45rem 0.65rem;
}

.pomodoro-achievements.advanced-options summary {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--muted);
  opacity: 0.75;
  gap: 0.35rem;
}

.pomodoro-achievements.advanced-options summary:hover {
  color: var(--text);
  opacity: 0.9;
}

.pomodoro-achievements.advanced-options[open] summary {
  opacity: 0.95;
}

.pomodoro-achievements.advanced-options summary::before {
  width: 0.28rem;
  height: 0.28rem;
  border-right-width: 1.5px;
  border-bottom-width: 1.5px;
  opacity: 0.55;
}

.pomodoro-achievements-body {
  margin-top: 0.45rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.pomodoro-badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pomodoro-badge {
  padding: 0.5rem 0.55rem 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.pomodoro-badge-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.pomodoro-badge-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pomodoro-badge-illu {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.72rem;
  height: 1.72rem;
  color: var(--muted);
  opacity: 0.85;
}

.pomodoro-badge--unlocked .pomodoro-badge-illu {
  color: var(--accent);
  opacity: 0.95;
}

.pomodoro-badge-icon {
  display: block;
  width: 100%;
  height: 100%;
}

.pomodoro-badge--locked {
  opacity: 0.48;
  filter: grayscale(0.85);
}

.pomodoro-badge--unlocked {
  border-color: rgba(61, 214, 140, 0.4);
  background: rgba(61, 214, 140, 0.06);
}

body[data-theme="light"] .pomodoro-badge--unlocked {
  border-color: rgba(15, 157, 106, 0.35);
  background: rgba(15, 157, 106, 0.06);
}

.pomodoro-badge-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.pomodoro-badge--locked .pomodoro-badge-title {
  color: var(--muted);
}

.pomodoro-badge-desc {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}

.pomodoro-toast-host.toast-host {
  z-index: 10060;
}

.pomodoro-confetti-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 135;
}

.pomodoro-confetti-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
