:root {
  --bg: #0a0f1a;
  --bg-elev: rgba(15, 23, 42, 0.82);
  --panel: rgba(17, 25, 40, 0.86);
  --panel-border: rgba(148, 163, 184, 0.18);
  --text: #e5edf8;
  --muted: #94a3b8;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --shadow: 0 24px 80px rgba(2, 8, 23, 0.55);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --scrollbar-track: rgba(8, 15, 29, 0.92);
  --scrollbar-thumb: linear-gradient(180deg, rgba(125, 211, 252, 0.6), rgba(14, 116, 144, 0.88));
  --scrollbar-thumb-hover: linear-gradient(180deg, rgba(186, 230, 253, 0.78), rgba(56, 189, 248, 0.96));
}

[hidden] { display: none !important; }

@font-face {
  font-family: "L5R Symbol";
  src: url("../res/fonts/l5r_textsymbols.eot");
  src:
    url("../res/fonts/l5r_textsymbols.eot?#iefix") format("embedded-opentype"),
    url("../res/fonts/l5r_textsymbols.woff") format("woff"),
    url("../res/fonts/l5r_textsymbols.ttf") format("truetype"),
    url("../res/fonts/l5r_textsymbols.svg#iconicfill") format("svg");
  font-weight: normal;
  font-style: normal;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(180deg, #030712 0%, var(--bg) 45%, #020617 100%);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 211, 252, 0.72) rgba(8, 15, 29, 0.92);
}

body {
  position: relative;
  padding: 32px 20px 48px;
  overflow-x: hidden;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.filter-options::-webkit-scrollbar,
.modal-panel::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.filter-options::-webkit-scrollbar-track,
.modal-panel::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.08);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.filter-options::-webkit-scrollbar-thumb,
.modal-panel::-webkit-scrollbar-thumb {
  border: 2px solid rgba(8, 15, 29, 0.95);
  border-radius: 999px;
  background: var(--scrollbar-thumb);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 14px rgba(56, 189, 248, 0.16);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.filter-options::-webkit-scrollbar-thumb:hover,
.modal-panel::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner,
.filter-options::-webkit-scrollbar-corner,
.modal-panel::-webkit-scrollbar-corner {
  background: rgba(8, 15, 29, 0.96);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1200px, 100%);
  margin: 0 auto;
}

.site-backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.site-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(125, 211, 252, 0.12), transparent 18%),
    radial-gradient(circle at 78% 12%, rgba(148, 163, 184, 0.08), transparent 20%),
    radial-gradient(circle at 70% 68%, rgba(56, 189, 248, 0.06), transparent 24%);
}

.starfield,
.starfield::before,
.starfield::after {
  position: absolute;
  inset: -20%;
  content: "";
  background-repeat: repeat;
}

.starfield-far,
.starfield-far::before,
.starfield-far::after {
  background-image:
    radial-gradient(circle at 7% 14%, rgba(255, 255, 255, 0.34) 0 1px, transparent 1.6px),
    radial-gradient(circle at 22% 68%, rgba(255, 255, 255, 0.28) 0 1px, transparent 1.8px),
    radial-gradient(circle at 41% 19%, rgba(255, 255, 255, 0.3) 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 58% 83%, rgba(255, 255, 255, 0.24) 0 1px, transparent 1.7px),
    radial-gradient(circle at 73% 31%, rgba(255, 255, 255, 0.32) 0 1px, transparent 1.7px),
    radial-gradient(circle at 88% 57%, rgba(255, 255, 255, 0.26) 0 1px, transparent 1.8px);
  background-size: 520px 460px;
}

.starfield-far::before {
  transform: translate(164px, 96px) scale(1.03);
  opacity: 0.48;
}

.starfield-far::after {
  transform: translate(-118px, 152px) scale(0.96);
  opacity: 0.34;
}

.starfield-mid,
.starfield-mid::before,
.starfield-mid::after {
  background-image:
    radial-gradient(circle at 11% 24%, rgba(255, 255, 255, 0.56) 0 1.2px, transparent 2px),
    radial-gradient(circle at 29% 72%, rgba(255, 255, 255, 0.5) 0 1.3px, transparent 2px),
    radial-gradient(circle at 38% 12%, rgba(255, 255, 255, 0.6) 0 1.2px, transparent 2px),
    radial-gradient(circle at 54% 62%, rgba(255, 255, 255, 0.48) 0 1.2px, transparent 2px),
    radial-gradient(circle at 69% 28%, rgba(255, 255, 255, 0.58) 0 1.3px, transparent 2px),
    radial-gradient(circle at 81% 74%, rgba(255, 255, 255, 0.46) 0 1.2px, transparent 2px),
    radial-gradient(circle at 93% 18%, rgba(255, 255, 255, 0.54) 0 1.2px, transparent 2px);
  background-size: 390px 340px;
}

