/* Windows 10 / Aero glass look: frosted window panels with title bars,
   flat clean controls and a blue accent. */
:root {
  --bg: #0b0e13;
  --text: #f4f7fb;
  --muted: #aab7c8;
  --accent: #3da5ff;
  --accent-deep: #0b6fcc;
  --enemy: #ff6b5e;
  --line: rgba(255, 255, 255, 0.2);
  --glass: rgba(16, 24, 36, 0.5);

  /* Background dimming: raise the numbers (0 to 1) for a darker image */
  --dim-top: 0.5;
  --dim-bottom: 0.78;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  line-height: 1.45;
  min-height: 100vh;
}

/* Fixed, dimmed background image (a pseudo-element works better than
   background-attachment: fixed, which is unreliable on phones) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(8, 10, 14, var(--dim-top)), rgba(8, 10, 14, var(--dim-bottom))),
    url("background.jpg") center / cover no-repeat;
}

header, footer { text-align: center; padding: 22px 16px; }
header h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.5px;
  text-shadow: 0 0 14px rgba(61, 165, 255, 0.55), 0 1px 3px rgba(0, 0, 0, 0.8);
}
header p, footer p { margin: 6px 0 0; color: var(--muted); font-size: 0.88rem; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }

main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 18px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 8px;
  align-items: start;
}
@media (max-width: 820px) { main { grid-template-columns: 1fr; } }

/* ---------- glass window ---------- */
.panel {
  border-radius: 8px;
  overflow: hidden;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--line);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel { background: rgba(18, 26, 38, 0.95); }
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.6);
}
.titlebar .dot {
  width: 10px; height: 10px; border-radius: 2px;
  background: linear-gradient(135deg, #7cc4ff, var(--accent-deep));
  box-shadow: 0 0 6px rgba(61, 165, 255, 0.8);
}

.panel-body { padding: 16px; }

#results { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
@media (max-width: 820px) { #results { position: static; max-height: none; } }

.panel h3 {
  margin: 16px 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.label { color: var(--muted); font-size: 0.8rem; min-width: 52px; }

input[type="search"] {
  flex: 1 1 140px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 10px;
  font: inherit;
  font-size: 0.9rem;
}
input[type="search"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

button {
  font: inherit;
  font-size: 0.88rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.18); border-color: var(--accent); }
button:active:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips button { padding: 3px 11px; }

/* selected state for chips and the mode switch: glossy aqua */
.chips button.on, .mode button.on {
  background: linear-gradient(180deg, #6cc0ff 0%, var(--accent) 48%, var(--accent-deep) 52%, #2a8ce0 100%);
  border-color: #a9d8ff;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(0, 40, 90, 0.6);
  box-shadow: 0 0 10px rgba(61, 165, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.mode { display: flex; margin-bottom: 8px; }
.mode button { flex: 1; padding: 8px 12px; font-weight: 600; border-radius: 0; }
.mode button:first-child { border-radius: 4px 0 0 4px; }
.mode button:last-child { border-radius: 0 4px 4px 0; border-left: 0; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 0.84rem; }
.legend { color: var(--muted); font-size: 0.76rem; margin: 4px 0 12px; }

/* ---------- hero tiles ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 6px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 2px 4px 2px 0;
}
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 6px;
  font-size: 0.8rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.hero small { color: var(--muted); font-size: 0.68rem; }
.hero.you {
  background: rgba(61, 165, 255, 0.28);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(61, 165, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.hero.sel {
  background: rgba(255, 107, 94, 0.25);
  border-color: var(--enemy);
  box-shadow: 0 0 12px rgba(255, 107, 94, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.hero:disabled { opacity: 0.4; cursor: not-allowed; }

/* glossy round badges */
.badge {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600; font-size: 1.05rem;
  color: #fff;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 45%),
    var(--c, #555);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 -4px 8px rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* ---------- results ---------- */
.selected { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag {
  background: rgba(255, 107, 94, 0.22);
  border: 1px solid var(--enemy);
  border-radius: 4px;
  padding: 2px 9px;
  font-size: 0.82rem;
}
.tag.you { background: rgba(61, 165, 255, 0.25); border-color: var(--accent); }

.empty { color: var(--muted); font-style: italic; }

.row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  transition: background 0.12s;
}
.row:hover { background: rgba(255, 255, 255, 0.06); }
.row .badge { width: 36px; height: 36px; font-size: 0.9rem; flex: none; }
.row .info { flex: 1; min-width: 0; }
.row .name { font-weight: 600; }
.row .meta { color: var(--muted); font-size: 0.78rem; }
.row ul { margin: 4px 0 0; padding-left: 18px; font-size: 0.82rem; color: var(--muted); }
.row li.fitnote { color: #8fd0ff; }
.row .count {
  flex: none;
  background: linear-gradient(180deg, #6cc0ff, var(--accent-deep));
  color: #fff;
  border-radius: 999px; padding: 1px 9px; font-size: 0.78rem; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.fit {
  display: inline-block;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #6cc0ff, var(--accent-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  vertical-align: middle;
}
.note { font-size: 0.74rem; color: var(--muted); font-style: italic; }

.key {
  display: inline-grid; place-items: center;
  width: 17px; height: 17px; border-radius: 50%;
  font-size: 0.68rem; font-weight: 700; color: #fff;
}
.key.weapon { background: #c2863c; }
.key.vitality { background: #4caf6a; }
.key.spirit { background: #9b6cd0; }

footer code { background: rgba(0, 0, 0, 0.4); padding: 1px 5px; border-radius: 3px; }

/* slim scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.3) transparent; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 4px; }
