/* === HEADER BACKGROUND === */
header {
  background: linear-gradient(90deg, #e67e22, #d84315); 
  color: white;
  padding: 0.4rem 1rem; /* further reduced padding */
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  border-bottom: 2px solid #fbc02d; /* thinner golden line */
}

/* === FLEX CONTAINER === */
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem; /* smaller gap */
}

/* === LOGO === */
.logo {
  width: 60px;   /* much smaller logo */
  height: auto;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.5))
          drop-shadow(0 0 8px #ffeb3b); 
  transition: transform 0.3s ease, filter 0.3s ease;
}

.logo:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.6))
          drop-shadow(0 0 12px #ff9800);
}

/* === TITLE === */
.site-title {
  font-size: 1.8rem; /* much smaller font size */
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0;
  color: #fff;
  text-shadow:
      0 0 2px rgba(255,255,255,0.7),
      0 0 6px #ffc107,
      0 0 12px rgba(255,152,0,0.6); /* subtler glow */
  animation: auraPulse 4s infinite ease-in-out;
}

/* === AURA PULSE (Adjusted for smaller size) === */
@keyframes auraPulse {
  0%, 100% {
    text-shadow:
      0 0 2px rgba(255,255,255,0.8),
      0 0 6px #ffc107,
      0 0 12px rgba(255,152,0,0.6);
  }
  50% {
    text-shadow:
      0 0 3px rgba(255,255,255,0.9),
      0 0 10px #ff9800,
      0 0 16px rgba(255,111,0,0.8);
  }
}

footer {
    background: #111;
    color: #aaa;
    text-align: center;
    padding: 0.3rem;
    font-size: 0.9rem;
    position: fixed;
    width: 100%;
    bottom: 0;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.5);
}

.back-home-btn {
  display: inline-block;
  margin: 12px 0 0 16px; /* spacing from top & left */
  background: #23273a;
  color: #ffe190;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  padding: 8px 16px;
  border-radius: 26px;
  box-shadow: 0 2px 12px #0005;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.back-home-btn:hover,
.back-home-btn:focus {
  background: #141736;
  color: #ffe567;
  box-shadow: 0 2px 16px #ffe56744;
  outline: none;
}

/* Smaller on mobile */
@media (max-width: 600px) {
  .back-home-btn {
    margin: 8px 0 0 10px;
    font-size: 1em;
    padding: 6px 12px;
  }
}

body {
  background: linear-gradient(135deg, #283a45 0%, #161b2e 100%);
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  color: #f6edda;
  padding-bottom: 30px;
}

h1 {
  color: #ffb300;
  text-align: center;
  margin-top: 2rem;
  font-size: 2.3rem;
  letter-spacing: 1.5px;
  text-shadow: 1px 3px 8px #22305eaa;
  font-weight: bold;
}

.calculator-section {
  max-width: 1000px;
  margin: 34px auto;
  background: #22293e;
  border-radius: 20px;
  box-shadow: 0 2px 32px #22293ecc;
  padding: 16px 24px 34px 24px;  /* More padding if you want */
}

.input-group-row {
  display: flex;
  justify-content: center;
  gap: 38px;
  margin: 20px 0 22px 0;
  flex-wrap: wrap;
}

.input-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #1e2535e6;
  border-radius: 1.2em;
  padding: 20px 22px 12px 22px;
  box-shadow: 0 6px 18px #0006;
  min-width: 140px;
}

.input-icon {
  font-size: 2.2rem;
  margin-bottom: 5px;
  filter: drop-shadow(1px 2px 2px #0008);
}

.input-block label {
  font-weight: 700;
  color: #cee9ff;
  font-size: 1.2em;
  margin-bottom: 9px;
  letter-spacing: 0.04em;
  text-align: center;
}

.input-block input[type="number"] {
  font-size: 1.6em;
  padding: 7px 0;
  width: 108px;
  text-align: center;
  background: #16213a;
  color: #fffde7;
  border: none;
  border-bottom: 3px solid #70c1ff;
  border-radius: .5em .5em 0 0;
  outline: none;
  margin-bottom: 4px;
  box-shadow: 0 1px 2px #0004;
  transition: border-color .18s;
}
.input-block input[type="number"]:focus {
  border-bottom: 3px solid #ffda38;
}

.input-example {
  color: #aaa;
  font-size: 1em;
  margin-top: 2px;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 18px;              /* space between label and input */
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
  position: relative;     /* for input-wrapper's cross button */
}

.search-label {
  color: #ffe190;
  font-weight: bold;
  font-size: 1.06rem;
  margin-bottom: 0;
  min-width: 130px;       /* or whatever you like for label width */
}

.search-input-wrapper {
  position: relative; /* needed for suggestion dropdown positioning */
  flex: 1 1 280px;
  max-width: 100%;
  min-width: 220px;
  display: flex;
  align-items: center;
}
#char-search {
  font-size: 1.07rem;
  padding: 8px 8px;
  border-radius: 8px;
  border: none;
  background: #fafdff;
  color: #243443;
  box-shadow: 0 1px 4px #08121922;
  margin-bottom: 4px;
}
#char-search:focus {
  outline: 2px solid #47b7ff;
}
#search-results {
  position: absolute;       /* absolute inside .search-input-wrapper */
  left: 0;
  top: 100%;                /* right below the input */
  width: 100%;              /* match input's width */
  background: #23273a;
  box-shadow: 0 2px 12px #0005;
  border-radius: 6px;
  z-index: 10;
  max-height: 180px;
  overflow-y: auto;
  padding-left: 4px;
  margin-top: 2px;          /* slight gap below the input */
}
.search-result {
  padding: 9px 7px 9px 14px;
  cursor: pointer;
  color: #fff;
  border-bottom: 1px solid #34455788;
  font-size: 1.05rem;
  transition: background 0.15s;
}
.search-result:last-child{border-bottom:none;}
.search-result:hover, .search-result.selected {
  background: #1c4466;
  color: #ffb300;
}
.search-row { position:relative; }