.starfield-mid::before {
  transform: translate(82px, 44px) scale(1.04);
  opacity: 0.55;
}

.starfield-mid::after {
  transform: translate(-74px, 118px) scale(0.95);
  opacity: 0.42;
}

.starfield-near,
.starfield-near::before,
.starfield-near::after {
  background-image:
    radial-gradient(circle at 6% 34%, rgba(255, 255, 255, 0.78) 0 1.5px, transparent 2.2px),
    radial-gradient(circle at 18% 78%, rgba(255, 255, 255, 0.72) 0 1.7px, transparent 2.4px),
    radial-gradient(circle at 34% 16%, rgba(255, 255, 255, 0.84) 0 1.6px, transparent 2.3px),
    radial-gradient(circle at 47% 58%, rgba(255, 255, 255, 0.7) 0 1.6px, transparent 2.4px),
    radial-gradient(circle at 63% 22%, rgba(255, 255, 255, 0.82) 0 1.5px, transparent 2.3px),
    radial-gradient(circle at 76% 86%, rgba(255, 255, 255, 0.68) 0 1.7px, transparent 2.5px),
    radial-gradient(circle at 91% 41%, rgba(255, 255, 255, 0.8) 0 1.5px, transparent 2.3px);
  background-size: 280px 240px;
  animation: star-twinkle 8s ease-in-out infinite;
}

.starfield-near::before {
  transform: translate(58px, 72px) scale(1.03);
  opacity: 0.58;
  animation-delay: -2.5s;
}

.starfield-near::after {
  transform: translate(-84px, 26px) scale(0.94);
  opacity: 0.34;
  animation-delay: -5s;
}

.shooting-stars {
  position: absolute;
  inset: 0;
}

.shooting-star {
  position: absolute;
  width: 180px;
  height: 2px;
  opacity: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(125, 211, 252, 0.2), transparent 75%);
  box-shadow: 0 0 18px rgba(125, 211, 252, 0.22);
  transform: rotate(-28deg) translate3d(0, 0, 0);
  animation: shooting-star 12s linear infinite;
}

.shooting-star-one {
  top: 14%;
  left: 68%;
  animation-delay: 1.5s;
}

.shooting-star-two {
  top: 24%;
  left: 18%;
  animation-delay: 6.5s;
  animation-duration: 15s;
}

.shooting-star-three {
  top: 10%;
  left: 82%;
  animation-delay: 10.5s;
  animation-duration: 13.5s;
}

.hero {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
}

.toolbar-panel {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 22px;
  background: rgba(2, 6, 23, 0.46);
}

.toolbar-panel-secondary {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 10px 12px;
  width: fit-content;
  max-width: 100%;
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.28), rgba(203, 213, 225, 0.2));
  border-color: rgba(226, 232, 240, 0.22);
}

.hero-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.hero-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.site-title {
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.site-logo {
  height: 0.82em;
  width: 0.82em;
  flex-shrink: 0;
  display: block;
}

.site-home-link {
  display: flex;
  align-items: center;
  gap: 0.3em;
  color: inherit;
  text-decoration: none;
}
.site-home-link:hover {
  color: var(--accent);
}
.site-home-link:hover .site-logo {
  opacity: 0.8;
}

.utility-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.utility-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.36);
  color: #dbe4ef;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.utility-button:hover {
  border-color: rgba(226, 232, 240, 0.4);
  background: rgba(255, 255, 255, 0.46);
}

.utility-button-user {
  height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  justify-content: center;
  gap: 8px;
}

.utility-button-user.is-logged-in {
  width: 36px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
}

.user-btn-icon {
  display: flex;
}

