/* Swarm Heroes Web Platform — Styles */

:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-tertiary: #0f3460;
  --accent: #e94560;
  --accent-hover: #ff6b6b;
  --text-primary: #eee;
  --text-secondary: #aaa;
  --success: #4ecdc4;
  --warning: #ffe66d;
  --danger: #ff4757;
  --border: #2a2a4a;
  --radius: 8px;
  --transition: 0.2s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ═══════════════════════════════════════════════════════════ */
/* ICONS                                                    */
/* ═══════════════════════════════════════════════════════════ */

.auth-icon {
  display: block;
  margin: 0 auto 12px;
  filter: drop-shadow(0 0 8px rgba(233, 69, 96, 0.4));
  transition: transform var(--transition);
}

.auth-icon:hover {
  transform: scale(1.05);
}

.header-icon {
  border-radius: 6px;
  vertical-align: middle;
  margin-right: 8px;
  filter: drop-shadow(0 0 4px rgba(233, 69, 96, 0.3));
}

/* ═══════════════════════════════════════════════════════════ */
/* SCREENS                                                  */
/* ═══════════════════════════════════════════════════════════ */

.screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.screen.hidden {
  display: none;
}

/* ═══════════════════════════════════════════════════════════ */
/* AUTH                                                     */
/* ═══════════════════════════════════════════════════════════ */

.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem;
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--accent), var(--warning));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.auth-tab {
  padding: 0.6rem 2rem;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
}

.auth-tab.active {
  background: var(--accent);
  color: white;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.auth-form.hidden {
  display: none;
}

.auth-form input {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2);
}

/* ═══════════════════════════════════════════════════════════ */
/* BUTTONS                                                  */
/* ═══════════════════════════════════════════════════════════ */

.btn-primary {
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--bg-tertiary);
}

.btn-logout {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-logout:hover {
  background: rgba(255, 71, 87, 0.1);
}

.btn-release-log {
  font-size: 1rem;
  padding: 0.3rem 0.6rem;
}

.btn-release-log:hover {
  background: rgba(233, 69, 96, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* Release Log Modal */
.release-log-modal {
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.release-log-content {
  font-size: 0.9rem;
  line-height: 1.5;
}

.release-log-entry {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.release-log-entry:last-child {
  border-bottom: none;
}

.release-log-content .log-version {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}

.release-log-content .log-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.release-log-content .log-section-title {
  font-weight: 600;
  margin: 0.5rem 0 0.25rem;
  color: var(--text-primary);
}

.release-log-content ul {
  list-style: none;
  padding-left: 0;
}

.release-log-content li {
  padding: 0.2rem 0;
  padding-left: 1rem;
  position: relative;
}

.release-log-content li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.release-log-footer {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════ */
/* TOP HEADER                                               */
/* ═══════════════════════════════════════════════════════════ */

.top-header {
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  min-height: 50px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-menu {
  position: relative;
}

.header-menu-toggle {
  white-space: nowrap;
}

.header-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  z-index: 1200;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.header-menu-item {
  background: transparent;
  border: none;
  color: var(--text-primary);
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
}

.header-menu-item:hover {
  background: var(--bg-tertiary);
}

.modal-content-wide {
  max-width: 560px;
  width: min(92vw, 560px);
}

.manage-block {
  margin: 0.85rem 0 1rem;
  text-align: left;
}

.manage-block h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.manage-block label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.manage-block select,
.manage-invite-row input,
.manage-inline-form input,
.manage-inline-form select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}

.manage-invite-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.manage-invite-row input {
  margin-bottom: 0;
  flex: 1;
}

.manage-inline-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.manage-list {
  list-style: none;
  margin: 0.4rem 0 0.75rem;
  padding: 0;
  max-height: 160px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.manage-list li {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

.manage-list li:last-child {
  border-bottom: none;
}

.manage-kv {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.manage-kv strong {
  color: var(--text-primary);
}

.user-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.header-separator {
  color: var(--border);
}

.team-name {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.ws-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  transition: var(--transition);
}

.ws-status.connected {
  background: var(--success);
}

/* ═══════════════════════════════════════════════════════════ */
/* XP BAR                                                   */
/* ═══════════════════════════════════════════════════════════ */

.xp-bar-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-width: 120px;
}

.xp-level {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--warning);
  min-width: 1.5rem;
  text-align: center;
}

.xp-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--warning));
  border-radius: 4px;
  transition: width 0.4s ease-out;
}

.xp-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-width: 3.5rem;
  text-align: right;
}

.xp-gain {
  animation: xp-gain 0.6s ease-out;
}

.level-up {
  animation: level-up 0.8s ease-out;
}

@keyframes xp-gain {
  0% { box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.6); }
  50% { box-shadow: 0 0 12px 4px rgba(233, 69, 96, 0.4); }
  100% { box-shadow: 0 0 0 0 rgba(233, 69, 96, 0); }
}

@keyframes level-up {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 230, 109, 0.8); }
  25% { transform: scale(1.2); box-shadow: 0 0 20px 8px rgba(255, 230, 109, 0.6); }
  50% { transform: scale(1.1); box-shadow: 0 0 15px 6px rgba(255, 230, 109, 0.4); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 230, 109, 0); }
}