#char-search {
  width: 100%;
  padding-right: 36px;
  box-sizing: border-box;
  height: 38px;
  font-size: 16px;
}

#clear-search {
  display: none; /* Only show when needed */
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: #888;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
  z-index: 2;
}

#clear-search svg {
  display: block;
  margin: auto;
  pointer-events: none;
}

#clear-search:hover {
  background: #f2f2f2;
  color: #d00;
}

#clear-search:active {
  background: #e0e0e0;
}

.char-header-bar {
  background: radial-gradient(ellipse at 50% 50%, #32335a 40%, #35374d 100%);
  text-align: center;
  border-radius: 18px;
  margin: 32px auto 22px auto;
  padding: 25px 0 15px 0;
  width: 96%;
  box-shadow: 0 2px 30px #20223299;
}
.char-header-title {
  font-size: 2em;
  font-weight: 700;
  color: #ffe48b;
  margin-bottom: 4px;
}


.def-combine-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 24px 0 18px 0;
  font-size: 1.22em;
}
.def-combine-item {
  background: #202949e8;
  border-radius: 1.1em;
  padding: 14px 17px 9px 17px;
  color: #fffad1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  box-shadow: 0 2px 16px #20193033;
  font-weight: 600;
  position: relative;
}
.def-main-icon { color: #ffcc4a; font-size: 2em; }
.def-pot-icon  { color: #97efff; font-size: 2em;}
.def-total-icon{ color: #ace5ea; font-size: 2em;}
.def-main-label, .def-pot-label, .def-total-label {
  font-size: .92em;
  margin-top: 2px;
  margin-bottom: 2px;
  letter-spacing: .03em;
  color: #ffe6a7;
}
.def-main-value, .def-total-value {
  font-size: 1.31em;
  font-weight: 700;
  margin-top: 3px;
  margin-bottom: 1px;
}
.def-hp-input {
  font-size: 1.13em;
  width: 74px;
  text-align: center;
  background: #222e49;
  border-radius: 7px;
  border: 1.5px solid #59dbe5;
  color: #86eaf3;font-weight:700;
  margin-top: 4px;
  margin-bottom: 1px;
  padding: 3px 0;
  outline: none;
  transition: border-color 0.16s;
}
.def-hp-input:focus {
  border-color: #ffe458;
}
.def-plus, .def-equals {
  font-size: 1.4em;
  color: #ffe77a;
  font-weight: 700;
  margin: 0 5px;
  padding: 0 2px;
}
@media (max-width: 700px) {
  .def-combine-card {flex-direction:column; gap:10px;}
  .def-plus, .def-equals {margin:10px 0 0 0;}
  .def-combine-item {min-width:140px;}
}

.leader-friend-row {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 12px 0 8px 0;
}

.leader-friend-row label {
  display: flex;
  align-items: center;
  font-weight: 500;
  gap: 6px;
}

.input-example {
  color: #aaa;
  font-size: 0.96em;
  margin-left: 4px;
}

/* Hide number input spinners/arrows in all major browsers */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#charDisplay {
  margin-top: 24px;
}

/* ---------- Passive Skill Section Styles ---------- */

.passive-block {
  background: #242c47;
  border-radius: 14px;
  margin: 30px auto 20px auto;
  padding: 20px 24px 20px 24px;
  max-width: 99%;
  box-shadow: 0 1px 10px #22293a24;
  border-left: 6px solid #ffae46;
  color: #fffde7;
}

/* --- Visual passive block title --- */
.passive-block-title {
  color: #ffae46;
  font-weight: 900;
  font-size: 1.5em;
  letter-spacing: .02em;
  margin-bottom: 14px;
  text-shadow: 0 2px 10px #37240c44;
  display: flex;
  align-items: center;
  gap: 0.35em;
}
.passive-block-title .emoji {
  font-size: 1.1em;
}

/* --- Each group --- */
.passive-group-title {
  color: #ffe190;
  background: none;
  font-size: 1.23em;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin: 18px 0 6px 0;
  text-shadow: 0 1px 4px #1c1411;
}

/* Remove bullets for group titles and effect rows! */
.passive-effects-list {
  margin: 0 0 0.3em 0.45em;
  padding: 0;
  list-style: none;
}

/* Only dash-item guaranteed effects get this list style */
.passive-effect-dash {
  margin-left: 0;
  padding-left: 1.2em;
  text-indent: -1.2em;
  list-style: none;
  color: #fffde7;
  font-size: 1.09em;
  margin-bottom: 2px;
}

/* Flexible row for controls + label */
.passive-effect-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0.19em 0;
}

.passive-label {
  cursor: pointer;
  font-size: 1.11em;
  font-weight: 600;
  color: #fffbe4;
}
.passive-effect-dash em,
.passive-effect-row em {
  color: #ffc27a;
  font-style: italic;
  font-size: 0.97em;
}

/* Custom Checkbox */
.passive-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ffae46;
  border-radius: 4px;
  background: #222;
  cursor: pointer;
  position: relative;
  margin-right: 3px;
  transition: border-color 0.15s, box-shadow 0.17s, background 0.15s;
  outline: none;
  vertical-align: middle;
}
.passive-checkbox:checked {
  background: #ffae46;
  box-shadow: 0 0 8px #ffb95644;
  border-color: #ffd477;
}
.passive-checkbox:checked::after {
  content: "✓";
  position: absolute;
  top: -2px;
  left: 4px;
  font-size: 15px;
  color: #1a160d;
  font-weight: bold;
}

