/* Transport For Flamingo – shared UI theme */
:root {
  --tff-bg: #111827;
  --tff-surface: #1f2937;
  --tff-border: #374151;
  --tff-accent: #3b82f6;
  --tff-accent-hover: #60a5fa;
  --tff-accent-glow: rgba(59, 130, 246, 0.35);
  --tff-cyan: #22d3ee;
  --tff-text: #f9fafb;
  --tff-muted: #9ca3af;
}

html {
  scroll-behavior: smooth;
}

body.tff-body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--tff-bg);
  color: var(--tff-text);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tff-bg-pattern {
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 98px,
    rgba(148, 163, 184, 0.04) 98px,
    rgba(148, 163, 184, 0.04) 100px
  );
}

.tff-gradient-text {
  background-image: linear-gradient(to right, #60a5fa, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tff-card {
  background-color: var(--tff-surface);
  border: 1px solid var(--tff-border);
  border-radius: 0.85rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.tff-card:hover {
  transform: translateY(-3px);
  border-color: var(--tff-accent);
  box-shadow: 0 10px 30px -15px var(--tff-accent-glow);
}

.tff-card-static {
  background-color: var(--tff-surface);
  border: 1px solid var(--tff-border);
  border-radius: 0.85rem;
}

.tff-card-accent-left {
  border-left: 4px solid var(--tff-accent);
}

.tff-glass {
  background: rgba(31, 41, 55, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.tff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  min-height: 44px;
}

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

.tff-btn-primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.tff-btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.tff-btn-discord {
  background: linear-gradient(135deg, #5865f2, #4752c4);
  color: #fff;
}

.tff-btn-discord:hover {
  box-shadow: 0 10px 25px rgba(88, 101, 242, 0.4);
}

.tff-btn-ghost {
  background: rgba(55, 65, 81, 0.6);
  color: #e5e7eb;
  border: 1px solid var(--tff-border);
}

.tff-btn-ghost:hover {
  border-color: var(--tff-accent);
  color: #fff;
}

.tff-btn-announce {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid var(--tff-border);
  color: #e5e7eb;
  min-height: 48px;
}

.tff-btn-announce:hover:not(:disabled) {
  border-color: var(--tff-accent);
  background: rgba(59, 130, 246, 0.12);
}

.tff-btn-announce:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tff-btn-announce.is-playing {
  border-color: #22d3ee;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.25);
}

/* PIS player */
.pis-seq-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  min-height: 2.75rem;
  max-height: 11rem;
  overflow-y: auto;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: rgba(17, 24, 39, 0.45);
  border: 1px solid var(--tff-border);
}

.pis-seq-empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--tff-muted);
}

.pis-seq-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.45rem 0.3rem 0.55rem;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  font-size: 0.75rem;
  color: #e5e7eb;
  position: relative;
  z-index: 1;
}

.pis-seq-chip button {
  pointer-events: auto;
  touch-action: manipulation;
}

.pis-seq-chip.is-playing {
  border-color: var(--tff-cyan);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.25);
}

.pis-seq-chip__n {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--tff-muted);
}

.pis-seq-chip__text {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pis-seq-chip__x {
  line-height: 1;
  padding: 0 0.15rem;
  color: #9ca3af;
  font-size: 1rem;
  background: none;
  border: none;
  cursor: pointer;
}

.pis-seq-chip__x:hover {
  color: #fff;
}

.pis-seq-chip__move {
  line-height: 1;
  padding: 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
}

.pis-seq-chip__move:hover:not(:disabled) {
  color: var(--tff-cyan);
}

.pis-seq-chip__move:disabled {
  opacity: 0.25;
  cursor: default;
}

.pis-saved-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pis-saved-empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--tff-muted);
}

.pis-saved-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(17, 24, 39, 0.45);
  border: 1px solid var(--tff-border);
}

.pis-saved-row__name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #f3f4f6;
}

.pis-saved-row__sub {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--tff-muted);
}

.pis-saved-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tff-sticky-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

.tff-nav-link {
  color: var(--tff-muted);
  font-size: 0.875rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.tff-nav-link:hover,
.tff-nav-link.is-active {
  color: #fff;
}

.tff-nav-link.is-active {
  color: #60a5fa;
}

.tff-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.tff-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tff-no-scrollbar::-webkit-scrollbar {
  display: none;
}

.tff-no-scrollbar {
  scrollbar-width: none;
}

.tff-status-dot {
  animation: tff-pulse-dot 1.6s ease-in-out infinite;
}

@keyframes tff-pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.8);
  }
}

@keyframes tff-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.tff-float {
  animation: tff-float 3s ease-in-out infinite;
}

.tff-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 100;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem 1.25rem;
  background: var(--tff-surface);
  border: 1px solid var(--tff-accent);
  border-radius: 0.75rem;
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
}

.tff-toast.is-shown {
  transform: translateX(-50%) translateY(0);
}

/* Dashboard-specific (kept for compatibility) */
.glass-card,
.stat-card {
  background: rgba(31, 41, 55, 0.9);
  border: 1px solid var(--tff-border);
  border-left: 4px solid var(--tff-accent);
  border-radius: 0.85rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.glass-card:hover,
.stat-card:hover {
  transform: translateY(-2px);
  border-left-color: var(--tff-accent-hover);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.rank-icon {
  display: inline-block;
  vertical-align: middle;
  height: 1.3em;
  width: auto;
}

.rank-badge {
  display: inline-block;
  vertical-align: middle;
  background-color: #fbbf24;
  color: white;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.9em;
  margin-right: 4px;
}

.fade-in {
  animation: tff-fade-in 0.5s ease forwards;
}

/* Dashboard forms & panels */
.tff-input,
body.tff-dashboard input[type="text"],
body.tff-dashboard input[type="number"],
body.tff-dashboard textarea,
body.tff-dashboard select {
  background-color: #1f2937;
  border: 1px solid var(--tff-border);
  border-radius: 0.5rem;
  color: #f9fafb;
}

.tff-input:focus,
body.tff-dashboard input:focus,
body.tff-dashboard textarea:focus,
body.tff-dashboard select:focus {
  outline: none;
  border-color: var(--tff-accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.tff-panel {
  background: rgba(31, 41, 55, 0.65);
  border: 1px solid var(--tff-border);
  border-radius: 0.75rem;
}

.tff-format-btn {
  padding: 0.35rem 0.5rem;
  background: #374151;
  border: 1px solid var(--tff-border);
  border-radius: 0.375rem;
  color: #fff;
  font-size: 0.75rem;
  min-height: 36px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tff-format-btn:hover {
  background: #4b5563;
  border-color: var(--tff-accent);
}

body.tff-dashboard .glass-card,
body.tff-dashboard .stat-card {
  border-radius: 0.85rem;
}

body.tff-dashboard h1,
body.tff-dashboard h2,
body.tff-dashboard h3 {
  letter-spacing: -0.01em;
  font-weight: 700;
  color: #f9fafb;
}

@keyframes tff-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