/* ═══════════════════════════════════════════════════════════ */
/* TAB NAVIGATION                                           */
/* ═══════════════════════════════════════════════════════════ */

.tab-nav {
  display: flex;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0.25rem;
  gap: 0.25rem;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.tab-btn:hover {
  background: var(--bg-tertiary);
}

.tab-btn.active {
  background: var(--accent);
  color: white;
}

.tab-icon {
  font-size: 1.2rem;
}

/* ═══════════════════════════════════════════════════════════ */
/* TAB CONTENT                                              */
/* ═══════════════════════════════════════════════════════════ */

.tab-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.tab-content:has(#tab-people.active) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

#tab-people.tab-pane.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.tab-pane.hidden {
  display: none;
}

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.tab-header h2 {
  font-size: 1.3rem;
}

/* ═══════════════════════════════════════════════════════════ */
/* PEOPLE + CHAT                                            */
/* ═══════════════════════════════════════════════════════════ */

.pane-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: 100%;
}

.pane-left {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  min-height: 0;
}

.pane-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-pane {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  min-height: 0;
}

.section-header {
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 1rem;
  color: var(--text-secondary);
}

.members-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 0.5rem;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.member-item.clickable {
  cursor: pointer;
}

.member-item.clickable:hover,
.member-item.active {
  background: var(--bg-tertiary, rgba(255,255,255,0.04));
}

.section-hint {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.chat-nav {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  max-height: 45%;
  overflow-y: auto;
}

.chat-nav-section {
  margin-top: 0.65rem;
}

.chat-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.35rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.chat-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chat-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text-primary);
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
}

.chat-nav-item:hover,
.chat-nav-item.active {
  background: var(--bg-tertiary, rgba(255,255,255,0.06));
}

.chat-nav-meta,
.chat-nav-badge {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.chat-nav-badge {
  background: var(--accent, #3d8bfd);
  color: #fff;
  border-radius: 999px;
  min-width: 1.2rem;
  text-align: center;
  padding: 0.1rem 0.35rem;
}

.chat-nav-empty {
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 0.4rem 0.65rem;
}

.chat-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.member-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 220px;
  overflow-y: auto;
  margin: 0.5rem 0 1rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.member-item:hover {
  background: var(--bg-tertiary);
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  flex-shrink: 0;
}

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

.member-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.member-role {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.member-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-secondary);
  flex-shrink: 0;
}

.member-status.online {
  background: var(--success);
}

/* Chat */
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
}

.chat-message {
  max-width: 75%;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  align-self: flex-start;
}

