/* ==========================================================================
   components.css — panels, selectors, profile card, matrix, intel
   ========================================================================== */

/* ---- Panel ---- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(14px, 2.2vw, 24px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .03);
  animation: panel-in .45s var(--ease) both;
}
.panel::after { /* HUD corner brackets */
  content: ""; position: absolute; inset: -1px; pointer-events: none; border-radius: var(--radius);
  background:
    linear-gradient(var(--orange), var(--orange)) top left / 18px 2px no-repeat,
    linear-gradient(var(--orange), var(--orange)) top left / 2px 18px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 18px 2px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 2px 18px no-repeat;
  opacity: .8;
}
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-title {
  font-size: clamp(22px, 2.4vw, 28px);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.section-title small { font-size: .62em; color: var(--text-dim); letter-spacing: .08em; }
.section-title--threat { color: var(--red); text-shadow: 0 0 12px rgba(255, 77, 79, .35); }
.section-title--adv { color: var(--green); text-shadow: 0 0 12px rgba(0, 229, 153, .3); }
.section-title--cyan { color: var(--cyan); }
.section-title--orange { color: var(--orange); }

/* ---- Pulse dot ---- */
.pulse-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--orange);
  box-shadow: var(--glow-orange); animation: pulse 1.8s ease-in-out infinite; flex: none;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(249, 158, 26, 0), 0 0 22px rgba(249, 158, 26, .9); } }