.user-btn-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.user-btn-wrap {
  position: relative;
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: rgba(10, 18, 36, 0.97);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 6px;
  z-index: 200;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.user-menu[hidden] {
  display: none;
}

.user-menu-info {
  padding: 8px 10px 6px;
  color: rgba(219, 228, 239, 0.55);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-separator {
  height: 1px;
  background: rgba(148, 163, 184, 0.15);
  margin: 4px 0;
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  background: none;
  border: none;
  border-radius: 8px;
  color: #dbe4ef;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.user-menu-item-danger {
  color: #f87171;
}

.user-menu-item-danger:hover {
  background: rgba(248, 113, 113, 0.1);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.filter-tools {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-button-secondary {
  background: rgba(15, 23, 42, 0.62);
  color: var(--muted);
}

.filter-button-reset {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text);
  box-shadow: none;
}

.filter-button-reset:hover {
  border-color: rgba(125, 211, 252, 0.28);
}

.filter-button[aria-expanded="true"] {
  border-color: rgba(125, 211, 252, 0.44);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

.filter-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.filter-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.filter-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(340px, 85vw);
  padding: 16px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 18px;
  background: rgba(8, 15, 29, 0.98);
  box-shadow: 0 30px 90px rgba(2, 6, 23, 0.65);
  z-index: 8;
  contain: layout style;
  visibility: hidden;
  pointer-events: none;
}

.filter-panel.is-open {
  visibility: visible;
  pointer-events: auto;
}

.filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.filter-title {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 700;
}

.filter-options {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 211, 252, 0.72) rgba(8, 15, 29, 0.92);
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  cursor: pointer;
}

.filter-option input {
  margin: 0;
  accent-color: var(--accent-strong);
}

.filter-group {
  display: grid;
  gap: 8px;
}

.filter-group-title {
  margin: 8px 0 2px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.filter-subsection {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.filter-panel-head-secondary {
  margin-bottom: 10px;
}

.lead {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.main-tabs {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.main-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px 16px 0 0;
  background: rgba(8, 15, 29, 0.72);
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
}

.main-tab:hover {
  border-color: rgba(125, 211, 252, 0.32);
  color: var(--text);
}

.main-tab.is-active {
  border-color: rgba(125, 211, 252, 0.34);
  background: linear-gradient(180deg, rgba(14, 24, 44, 0.96), rgba(5, 11, 24, 0.9));
  color: var(--accent);
  box-shadow: 0 18px 40px rgba(2, 8, 23, 0.18);
}

.main-panel {
  padding: 20px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 0 24px 24px 24px;
  background: linear-gradient(180deg, rgba(3, 10, 24, 0.64), rgba(2, 6, 23, 0.46));
  box-shadow: 0 24px 70px rgba(2, 8, 23, 0.22);
}

.tab-panel[hidden] {
  display: none;
}

.search-panel {
  padding: 18px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(3, 10, 24, 0.82), rgba(2, 6, 23, 0.62));
  box-shadow: 0 22px 70px rgba(2, 8, 23, 0.28);
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.search-input {
  width: 100%;
  border: 1px solid rgba(125, 211, 252, 0.32);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(10, 15, 26, 0.96));
  color: var(--text);
  padding: 22px 24px;
  font-size: 1.12rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(125, 211, 252, 0.04),
    0 18px 42px rgba(2, 8, 23, 0.34);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.search-input::placeholder {
  color: #64748b;
}

.search-input:focus {
  border-color: rgba(125, 211, 252, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 6px rgba(56, 189, 248, 0.14),
    0 24px 50px rgba(2, 8, 23, 0.42);
  transform: translateY(-1px);
}

.search-button {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 16px;
  padding: 0 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #03111d;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.search-button-wrap {
  display: block;
  min-height: 56px;
}

.advanced-toggle-btn {
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  align-self: flex-end;
  transition: color 0.15s;
  text-align: right;
  display: block;
  margin-left: auto;
  margin-bottom: 2px;
}

.advanced-toggle-btn:hover,
.advanced-toggle-btn.is-active {
  color: var(--accent);
}

.advanced-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 12px;
}

.advanced-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.advanced-field {
  display: flex;
  align-items: center;
  gap: 14px;
}

.advanced-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  min-width: 72px;
  flex-shrink: 0;
  text-align: right;
}

.advanced-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  font-size: 0.95rem;
}

.advanced-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.advanced-footer .search-button-wrap {
  min-height: 44px;
}

.advanced-footer .search-button {
  height: 44px;
}

.advanced-operator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.advanced-operator-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-right: 2px;
}

.advanced-op-btn {
  padding: 4px 14px;
  font-size: 0.8rem;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 20px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.advanced-op-btn.is-active {
  background: rgba(125, 211, 252, 0.12);
  border-color: rgba(125, 211, 252, 0.4);
  color: var(--accent);
  font-weight: 600;
}

.advanced-op-btn:hover:not(.is-active) {
  color: var(--text);
  border-color: rgba(125, 211, 252, 0.28);
}

.search-controls-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  gap: 14px;
  margin-top: 14px;
}

.search-subpanel {
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.56);
}

.search-subpanel-title {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-subpanel-filters .filter-tools {
  width: 100%;
  justify-content: flex-start;
}

.collection-target-toggle {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(8, 15, 29, 0.68);
  overflow: hidden;
}

.collection-target-toggle-toolbar {
  min-width: 190px;
  background: rgba(8, 15, 29, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.collection-target-slider {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc(50% - 9px);
  height: calc(100% - 12px);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.28), rgba(14, 116, 144, 0.34));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 12px 24px rgba(2, 6, 23, 0.28);
  transition: transform 180ms ease;
}

.collection-target-slider[data-target-type="list"] {
  transform: translateX(calc(100% + 6px));
}

.collection-target-option {
  position: relative;
  z-index: 1;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.collection-target-option.is-active {
  color: var(--text);
}

.search-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.search-button:disabled {
  background: linear-gradient(180deg, #4b5563, #374151);
  color: #cbd5e1;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
  filter: none;
}

.search-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 999px;
  background: rgba(14, 116, 144, 0.14);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1;
}

.filter-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.18);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-tag-remove:hover {
  background: rgba(125, 211, 252, 0.3);
}

.option-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}

.option-pill:has(input:checked) {
  border-color: rgba(125, 211, 252, 0.44);
  background: rgba(14, 165, 233, 0.12);
  color: var(--text);
}

.option-pill input {
  margin: 0;
  accent-color: var(--accent-strong);
}

.status {
  margin: 18px 0 0;
  min-height: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.results {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(15, 23, 42, 0.64));
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.42);
  transition: border-color 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
}