.chat-message.own {
  align-self: flex-end;
  background: rgba(233, 69, 96, 0.2);
}

.chat-message-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.chat-message-sender {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--accent);
}

.chat-message-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.chat-message-content {
  font-size: 0.9rem;
  line-height: 1.4;
}

.chat-form {
  display: flex;
  flex-shrink: 0;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.chat-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.chat-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-send {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-send:hover {
  background: var(--accent-hover);
}

/* ═══════════════════════════════════════════════════════════ */
/* CHALLENGES                                               */
/* ═══════════════════════════════════════════════════════════ */

.my-tasks-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.my-tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.my-tasks-header h3 {
  margin: 0;
  font-size: 1rem;
}

.my-tasks-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.my-tasks-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
}

.my-task-empty {
  color: var(--text-secondary);
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.my-task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0.65rem;
  border-radius: var(--radius);
}

.my-task-item:hover {
  background: var(--bg-tertiary, rgba(255,255,255,0.04));
}

.my-task-item.completed {
  opacity: 0.55;
}

.my-task-item.completed .my-task-title {
  text-decoration: line-through;
}

.my-task-check {
  flex-shrink: 0;
  margin-top: 0.15rem;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.my-task-body {
  min-width: 0;
  flex: 1;
}

.my-task-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.my-task-title {
  font-weight: 600;
}

.my-task-deadline,
.my-task-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.my-task-desc {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.challenge-my-open {
  color: var(--accent, #3d8bfd);
  font-weight: 600;
}

.challenge-task.mine {
  background: color-mix(in srgb, var(--accent, #3d8bfd) 10%, transparent);
  border-radius: var(--radius);
}

.task-mine-tag {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent, #3d8bfd);
  font-weight: 700;
}

.task-open-detail {
  cursor: pointer;
}

.task-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.subtask-points {
  width: 4.5rem;
  flex-shrink: 0;
}

.task-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.task-detail-desc {
  white-space: pre-wrap;
  color: var(--text-secondary);
  margin: 0.5rem 0 1rem;
}

.task-detail-close-note {
  padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--success, #3ecf8e);
  background: color-mix(in srgb, var(--success, #3ecf8e) 12%, transparent);
  margin-bottom: 1rem;
}

.task-points-row {
  margin-bottom: 1rem;
}

.task-points-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.task-points-controls input {
  width: 6rem;
}

.task-detail-section {
  margin: 1rem 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.task-detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.task-detail-section-header h4 {
  margin: 0;
  font-size: 0.95rem;
}

.task-comments-list,
.task-files-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
}

.task-comment-item,
.task-file-item {
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
  margin-bottom: 0.35rem;
  background: var(--bg-tertiary, rgba(255,255,255,0.03));
}

.task-comment-item.question {
  border-left: 3px solid var(--accent, #3d8bfd);
}

.task-comment-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.task-comment-item p {
  margin: 0;
  white-space: pre-wrap;
}

.task-comment-empty {
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.task-comment-form textarea {
  width: 100%;
  margin-bottom: 0.5rem;
}

.task-comment-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.task-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.task-file-upload-btn {
  cursor: pointer;
}

.task-detail-footer {
  margin-top: 1rem;
}

.challenges-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1rem;
}

.challenge-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: var(--transition);
}

.challenge-card:hover {
  border-color: var(--accent);
}

.challenge-card.completed {
  border-color: var(--success);
  opacity: 0.8;
}

.challenge-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.challenge-title {
  font-weight: 600;
  font-size: 1rem;
}

.challenge-status {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  background: var(--bg-tertiary);
  color: var(--warning);
}

.challenge-status.completed {
  background: rgba(78, 205, 196, 0.15);
  color: var(--success);
}

.challenge-deadline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.challenge-progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.challenge-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.challenge-tasks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.challenge-task {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.challenge-task.completed {
  color: var(--text-secondary);
  text-decoration: line-through;
}

.task-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.task-checkbox:hover {
  border-color: var(--accent);
}

.task-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
}

.task-checkbox.checked::after {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-primary);
  font-size: 0.75rem;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════ */
/* FILES                                                    */
/* ═══════════════════════════════════════════════════════════ */

.file-filter {
  margin-bottom: 1rem;
}

.file-filter select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 1rem;
}

.file-upload-zone:hover {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.05);
}

.file-upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
}

.file-upload-zone p {
  color: var(--text-secondary);
}

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

.file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.file-item:hover {
  border-color: var(--accent);
}

.file-icon {
  font-size: 1.5rem;
}

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

.file-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.file-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.file-actions {
  display: flex;
  gap: 0.5rem;
}

.file-action-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-action-btn:hover {
  background: var(--bg-tertiary);
}

/* ═══════════════════════════════════════════════════════════ */
/* GOAL INDICATOR                                           */
/* ═══════════════════════════════════════════════════════════ */

.goal-selector {
  margin-bottom: 2rem;
}

.goal-selector select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.goal-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
}

.goal-circle {
  position: relative;
  width: 200px;
  height: 200px;
}

.goal-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.goal-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 8;
}

.goal-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.5s ease;
}

.goal-progress.complete {
  stroke: var(--success);
}

.goal-percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 700;
}

.goal-status {
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: center;
}

.goal-status.complete {
  color: var(--success);
  font-weight: 600;
}

.result-section {
  text-align: center;
  padding: 2rem;
  background: rgba(78, 205, 196, 0.1);
  border: 1px solid var(--success);
  border-radius: var(--radius);
  margin-top: 1.5rem;
}

.result-section h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.result-section p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* ═══════════════════════════════════════════════════════════ */
/* TEAM PROGRESS                                           */
/* ═══════════════════════════════════════════════════════════ */

.team-progress-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.team-progress-section .section-header h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.team-progress-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.team-progress-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.team-progress-bar-container {
  margin-bottom: 1.5rem;
}

.team-progress-bar {
  height: 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  overflow: hidden;
}

.team-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  transition: width 0.5s ease;
}

