:root {
  color-scheme: dark;
  --yellow: #F8F546;
  --silver: #A0AAA9;
  --charcoal: #313739;
  --charcoal-2: #252c2e;
  --text: #f6f7f0;
  --muted: #A0AAA9;
  --border: rgba(160, 170, 169, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(160, 170, 169, 0.22), transparent 32rem),
    radial-gradient(circle at 82% 8%, rgba(248, 245, 70, 0.14), transparent 34rem),
    linear-gradient(135deg, #313739, #252c2e 52%, #181d1f);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.15;
  background-image:
    linear-gradient(rgba(160, 170, 169, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 170, 169, 0.18) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(160, 170, 169, 0.20);
  background: rgba(37, 44, 46, 0.88);
  backdrop-filter: blur(14px);
}

.nav,
.page,
footer {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.nav {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.98rem;
  font-weight: 950;
}

.mark {
  display: block;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 7px;
  box-shadow: 0 0 24px rgba(205, 166, 94, 0.22);
}

.mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.84rem;
  font-weight: 800;
}

.nav-cta {
  padding: 10px 15px;
  border: 1px solid rgba(248, 245, 70, 0.42);
  border-radius: 9px;
  color: var(--yellow);
  background: rgba(248, 245, 70, 0.07);
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.nav-cta:hover {
  color: var(--charcoal);
  border-color: var(--yellow);
  background: var(--yellow);
}

.page {
  padding: 14px 0 56px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.breadcrumbs strong {
  color: var(--text);
}

.hero {
  margin-bottom: 10px;
  padding: 16px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(101, 113, 54, 0.40), rgba(49, 55, 57, 0.90));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--yellow);
  font-size: 0.64rem;
  font-weight: 950;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.85rem, 3vw, 2.7rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.hero p {
  max-width: 1000px;
  margin: 8px 0 0;
  color: #d7ddd9;
  font-size: 0.86rem;
  line-height: 1.45;
}

.toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) repeat(3, minmax(125px, auto)) auto auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(160, 170, 169, 0.20);
  border-radius: 10px;
  background: rgba(37, 44, 46, 0.68);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.summary {
  min-width: 126px;
  padding: 0 6px 7px;
}

.summary strong {
  display: block;
  font-size: 0.9rem;
}

.summary span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.65rem;
}

.control {
  display: grid;
  gap: 4px;
}

.control span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control input,
.control select {
  width: 100%;
  height: 36px;
  border: 1px solid rgba(160, 170, 169, 0.24);
  border-radius: 7px;
  color: var(--text);
  background: #252c2e;
  padding: 0 10px;
  font-size: 0.76rem;
  outline: none;
}

.control input:focus,
.control select:focus {
  border-color: rgba(248, 245, 70, 0.72);
  box-shadow: 0 0 0 3px rgba(248, 245, 70, 0.08);
}

.control input::placeholder {
  color: #899391;
}

.filter-reset {
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(160, 170, 169, 0.24);
  border-radius: 7px;
  color: #d9dedb;
  background: rgba(126, 128, 124, 0.12);
  font-size: 0.72rem;
  font-weight: 850;
  cursor: pointer;
}

.filter-reset:hover {
  color: var(--yellow);
  border-color: rgba(248, 245, 70, 0.42);
}

.rotation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.rotation-card {
  display: grid;
  gap: 9px;
  align-content: start;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(160, 170, 169, 0.22);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(126, 128, 124, 0.14), rgba(49, 55, 57, 0.84));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.rotation-card:hover {
  transform: translateY(-3px);
  border-color: rgba(248, 245, 70, 0.58);
  background: linear-gradient(135deg, rgba(101, 113, 54, 0.22), rgba(49, 55, 57, 0.86));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.30);
}

.team-strip {
  min-height: 76px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding: 7px;
  border: 1px solid rgba(216, 224, 220, 0.22);
  border-radius: 9px;
  background:
    radial-gradient(circle at 50% 22%, rgba(248, 245, 70, 0.08), transparent 52%),
    linear-gradient(145deg, rgba(25, 31, 32, 0.18), rgba(15, 19, 20, 0.68));
}

.operator-avatar,
.operator-placeholder {
  width: 100%;
  max-width: 66px;
  aspect-ratio: 1;
  justify-self: center;
  border: 1px solid rgba(216, 224, 220, 0.30);
  border-radius: 8px;
  background: rgba(7, 9, 10, 0.62);
}

.operator-avatar {
  display: block;
  object-fit: contain;
}

.operator-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-title-wrap {
  min-width: 0;
}

.card-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.15;
}

.author {
  margin-top: 5px;
  color: #d8deda;
  font-size: 0.72rem;
  font-weight: 800;
}

.date {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
}

