/* ═══════════════════════════════════════════════════════════ */
/* SSIA VANGUARD CHRONICLES - TEAM BUILDER CSS               */
/* Modern, Responsive Design with Mobile Support              */
/* ═══════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────────── */
/* MAIN LAYOUT                                                 */
/* ────────────────────────────────────────────────────────── */

.teambuilder-section {
  max-width: 1500px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

/* ────────────────────────────────────────────────────────── */
/* TOPBAR CONTROLS                                             */
/* ────────────────────────────────────────────────────────── */

.tb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  background: rgba(8, 14, 24, 0.3);
  border: 1px solid rgba(0, 255, 153, 0.1);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
}

.tb-controls-left {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.tb-btn {
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.tb-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: left 0.3s ease;
  z-index: -1;
}

.tb-btn:hover::before {
  left: 100%;
}

.tb-btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(0, 255, 153, 0.2), rgba(255, 221, 0, 0.2));
  color: var(--accent);
  border-color: rgba(0, 255, 153, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(0, 255, 153, 0.3), rgba(255, 221, 0, 0.3));
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(0, 255, 153, 0.3);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 64, 96, 0.15);
  color: var(--danger);
  border-color: rgba(255, 64, 96, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 64, 96, 0.25);
  border-color: var(--danger);
  box-shadow: 0 0 20px rgba(255, 64, 96, 0.3);
  transform: translateY(-2px);
}

.btn-settings {
  background: linear-gradient(135deg, rgba(0, 148, 255, 0.2), rgba(0, 200, 255, 0.2));
  color: #00c8ff;
  border-color: rgba(0, 148, 255, 0.35);
}

.btn-settings:hover {
  background: linear-gradient(135deg, rgba(0, 148, 255, 0.3), rgba(0, 200, 255, 0.3));
  border-color: #00c8ff;
  box-shadow: 0 0 20px rgba(0, 148, 255, 0.3);
  transform: translateY(-2px);
}

.tb-team-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding: 0.85rem 1.2rem;
  border-radius: 12px;
  background: rgba(0, 255, 153, 0.1);
  border: 1px solid rgba(0, 255, 153, 0.3);
  color: var(--accent);
  font-family: var(--f-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
}

.tb-team-counter:hover {
  background: rgba(0, 255, 153, 0.18);
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(0, 255, 153, 0.2);
}

/* ────────────────────────────────────────────────────────── */
/* MAIN GRID LAYOUT                                            */
/* ────────────────────────────────────────────────────────── */

.tb-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* Left Panel */

.tb-left-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: rgba(8, 14, 24, 0.4);
  border: 1px solid rgba(0, 255, 153, 0.12);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(12px);
}

/* Right Panel */

.tb-right-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ────────────────────────────────────────────────────────── */
/* PANEL HEADERS & TITLES                                      */
/* ────────────────────────────────────────────────────────── */

.tb-panel-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tb-panel-title {
  font-family: var(--f-head);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0;
}

.tb-search {
  max-width: 100%;
}

#team-character-search {
  width: 100%;
  padding: 0.9rem 1.2rem 0.9rem 2.8rem;
  border-radius: 10px;
  background: rgba(0, 255, 153, 0.08);
  border: 1px solid rgba(0, 255, 153, 0.2);
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

#team-character-search:focus {
  outline: none;
  background: rgba(0, 255, 153, 0.15);
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(0, 255, 153, 0.2);
}

#team-character-search::placeholder {
  color: var(--text-muted);
}

/* ────────────────────────────────────────────────────────── */
/* CHARACTER LIST                                              */
/* ────────────────────────────────────────────────────────── */

.tb-character-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.tb-character-list::-webkit-scrollbar {
  width: 8px;
}

.tb-character-list::-webkit-scrollbar-track {
  background: rgba(0, 255, 153, 0.05);
  border-radius: 10px;
}

.tb-character-list::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 153, 0.3);
  border-radius: 10px;
}

.tb-character-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 153, 0.5);
}

/* Character Item */