.team-challenges-progress {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.team-challenge-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.team-challenge-item-title {
  flex: 1;
  font-size: 0.9rem;
  min-width: 120px;
}

.team-challenge-bar {
  flex: 2;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.team-challenge-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.team-challenge-bar-fill.completed {
  background: var(--success);
}

.team-challenge-percentage {
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 36px;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════ */
/* NO TEAM STATE                                            */
/* ═══════════════════════════════════════════════════════════ */

.no-team-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 2rem;
}

.no-team-state h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.no-team-state p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 400px;
}

.no-team-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 300px;
}

/* ═══════════════════════════════════════════════════════════ */
/* MODALS                                                   */
/* ═══════════════════════════════════════════════════════════ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.modal-content h3 {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-content input,
.modal-content textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
}

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

.modal-content input:focus,
.modal-content textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.modal-actions button {
  flex: 1;
}

.modal-lg {
  max-width: 640px;
}

.field-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0.35rem 0 0.25rem;
  text-align: left;
}

.subtasks-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.subtasks-header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
}

.subtasks-header label {
  font-weight: 600;
  font-size: 0.95rem;
}

.subtasks-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.subtasks-container,
#subtasks-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.subtask-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
}

.subtask-top {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.subtask-item .subtask-input {
  flex: 1;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.subtask-description {
  width: 100%;
  min-height: 72px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.88rem;
  resize: vertical;
  font-family: inherit;
}

.subtask-assign {
  min-width: 150px;
  max-width: 200px;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.subtask-remove {
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.subtask-remove:hover {
  background: rgba(255, 71, 87, 0.1);
}

.challenge-desc,
.task-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.4;
  margin: 0.35rem 0 0.5rem;
  white-space: pre-wrap;
}

.challenge-tasks .challenge-task {
  align-items: flex-start;
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-title-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.task-title {
  font-weight: 600;
}

.task-assignee {
  font-size: 0.75rem;
  color: var(--success);
  white-space: nowrap;
}

.task-assignee.muted {
  color: var(--text-secondary);
  opacity: 0.75;
}

.challenge-card-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
}

.challenge-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ═══════════════════════════════════════════════════════════ */
/* TOASTS                                                   */
/* ═══════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.9rem;
  animation: slideIn 0.3s ease;
  max-width: 350px;
}

.toast.success {
  background: rgba(78, 205, 196, 0.2);
  border: 1px solid var(--success);
}

.toast.error {
  background: rgba(255, 71, 87, 0.2);
  border: 1px solid var(--danger);
}

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

/* ═══════════════════════════════════════════════════════════ */
/* ERROR MESSAGES                                           */
/* ═══════════════════════════════════════════════════════════ */

