/* ═══════════════════════════════════════════════════════════════════
   TSG Fleet Planner — Stylesheet
   Author : Daygonn · v1.0
   https://github.com/NicoVBucks/tsg-fleet-planner
═══════════════════════════════════════════════════════════════════ */


/* ─── 1. Variables / tokens ──────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-deep:           #030a12;
  --bg-card:           #0b1929;
  --bg-modal:          #0a1624;
  --bg-input:          #07111e;
  --bg-lang:           #0a1828;

  /* Blue palette */
  --blue:              #4db8ff;
  --blue-mid:          #2a90d4;
  --blue-dim:          rgba(42, 144, 212, 0.28);
  --blue-hover:        rgba(42, 144, 212, 0.50);
  --blue-fill:         rgba(42, 120, 200, 0.08);
  --blue-fill-hover:   rgba(42, 144, 212, 0.16);
  --border-dim:        rgba(42, 100, 180, 0.25);
  --border-card:       rgba(42, 110, 190, 0.18);
  --border-card-left:  rgba(42, 150, 220, 0.45);

  /* Semantic colors */
  --green:             #22d480;
  --amber:             #f0a020;
  --red:               #ff5040;
  --gold:              #ffd000;
  --gold-accent:       #d4a020;
  --violet:            #c888ff;

  /* Text */
  --text-primary:      #c8dcea;
  --text-secondary:    #5a90b8;
  --text-muted:        #4a7090;

  /* Typography */
  --font-ui:           'Rajdhani', sans-serif;
  --font-mono:         'Share Tech Mono', monospace;

  /* Easing */
  --ease-spring:       cubic-bezier(0.22, 1, 0.36, 1);
}


/* ─── 2. Reset & base ────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  height: 100%;
}

body {
  min-height: 100%;
  background-color: var(--bg-deep);
  background-image:
    linear-gradient(rgba(3, 10, 18, 0.74), rgba(3, 10, 18, 0.74)),
    url("assets/images/Champs%20d%27ast%C3%A9roides/SC_Wallpaper_1920x1080_HD_ext_3.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  font-family: var(--font-ui);
}


/* ─── 3. Layout ──────────────────────────────────────────────────── */
.wrap {
  background: linear-gradient(
    150deg,
    rgba(7, 16, 29, 0.84) 0%,
    rgba(5, 12, 23, 0.90) 100%
  );
  border: 1px solid rgba(42, 130, 210, 0.2);
  border-radius: 6px;
  padding: 2.5rem 2.25rem;
  position: relative;
  overflow: clip;
  width: 100%;
  max-width: 1080px;
}

/* Scanline overlay */
.wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 15, 40, 0.07) 3px,
    rgba(0, 15, 40, 0.07) 4px
  );
  pointer-events: none;
  z-index: 0;
}

/* Top glow line */
.wrap::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(77, 184, 255, 0.45),
    transparent
  );
  pointer-events: none;
  z-index: 1;
}

/* Corner brackets */
.c-tl,
.c-tr,
.c-bl,
.c-br {
  position: absolute;
  width: 14px;
  height: 14px;
  z-index: 2;
  pointer-events: none;
}

.c-tl {
  top: 9px;
  left: 9px;
  border-top: 2px solid rgba(42, 144, 212, 0.55);
  border-left: 2px solid rgba(42, 144, 212, 0.55);
}

.c-tr {
  top: 9px;
  right: 9px;
  border-top: 2px solid rgba(42, 144, 212, 0.55);
  border-right: 2px solid rgba(42, 144, 212, 0.55);
}

.c-bl {
  bottom: 9px;
  left: 9px;
  border-bottom: 2px solid rgba(42, 144, 212, 0.55);
  border-left: 2px solid rgba(42, 144, 212, 0.55);
}

.c-br {
  bottom: 9px;
  right: 9px;
  border-bottom: 2px solid rgba(42, 144, 212, 0.55);
  border-right: 2px solid rgba(42, 144, 212, 0.55);
}

#root {
  position: relative;
  z-index: 1;
}

.sticky-top {
  margin: 0 -2.25rem;
  padding: 0 2.25rem;
  border-bottom: 1px solid rgba(42, 100, 180, 0.25);
}