.card:hover {
  border-color: rgba(125, 211, 252, 0.44);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.08), 0 24px 48px rgba(2, 6, 23, 0.55);
}

.card-image {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.72));
}


.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px 14px;
}

.card-title {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.35;
  color: var(--text);
}

.card-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(8, 15, 29, 0.88), rgba(15, 23, 42, 0.82));
  color: rgba(125, 211, 252, 0.98);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 160ms ease, opacity 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.card-add-button:hover {
  border-color: rgba(125, 211, 252, 0.42);
  background: linear-gradient(180deg, rgba(14, 25, 46, 0.92), rgba(15, 23, 42, 0.88));
  color: #d7f2ff;
}

.card-add-button.is-disabled,
.card-add-button:disabled {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: rgba(148, 163, 184, 0.9);
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
  opacity: 0.5;
}

.card-add-button.is-disabled:hover,
.card-add-button:disabled:hover {
  filter: none;
}

.card-remove-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #fca5a5;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.34);
  cursor: pointer;
}

.card-remove-button:hover {
  border-color: rgba(252, 165, 165, 0.32);
  color: #fecaca;
}

.card-quantity-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: rgba(8, 15, 29, 0.52);
}

.card-quantity-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.14);
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
}

.card-quantity-button:hover {
  background: rgba(125, 211, 252, 0.24);
}

.card-quantity-button:disabled {
  background: rgba(71, 85, 105, 0.32);
  color: rgba(226, 232, 240, 0.52);
  cursor: not-allowed;
}

.card-quantity-value {
  min-width: 1ch;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}

.card-quantity-input {
  width: 58px;
  height: 28px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}

.card-quantity-input:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.5);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.placeholder-panel {
  padding: 36px 24px;
  border: 1px dashed rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  background: rgba(8, 15, 29, 0.42);
}

.placeholder-title {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.placeholder-copy {
  margin: 0;
  max-width: 56ch;
  color: var(--muted);
  line-height: 1.7;
}

.deck-panel {
  padding: 24px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(3, 10, 24, 0.68), rgba(2, 6, 23, 0.5));
  box-shadow: 0 20px 60px rgba(2, 8, 23, 0.24);
}

.deck-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.deck-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.deck-controls {
  display: flex;
  flex: 0 0 420px;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 320px;
}

.deck-controls-compact {
  flex: 0 0 auto;
  min-width: 0;
  align-items: flex-start;
}

.deck-select-row {
  display: flex;
  gap: 10px;
}

.deck-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck-title {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.25;
  color: var(--accent);
}

.deck-rename-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(148, 163, 184, 0.45);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.deck-rename-btn:hover {
  color: var(--accent);
  background: rgba(125, 211, 252, 0.1);
}

.deck-rename-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.deck-rename-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(125, 211, 252, 0.4);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.deck-rename-input:focus {
  outline: 2px solid rgba(125, 211, 252, 0.5);
  outline-offset: 1px;
}

.deck-rename-confirm {
  padding: 6px 18px;
  font-size: 0.875rem;
  white-space: nowrap;
}

.deck-storage-note {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 0;
  line-height: 1.6;
}