/* --- Orange Select Style (same as Links select) --- */
.passive-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  background-color: #ffae46;        /* orange fill */
  color: #141824;                   /* dark text for contrast */
  border: 1px solid #ffae46;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 700;
  min-width: 70px;
  margin-right: 4px;

  padding: 4px 30px 4px 10px;       /* space for arrow */
  cursor: pointer;

  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);

  /* white arrow icon */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path fill='%23ffffff' d='M1 1l5 6 5-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right .55rem center;
  background-size: 12px 8px;

  transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s;
}

/* Hide legacy IE arrow */
.passive-select::-ms-expand { display: none; }

.passive-select:hover {
  background-color: #ffc25f;        /* lighter orange */
  border-color: #ffd58a;
}
.passive-select:active {
  background-color: #e49b33;        /* pressed */
  border-color: #ffc25f;
}
.passive-select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,.45);
  border-color: #ffffff;
}
.passive-select:disabled {
  opacity: .7;
  cursor: not-allowed;
}

/* Orange dropdown menu items */
.passive-select option {
  background-color: #ffae46;
  color: #141824;
  font-weight: 700;
}
.passive-select option:checked,
.passive-select option[selected] {
  background-color: #e49b33;   /* darker orange for selected */
  color: #141824;
}
.passive-select option:hover {
  background-color: #ffc25f;   /* lighter orange */
  color: #141824;
}

