/* ==========================================================================
   RUMMIKUB TRACKER - Styles
   ==========================================================================
   Table of Contents:
   1. Theme Variables
   2. Reset & Base
   3. Layout
   4. Header
   5. Cards
   6. Inputs & Forms
   7. Buttons
   8. Scoreboard
   9. Modals
   10. Round Entry & Tile Picker
   11. History
   12. Winner Celebration
   13. Chart
   14. Archive
   15. Settings
   16. Custom Dialogs & Toasts
   17. Empty States
   18. Animations
   19. Accessibility & Utility
   ========================================================================== */

/* --- 1. Theme Variables --- */

[data-theme="dark"], :root {
  --bg: #121212;
  --bg-elevated: #1E1E1E;
  --bg-modal: #242424;
  --bg-input: #2C2C2C;
  --primary: #4A90E2;
  --primary-dim: #357ABD;
  --primary-alpha: rgba(74, 144, 226, 0.15);
  --accent: #FFD700;
  --accent-alpha: rgba(255, 215, 0, 0.15);
  --danger: #CF6679;
  --danger-alpha: rgba(207, 102, 121, 0.2);
  --success: #2ecc71;
  --success-alpha: rgba(46, 204, 113, 0.2);
  --text: #FFFFFF;
  --text-sec: #B0B3B8;
  --text-muted: #666;
  --border: #333333;
  --shadow: rgba(0, 0, 0, 0.3);
  --overlay: rgba(0, 0, 0, 0.8);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="light"] {
  --bg: #F5F5F5;
  --bg-elevated: #FFFFFF;
  --bg-modal: #FFFFFF;
  --bg-input: #F0F0F0;
  --primary: #3B7DD8;
  --primary-dim: #2E6ABD;
  --primary-alpha: rgba(59, 125, 216, 0.1);
  --accent: #D4A800;
  --accent-alpha: rgba(212, 168, 0, 0.12);
  --danger: #D32F2F;
  --danger-alpha: rgba(211, 47, 47, 0.1);
  --success: #27ae60;
  --success-alpha: rgba(39, 174, 96, 0.1);
  --text: #1A1A1A;
  --text-sec: #666666;
  --text-muted: #999;
  --border: #E0E0E0;
  --shadow: rgba(0, 0, 0, 0.08);
  --overlay: rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --bg: #F5F5F5;
    --bg-elevated: #FFFFFF;
    --bg-modal: #FFFFFF;
    --bg-input: #F0F0F0;
    --primary: #3B7DD8;
    --primary-dim: #2E6ABD;
    --primary-alpha: rgba(59, 125, 216, 0.1);
    --accent: #D4A800;
    --accent-alpha: rgba(212, 168, 0, 0.12);
    --danger: #D32F2F;
    --danger-alpha: rgba(211, 47, 47, 0.1);
    --success: #27ae60;
    --success-alpha: rgba(39, 174, 96, 0.1);
    --text: #1A1A1A;
    --text-sec: #666666;
    --text-muted: #999;
    --border: #E0E0E0;
    --shadow: rgba(0, 0, 0, 0.08);
    --overlay: rgba(0, 0, 0, 0.5);
  }
}

/* --- 2. Reset & Base --- */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", "Helvetica Neue", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- 3. Layout --- */

#main-container {
  flex: 1;
  overflow-y: auto;
  position: relative;
  padding-bottom: calc(80px + var(--safe-bottom));
}

.view {
  display: none;
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
}

/* --- 4. Header --- */

.app-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 50;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#header-title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--primary);
  padding: 8px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.icon-btn:hover {
  background: var(--primary-alpha);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

/* --- 5. Cards --- */

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px var(--shadow);
}

.card h2 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: var(--text);
}

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

.card-header h2 {
  margin-bottom: 0;
}

/* --- 6. Inputs & Forms --- */

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 12px;
  color: var(--text-sec);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: var(--primary);
}

.segmented-control {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.segment {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-sec);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.segment.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 1px 4px var(--shadow);
}

.helper-text {
  font-size: 12px;
  color: var(--text-sec);
  margin-top: 8px;
  line-height: 1.4;
}