/* Scroll-to-top button */
#scroll-top-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #090f1c;
  border: 1px solid rgba(42, 120, 200, 0.4);
  color: var(--blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  transform: translateY(10px);
  pointer-events: none;
}

#scroll-top-btn.visible {
  opacity: .9;
  transform: translateY(0);
  pointer-events: auto;
}

#scroll-top-btn:hover {
  background: rgba(42, 120, 200, 0.14);
  border-color: rgba(42, 144, 212, 0.6);
}


/* ─── 4. Header / navigation ─────────────────────────────────────── */
.tabs-row {
  display: flex;
  border-bottom: 1px solid rgba(42, 100, 180, 0.14);
  overflow-x: auto;
  position: relative;
}

.tab {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6a9ab8;
  transition: color .15s;
  white-space: nowrap;
  border-radius: 0;
}

.tab.on {
  color: var(--blue);
  text-shadow: 0 0 16px rgba(77, 184, 255, 0.28);
}

.tab.on[data-tab="score"] {
  color: var(--green);
  text-shadow: 0 0 16px rgba(34, 212, 128, 0.28);
}

.tab.on[data-tab="timer"] {
  color: var(--amber);
  text-shadow: 0 0 16px rgba(240, 160, 32, 0.28);
}

.tab:hover:not(.on) {
  color: #8abcd4;
}

.tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--blue-mid);
  box-shadow: 0 0 8px rgba(42, 144, 212, 0.55);
  border-radius: 1px;
  pointer-events: none;
  transition:
    transform .32s var(--ease-spring),
    width    .32s var(--ease-spring);
  will-change: transform, width;
}

/* Language selector */
.lang-toggle {
  background: var(--blue-fill);
  border: 1px solid rgba(42, 120, 200, 0.28);
  border-radius: 3px;
  cursor: pointer;
  padding: 8px 28px 8px 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .15s;
  justify-content: center;
  position: relative;
}

.lang-toggle > i {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.lang-toggle:hover,
.lang-toggle.open {
  background: rgba(42, 144, 212, 0.14);
  border-color: var(--blue-hover);
  color: var(--blue);
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  background: var(--bg-lang);
  border: 1px solid rgba(42, 120, 200, 0.4);
  border-radius: 4px;
  padding: 5px;
  z-index: 200;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
}

.lang-item {
  background: none;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  padding: 7px 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  transition: all .12s;
  width: 100%;
}

.lang-item:hover {
  background: rgba(42, 144, 212, 0.12);
  color: var(--blue);
}

.lang-item.on {
  background: rgba(42, 144, 212, 0.18);
  color: var(--blue);
  border: .5px solid rgba(42, 144, 212, 0.35);
}


/* ─── 5. Buttons ─────────────────────────────────────────────────── */
.btn {
  background: var(--blue-fill);
  border: 1px solid rgba(42, 120, 200, 0.28);
  border-radius: 3px;
  cursor: pointer;
  padding: 8px 18px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .15s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--blue-fill-hover);
  border-color: var(--blue-hover);
  color: var(--blue);
  box-shadow: 0 0 14px rgba(42, 144, 212, 0.18);
}

.btn:disabled {
  opacity: .3;
  cursor: not-allowed;
}

/* Ship class selector buttons */
.cls-btn {
  background: rgba(10, 20, 38, 0.8);
  border: 1px solid rgba(42, 120, 200, 0.22);
  border-radius: 3px;
  cursor: pointer;
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .15s;
}

.cls-btn:hover {
  color: var(--text-secondary);
  border-color: rgba(42, 144, 212, 0.4);
}

/* Ship picker buttons */
.ship-btn {
  background: rgba(8, 18, 32, 0.8);
  border: 1px solid rgba(42, 100, 160, 0.28);
  border-radius: 3px;
  cursor: pointer;
  padding: 6px 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: #a8c8e0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .12s;
  white-space: nowrap;
  letter-spacing: .04em;
}

.ship-btn:hover {
  background: rgba(42, 90, 150, 0.18);
  border-color: var(--blue-hover);
  color: #d8eaf6;
}

/* Favourite ship button modifier */
.fav-btn {
  border-color: rgba(200, 148, 20, 0.45) !important;
  color: var(--gold-accent) !important;
}