.error-message {
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
}

.error-message.hidden {
  display: none;
}

/* ═══════════════════════════════════════════════════════════ */
/* SCROLLBARS                                               */
/* ═══════════════════════════════════════════════════════════ */

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

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════ */
/* RESPONSIVE                                               */
/* ═══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .pane-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(140px, 28%) 1fr;
  }
  
  .challenges-list {
    grid-template-columns: 1fr;
  }
  
  .tab-btn {
    font-size: 0.75rem;
  }
  
  .tab-label {
    display: none;
  }
  
  .tab-icon {
    font-size: 1.5rem;
  }
}

#wg-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

/* ═══════════════════════════════════════════════════════════ */
/* LEADERBOARD                                              */
/* ═══════════════════════════════════════════════════════════ */

.leaderboard-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

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

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.leaderboard-item:hover {
  background: var(--bg-tertiary);
}

.leaderboard-item.current-user {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
  box-shadow: 0 0 8px rgba(233, 69, 96, 0.2);
}

.leaderboard-rank {
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 2rem;
  text-align: center;
  color: var(--text-secondary);
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
  color: gold;
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
  color: silver;
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
  color: #cd7f32;
}

.leaderboard-user {
  flex: 1;
  margin-left: 1rem;
}

.leaderboard-user-name {
  font-weight: 600;
}

.leaderboard-user-level {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.leaderboard-xp {
  font-weight: 600;
  color: var(--warning);
  font-size: 0.95rem;
}

.leaderboard-empty {
  color: var(--text-secondary);
  text-align: center;
  padding: 1rem;
}

/* ═══════════════════════════════════════════════════════════ */
/* INVENTORY                                                */
/* ═══════════════════════════════════════════════════════════ */

.inventory-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.inventory-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.inventory-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border-left-width: 4px;
}

