
:root {
  --bg-dark: #050811;
  --card-bg: rgba(13, 20, 36, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-active: rgba(255, 154, 24, 0.5);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-orange: #ff9a18;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --accent-cyan: #38bdf8;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
}

.bg-glow-1 {
  top: -100px;
  right: -100px;
  background: #ff9a18;
}

.bg-glow-2 {
  bottom: -100px;
  left: -100px;
  background: #e93627;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

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

.brand-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255, 154, 24, 0.12);
  border: 1px solid rgba(255, 154, 24, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(233, 54, 39, 0.15);
}

.brand-text h1 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.brand-text h1 span {
  color: var(--accent-orange);
}

.brand-text p {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #10b981;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

/* State Cards */
.state-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 48px 24px;
  text-align: center;
  margin: 40px 0;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 154, 24, 0.2);
  border-top-color: var(--accent-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 18px;
}

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

.state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.state-card h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
  color: #f1f5f9;
}

.state-card p {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 500px;
  margin: 0 auto 24px;
}

.instruction-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 20px;
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
}

.instruction-box h4 {
  font-size: 14px;
  color: var(--accent-orange);
  margin-bottom: 10px;
}

.instruction-box ol {
  padding-left: 20px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.8;
}

/* Player Card */
.player-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.player-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff9a18, #e93627);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 14px rgba(233, 54, 39, 0.3);
}

.player-sub {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.player-name {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.player-dbid {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.player-dbid code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.limit-status {
  min-width: 260px;
  flex: 1;
  max-width: 380px;
}

.limit-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.limit-title {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
}

.limit-counter {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 14px;
  color: var(--accent-orange);
  background: rgba(255, 154, 24, 0.15);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 154, 24, 0.3);
}

.limit-counter.full {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff9a18, #10b981);
  border-radius: 4px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.limit-hint {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Category Filter Tabs */
.filters-wrap {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

.filter-btn.active {
  background: rgba(255, 154, 24, 0.15);
  border-color: rgba(255, 154, 24, 0.4);
  color: var(--accent-orange);
}

/* Roles Grid */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.role-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.role-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.role-card.selected {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.05);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.role-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.role-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.ts3-role-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -webkit-optimize-contrast;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.emoji-fallback {
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.role-card.selected .role-icon-box {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

.role-meta {
  flex: 1;
}

.role-name {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.role-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.role-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.role-cat-badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 6px;
}

.role-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.role-toggle-btn:hover {
  background: rgba(255, 154, 24, 0.2);
  border-color: rgba(255, 154, 24, 0.4);
  color: var(--accent-orange);
}

.role-card.selected .role-toggle-btn {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.role-card.selected .role-toggle-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: slideIn 0.3s ease;
}

.toast.success { border-color: rgba(16, 185, 129, 0.4); color: #10b981; }
.toast.error { border-color: rgba(239, 68, 68, 0.4); color: #f87171; }
.toast.warning { border-color: rgba(255, 154, 24, 0.4); color: #ff9a18; }

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

/* Footer */
.footer {
  text-align: center;
  color: #64748b;
  font-size: 12px;
  padding: 24px 0;
  border-top: 1px solid var(--card-border);
}

.hidden {
  display: none !important;
}