.tb-char-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(0, 255, 153, 0.05);
  border: 1px solid rgba(0, 255, 153, 0.15);
  cursor: pointer;
  transition: all 0.3s ease;
}

.tb-char-item:hover {
  background: rgba(0, 255, 153, 0.12);
  border-color: rgba(0, 255, 153, 0.3);
  box-shadow: 0 0 15px rgba(0, 255, 153, 0.2);
  transform: translateX(5px);
}

.tb-char-item:active {
  transform: translateX(3px);
}

.tb-char-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.tb-char-portrait {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(0, 255, 153, 0.3);
  transition: all 0.3s ease;
  position: relative;
}

.tb-char-item:hover .tb-char-portrait {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 255, 153, 0.4);
  transform: scale(1.1);
}

.tb-char-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.tb-char-item:hover .tb-char-portrait img {
  transform: scale(1.15);
}

.tb-char-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tb-char-name {
  font-family: var(--f-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.tb-char-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.tb-char-element {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 221, 0, 0.15);
  color: var(--accent2);
}

.tb-char-role {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: rgba(0, 255, 153, 0.1);
  color: var(--accent);
}

.tb-char-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0, 255, 153, 0.15);
  border: 1px solid rgba(0, 255, 153, 0.25);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  flex-shrink: 0;
}

.tb-char-action:hover {
  background: rgba(0, 255, 153, 0.3);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(0, 255, 153, 0.3);
}

/* ────────────────────────────────────────────────────────── */
/* TEAM DISPLAY                                                */
/* ────────────────────────────────────────────────────────── */

.tb-team-display {
  background: rgba(8, 14, 24, 0.4);
  border: 1px solid rgba(0, 255, 153, 0.12);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(12px);
}

.tb-team-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Team Slot */

.tb-team-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 2px dashed rgba(0, 255, 153, 0.3);
  background: rgba(0, 255, 153, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.tb-team-slot:hover {
  border-color: rgba(0, 255, 153, 0.5);
  background: rgba(0, 255, 153, 0.12);
  box-shadow: 0 0 20px rgba(0, 255, 153, 0.2);
}

.tb-team-slot:active {
  transform: scale(0.98);
}

.tb-team-slot.filled {
  border-style: solid;
  border-color: rgba(0, 255, 153, 0.35);
  background: rgba(0, 255, 153, 0.08);
  padding: 0;
}

.tb-team-slot.filled:hover {
  box-shadow: 0 0 25px rgba(0, 255, 153, 0.3), inset 0 0 20px rgba(0, 255, 153, 0.1);
}

.slot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  pointer-events: none;
}