/* Responsive tweaks */
@media (max-width: 680px) {
  .passive-block { padding: 12px 4vw; }
  .passive-block-title { font-size: 1.08rem; }
  .passive-group-title { font-size: 1em; }
  .passive-label { font-size: 1em; }
}

@media (max-width: 600px) {
  .passive-group-title {
    font-size: 1.06rem;
  }
  .passive-label {
    font-size: 0.98rem;
  }
  .passive-checkbox {
    width: 1.17em;
    height: 1.17em;
  }
  .passive-select {
    font-size: 0.94rem;
    min-width: 50px;
    padding: 4px 28px 4px 10px;
  }
}

/* Active Skill Section*/

.active-skill-collapsible {
  margin: 1em 0;
  border: 1px solid #215b36;
  border-radius: 6px;
  overflow: hidden;
  background: #1d2233;
}
.active-skill-collapsible summary::-webkit-details-marker,
.active-skill-collapsible summary::marker {
  display: none;
}
.active-skill-collapsible-title {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 1.1em;
  color: #56e381;
  /* background: #162922; */
  /* border-bottom: 1px solid #215b36; */
  list-style: none;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.active-skill-collapsible-title::after {
  content: "▶";
  font-size: 14px;
  color: #56e381;
  transition: transform 0.2s ease;
}
.active-skill-collapsible[open] .active-skill-collapsible-title::after {
  content: "▼";
}
.active-skill-collapsible-title span {
  font-weight: 700;
  font-size: 1em;
  color: #56e381;
}
.active-skill-collapsible-content { padding: 12px 16px; color: #fff; }
.active-skill-collapsible-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 9px;
}
#active-skill-toggle {
  appearance: none;
  width: 18px; height: 18px;
  border: 2px solid #56e381;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
}
#active-skill-toggle:checked {
  background: #56e381;
  box-shadow: 0 0 6px #56e381;
}
#active-skill-toggle:checked::after {
  content: "✓";
  position: absolute;
  top: -2px; left: 3px;
  font-size: 14px;
  color: #141824;
}
.active-skill-collapsible-name {
  font-weight: 600; font-size: 1.12em; color: #56e381;
}
.active-skill-collapsible-condition,
.active-skill-collapsible-description {
  margin-left: 32px; font-size: 0.99em; line-height: 1.38;
}
.active-skill-collapsible-condition .condition-label {
  color: #56e381;
  font-weight: 600; margin-right: 4px;
}
.active-skill-collapsible-description { color: #ffd980; }

/* Stack section */

/* ===== STACK SECTION ===== */

/* Outer container */
.super-stacks-section {
  margin: 12px 0 14px 0;
  border: 1.5px solid #00b4d8;
  border-radius: 6px;
  overflow: hidden;
  background: #1d2233;
}

/* Section header */
.super-stacks-title {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 1.1em;
  color: #00d4ff;
  background: linear-gradient(135deg, #1e2439 0%, #252b42 100%);
  border-bottom: 1px solid #00b4d833;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.super-stacks-title::after {
  content: "▶";
  font-size: 14px;
  color: #00d4ff;
  transition: transform 0.2s ease;
}

.super-stacks-section[open] .super-stacks-title::after {
  content: "▼";
}

/* Content wrapper */
.super-stacks-content {
  padding: 14px 16px;
  background: linear-gradient(180deg, #1a1f30 0%, #1d2233 100%);
}

/* Form/character blocks */
.stack-form-block {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(30, 40, 65, 0.4) 0%, rgba(25, 35, 55, 0.3) 100%);
  border-radius: 10px;
  border: 1px solid #00b4d822;
  box-shadow: 0 2px 8px rgba(0, 180, 216, 0.06);
}

.stack-form-block.current {
  background: linear-gradient(135deg, rgba(0, 90, 140, 0.15) 0%, rgba(0, 70, 110, 0.12) 100%);
  border-color: #00d4ff44;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.08);
}

/* Character name */
.stack-form-name {
  color: #4de4ff;
  font-size: 1.05em;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #00b4d818;
  letter-spacing: 0.3px;
}

.current-badge {
  color: #00d4ff;
  font-size: 0.85em;
  margin-left: 8px;
  font-weight: 500;
}

/* Attack items */
.stack-item {
  margin-bottom: 14px;
  padding: 10px;
  background: rgba(0, 100, 150, 0.06);
  border-radius: 6px;
  border: 1px solid #00b4d815;
}

.stack-item:last-child {
  margin-bottom: 0;
}

/* Attack names */
.stack-attack-name {
  color: #00d4ff;
  font-weight: 700;
  font-size: 1em;
  margin-bottom: 6px;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.stack-attack-name::before {
  content: "●";
  margin-right: 8px;
  color: #00d4ff;
  font-size: 0.8em;
  text-shadow: 0 0 8px #00d4ff;
}

/* Attack descriptions */
.stack-description {
  font-size: 0.91em;
  color: #ffffff;
  font-style: italic;
  margin-bottom: 10px;
  line-height: 1.4;
  opacity: 0.85;
}

/* Input rows */
.stack-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.stack-row:last-child {
  margin-bottom: 0;
}

.stack-row label {
  font-weight: 600;
  color: #ffffff;
  min-width: 90px;
  font-size: 0.94em;
}

/* Input and select base styling */
.stack-count-input,
.stack-select {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid #00b4d855;
  background: linear-gradient(135deg, rgba(0, 140, 200, 0.15) 0%, rgba(0, 100, 150, 0.1) 100%);
  color: #ffffff;
  font-size: 0.95em;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.stack-count-input {
  width: 55px;
  text-align: center;
}

/* Select specific styling with custom arrow */
.stack-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 32px;
}

/* Hover states */
.stack-count-input:hover,
.stack-select:hover {
  border-color: #00d4ff77;
  background: linear-gradient(135deg, rgba(0, 160, 220, 0.2) 0%, rgba(0, 120, 180, 0.15) 100%);
}

/* Focus states */
.stack-count-input:focus,
.stack-select:focus {
  border-color: #00d4ff;
  background: linear-gradient(135deg, rgba(0, 180, 240, 0.25) 0%, rgba(0, 140, 200, 0.2) 100%);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15), inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Fix dropdown options visibility */
.stack-select option {
  background: #1d2233;
  color: #ffffff;
  padding: 4px 8px;
}

.stack-select option:hover,
.stack-select option:focus,
.stack-select option:checked {
  background: #00b4d8;
  color: #ffffff;
}

/* Bonus text */
.stack-bonus {
  color: #ffffff;
  font-size: 0.87em;
  font-weight: 500;
  opacity: 0.75;
}

/* Input placeholder */
.stack-count-input::placeholder {
  color: #7dc8e888;
}

/* Links section */

/* Collapsible Section */
.links-section {
  margin: 1em 0;
  border: 1px solid #ffae46;
  border-radius: 6px;
  overflow: hidden;
  background: #1d2233;
}

/* Summary styled as header button */
.links-section summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 1.1em;
  color: #ffae46;
  background: #20263a;
  border-bottom: 1px solid #2c3250;
  list-style: none; /* remove default arrow */
  outline: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Custom caret for open/closed state */
.links-section summary::after {
  content: "▶";
  font-size: 14px;
  color: #ffae46;
  transition: transform 0.2s ease;
}
.links-section[open] summary::after {
  content: "▼";
}

/* List styling */
.links-list {
  list-style: none;
  margin: 10px 0;
  padding: 0 14px 14px;
}

/* Each item */
.link-item {
  margin-bottom: 12px;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Styled checkbox */
.styled-checkbox {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #ffae46;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background-color .15s, box-shadow .15s, border-color .15s;
}
.styled-checkbox:hover {
  border-color: #ffd580;
}
.styled-checkbox:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 174, 70, .35);
}
.styled-checkbox:checked {
  background: #ffae46;
  box-shadow: 0 0 6px #ffae46;
}
.styled-checkbox:checked::after {
  content: "✓";
  position: absolute;
  top: -2px;
  left: 3px;
  font-size: 14px;
  color: #141824;
}

/* Styled select — orange filled with white arrow and orange options */
.styled-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  background-color: #ffae46;        /* orange fill */
  color: #141824;                    /* dark text for contrast */
  border: 1px solid #ffae46;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  min-width: 4.25rem;

  padding: 4px 30px 4px 10px;       /* space for arrow */
  cursor: pointer;

  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);

  /* white arrow icon */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path fill='%23ffffff' d='M1 1l5 6 5-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right .55rem center;
  background-size: 12px 8px;

  transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s;
}