.fav-btn:hover {
  background: rgba(200, 148, 20, 0.12) !important;
  border-color: rgba(200, 148, 20, 0.65) !important;
  color: #f0c040 !important;
}


/* ─── 6. Forms ───────────────────────────────────────────────────── */
.lbl {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stag {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 3px;
  display: inline-block;
}

.ship-btn .stag {
  font-size: 10px;
  padding: 1px 5px;
  vertical-align: middle;
  margin-left: 4px;
}

input[type="text"] {
  background: var(--bg-input);
  border: 1px solid rgba(42, 100, 180, 0.25);
  border-radius: 3px;
  padding: 10px 13px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  width: 100%;
  outline: none;
  transition: border-color .15s;
}

input[type="text"]::placeholder {
  color: #6090b8;
}

input[type="text"]:focus {
  border-color: rgba(42, 144, 212, 0.55);
}

input[type="checkbox"] {
  accent-color: var(--blue-mid);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.chk-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .05em;
  cursor: pointer;
  white-space: nowrap;
  padding: 2px 0;
  transition: color .15s;
}

/* Ship search wrapper */
.ship-search-wrap {
  position: relative;
  max-width: 340px;
  margin-bottom: 12px;
}
.ship-search-wrap .ti-search {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
}
.ship-search-wrap input[type="text"] {
  padding-left: 33px;
  padding-right: 12px;
}
.ship-search-wrap [data-action="clear-ship-search"] {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #5a90b8;
  padding: 4px;
  border-radius: 3px;
}
.ship-search-wrap [data-action="clear-ship-search"] .ti-x {
  font-size: 14px;
}

/* Trench letter selector */
.trench-sel {
  display: flex;
  gap: 5px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .18s ease, opacity .15s ease;
}

.trench-sel.trench-sel-on {
  max-height: 32px;
  opacity: 1;
}

.trench-btn {
  background: transparent;
  border: 1px solid rgba(42, 100, 180, 0.2);
  border-radius: 3px;
  cursor: pointer;
  padding: 2px 9px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all .12s;
  white-space: nowrap;
}

.trench-btn-a:hover:not(.active) {
  border-color: rgba(255, 208, 0, 0.45);
  color: #c8b000;
}

.trench-btn-b:hover:not(.active) {
  border-color: rgba(77, 184, 255, 0.45);
  color: #5a8ab0;
}

.trench-btn-c:hover:not(.active) {
  border-color: rgba(34, 212, 128, 0.45);
  color: #4a8060;
}

.trench-btn-a.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(255, 208, 0, 0.1);
  box-shadow: 0 0 8px rgba(255, 208, 0, 0.22);
}

.trench-btn-b.active {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(77, 184, 255, 0.1);
  box-shadow: 0 0 8px rgba(77, 184, 255, 0.2);
}

.trench-btn-c.active {
  border-color: var(--green);
  color: var(--green);
  background: rgba(34, 212, 128, 0.1);
  box-shadow: 0 0 8px rgba(34, 212, 128, 0.2);
}


/* ─── 7. Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-left: 3px solid var(--border-card-left);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin-bottom: .875rem;
  transition: border-left-color .25s;
}

/* Ballistic loadout section */
.bal-section {
  padding: 14px;
  border-radius: 3px;
  border-top: 1px solid rgba(42, 100, 180, 0.15);
  margin-top: 4px;
  transition: background .25s, border-color .25s;
}

.bal-off {
  background: rgba(255, 80, 64, 0.06);
  border-top-color: rgba(255, 80, 64, 0.15);
}

.bal-on {
  background: rgba(34, 212, 128, 0.08);
  border-top-color: rgba(34, 212, 128, 0.2);
}

/* Empty state */
.empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .05em;
  border: 1px dashed rgba(42, 100, 180, 0.2);
  border-radius: 4px;
}