.planner-link,
.detail-button,
.copy-button,
.like-button,
.detail-close {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid rgba(160, 170, 169, 0.28);
  border-radius: 7px;
  color: #f2f2f2;
  background: rgba(126, 128, 124, 0.12);
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.planner-link {
  color: var(--yellow);
  border-color: rgba(248, 245, 70, 0.44);
  background: rgba(248, 245, 70, 0.08);
}

.planner-link:hover,
.detail-button:hover,
.copy-button:hover,
.like-button:hover,
.detail-close:hover {
  color: var(--yellow);
  border-color: rgba(248, 245, 70, 0.62);
}

.like-button.is-liked {
  color: var(--yellow);
  border-color: rgba(248, 245, 70, 0.72);
}

.copy-button.is-copied {
  color: var(--charcoal);
  border-color: var(--yellow);
  background: var(--yellow);
}

.rotation-preview {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  padding: 8px;
  border: 1px solid rgba(160, 170, 169, 0.14);
  border-radius: 8px;
  background: rgba(7, 9, 10, 0.30);
}

.ef-skill-icon {
  --ef-size: 30px;
  --ef-bg-color: #8c8c8c;
  position: relative;
  width: var(--ef-size);
  height: var(--ef-size);
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(7, 9, 10, 0.68);
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.28));
}

.ef-skill-fill,
.ef-skill-ring,
.ef-skill-glyph-wrap {
  position: absolute;
}

.ef-skill-ring,
.ef-skill-glyph-wrap {
  inset: 0;
}

.ef-skill-ring {
  z-index: 3;
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
}

.ef-skill-glyph-wrap {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ef-skill-glyph {
  display: block;
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.ef-skill-fallback {
  color: #fff;
  font-size: 0.62rem;
  font-weight: 900;
}

.ef-fill-half .ef-skill-fill {
  left: 50%;
  top: 52%;
  z-index: 1;
  width: 122%;
  height: 122%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--ef-bg-color);
}

.ef-fill-full .ef-skill-fill {
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  background: var(--ef-bg-color);
}

.ef-element-heat {
  --ef-bg-color: #ef4b43;
}

.ef-element-cryo {
  --ef-bg-color: #5ab8ff;
}

.ef-element-electric {
  --ef-bg-color: #f0d34a;
}

.ef-element-nature {
  --ef-bg-color: #58d17a;
}

.ef-element-physical {
  --ef-bg-color: #b9b9b9;
}

.ef-element-neutral {
  --ef-bg-color: #8c8c8c;
}

.preview-arrow {
  flex: 0 0 auto;
  color: rgba(248, 245, 70, 0.78);
  font-size: 0.72rem;
  font-weight: 900;
}

.preview-more {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.description {
  margin: 0;
  color: rgba(242, 242, 242, 0.76);
  font-size: 0.74rem;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(160, 170, 169, 0.24);
  border-radius: 999px;
  color: #dbe0dc;
  background: rgba(7, 9, 10, 0.28);
  font-size: 0.58rem;
  font-weight: 850;
  text-transform: uppercase;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid rgba(160, 170, 169, 0.16);
}

.stats {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.card-actions {
  display: flex;
  gap: 5px;
}

.detail-panel {
  margin-bottom: 12px;
  padding: 18px;
  border: 1px solid rgba(248, 245, 70, 0.24);
  border-radius: 11px;
  background:
    radial-gradient(circle at 88% 12%, rgba(101, 113, 54, 0.26), transparent 30%),
    linear-gradient(135deg, rgba(49, 55, 57, 0.92), rgba(25, 30, 31, 0.96));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  scroll-margin-top: 72px;
}

.detail-panel[hidden],
.empty-state[hidden] {
  display: none;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.detail-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
  gap: 16px;
  margin-top: 16px;
}

.detail-section {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(160, 170, 169, 0.16);
  border-radius: 9px;
  background: rgba(7, 9, 10, 0.22);
}

.detail-section h3 {
  margin: 0 0 10px;
  color: var(--yellow);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-team {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.detail-operator {
  min-width: 0;
  text-align: center;
}

.detail-operator strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-skills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.detail-skill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #dce2de;
  font-size: 0.68rem;
  font-weight: 800;
}

.detail-skill .ef-skill-icon {
  --ef-size: 38px;
}

.detail-notes {
  margin: 0;
  color: #d4dad6;
  font-size: 0.78rem;
  line-height: 1.55;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.empty-state,
.state-card {
  padding: 32px;
  border: 1px dashed rgba(160, 170, 169, 0.28);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.state-card {
  grid-column: 1 / -1;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 34px;
  color: rgba(160, 170, 169, 0.82);
  font-size: 0.78rem;
}

footer a {
  color: var(--yellow);
}

.page-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  max-width: min(420px, calc(100% - 32px));
  padding: 11px 16px;
  border: 1px solid rgba(160, 170, 169, 0.30);
  border-radius: 8px;
  color: #f4f5ef;
  background: rgba(25, 30, 31, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.40);
  font-size: 0.78rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.page-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.page-toast.is-success {
  color: var(--yellow);
  border-color: rgba(248, 245, 70, 0.52);
}

.page-toast.is-info {
  color: #d9dedb;
}

@media (max-width: 980px) {
  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary,
  .search-control {
    grid-column: 1 / -1;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .nav {
    gap: 10px;
  }

  .nav-links > a:first-child {
    display: none;
  }

  .nav-cta {
    padding: 9px 11px;
    font-size: 0.72rem;
  }

  .page {
    width: min(100% - 20px, 1120px);
  }

  .hero {
    padding: 16px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .summary,
  .search-control {
    grid-column: auto;
  }

  .rotation-grid {
    grid-template-columns: 1fr;
  }

  .card-footer,
  .detail-head,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-team {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .rotation-card {
    transition: none;
  }
}