/* Hide legacy IE arrow */
.styled-select::-ms-expand { display: none; }

.styled-select:hover {
  background-color: #ffc25f;        /* lighter orange */
  border-color: #ffd58a;
}
.styled-select:active {
  background-color: #e49b33;        /* pressed */
  border-color: #ffc25f;
}
.styled-select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,.45);
  border-color: #ffffff;
}
.styled-select:disabled {
  opacity: .7;
  cursor: not-allowed;
}

/* Orange dropdown menu items (note: some browsers still show a system highlight color for the actively highlighted row) */
.styled-select option {
  background-color: #ffae46;   /* orange options */
  color: #141824;              /* dark text */
  font-weight: 700;
}

/* Selected item color inside the popup (where supported) */
.styled-select option:checked,
.styled-select option[selected] {
  background-color: #e49b33;   /* darker orange for selected */
  color: #141824;
}

/* Hovered option tint (supported in some browsers) */
.styled-select option:hover {
  background-color: #ffc25f;   /* lighter orange on hover */
  color: #141824;
}

/* Text */
.link-name {
  font-weight: 600;
  color: #fff;
}
.link-desc {
  margin-left: 64px;
  color: #ffd980;
  font-size: 0.95em;
}

/* Extra Support Section */

.extra-support {
  margin: 1em 0;
  border: 1px solid #c7d9ee; /* or #f0f0f0, or your desired accent */
  border-radius: 6px;
  overflow: hidden;
  background: #1d2233;
}