/* ─── 8. Score ───────────────────────────────────────────────────── */
.prog-track {
  height: 5px;
  background: rgba(42, 100, 180, 0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 14px;
}

.prog-bar {
  height: 100%;
  border-radius: 2px;
  transition: width .55s var(--ease-spring);
}


/* ─── 9. Timer ───────────────────────────────────────────────────── */
.timer-big {
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: 90px;
  line-height: 1;
  letter-spacing: .06em;
  color: var(--text-primary);
}

.t-live {
  color: var(--blue);
  animation: pulse-live 1.8s ease-in-out infinite;
}

.t-done {
  color: var(--green);
  text-shadow: 0 0 14px rgba(34, 212, 128, 0.4);
}


/* ─── 10. Crew summary ───────────────────────────────────────────── */
/* Row styles are applied inline via renderRecapRows() in app.js.   */
/* The only CSS hook is the animation class below (see §14).         */


/* ─── 11. Onboarding ─────────────────────────────────────────────── */
/* Onboarding cards use .card + inline styles via renderOnboarding(). */


/* ─── 12. Footer ─────────────────────────────────────────────────── */
.app-footer {
  margin-top: 2.5rem;
}

.footer-sep {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(42, 100, 180, 0.5),
    transparent
  );
  margin-bottom: 1.75rem;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.footer-credit {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-badge {
  height: 72px;
  opacity: .95;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(42, 144, 212, 0.28));
}

.footer-author {
  color: var(--gold-accent);
  font-weight: 700;
}

.footer-credit-text {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #5a8aaa;
}

.footer-enlist {
  background: rgba(42, 120, 200, 0.1);
  border: 1px solid rgba(42, 120, 200, 0.35);
  border-radius: 3px;
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.footer-enlist:hover {
  background: var(--blue-fill-hover);
  border-color: rgba(42, 144, 212, 0.55);
  color: var(--blue);
  box-shadow: 0 0 14px rgba(42, 144, 212, 0.18);
}

.footer-legal {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.75;
  color: #3a5870;
  text-align: center;
}

/* Utility bar */
.util-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  padding: .65rem 0;
}

.util-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.util-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.util-brand {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.util-ver {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #3a6a8a;
  margin-left: 3px;
}

.util-dot {
  color: rgba(42, 100, 180, 0.38);
  user-select: none;
  font-size: 13px;
}

.util-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0;
  text-decoration: none;
  letter-spacing: .04em;
  transition: color .15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}

.util-link:hover {
  color: #7ab8d8;
}


/* ─── 13. Modals / toast ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 4, 12, 0.8);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  transition: opacity .2s ease;
  padding: 1rem;
}

.modal-overlay.visible {
  opacity: 1;
}

.modal-box {
  background: var(--bg-modal);
  border: 1px solid rgba(42, 110, 190, 0.28);
  border-left: 3px solid rgba(42, 150, 220, 0.5);
  border-radius: 5px;
  padding: 1.5rem;
  max-width: 520px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  transform: translateY(14px);
  transition: transform .24s var(--ease-spring);
}

.modal-overlay.visible .modal-box {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid rgba(42, 100, 180, 0.16);
}

.modal-title {
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
}

/* Toast notification */
.share-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(8, 14, 26, 0.97);
  border: 1px solid rgba(42, 144, 212, 0.35);
  border-radius: 4px;
  padding: 11px 20px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-primary);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity   .22s ease,
    transform .22s var(--ease-spring);
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
}

.share-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.share-toast.success {
  border-color: rgba(34, 212, 128, 0.45);
  color: var(--green);
}

.share-toast.fallback {
  border-color: rgba(240, 160, 32, 0.4);
  color: var(--amber);
}


/* ─── 14. Animations ─────────────────────────────────────────────── */
@keyframes fi {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-live {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 10px rgba(77, 184, 255, 0.5);
  }
  50% {
    opacity: .8;
    text-shadow: 0 0 22px rgba(77, 184, 255, 0.8);
  }
}

@keyframes badge-pop {
  0%   { transform: scale(0.75); opacity: 0.5; }
  65%  { transform: scale(1.09); }
  100% { transform: scale(1);    opacity: 1; }
}