.inventory-item.rarity-common { border-left-color: #9ca3af; }
.inventory-item.rarity-uncommon { border-left-color: #22c55e; }
.inventory-item.rarity-rare { border-left-color: #3b82f6; }
.inventory-item.rarity-epic { border-left-color: #a855f7; }
.inventory-item.rarity-legendary { border-left-color: #f59e0b; }

.inventory-item-icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.inventory-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.inventory-item-body {
  flex: 1;
  min-width: 0;
}

.inventory-item-name {
  font-weight: 600;
}

.inventory-item-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.inventory-item-desc {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.inventory-empty {
  color: var(--text-secondary);
  text-align: center;
  padding: 1rem;
}

/* ═══════════════════════════════════════════════════════════ */
/* SERIES                                                   */
/* ═══════════════════════════════════════════════════════════ */

.series-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.series-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.series-form select,
.series-form input {
  padding: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.series-form button {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

.series-form button:hover {
  background: var(--accent-hover);
}

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

.series-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.series-info {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.series-frequency {
  text-transform: capitalize;
  font-weight: 600;
}

.series-status.active {
  color: var(--success);
}

.series-status.inactive {
  color: var(--text-secondary);
}

.series-trigger-btn {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.85rem;
}

.series-trigger-btn:hover {
  background: var(--accent);
  color: white;
}

/* ═══════════════════════════════════════════════════════════ */
/* ACHIEVEMENTS                                             */
/* ═══════════════════════════════════════════════════════════ */

.achievements-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.achievements-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.achievement-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.achievement-card:hover {
  border-color: var(--accent);
}

.achievement-card.locked {
  opacity: 0.65;
}

.achievement-card.unlocked {
  border-color: var(--success);
  background: rgba(78, 205, 196, 0.05);
}

.achievement-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.achievement-description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.achievement-xp {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--warning);
}

.achievement-progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.achievement-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--warning));
  border-radius: 3px;
  transition: width 0.4s ease-out;
}

.achievement-progress-text {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: right;
}

.achievement-unlock-anim {
  animation: achievement-unlock 1.2s ease-out;
}

@keyframes achievement-unlock {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(78, 205, 196, 0);
  }
  15% {
    transform: scale(1.05);
    box-shadow: 0 0 30px 10px rgba(78, 205, 196, 0.6);
  }
  30% {
    transform: scale(0.98);
    box-shadow: 0 0 20px 6px rgba(78, 205, 196, 0.4);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 25px 8px rgba(78, 205, 196, 0.5);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 15px 4px rgba(78, 205, 196, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(78, 205, 196, 0);
  }
}

/* ═══════════════════════════════════════════════════════════ */
/* GAME THEMES                                              */
/* ═══════════════════════════════════════════════════════════ */

.game-themes-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.game-themes-panel {
  margin-top: 0.5rem;
}

.theme-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  min-width: 100px;
}

.theme-option:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.theme-option.active {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
  box-shadow: 0 0 12px rgba(233, 69, 96, 0.3);
}

.theme-preview {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.default-preview {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.cyberpunk-preview {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.retro-preview {
  background: linear-gradient(135deg, #10b981, #3b82f6);
}

.theme-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════ */
/* CONFETTI                                                 */
/* ═══════════════════════════════════════════════════════════ */

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-particle {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 10px;
  opacity: 0;
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

.confetti-particle:nth-child(1) { left: 10%; background: #e94560; animation-delay: 0s; }
.confetti-particle:nth-child(2) { left: 20%; background: #6366f1; animation-delay: 0.1s; }
.confetti-particle:nth-child(3) { left: 30%; background: #f59e0b; animation-delay: 0.2s; }
.confetti-particle:nth-child(4) { left: 40%; background: #10b981; animation-delay: 0.3s; }
.confetti-particle:nth-child(5) { left: 50%; background: #8b5cf6; animation-delay: 0.4s; }
.confetti-particle:nth-child(6) { left: 60%; background: #ef4444; animation-delay: 0.5s; }
.confetti-particle:nth-child(7) { left: 70%; background: #3b82f6; animation-delay: 0.6s; }
.confetti-particle:nth-child(8) { left: 80%; background: #ffe66d; animation-delay: 0.7s; }
.confetti-particle:nth-child(9) { left: 90%; background: #4ecdc4; animation-delay: 0.8s; }
.confetti-particle:nth-child(10) { left: 15%; background: #ff6b6b; animation-delay: 0.15s; }
.confetti-particle:nth-child(11) { left: 25%; background: #a78bfa; animation-delay: 0.25s; }
.confetti-particle:nth-child(12) { left: 35%; background: #fbbf24; animation-delay: 0.35s; }
.confetti-particle:nth-child(13) { left: 45%; background: #34d399; animation-delay: 0.45s; }
.confetti-particle:nth-child(14) { left: 55%; background: #60a5fa; animation-delay: 0.55s; }
.confetti-particle:nth-child(15) { left: 65%; background: #f87171; animation-delay: 0.65s; }
.confetti-particle:nth-child(16) { left: 75%; background: #c084fc; animation-delay: 0.75s; }
.confetti-particle:nth-child(17) { left: 85%; background: #fcd34d; animation-delay: 0.85s; }
.confetti-particle:nth-child(18) { left: 95%; background: #6ee7b7; animation-delay: 0.95s; }
.confetti-particle:nth-child(19) { left: 5%; background: #fca5a5; animation-delay: 0.05s; }
.confetti-particle:nth-child(20) { left: 45%; background: #93c5fd; animation-delay: 0.45s; }

/* ═══════════════════════════════════════════════════════════ */
/* THEME VARIABELEN                                        */
/* ═══════════════════════════════════════════════════════════ */

/* Cyberpunk theme */
.theme-cyberpunk {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #2d1b4e;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #3d2e5e;
}

/* Retro theme */
.theme-retro {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #404040;
  --accent: #10b981;
  --accent-hover: #34d399;
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --success: #10b981;
  --warning: #3b82f6;
  --danger: #ef4444;
  --border: #505050;
}

/* ═══════════════════════════════════════════════════════ */
/* ADMIN DASHBOARD                                        */
/* ═══════════════════════════════════════════════════════ */

.admin-dashboard {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  height: 100%;
}

.admin-sidebar {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: all var(--transition);
}

.admin-nav-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.admin-nav-btn.active {
  background: var(--accent);
  color: #fff;
}

.admin-content {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow-y: auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.admin-header h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Toolbar */
.admin-toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-search {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.admin-search:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-filter {
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* Users List */
.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-user-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.admin-user-card .user-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-user-card .user-email {
  font-weight: 600;
  color: var(--text-primary);
}

.admin-user-card .user-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.admin-user-card .user-actions {
  display: flex;
  gap: 0.5rem;
}

/* Tiers */
.admin-tiers-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.tier-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.tier-card h4 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.tier-card .tier-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1rem;
}

.tier-card .tier-limits {
  list-style: none;
  padding: 0;
}

.tier-card .tier-limits li {
  padding: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Tier Breakdown */
.admin-tier-breakdown-section {
  margin-top: 2rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.admin-tier-breakdown-section h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.tier-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tier-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tier-bar-label {
  width: 100px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.tier-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.tier-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.tier-bar-count {
  width: 80px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: right;
}

/* Stat card highlight */
.stat-card.highlight {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb, 99, 102, 241), 0.1);
}

/* User Detail Modal */
.user-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.user-detail-stat {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 0.75rem;
  text-align: center;
}

.user-detail-stat .value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.user-detail-stat .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Tier Edit Form */
.tier-edit-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.tier-edit-form label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.25rem;
}

.tier-edit-form input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.tier-edit-form input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Organizations */
.admin-orgs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-org-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Audit Log */
.admin-audit-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-audit-entry {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.admin-audit-entry .audit-time {
  color: var(--text-secondary);
}

.admin-audit-entry .audit-action {
  color: var(--text-primary);
}

/* Pagination */
.admin-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.admin-pagination button {
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  cursor: pointer;
}

.admin-pagination button.active {
  background: var(--accent);
  border-color: var(--accent);
}

/* Buttons */
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition);
}

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

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8rem;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Account type / invite register extras */
.account-type-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
}
.account-type-fieldset legend {
  padding: 0 0.35rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.radio-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
  cursor: pointer;
  color: var(--text-primary);
}
.invite-tier-block {
  margin: 0.5rem 0 0.75rem;
  text-align: left;
}
.invite-tier-block label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}
.invite-tier-block select,
#register-org-name {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.invite-team-label {
  font-size: 0.9rem;
  color: var(--success);
  margin-bottom: 0.5rem;
}
.modal-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0 0 1rem;
}
#org-project-form input {
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Pending reviews + celebrate/crash FX */
.pending-reviews-panel {
  background: color-mix(in srgb, var(--accent, #3d8bfd) 8%, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.pending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.task-status-pill {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
  vertical-align: middle;
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
}

.task-status-pill.pending_review {
  background: color-mix(in srgb, #f0b429 25%, transparent);
  color: #f0b429;
}

.task-status-pill.approved {
  background: color-mix(in srgb, var(--success, #3ecf8e) 25%, transparent);
  color: var(--success, #3ecf8e);
}

.task-status-pill.crashed {
  background: color-mix(in srgb, #ff5c5c 25%, transparent);
  color: #ff5c5c;
}

.task-checkbox.pending { outline: 2px solid #f0b429; }
.task-checkbox.crashed { outline: 2px solid #ff5c5c; opacity: 0.7; }
.challenge-task.status-crashed {
  opacity: 0.75;
  border: 1px solid color-mix(in srgb, #ff5c5c 40%, transparent);
}

.fx-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fx-modal.hidden { display: none; }
.fx-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); }
.crash-backdrop { background: rgba(40, 0, 0, 0.72); }
.fx-card {
  position: relative;
  z-index: 1;
  width: min(420px, 92vw);
  background: var(--bg-secondary, #1a1d24);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.fx-card h2 { margin: 0.75rem 0 0.35rem; }
.fx-card p { color: var(--text-secondary); margin: 0 0 1.25rem; }

.party-scene { height: 110px; position: relative; overflow: hidden; }
.party-person {
  position: absolute;
  bottom: 8px;
  font-size: 2rem;
  animation: party-bounce 0.7s ease-in-out infinite alternate;
}
.party-person.p1 { left: 12%; }
.party-person.p2 { left: 32%; animation-delay: 0.1s; font-size: 1.6rem; top: 18px; bottom: auto; }
.party-person.p3 { left: 48%; animation-delay: 0.15s; }
.party-person.p4 { left: 68%; animation-delay: 0.05s; }
.party-person.p5 { left: 82%; animation-delay: 0.2s; font-size: 1.4rem; top: 10px; bottom: auto; }
@keyframes party-bounce {
  from { transform: translateY(0) rotate(-6deg); }
  to { transform: translateY(-18px) rotate(6deg); }
}

.crash-sky {
  position: relative;
  height: 140px;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(180deg, #1b2735 0%, #3a1a1a 70%, #5a2010 100%);
  margin-bottom: 0.5rem;
}
.crash-plane {
  position: absolute;
  top: 12px;
  left: -20%;
  font-size: 2.4rem;
  transform: rotate(25deg);
  animation: plane-crash 1.6s ease-in forwards;
}
.crash-smoke {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(200,200,200,0.35);
  animation: smoke-drift 1.6s ease-out forwards;
}
.crash-smoke.s1 { top: 30px; left: 30%; animation-delay: 0.2s; }
.crash-smoke.s2 { top: 50px; left: 45%; animation-delay: 0.45s; }
.crash-smoke.s3 { top: 70px; left: 58%; animation-delay: 0.7s; }
.crash-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; background: #2a1810; }
.crash-boom {
  position: absolute;
  bottom: 10px;
  left: 62%;
  font-size: 2rem;
  opacity: 0;
  animation: boom-pop 0.5s ease-out 1.35s forwards;
}
@keyframes plane-crash {
  0% { left: -20%; top: 10px; transform: rotate(20deg) scale(1); }
  70% { left: 55%; top: 70px; transform: rotate(55deg) scale(1.05); }
  100% { left: 60%; top: 95px; transform: rotate(110deg) scale(0.7); opacity: 0.2; }
}
@keyframes smoke-drift {
  from { opacity: 0; transform: translate(0,0) scale(0.6); }
  to { opacity: 0.8; transform: translate(20px, -25px) scale(1.6); }
}
@keyframes boom-pop {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1.2); }
}