.extra-support summary {
  list-style: none;
}

.extra-support-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 10px 14px;
  margin: 0;
  font-weight: 600;
  font-size: 1.1em;
  background-color: #1d2233;
  color: #f0f0f0;
  transition: background 0.2s, color 0.2s;
}

/* Indicator "▶" for collapsed, "▼" for open */
.extra-support-title::after {
  content: "▶";
  font-size: 14px;
  margin-left: 8px;
  transition: transform 0.2s ease;
}
.extra-support[open] .extra-support-title::after {
  content: "▼";
}

/* Content area inside */
.extra-support > div {
  padding: 10px 14px;
  background-color: #252b3d; 
}

.support-sot-section {
  margin-top: 16px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.support-sot-header {
  font-size: 1.15em;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
  color: #f49e42; /* close to items boost but distinct */
}

.support-sot-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

#support-sot-boost-input {
  width: 65px;
  font-size: 1.12em;
  font-weight: bold;
  color: #3f2e07;                  /* darker text */
  background: #fff8d1;             /* pale yellow background */
  border: 2px solid #f4a621;       /* warm orange border */
  border-radius: 7px;
  text-align: right;
  padding: 3px 9px;
  transition: border-color 0.14s, background 0.14s;
  box-shadow: 0 2px 14px #f9e7a339; /* subtle yellow glow */
}

#support-sot-boost-input:focus {
  border-color: #f57c00;           /* stronger orange on focus */
  background: #f9e07f;
  outline: none;
}

.support-sot-percent {
  color: #f4a621;
  font-weight: 700;
  font-size: 1.09em;
}

.support-attacking-section {
  margin-top: 16px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.support-attacking-header {
  font-size: 1.15em;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
  color: #66e07f; /* A greenish hue to distinguish from Support SOT and Items */
}

.support-attacking-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

#support-attacking-boost-input {
  width: 65px;
  font-size: 1.12em;
  font-weight: bold;
  color: #185d35;                   /* darker green text */
  background: #d8fcec;              /* light green bg */
  border: 2px solid #66e07f;        /* border matches header */
  border-radius: 7px;
  text-align: right;
  padding: 3px 9px;
  transition: border-color 0.14s, background 0.14s;
  box-shadow: 0 2px 14px #8cf9be39; /* subtle green glow */
}

#support-attacking-boost-input:focus {
  border-color: #29c564;            /* darker green focus */
  background: #b7f6d6;
  outline: none;
}

.support-attacking-percent {
  color: #29c564;
  font-weight: 700;
  font-size: 1.09em;
}