.slot-number {
  font-family: var(--f-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.slot-label {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tb-team-slot.filled .slot-placeholder {
  display: none;
}

/* Filled Team Slot Content */

.tb-slot-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
}

.tb-slot-portrait {
  width: 100%;
  height: 70%;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 255, 153, 0.2);
}

.tb-slot-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tb-slot-info {
  height: 30%;
  padding: 0.8rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.tb-slot-name {
  font-family: var(--f-head);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.tb-slot-element {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.tb-slot-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 64, 96, 0.8);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.tb-slot-remove:hover {
  background: var(--danger);
  box-shadow: 0 0 15px rgba(255, 64, 96, 0.5);
}

/* ────────────────────────────────────────────────────────── *//* TEAM STRENGTH SCORE                                         */
/* ────────────────────────────────────────────────────────── */

.tb-team-strength {
  background: rgba(8, 14, 24, 0.4);
  border: 1px solid rgba(0, 255, 153, 0.12);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(12px);
}

.tb-strength-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.tb-strength-title {
  font-family: var(--f-head);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0;
}

.tb-strength-percentage {
  font-family: var(--f-head);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 80px;
  text-align: right;
}

.tb-strength-bar-container {
  width: 100%;
  height: 12px;
  border-radius: 10px;
  background: rgba(0, 255, 153, 0.1);
  border: 1px solid rgba(0, 255, 153, 0.2);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.tb-strength-bar {
  width: 100%;
  height: 100%;
  position: relative;
}

.tb-strength-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffdd00, #00ff99);
  transition: all 0.6s ease;
  border-radius: 10px;
}

.tb-strength-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.tb-strength-stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(255, 221, 0, 0.08);
  border: 1px solid rgba(255, 221, 0, 0.2);
  text-align: center;
}

.tb-stat-label {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tb-stat-value {
  font-family: var(--f-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent2);
}

/* ────────────────────────────────────────────────────────── *//* COUNTER INFO TABLE                                          */
/* ────────────────────────────────────────────────────────── */

.tb-counter-info {
  background: rgba(8, 14, 24, 0.4);
  border: 1px solid rgba(0, 255, 153, 0.12);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(12px);
}

.tb-info-title {
  font-family: var(--f-head);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 1.5rem 0;
}

.tb-counter-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.tb-counter-item {
  padding: 1rem;
  border-radius: 10px;
  background: rgba(255, 221, 0, 0.08);
  border: 1px solid rgba(255, 221, 0, 0.2);
  text-align: center;
}

.tb-counter-element {
  font-family: var(--f-head);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.tb-counter-name {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  color: var(--accent2);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.tb-counter-text {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.tb-counter-hint {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
  padding: 0.8rem;
  border-radius: 8px;
  background: rgba(0, 255, 153, 0.05);
  border-left: 2px solid var(--accent);
}

/* ────────────────────────────────────────────────────────── */
/* TIPS SECTION                                                */
/* ────────────────────────────────────────────────────────── */

.tb-tips-section {
  background: rgba(8, 14, 24, 0.4);
  border: 1px solid rgba(0, 255, 153, 0.12);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(12px);
}

.tb-tips-list {
  display: grid;
  gap: 1rem;
}

.tb-tip {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(0, 255, 153, 0.05);
  border: 1px solid rgba(0, 255, 153, 0.15);
  transition: all 0.3s ease;
}

.tb-tip:hover {
  background: rgba(0, 255, 153, 0.12);
  border-color: rgba(0, 255, 153, 0.3);
  transform: translateX(5px);
}

.tip-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.tip-text {
  font-family: var(--f-ui);
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ────────────────────────────────────────────────────────── */
/* MODAL (Mobile)                                              */
/* ────────────────────────────────────────────────────────– */

.tb-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(8px);
}

.tb-modal.active {
  display: flex;
}

.settings-modal {
  z-index: 1001;
}

.tb-modal-content {
  background: linear-gradient(135deg, rgba(8, 14, 24, 0.95), rgba(12, 20, 36, 0.85));
  border: 1px solid rgba(0, 255, 153, 0.25);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
}

.tb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0, 255, 153, 0.15);
}

.tb-modal-header h2 {
  font-family: var(--f-head);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.tb-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 64, 96, 0.15);
  color: var(--danger);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tb-modal-close:hover {
  background: rgba(255, 64, 96, 0.3);
  box-shadow: 0 0 15px rgba(255, 64, 96, 0.3);
}

.tb-modal-body {
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.tb-modal-body .tb-char-item {
  margin: 0;
}

/* ────────────────────────────────────────────────────────── */
/* SETTINGS MODAL                                              */
/* ────────────────────────────────────────────────────────── */

.settings-modal.active {
  display: flex !important;
}

.settings-modal-content {
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-modal-body {
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-modal-body::-webkit-scrollbar {
  width: 8px;
}

.settings-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 255, 153, 0.05);
}

.settings-modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 153, 0.3);
  border-radius: 10px;
}

.settings-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 153, 0.5);
}

/* Settings Section */

.settings-section {
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 153, 0.15);
  padding: 1.2rem;
  background: rgba(0, 255, 153, 0.03);
  transition: all 0.3s ease;
}

.settings-section:hover {
  background: rgba(0, 255, 153, 0.06);
  border-color: rgba(0, 255, 153, 0.25);
}

.settings-section-title {
  font-family: var(--f-head);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Settings Group */

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* Settings Label */

.settings-label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--f-ui);
  font-size: 0.9rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  user-select: none;
}