@keyframes score-in {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes subtitle-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes card-open {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes card-collapse {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

@keyframes row-enter {
  from { opacity: 0; transform: translateX(-5px); }
  to   { opacity: 1; transform: none; }
}

@keyframes ships-reveal {
  from { opacity: 0; clip-path: inset(0 0 100% 0); }
  to   { opacity: 1; clip-path: inset(0 0 0% 0); }
}

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

/* Animation utility classes */
.score-num {
  animation: score-in .30s ease both;
}

.subtitle-reveal {
  animation: subtitle-in .20s ease both;
}

.card-new {
  animation: card-open .24s var(--ease-spring) both;
}

.card-opening {
  animation: card-open .22s var(--ease-spring) both;
}

.card-closing {
  animation: card-collapse .18s ease-in both;
  pointer-events: none;
}

.ships-enter {
  animation: ships-reveal .28s var(--ease-spring) both;
}

.recap-row-new {
  animation: row-enter .16s ease both;
}

.ti-spin {
  animation: tsg-spin .75s linear infinite;
}

.type-cursor {
  color: var(--blue);
  animation: cursor-blink .65s step-end infinite;
  margin-left: 2px;
  font-weight: 400;
  font-style: normal;
}

.type-cursor.cursor-done {
  animation: cursor-blink .65s step-end 2;
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* ─── 15. Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .wrap       { padding: 2rem 1.75rem; }
  .sticky-top { margin: 0 -1.75rem; padding: 0 1.75rem; }
  .tab        { padding: 10px 18px; font-size: 15px; }
}

@media (max-width: 600px) {
  body               { padding: .75rem .5rem; }
  .wrap              { padding: 1.5rem 1.25rem; border-radius: 0; }
  .sticky-top        { margin: 0 -1.25rem; padding: 0 1.25rem; }
  .tab               { padding: 9px 12px; font-size: 13px; }
  .cls-btn           { padding: 6px 11px; font-size: 13px; }
  .ship-btn          { padding: 5px 10px; font-size: 12px; }
  .card              { padding: 1rem 1.1rem; }
  input[type="text"] { font-size: 14px; padding: 8px 10px; }
  .timer-big         { font-size: 56px; }
  .util-bar          { gap: 4px 10px; }
  .util-bar-right    { gap: 4px 8px; }
  .modal-box         { padding: 1.1rem; }
  .ship-search-wrap  { max-width: 100%; }
}

@media (max-width: 400px) {
  .timer-big { font-size: 44px; }
  .btn       { padding: 6px 12px; font-size: 12px; }
  .tab       { padding: 8px 9px; font-size: 12px; gap: 4px; }
}

/* Background images — resolution variants */
@media (max-width: 600px) and (orientation: portrait) {
  body {
    background-image:
      linear-gradient(rgba(3, 10, 18, 0.74), rgba(3, 10, 18, 0.74)),
      url("assets/images/Champs%20d%27ast%C3%A9roides/SC_Wallpaper_1080x2340_Mobile_ext_3.jpg");
    background-attachment: scroll;
  }
}

@media (min-width: 601px) and (max-width: 1200px) and (orientation: portrait) {
  body {
    background-image:
      linear-gradient(rgba(3, 10, 18, 0.74), rgba(3, 10, 18, 0.74)),
      url("assets/images/Champs%20d%27ast%C3%A9roides/SC_Wallpaper_1440x3200_Mobile_ext_3.jpg");
    background-attachment: scroll;
  }
}

@media (min-width: 601px) and (max-width: 1200px) and (orientation: landscape) {
  body {
    background-image:
      linear-gradient(rgba(3, 10, 18, 0.74), rgba(3, 10, 18, 0.74)),
      url("assets/images/Champs%20d%27ast%C3%A9roides/SC_Wallpaper_2048x2048_Tablet_ext_3.jpg");
  }
}

@media (min-width: 1921px) and (max-width: 2560px) {
  body {
    background-image:
      linear-gradient(rgba(3, 10, 18, 0.74), rgba(3, 10, 18, 0.74)),
      url("assets/images/Champs%20d%27ast%C3%A9roides/SC_Wallpaper_2560x1440_QHD_ext_3.jpg");
  }
}

@media (min-width: 2561px) and (max-width: 3840px) {
  body {
    background-image:
      linear-gradient(rgba(3, 10, 18, 0.74), rgba(3, 10, 18, 0.74)),
      url("assets/images/Champs%20d%27ast%C3%A9roides/SC_Wallpaper_3840x2160_4K_ext_3.jpg");
  }
}

@media (min-width: 3841px) {
  body {
    background-image:
      linear-gradient(rgba(3, 10, 18, 0.74), rgba(3, 10, 18, 0.74)),
      url("assets/images/Champs%20d%27ast%C3%A9roides/SC_Wallpaper_5120x1440_Wide_ext_3.jpg");
  }
}