.active-skill-section, .domain-section {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.active-skill-header, .domain-header {
  font-size: 1.15em;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.active-skill-header { color: #ffd851; }
.domain-header      { color: #af8cff; }

.active-skill-row, .domain-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

#active-skill-multiplier-input {
  width: 65px;
  font-size: 1.12em;
  font-weight: bold;
  color: #49380a;
  background: #fff4cb;
  border: 2px solid #ffd851;
  border-radius: 7px;
  text-align: right;
  padding: 3px 9px;
  transition: border-color 0.14s;
  box-shadow: 0 2px 14px #ffe8a933;
}
#active-skill-multiplier-input:focus {
  border-color: #fece16;
  background: #fcee8d;
}

.active-skill-percent {
  color: #ffd851;
  font-weight: 700;
  font-size: 1.09em;
}

#domain-multiplier-input {
  width: 65px;
  font-size: 1.12em;
  font-weight: bold;
  color: #44258c;
  background: #efe8ff;
  border: 2px solid #af8cff;
  border-radius: 7px;
  text-align: right;
  padding: 3px 9px;
  transition: border-color 0.14s;
  box-shadow: 0 2px 14px #af8cff44;
}
#domain-multiplier-input:focus {
  border-color: #ae7fff;
  background: #cabafd;
}

.domain-percent {
  color: #af8cff;
  font-weight: 700;
  font-size: 1.09em;
}

.items-section, .temporary-section {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.items-header, .temporary-header {
  font-size: 1.15em;  
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.items-header    { color: #ffae46; }
.temporary-header{ color: #6babff; }

.item-row, .temporary-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

#items-boost-input {
  width: 65px;
  font-size: 1.12em;
  font-weight: bold;
  color: #2e2e2e;
  background: #fffbe7;
  border: 2px solid #ffe14d;
  border-radius: 7px;
  text-align: right;
  padding: 3px 9px;
  transition: border-color 0.14s;
  box-shadow: 0 2px 14px #fffbf183;
}
#items-boost-input:focus {
  border-color: #ffbc08;
  background: #352808;
}

.item-percent {
  color: #ffe14d;
  font-weight: 700;
  font-size: 1.09em;
}

#temporary-boost-input {
  width: 65px;
  font-size: 1.12em;
  font-weight: bold;
  color: #253058;
  background: #eaf3ff;
  border: 2px solid #6babff;
  border-radius: 7px;
  text-align: right;
  padding: 3px 9px;
  transition: border-color 0.14s;
  box-shadow: 0 2px 14px #b8caf7b0;
}
#temporary-boost-input:focus {
  border-color: #37a9ff;
  background: #224c77;
}
.temporary-percent {
  color: #6babff;
  font-weight: 700;
  font-size: 1.09em;
}

.sa-type-btn.selected {
  filter: brightness(1.2) drop-shadow(0 0 7px #faa);
  border-width: 3px;
  outline:2px solid #ffd257;
}
.sa-type-btn:not(.selected) {
  filter: grayscale(0.30) opacity(0.7);
  border-width: 2px;
  outline:none;
}

#compute-defense-btn {
  background: linear-gradient(90deg, #2196f3 0%, #3f51b5 100%);
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  padding: 0.6em 1.5em;
  font-size: 1.09em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(40,50,100,0.1);
  margin-top: 1.1em;
  margin-bottom: 0.6em;
  transition: background 0.2s, box-shadow 0.2s;
}
#compute-defense-btn:hover {
  background: linear-gradient(90deg, #1565c0 0%, #1a237e 100%);
  box-shadow: 0 4px 12px rgba(40,50,100,0.15);
}

#computed-defense-result {
  font-size: 1.15em;
  background: #181c28;
  color: #77f7b1;
  border-radius: 5px;
  margin-top: 0.6em;
  padding: 0.65em 1em;
  margin-bottom: 0.6em;
  box-shadow: 0 1px 3px rgba(10,30,40,0.10);
  min-height: 1.9em;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.atk-calc-btn.selected {
  font-weight: bold;
  outline: 2px solid #44efef;
  box-shadow: 0 0 3px #00e4ff;
}

@media (max-width: 650px) {
  .inputs-row { flex-direction: column; gap: 8px; }
  .calculator-section {margin: 14px 0; border-radius:14px;}
  h1 {font-size: 1.2rem;}
  .char-search-container, .search-row, .search-input-wrapper {
    max-width: 100%;
    padding: 10px;
  }
  #char-search {
    font-size: 15px;
    height: 34px;
  }
  .input-group-row {
    flex-direction: column;
    gap: 18px;
  }
  .input-block {
    min-width: 90vw;
    width: 92vw;
  }
  .add-lvl-badge {font-size:0.95em;}
}