/* Player Setup */

.player-setup-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.player-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.remove-player {
  color: var(--danger);
  background: none;
  border: none;
  font-size: 22px;
  padding: 0 8px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- 7. Buttons --- */

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
  text-align: center;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary:active {
  background: var(--primary-dim);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--primary);
}

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

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-xs);
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  background: var(--primary-alpha);
  color: var(--text-sec);
}

.btn-large {
  font-size: 16px;
  padding: 14px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  padding: 8px;
  cursor: pointer;
}

.sticky-bottom {
  margin-top: 16px;
}

/* --- 8. Scoreboard --- */

.stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 16px 0;
  gap: 8px;
}

.stat {
  text-align: center;
}

.stat .label {
  display: block;
  font-size: 10px;
  color: var(--text-sec);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.stat .value {
  font-size: 18px;
  font-weight: 700;
}

.stats-bar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.leaderboard-grid.grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.score-card {
  background: var(--bg-elevated);
  padding: 16px 12px;
  border-radius: var(--radius);
  text-align: center;
  position: relative;
  border: 1px solid transparent;
  box-shadow: 0 1px 3px var(--shadow);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.score-card.leader {
  border-color: var(--accent);
  box-shadow: 0 2px 12px var(--accent-alpha);
}

.position-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.pos-1 {
  background: var(--accent);
  color: #000;
}

.pos-2 {
  background: #C0C0C0;
  color: #000;
}

.pos-3 {
  background: #CD7F32;
  color: #fff;
}

.pos-4 {
  background: var(--bg-input);
  color: var(--text-sec);
}

.player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin: 0 auto 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  transition: transform 0.2s;
}

.player-avatar.leader {
  transform: scale(1.1);
}

.player-name {
  font-size: 13px;
  color: var(--text-sec);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-score {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  position: relative;
}

.player-score.negative {
  color: var(--danger);
}

.player-mini-stats {
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* Score delta animation */

.score-delta {
  position: absolute;
  top: -4px;
  right: -8px;
  font-size: 14px;
  font-weight: 700;
  animation: floatUp 1.5s ease forwards;
  pointer-events: none;
  white-space: nowrap;
}

.delta-pos {
  color: var(--success);
}

.delta-neg {
  color: var(--danger);
}

/* FAB */

.fab-container {
  position: fixed;
  bottom: 16px;
  left: 0;
  right: 0;
  padding: 0 16px;
  padding-bottom: var(--safe-bottom);
  z-index: 10;
  max-width: 480px;
  margin: 0 auto;
}

.btn-fab {
  box-shadow: 0 4px 16px rgba(74, 144, 226, 0.4);
}

/* --- 9. Modals --- */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: var(--bg-modal);
  width: 100%;
  max-width: 600px;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-content.closing {
  animation: slideDown 0.25s ease forwards;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-sec);
  font-size: 28px;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-footer {
  margin-top: 16px;
}

.instruction-text {
  font-size: 13px;
  color: var(--text-sec);
  margin: 0 0 12px 0;
}

/* --- 10. Round Entry & Tile Picker --- */

.round-entry-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  background: var(--bg-input);
  padding: 12px;
  border-radius: var(--radius);
}

.round-entry-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.player-label {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.projected-score {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.winner-toggle {
  background: transparent;
  border: 1px solid var(--text-sec);
  color: var(--text-sec);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.winner-toggle.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.score-input {
  width: 80px !important;
  text-align: right;
  padding: 10px !important;
}

.manual-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.manual-input-row .score-input {
  flex: 1;
  width: auto !important;
}

/* Tile Picker */

.tile-picker {
  margin-top: 4px;
}

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

.tile-total-display {
  font-size: 13px;
  color: var(--text-sec);
}

.tile-total-display strong {
  color: var(--text);
  font-size: 15px;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 6px;
}

.tile {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, background 0.1s;
  -webkit-user-select: none;
  user-select: none;
}

.tile:active {
  transform: scale(0.92);
  background: var(--primary);
}

.tile-active {
  border-color: var(--primary);
  background: var(--primary-alpha);
}

.tile-joker {
  border-color: var(--accent);
  color: var(--accent);
}

.tile-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--primary);
  color: white;
  font-size: 9px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* --- 11. History --- */

.history-item {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.history-round-num {
  font-weight: 700;
  color: var(--text-sec);
  font-size: 13px;
  white-space: nowrap;
}

.history-badges {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
}

.score-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-pos {
  background: var(--success-alpha);
  color: var(--success);
}

.badge-neg {
  background: var(--danger-alpha);
  color: var(--danger);
}

.delete-round-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 20px;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.5;
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-round-btn:hover,
.delete-round-btn:active {
  opacity: 1;
}

/* --- 12. Winner Celebration --- */

.winner-modal {
  text-align: center;
  position: relative;
  overflow: hidden;
}

.winner-content {
  position: relative;
  z-index: 1;
}

.trophy {
  font-size: 56px;
  margin-bottom: 8px;
  animation: bounce 0.6s ease infinite alternate;
}

.winner-title {
  font-size: 24px;
  color: var(--accent);
  margin: 0 0 8px 0;
}

.winner-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.winner-score-display {
  font-size: 40px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 16px;
}

.final-scores {
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
  text-align: left;
}

.final-scores h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: var(--text-sec);
}

.final-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.final-score-row:last-child {
  border-bottom: none;
}

.final-score-row span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.final-score-value {
  font-weight: 700;
}

/* Game summary stats */

.game-summary-stats {
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}

.summary-stat {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.summary-label {
  color: var(--text-sec);
}

.summary-value {
  font-weight: 600;
}

.winner-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Confetti */

.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -10px;
  border-radius: 2px;
  animation: confettiFall 3s linear infinite;
}

.confetti:nth-child(1) { left: 10%; background: #f44336; animation-delay: 0s; }
.confetti:nth-child(2) { left: 25%; background: #e91e63; animation-delay: 0.2s; }
.confetti:nth-child(3) { left: 40%; background: #9c27b0; animation-delay: 0.4s; }
.confetti:nth-child(4) { left: 55%; background: #2196f3; animation-delay: 0.6s; }
.confetti:nth-child(5) { left: 70%; background: #4caf50; animation-delay: 0.8s; }
.confetti:nth-child(6) { left: 85%; background: #ffeb3b; animation-delay: 1s; }
.confetti:nth-child(7) { left: 15%; background: #ff9800; animation-delay: 1.2s; }
.confetti:nth-child(8) { left: 60%; background: #00bcd4; animation-delay: 1.4s; }

/* --- 13. Chart --- */

.chart-container {
  width: 100%;
  height: 280px;
  margin-top: 8px;
}

.chart-container canvas {
  width: 100%;
  height: 100%;
}

/* --- 14. Archive --- */

.archive-item {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

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

.archive-date {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.archive-players {
  font-size: 12px;
  color: var(--text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- 15. Settings --- */

.settings-group {
  margin-bottom: 20px;
}

.settings-group label {
  display: block;
  font-size: 12px;
  color: var(--text-sec);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* --- 16. Custom Dialogs & Toasts --- */

/* Custom Dialog */
#custom-dialog {
  z-index: 200;
  align-items: center;
}

#custom-dialog .modal-content {
  border-radius: var(--radius);
  max-width: 340px;
  text-align: center;
  padding: 24px;
  animation: scaleIn 0.2s ease;
}

.dialog-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.dialog-message {
  font-size: 14px;
  color: var(--text-sec);
  margin-bottom: 20px;
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  gap: 8px;
}

.dialog-actions .btn {
  flex: 1;
}

/* Toast */

#toast-container {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px var(--shadow);
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: auto;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: var(--success);
}

/* --- 17. Empty States --- */

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-sec);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* --- 18. Animations --- */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-24px); }
}

@keyframes staggerIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.stagger-in {
  animation: staggerIn 0.25s ease both;
}

/* --- 19. Accessibility & Utility --- */

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
  outline: none;
}

/* Scrollbar theming */

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