.deck-metadata-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.deck-metadata-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.52);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.deck-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.deck-summary-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 999px;
  background: rgba(14, 116, 144, 0.14);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
}

.deck-summary-warning {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.24);
  color: #fecaca;
  font-size: 0.88rem;
  font-weight: 700;
}

.deck-summary-chip-danger {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.24);
  color: #fecaca;
  font-weight: 700;
}

.deck-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.deck-linked-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deck-linked-list-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.deck-linked-list-input {
  flex: 1 1 auto;
  min-width: 0;
}

.deck-linked-list-input::placeholder {
  color: rgba(148, 163, 184, 0.72);
}

.deck-tool-button,
.deck-select {
  height: 36px;
  border-radius: 14px;
  font-weight: 700;
}

.deck-tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 36px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
  cursor: pointer;
}

.deck-tool-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.deck-tool-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.deck-tool-button:hover:not(:disabled) {
  border-color: rgba(125, 211, 252, 0.32);
}

.deck-tool-button-wide {
  min-width: 84px;
}

.deck-format-select {
  min-width: 160px;
  flex: 1 1 0;
}

.deck-clan-select {
  min-width: 150px;
  flex: 1 1 0;
}

.deck-select-main {
  width: 100%;
  min-width: 0;
}

.deck-tool-button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.deck-tool-button.is-active {
  border-color: rgba(125, 211, 252, 0.5);
  background: rgba(14, 25, 46, 0.92);
  color: var(--accent);
}

#deck-no-limit.is-active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.15);
}

#deck-no-limit:disabled,
#deck-no-limit.is-active:disabled {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text);
  box-shadow: none;
  opacity: 0.56;
}

.deck-select {
  min-width: 190px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
}

.deck-status {
  margin-top: 18px;
  min-height: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.deck-results {
  margin-top: 22px;
}

.empty {
  margin-top: 26px;
  padding: 26px;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.4);
  color: var(--muted);
  text-align: center;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(10px);
}

.modal-panel {
  width: min(1100px, 100%);
  max-height: min(90vh, 920px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 211, 252, 0.72) rgba(8, 15, 29, 0.92);
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.97), rgba(8, 15, 29, 0.97));
  box-shadow: 0 30px 90px rgba(2, 6, 23, 0.75);
}

.deck-notes-modal-panel {
  width: min(760px, 100%);
}

.deck-notes-body {
  gap: 14px;
}

.deck-notes-input {
  width: 100%;
  min-height: 280px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  font: inherit;
  line-height: 1.6;
  resize: vertical;
}

.deck-notes-input::placeholder {
  color: rgba(148, 163, 184, 0.72);
}

.deck-notes-input:focus,
.deck-notes-input:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.5);
  outline-offset: 2px;
}

.modal-panel-compact {
  width: min(520px, 100%);
  max-height: none;
}

.deck-text-modal-panel {
  width: min(820px, 100%);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  background: rgba(12, 19, 36, 0.98);
  border-bottom: 1px solid rgba(125, 211, 252, 0.08);
  border-radius: 24px 24px 0 0;
}

.modal-title {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.close-button:hover {
  background: rgba(125, 211, 252, 0.12);
  border-color: var(--accent);
  color: #e0f4ff;
}

.close-button-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.25rem;
}

.modal-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 24px;
  padding: 0 24px 24px;
}

.modal-left {
  display: grid;
  gap: 16px;
  align-content: start;
}

.modal-image {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.48);
}

.modal-versions-block {
  width: 100%;
}


.modal-info {
  display: grid;
  gap: 16px;
  align-content: start;
}

.modal-meta {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.deck-create-body {
  padding: 4px 24px 24px;
}

.deck-create-label {
  display: block;
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.deck-create-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  font-size: 1rem;
}

.deck-create-message {
  margin-top: 12px;
  min-height: 1.4rem;
  color: #fda4af;
  font-size: 0.92rem;
}

.deck-create-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.deck-create-actions .search-button,
.library-import-actions .search-button,
.deck-controls-compact .search-button {
  width: auto;
  height: 38px;
  padding: 0 22px;
  border-radius: 14px;
  flex-shrink: 0;
}

.deck-create-actions .filter-button,
.library-import-actions .filter-button {
  height: 38px;
}

.deck-export-message {
  margin: 0 0 12px;
  color: var(--muted);
}

.deck-export-actions {
  justify-content: flex-start;
}

.share-modal-panel {
  width: min(680px, 100%);
}

.share-modal-body {
  display: grid;
  gap: 12px;
}

.login-modal-body {
  display: grid;
  gap: 20px;
}

.login-modal-actions {
  display: flex;
  justify-content: center;
}

.login-google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: #fff;
  color: #3c4043;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid #dadce0;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
}