.settings-label:hover {
  background: rgba(0, 255, 153, 0.08);
  color: var(--text);
}

/* Checkbox */

.settings-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}

/* Radio Group */

.settings-radio-group {
  display: grid;
  gap: 0.6rem;
  margin-left: 0.5rem;
}

.settings-radio {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--f-ui);
  font-size: 0.9rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  user-select: none;
}

.settings-radio:hover {
  background: rgba(0, 255, 153, 0.08);
  color: var(--text);
}

.settings-radio-input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}

/* Text Input */

.settings-text-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 153, 0.25);
  background: rgba(0, 255, 153, 0.05);
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 0.9rem;
  transition: all 0.3s ease;
  margin-top: 0.4rem;
}

.settings-text-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 255, 153, 0.12);
  box-shadow: 0 0 12px rgba(0, 255, 153, 0.2);
}

.settings-text-input::placeholder {
  color: var(--text-muted);
}

.settings-hint {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.3rem;
}

/* Keyboard Shortcuts */

.settings-shortcuts {
  display: grid;
  gap: 0.6rem;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: rgba(0, 148, 255, 0.08);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  transition: all 0.3s ease;
}

.shortcut-item:hover {
  background: rgba(0, 148, 255, 0.15);
  transform: translateX(4px);
}

.shortcut-key {
  font-family: var(--f-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(0, 255, 153, 0.15);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 255, 153, 0.3);
  min-width: 100px;
  text-align: center;
}

.shortcut-desc {
  font-family: var(--f-ui);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Settings Actions */

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 255, 153, 0.15);
}