/* ---- Selectors ---- */
.selector { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.selector__label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-size: 20px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-dim);
}
.selector__label .count {
  font-family: var(--font-body); font-weight: 700; font-size: 13px; line-height: 1;
  padding: 4px 8px; border-radius: 999px; color: #0b1220; background: var(--cyan); box-shadow: var(--glow-cyan);
}
.selector[data-role="tank"] .count { background: var(--role-tank); }
.selector[data-role="damage"] .count { background: var(--orange); box-shadow: var(--glow-orange); }
.selector[data-role="support"] .count { background: var(--green); box-shadow: 0 0 12px rgba(0, 229, 153, .45); }
.selector__control { position: relative; }
.selector__control::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--orange); border-bottom: 2px solid var(--orange); transform: rotate(45deg); pointer-events: none;
}
.selector select {
  width: 100%; appearance: none; -webkit-appearance: none;
  background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 36px 10px 12px; font-size: 17px; font-weight: 600; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.selector select:hover { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.selector select.is-active { border-color: var(--orange); box-shadow: var(--glow-orange); color: var(--orange); }
.selector select option { background: #0e1726; color: var(--text); }

/* ---- Badges ---- */
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.badge {
  font-family: var(--font-body); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 4px; border: 1px solid currentColor; background: rgba(0, 0, 0, .35); line-height: 1.3;
}
.badge--tank { color: var(--role-tank); box-shadow: 0 0 10px rgba(63, 169, 245, .35); }
.badge--damage { color: var(--role-damage); box-shadow: 0 0 10px rgba(255, 107, 91, .35); }
.badge--support { color: var(--role-support); box-shadow: 0 0 10px rgba(79, 224, 166, .35); }
.badge--play { color: var(--orange); box-shadow: var(--glow-orange); }
.badge--sub { color: var(--cyan); }

/* ---- Portrait ---- */
.portrait {
  position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(circle at 50% 30%, rgba(0, 163, 224, .25), rgba(6, 11, 20, .9) 70%);
  border: 2px solid var(--line-strong); box-shadow: var(--glow-cyan);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait--lg { width: clamp(150px, 22vw, 240px); }
.portrait--lg::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(transparent 60%, rgba(6, 11, 20, .6)), repeating-linear-gradient(transparent 0 3px, rgba(0, 163, 224, .05) 3px 4px);
}
.portrait--sm { width: 64px; flex: none; border-width: 1px; box-shadow: none; }

/* ---- Profile ---- */
.profile { display: grid; grid-template-columns: auto 1fr auto; gap: clamp(14px, 2.5vw, 28px); align-items: start; }
.profile__name {
  font-size: clamp(48px, 7vw, 84px); font-weight: 700; color: #fff; margin: 4px 0 6px;
  text-shadow: 0 0 22px rgba(0, 163, 224, .35);
}
.profile__tagline { color: var(--text-dim); font-style: italic; margin: 0 0 10px; border-left: 3px solid var(--orange); padding-left: 10px; }
.profile__overview { margin: 0 0 12px; font-size: 18px; }
.profile__meta { color: var(--text-mute); font-size: 14px; letter-spacing: .04em; }
.profile__meta a { color: var(--text-dim); }

.abilities { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.ability {
  font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: rgba(0, 163, 224, .08); border: 1px solid var(--line); color: var(--text-dim); cursor: help;
  transition: border-color .2s, color .2s;
}
.ability:hover, .ability:focus-visible { border-color: var(--cyan); color: var(--text); }

.stats { display: grid; gap: 10px; min-width: 170px; }
.stat {
  border-radius: var(--radius-sm); padding: 12px 14px; text-align: center; background: rgba(0, 0, 0, .35); border: 1px solid;
}
.stat__value { font-family: var(--font-head); font-size: 54px; line-height: .9; font-weight: 700; }
.stat__label { font-size: 13px; letter-spacing: .12em; font-weight: 700; text-transform: uppercase; }
.stat--threat { border-color: rgba(255, 77, 79, .55); color: var(--red); box-shadow: inset 0 0 20px rgba(255, 77, 79, .12), 0 0 12px rgba(255, 77, 79, .2); }
.stat--adv { border-color: rgba(0, 229, 153, .55); color: var(--green); box-shadow: inset 0 0 20px rgba(0, 229, 153, .12), 0 0 12px rgba(0, 229, 153, .2); }

@media (max-width: 900px) {
  .profile { grid-template-columns: auto 1fr; }
  .stats { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .profile { grid-template-columns: 1fr; justify-items: start; }
  .portrait--lg { width: 150px; }
}

/* ---- Counter cards ---- */
.counter-list { display: grid; gap: 10px; }
.counter-card {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid; border-radius: var(--radius-sm);
  padding: 10px 12px; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s, background .2s;
}
.matrix__col--threat .counter-card { border-left-color: var(--red); }
.matrix__col--adv .counter-card { border-left-color: var(--green); }
.counter-card:hover, .counter-card:focus-visible { transform: translateX(4px); background: rgba(28, 44, 70, .95); }
.matrix__col--threat .counter-card:hover { border-color: var(--red); box-shadow: 0 0 16px rgba(255, 77, 79, .3); }
.matrix__col--adv .counter-card:hover { border-color: var(--green); box-shadow: 0 0 16px rgba(0, 229, 153, .28); }
.counter-card__body { min-width: 0; flex: 1; }
.counter-card__name { font-family: var(--font-head); font-size: 26px; text-transform: uppercase; letter-spacing: .04em; line-height: 1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.counter-card__role { font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: .1em; padding: 2px 6px; border-radius: 3px; border: 1px solid currentColor; }
.counter-card__why { margin: 4px 0 0; color: var(--text-dim); font-size: 15.5px; line-height: 1.35; }
.counter-card__why b { color: var(--text); font-weight: 700; }
.counter-card__go { color: var(--text-mute); font-size: 22px; transition: color .2s, transform .2s; }
.counter-card:hover .counter-card__go { color: var(--orange); transform: translateX(3px); }
.role-tank { color: var(--role-tank); }
.role-damage { color: var(--role-damage); }
.role-support { color: var(--role-support); }

/* ---- Intel ---- */
.map-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.map-group { background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.map-group h3 { font-size: 22px; margin-bottom: 8px; }
.map-group--attack h3 { color: var(--orange); }
.map-group--defense h3 { color: var(--cyan); }
.map-list { display: grid; gap: 6px; }
.map-list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-weight: 600; padding: 6px 8px; border-radius: 4px; background: rgba(255, 255, 255, .03); }
.map-mode { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; }
.positioning { border-left: 3px solid var(--cyan); padding: 8px 12px; background: rgba(0, 163, 224, .06); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 0; }
.positioning strong { color: var(--cyan); font-family: var(--font-head); font-size: 20px; letter-spacing: .05em; text-transform: uppercase; display: block; }

.tips { counter-reset: tip; display: grid; gap: 10px; }
.tips li {
  counter-increment: tip; position: relative; padding: 10px 12px 10px 52px;
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.tips li::before {
  content: counter(tip, decimal-leading-zero); position: absolute; left: 12px; top: 8px;
  font-family: var(--font-head); font-size: 28px; line-height: 1; color: var(--orange); text-shadow: var(--glow-orange);
}
@media (max-width: 560px) { .map-split { grid-template-columns: 1fr; } }

/* ---- States ---- */
.loader { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 60px 0; font-family: var(--font-head); font-size: 26px; text-transform: uppercase; color: var(--text-dim); letter-spacing: .08em; }
.loader__ring { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--orange); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-panel { border-color: rgba(255, 77, 79, .6); color: var(--red); font-weight: 600; }
.empty { color: var(--text-mute); font-style: italic; }
.flash { animation: flash .6s var(--ease); }
@keyframes flash { from { box-shadow: 0 0 0 2px var(--orange), 0 0 40px rgba(249, 158, 26, .5); } }

/* ---- Language toggle (EN / NO) ---------------------------------------- */
.lang-toggle {
  display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  overflow: hidden; background: rgba(6, 11, 20, .7); box-shadow: var(--glow-cyan);
}
.lang-toggle__btn {
  font: 700 18px/1 var(--font-head); letter-spacing: .12em; color: var(--text-dim);
  background: transparent; border: 0; padding: 7px 14px 5px; cursor: pointer;
  transition: background .2s, color .2s;
}
.lang-toggle__btn + .lang-toggle__btn { border-left: 1px solid var(--line-strong); }
.lang-toggle__btn:hover { color: var(--text); background: rgba(0, 163, 224, .12); }
.lang-toggle__btn:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.lang-toggle__btn.is-active { color: #060b14; background: linear-gradient(90deg, var(--orange), #ffc15e); }

/* ---- Upcoming hero ---------------------------------------------------- */
.badge--upcoming {
  color: #060b14; background: linear-gradient(90deg, var(--orange), var(--cyan));
  border-color: transparent; box-shadow: var(--glow-orange), var(--glow-cyan);
  animation: upcoming-pulse 2.4s ease-in-out infinite;
}
@keyframes upcoming-pulse { 50% { filter: brightness(1.25); } }
@media (prefers-reduced-motion: reduce) { .badge--upcoming { animation: none; } }
.profile--upcoming { border-color: var(--orange); box-shadow: 0 0 0 1px rgba(249, 158, 26, .35), 0 0 26px rgba(0, 163, 224, .18); }
.upcoming-info {
  margin: 12px 0 4px; padding: 10px 12px; border-left: 3px solid var(--orange);
  background: rgba(249, 158, 26, .07); border-radius: var(--radius-sm); font-size: 15px; line-height: 1.4;
  display: grid; gap: 6px; color: var(--text-dim);
}
.upcoming-info strong { color: var(--text); }
.upcoming-info__note { color: var(--orange); }
.sources a { color: var(--cyan); }
.sources a:hover { color: var(--orange); }
.counter-card__tag {
  font-family: var(--font-body); font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  padding: 2px 6px; border-radius: 3px; color: var(--orange); border: 1px dashed var(--orange);
}
.counter-card__tag--upcoming { color: var(--cyan); border-style: solid; border-color: var(--cyan); }
.counter-card--prelim { border-style: dashed; }
.upcoming-info p { margin: 0; }