.login-google-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.signin-prompt-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.signin-prompt-btn:hover {
  color: var(--accent-strong);
}

.share-modal-message {
  margin: 0;
  color: var(--muted);
}

.share-modal-input {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.95rem;
}

.share-modal-feedback {
  margin: 0;
  min-height: 1.4rem;
  color: var(--accent);
}

.share-modal-actions {
  justify-content: flex-start;
  margin-top: 0;
}

.share-creator {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.share-creator-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(125, 211, 252, 0.12);
  flex-shrink: 0;
}

.share-creator-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  color: var(--muted);
}

.share-creator-name:hover {
  color: var(--accent);
  text-decoration: underline;
}

.share-more {
  margin-top: 36px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  padding-top: 24px;
}

.share-more-heading {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px 0;
}

.share-more-list {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.share-more-panel {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid rgba(125, 211, 252, 0.12);
  border-radius: 14px;
  padding: 16px 20px 8px;
  background: rgba(125, 211, 252, 0.03);
}

.share-more-panel-heading {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px 0;
}

.share-more-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  text-decoration: none;
  color: var(--text);
  transition: color 0.12s;
}

.share-more-row:last-child {
  border-bottom: none;
}

.share-more-row:hover {
  color: var(--accent);
}

.share-more-row:hover .share-more-row-meta {
  color: var(--accent);
  opacity: 0.75;
}

.share-more-row-title {
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-more-row-meta {
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.12s;
}

/* profile.html */

.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  margin-bottom: 28px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(125, 211, 252, 0.1);
  flex-shrink: 0;
}