.settings-action-btn {
  padding: 0.9rem 1.2rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: var(--f-mono);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.save-btn {
  background: linear-gradient(135deg, rgba(0, 255, 153, 0.3), rgba(0, 200, 255, 0.2));
  color: var(--accent);
  border-color: rgba(0, 255, 153, 0.4);
}

.save-btn:hover {
  background: linear-gradient(135deg, rgba(0, 255, 153, 0.4), rgba(0, 200, 255, 0.3));
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(0, 255, 153, 0.3);
  transform: translateY(-2px);
}

.reset-btn {
  background: rgba(255, 221, 0, 0.15);
  color: var(--accent2);
  border-color: rgba(255, 221, 0, 0.3);
}

.reset-btn:hover {
  background: rgba(255, 221, 0, 0.25);
  border-color: var(--accent2);
  box-shadow: 0 0 20px rgba(255, 221, 0, 0.2);
  transform: translateY(-2px);
}

/* ────────────────────────────────────────────────────────── */
/* MOBILE RESPONSIVE                                           */
/* ────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .tb-main-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .tb-team-slots {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  * {
    box-sizing: border-box;
  }

  html, body {
    overflow-x: hidden;
  }

  .teambuilder-section {
    padding: 1.5rem 1rem 4rem;
    overflow-x: hidden;
  }

  .tb-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .tb-controls-left {
    width: 100%;
    flex-wrap: wrap;
  }

  .tb-btn {
    flex: 1;
    justify-content: center;
    min-width: 120px;
    font-size: 0.75rem;
  }

  .tb-team-counter {
    width: 100%;
    font-size: 0.8rem;
  }

  .tb-main-grid {
    gap: 1.5rem;
  }

  .tb-left-panel {
    padding: 1.5rem;
  }

  .tb-panel-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }

  .tb-search {
    margin-top: 1rem;
  }

  .tb-character-list {
    max-height: 450px;
    gap: 0.8rem;
  }

  .tb-char-item {
    gap: 1rem;
    padding: 0.9rem;
  }

  .tb-char-portrait {
    width: 50px;
    height: 50px;
    min-width: 50px;
  }

  .tb-char-name {
    font-size: 0.9rem;
  }

  .tb-char-meta {
    font-size: 0.75rem;
  }

  .tb-team-slots {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .tb-counter-table {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .tb-strength-details {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .tb-strength-stat {
    padding: 1rem;
  }

  .tb-stat-label {
    font-size: 0.75rem;
  }

  .tb-stat-value {
    font-size: 1.2rem;
  }

  .tb-tips-list {
    gap: 0.8rem;
  }

  .tb-tip {
    padding: 0.9rem;
    font-size: 0.9rem;
  }

  .tip-text {
    font-size: 0.85rem;
  }

  /* Settings Modal Mobile */
  .settings-modal-content {
    max-width: 95vw;
    max-height: 90vh;
  }

  .settings-modal-body {
    padding: 1rem;
    gap: 1rem;
  }

  .settings-section {
    padding: 1rem;
  }

  .settings-actions {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .settings-radio-group {
    margin-left: 0.25rem;
  }

  .settings-shortcuts {
    gap: 0.5rem;
  }

  .shortcut-item {
    padding: 0.6rem 0.8rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .shortcut-key {
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 640px) {
  * {
    box-sizing: border-box;
  }

  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  .teambuilder-section {
    padding: 1.2rem 0.75rem 3rem;
    overflow-x: hidden;
    width: 100%;
  }

  .tb-topbar {
    gap: 0.8rem;
  }

  .tb-controls-left {
    gap: 0.6rem;
  }

  .tb-btn {
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    min-width: 100px;
  }

  .tb-team-counter {
    font-size: 0.75rem;
    padding: 0.8rem 1rem;
  }

  .tb-main-grid {
    gap: 1.2rem;
  }

  .tb-left-panel,
  .tb-right-panel {
    padding: 1.2rem;
  }

  .tb-panel-title {
    font-size: 1.1rem;
    margin-bottom: 0.9rem;
  }

  .tb-search {
    margin-top: 0.8rem;
  }

  #team-character-search {
    font-size: 0.8rem;
  }

  .tb-character-list {
    max-height: 350px;
    gap: 0.7rem;
  }

  .tb-char-item {
    gap: 0.9rem;
    padding: 0.8rem;
    border-radius: 10px;
  }

  .tb-char-portrait {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 8px;
  }

  .tb-char-name {
    font-size: 0.85rem;
  }

  .tb-char-meta {
    font-size: 0.7rem;
  }

  .tb-team-display {
    padding: 1.2rem;
  }

  .tb-team-slots {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
  }

  .tb-team-slot {
    aspect-ratio: 1;
  }

  .tb-counter-table {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .tb-counter-cell {
    padding: 0.8rem;
  }

  .tb-strength-details {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .tb-strength-stat {
    padding: 0.9rem;
    border-radius: 10px;
  }

  .tb-stat-label {
    font-size: 0.7rem;
  }

  .tb-stat-value {
    font-size: 1.1rem;
  }

  .tb-tips-list {
    gap: 0.7rem;
  }

  .tb-tip {
    padding: 0.8rem;
    border-radius: 10px;
    font-size: 0.85rem;
  }

  .tip-text {
    font-size: 0.8rem;
  }

  /* Settings Modal 640px */
  .settings-modal-content {
    max-width: 100%;
    width: 100%;
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
  }

  .settings-modal-body {
    max-height: calc(95vh - 80px);
    overflow-y: auto;
  }

  .settings-section-title {
    font-size: 0.9rem;
  }

  .settings-label {
    font-size: 0.85rem;
  }

  .settings-radio {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  * {
    box-sizing: border-box;
  }

  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  .teambuilder-section {
    padding: 1rem 0.5rem 2.5rem;
    overflow-x: hidden;
    width: 100%;
  }

  .tb-topbar {
    flex-direction: column;
    gap: 0.6rem;
  }

  .tb-controls-left {
    gap: 0.5rem;
  }

  .tb-btn {
    padding: 0.65rem 0.8rem;
    font-size: 0.65rem;
    min-width: auto;
    flex: 1;
  }

  .tb-team-counter {
    font-size: 0.7rem;
    padding: 0.65rem 0.9rem;
  }

  .tb-main-grid {
    gap: 1rem;
  }

  .tb-left-panel,
  .tb-team-display,
  .tb-counter-info,
  .tb-tips-section {
    padding: 1rem;
    border-radius: 10px;
  }

  .tb-panel-title {
    font-size: 1rem;
    margin-bottom: 0.8rem;
  }

  .tb-search {
    margin-top: 0.7rem;
  }

  #team-character-search {
    font-size: 0.75rem;
    padding: 0.75rem 0.9rem 0.75rem 2.4rem;
  }

  .tb-character-list {
    max-height: 300px;
    gap: 0.6rem;
  }

  .tb-char-item {
    gap: 0.8rem;
    padding: 0.7rem;
    border-radius: 8px;
  }

  .tb-char-portrait {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .tb-char-name {
    font-size: 0.8rem;
  }

  .tb-char-meta {
    font-size: 0.65rem;
  }

  .tb-team-slots {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .tb-team-slot {
    aspect-ratio: 1;
  }

  .tb-counter-table {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .tb-counter-cell {
    padding: 0.7rem;
    font-size: 0.85rem;
  }

  .tb-strength-details {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
  }

  .tb-strength-stat {
    padding: 0.8rem;
    border-radius: 8px;
  }

  .tb-stat-label {
    font-size: 0.65rem;
  }

  .tb-stat-value {
    font-size: 1rem;
  }

  .tb-tips-list {
    gap: 0.6rem;
  }

  .tb-tip {
    padding: 0.7rem;
    border-radius: 8px;
    font-size: 0.8rem;
  }

  .tip-text {
    font-size: 0.75rem;
  }
}

  .tb-strength-percentage {
    font-size: 1.5rem;
    min-width: 70px;
  }

  .tb-tips-list {
    gap: 0.6rem;
  }

  .tip-icon {
    font-size: 1.2rem;
  }

  .tip-text {
    font-size: 0.8rem;
  }

  .tb-modal-content {
    max-height: 90vh;
    border-radius: 12px;
  }

  .tb-modal-header {
    padding: 1rem;
  }

  .tb-modal-header h2 {
    font-size: 1.1rem;
  }


/* ────────────────────────────────────────────────────────── */
/* ANIMATIONS & EFFECTS                                        */
/* ────────────────────────────────────────────────────────── */

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0, 255, 153, 0.2);
  }
  50% {
    box-shadow: 0 0 25px rgba(0, 255, 153, 0.5);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.tb-char-item,
.tb-team-slot,
.tb-tip {
  animation: slideIn 0.5s ease forwards;
}

.tb-char-item:nth-child(n) {
  animation-delay: calc(0.05s * var(--index, 1));
}

.tb-btn:hover {
  animation: glow 0.6s ease infinite;
}

.tb-team-slot.filled {
  animation: popIn 0.3s ease;
}

.tb-modal.active .tb-modal-content {
  animation: popIn 0.3s ease;
}

.settings-section {
  animation: slideIn 0.4s ease forwards;
}

/* ────────────────────────────────────────────────────────── */
/* PRINT STYLES (PDF)                                          */
/* ────────────────────────────────────────────────────────── */

@media print {
  body {
    background: white;
  }

  #navbar-container,
  #footer-container,
  .characters-header,
  #page-loader,
  .tb-topbar,
  .tb-left-panel,
  .tb-modal {
    display: none !important;
  }

  .tb-main-grid {
    grid-template-columns: 1fr;
  }

  .tb-right-panel {
    gap: 1.5rem;
  }

  .teambuilder-section {
    padding: 0;
  }

  .tb-team-display,
  .tb-counter-info,
  .tb-tips-section {
    border: 1px solid #ccc;
    background: white;
    color: black;
    page-break-inside: avoid;
  }

  .tb-team-slots {
    grid-template-columns: repeat(2, 1fr);
  }

  .tb-team-slot {
    border-color: #ccc;
    background: #f9f9f9;
  }

  .tb-slot-portrait {
    display: none;
  }

  .tb-panel-title {
    color: black;
  }

  .tb-tip {
    background: #f9f9f9;
    border: 1px solid #ccc;
    color: black;
  }

  .tip-text {
    color: black;
  }
}