.profile-name {
  margin: 0 0 2px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.profile-label {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-panels {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.profile-panel {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid rgba(125, 211, 252, 0.12);
  border-radius: 14px;
  overflow: hidden;
}

.profile-panel-heading {
  margin: 0;
  padding: 12px 18px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(125, 211, 252, 0.04);
  border-bottom: 1px solid rgba(125, 211, 252, 0.08);
}

.profile-panel-list {
  display: flex;
  flex-direction: column;
}

.profile-panel-empty {
  margin: 0;
  padding: 16px 18px;
  font-size: 0.85rem;
  color: var(--muted);
}

.profile-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s;
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-row:hover {
  background: rgba(125, 211, 252, 0.05);
}

.profile-row-title {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-row-meta {
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .profile-panels {
    flex-direction: column;
  }

  .profile-panel {
    width: 100%;
  }
}

/* end profile.html */

.deck-create-save {
  width: auto;
  min-width: 96px;
  height: 36px;
  padding: 0 18px;
  border-radius: 14px;
}

.info-block {
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.62);
}

.info-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.info-text {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
  white-space: pre-wrap;
}

.info-text a {
  color: var(--accent);
}

.deck-text-body {
  padding: 4px 24px 28px;
}

.deck-text-title {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.35;
}

.deck-text-heading {
  margin: 10px 0 8px;
  color: #f8fafc;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.deck-text-line {
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.deck-text-spacer {
  height: 10px;
}

.l5rsym {
  font-family: "L5R Symbol";
  font-size: 120%;
}

.inlinesymbol {
  display: inline-block;
  height: 1.1em;
  vertical-align: text-bottom;
}

.inlinesymbolbounded {
  display: inline-block;
  max-width: 1.1em;
  max-height: 1.1em;
  vertical-align: text-bottom;
}

@keyframes star-twinkle {
  0%, 100% {
    opacity: 0.35;
    transform: scale(1);
  }

  50% {
    opacity: 0.75;
    transform: scale(1.02);
  }
}

@keyframes shooting-star {
  0% {
    opacity: 0;
    transform: rotate(-28deg) translate3d(0, 0, 0);
  }

  6% {
    opacity: 0.85;
  }

  18% {
    opacity: 0;
    transform: rotate(-28deg) translate3d(-340px, 220px, 0);
  }

  100% {
    opacity: 0;
    transform: rotate(-28deg) translate3d(-340px, 220px, 0);
  }
}

.results-4col {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.results-4col .card-title {
  font-size: 0.84rem;
}

.results-4col .card-add-button {
  font-size: 0.72rem;
  padding: 0 8px;
  min-height: 28px;
}

.preferences-body {
  padding: 20px 24px 24px;
}

.preferences-section {
  margin-bottom: 0;
}

.preferences-section-title {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.preferences-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preferences-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.preferences-option:hover {
  border-color: rgba(125, 211, 252, 0.36);
  background: rgba(30, 41, 59, 0.7);
  color: var(--text);
}

.preferences-option.is-active {
  border-color: rgba(125, 211, 252, 0.6);
  background: rgba(14, 25, 46, 0.9);
  color: #d7f2ff;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.12);
}

.preferences-option-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: currentColor;
}

.preferences-save-note {
  margin: 16px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  min-height: 1.2em;
}

.preferences-section + .preferences-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

@keyframes card-add-confirm {
  0%   { transform: scale(1.1); box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.6); }
  100% { transform: scale(1);   box-shadow: none; }
}

.card-add-button.is-adding {
  animation: card-add-confirm 380ms ease-out forwards;
  pointer-events: none;
}

@media (max-width: 720px) {
  body {
    padding: 18px 14px 28px;
  }

  .hero {
    padding: 22px;
  }

  .hero-header {
    flex-direction: column;
  }

  .main-tabs {
    flex-wrap: wrap;
  }

  .main-panel {
    border-radius: 18px;
  }

  .toolbar-panel-secondary {
    width: 100%;
  }

  .utility-tools {
    width: 100%;
  }

  .deck-panel-header {
    flex-direction: column;
  }

  .deck-controls {
    width: 100%;
    min-width: 0;
    flex-basis: auto;
  }

  .deck-select-row {
    flex-direction: column;
  }

  .deck-select {
    width: 100%;
    min-width: 0;
  }

  .filter-tools {
    width: 100%;
    flex-wrap: wrap;
  }

  .filter-button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .filter-panel {
    left: 0;
    right: auto;
    width: 100%;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .search-controls-row {
    grid-template-columns: 1fr;
  }

  .search-button {
    height: 54px;
  }

  .results,
  .results-4col {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .modal {
    padding: 12px;
  }

  .modal-header {
    padding: 18px 18px 10px;
  }

  .modal-layout {
    grid-template-columns: 1fr;
    padding: 0 18px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .starfield-near,
  .starfield-near::before,
  .starfield-near::after,
  .shooting-star {
    animation: none;
  }
}

/* ── Text Import Modal ─────────────────────────────────────── */

.deck-text-import-panel {
  width: min(680px, 100%);
}

.deck-text-import-body {
  padding: 8px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.deck-text-import-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(125, 211, 252, 0.12);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.deck-text-import-tab {
  padding: 8px 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.deck-text-import-tab.is-active {
  border-color: rgba(125, 211, 252, 0.5);
  background: rgba(14, 25, 46, 0.92);
  color: var(--accent);
}

.deck-text-import-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.deck-text-import-hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.deck-text-import-textarea {
  width: 100%;
  min-height: 260px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.65;
  resize: vertical;
  box-sizing: border-box;
}

.deck-text-import-textarea::placeholder {
  color: rgba(148, 163, 184, 0.45);
}

.deck-text-import-textarea:focus,
.deck-text-import-textarea:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.5);
  outline-offset: 2px;
}

.deck-text-import-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 0;
}

.deck-text-import-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.deck-text-import-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 200ms ease;
  width: 0%;
}

.deck-text-import-progress-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.deck-text-import-summary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.13);
  font-size: 0.875rem;
  margin-bottom: 18px;
}

.deck-text-import-summary-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.deck-text-import-summary-count {
  font-weight: 600;
}

.deck-text-import-summary-count.is-resolved { color: var(--accent); }
.deck-text-import-summary-count.is-ambiguous { color: #fbbf24; }
.deck-text-import-summary-count.is-unresolved { color: rgba(148, 163, 184, 0.65); }

.deck-text-import-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 10px;
  padding-top: 16px;
}

.deck-text-import-ambiguous-item {
  display: grid;
  grid-template-columns: 1fr 2fr;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.deck-text-import-ambiguous-label {
  font-size: 0.875rem;
  color: rgba(148, 163, 184, 0.8);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-text-import-ambiguous-select {
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  width: 100%;
}

.deck-text-import-unresolved-item {
  padding: 5px 0;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.55);
  font-style: italic;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.deck-text-import-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.deck-text-import-options-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.deck-text-import-name-label {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.deck-text-import-name-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
}

.deck-text-import-name-input::placeholder {
  color: rgba(148, 163, 184, 0.4);
}

.deck-text-import-name-input:focus {
  outline: 2px solid rgba(125, 211, 252, 0.5);
  outline-offset: 1px;
}

@media (max-width: 500px) {
  .deck-text-import-ambiguous-item {
    grid-template-columns: 1fr;
  }
  .deck-text-import-name-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .deck-text-import-name-input {
    width: 100%;
  }
}

/* ── Library panel ───────────────────────────────────────────── */
.library-panel {
  padding: 4px 0 0;
}

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.library-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lib-filter-select {
  min-width: 140px;
}

.library-admin-wrap {
  display: flex;
  gap: 8px;
}

.library-import-form {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.library-import-fields {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.lib-import-select {
  min-width: 140px;
}

.lib-import-input {
  flex: 1;
  min-width: 180px;
}

.library-import-actions {
  margin-bottom: 0;
}

.library-import-status {
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--accent);
}

.library-status {
  min-height: 1.2em;
  font-size: 0.875rem;
  color: rgba(148, 163, 184, 0.6);
  margin-bottom: 6px;
}

.library-table-wrap {
  overflow-x: auto;
}

.library-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.library-table thead th {
  padding: 8px 10px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(148, 163, 184, 0.55);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  white-space: nowrap;
}

.library-table tbody .lib-row {
  cursor: pointer;
  transition: background 0.12s;
}

.library-table tbody .lib-row:hover {
  background: rgba(125, 211, 252, 0.06);
}

.library-table tbody .lib-row:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.5);
  outline-offset: -2px;
}

.library-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  vertical-align: middle;
}

.lib-col-title    { font-weight: 500; color: var(--text); }
.lib-col-format   { color: var(--accent); white-space: nowrap; }
.lib-col-clan     { color: rgba(148, 163, 184, 0.8); white-space: nowrap; }
.lib-col-builder  { color: rgba(148, 163, 184, 0.7); }
.lib-col-tournament { color: rgba(148, 163, 184, 0.55); font-size: 0.8125rem; }

.lib-import-title-input {
  width: 100%;
  flex-basis: 100%;
}

.lib-col-title-editing {
  min-width: 260px;
}

.lib-row-edit-btn {
  background: none;
  border: none;
  padding: 1px 5px;
  margin-left: 6px;
  color: rgba(148, 163, 184, 0.35);
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: 4px;
  vertical-align: middle;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s;
  line-height: 1;
}

.lib-row:hover .lib-row-edit-btn,
.lib-row:focus-within .lib-row-edit-btn {
  opacity: 1;
}

.lib-row-edit-btn:hover {
  color: var(--accent);
  background: rgba(125, 211, 252, 0.08);
}

.lib-edit-input {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(125, 211, 252, 0.45);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  width: 200px;
  vertical-align: middle;
}

.lib-edit-input:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.7);
}

.lib-edit-save,
.lib-edit-cancel {
  vertical-align: middle;
  margin-left: 5px;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.4;
}

.lib-edit-save {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #03111d;
  border: none;
}

.lib-edit-save:hover { filter: brightness(1.05); }

.lib-edit-cancel {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.lib-edit-cancel:hover {
  border-color: rgba(148, 163, 184, 0.4);
  color: var(--text);
}

/* Open-in-editor button (appears next to rename button in library rows) */
.lib-row-open-editor-btn {
  background: none;
  border: 1px solid rgba(125, 211, 252, 0.2);
  padding: 1px 7px;
  margin-left: 5px;
  color: rgba(125, 211, 252, 0.5);
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  vertical-align: middle;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.5;
}

.lib-row:hover .lib-row-open-editor-btn,
.lib-row:focus-within .lib-row-open-editor-btn {
  opacity: 1;
}

.lib-row-open-editor-btn:hover {
  color: var(--accent);
  border-color: rgba(125, 211, 252, 0.5);
  background: rgba(125, 211, 252, 0.06);
}

/* Library edit mode banner shown inside the deck panel */
#lib-edit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(20, 60, 20, 0.7);
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 6px;
  padding: 6px 12px;
  margin: 8px 12px 0;
  font-size: 0.82rem;
  color: rgba(134, 239, 172, 0.9);
}

#lib-edit-banner strong {
  color: rgb(187, 247, 208);
}

#lib-edit-exit-btn {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: rgb(134, 239, 172);
  padding: 3px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
  white-space: nowrap;
  flex-shrink: 0;
}

#lib-edit-exit-btn:hover {
  background: rgba(74, 222, 128, 0.22);
  border-color: rgba(74, 222, 128, 0.6);
}

/* Hide delete button when library edit mode is active */
.lib-edit-mode #deck-delete {
  display: none;
}

@media (max-width: 640px) {
  .lib-col-tournament { display: none; }
  .library-import-fields { flex-direction: column; }
}
