:root {
  --bg: #0b1224;
  --panel: rgba(17, 27, 52, 0.9);
  --border: rgba(255, 255, 255, 0.08);
  --accent: #2de3c4;
  --accent-amber: #ffb454;
  --accent-blue: #69a8ff;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Noto Sans JP", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #050912;
  background-image: url("https://images.unsplash.com/photo-1462331940025-496dfbfc7564?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 24px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 12px;
}

.lede {
  margin-top: 16px;
  max-width: 78ch;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.controls input,
.controls select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s, transform 0.2s;
}

.controls input:focus,
.controls select:focus {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.controls input {
  flex: 1 1 240px;
}

.controls select {
  min-width: 180px;
}

.legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

.pill-green {
  color: var(--accent);
}

.pill-amber {
  color: var(--accent-amber);
}

.pill-silver {
  color: #c9d1d9;
}

.card-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 0 64px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.role-pill {
  padding: 8px 12px;
  border-radius: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-size: 13px;
  background: rgba(105, 168, 255, 0.12);
  color: #b9d6ff;
  border: 1px solid rgba(105, 168, 255, 0.4);
}

.role-pill[data-role="強襲"] {
  background: rgba(255, 113, 141, 0.16);
  color: #ffafc4;
  border-color: rgba(255, 113, 141, 0.4);
}

.role-pill[data-role="支援"] {
  background: rgba(45, 227, 196, 0.16);
  color: #9cf3de;
  border-color: rgba(45, 227, 196, 0.45);
}

.role-pill[data-role="強襲支援"] {
  background: rgba(255, 180, 84, 0.16);
  color: #ffd8aa;
  border-color: rgba(255, 180, 84, 0.45);
}

.cost {
  font-weight: 700;
  color: #f7f7f7;
  letter-spacing: 0.04em;
  font-size: 14px;
}

.brief {
  min-height: 52px;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: #cdd5e1;
}

.tag.difficulty[data-tier="初級"] {
  border-color: rgba(45, 227, 196, 0.5);
  color: #b1f6e7;
}

.tag.difficulty[data-tier="中級"] {
  border-color: rgba(255, 180, 84, 0.5);
  color: #ffd8aa;
}

.tag.difficulty[data-tier="上級"] {
  border-color: rgba(255, 113, 141, 0.55);
  color: #ffc1d4;
}

.visual {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 12px;
  align-items: center;
}

.canvas-wrap {
  background: radial-gradient(circle at 40% 40%, rgba(45, 227, 196, 0.1), rgba(255, 255, 255, 0));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
}

.stat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-title {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-blue));
}

.stat-value {
  font-size: 12px;
  color: var(--muted);
}

.parts-block {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.block-title {
  font-weight: 700;
  font-size: 14px;
}

.slots-block {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

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

.slot-label {
  min-width: 56px;
  font-weight: 600;
  color: var(--muted);
}

.slot-meter {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.slot-meter span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-blue));
  border-radius: 999px;
}

.slot-value {
  font-variant-numeric: tabular-nums;
  color: #cdd5e1;
  font-size: 13px;
}

.parts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.part-set {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
}

.part-set h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.part-set ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.part-set .note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--accent-amber);
}

.notes {
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.6;
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}

.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 32px;
  color: var(--muted);
  font-size: 13px;
}

/* Detail view */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.list-toolbar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 12px 0 20px;
}

.detail-view {
  background: linear-gradient(135deg, rgba(8, 13, 26, 0.8), rgba(10, 17, 32, 0.9));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.detail-meta {
  display: flex;
  gap: 12px;
  align-items: center;
}

.detail-ms-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
}

.detail-ms-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-tags {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.detail-actions .btn {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
}
.detail-actions .btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.detail-body {
  display: grid;
  grid-template-columns: 0.6fr 0.4fr;
  gap: 18px;
}

.detail-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.slots-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slots-bar {
  display: grid;
  gap: 8px;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.slot-cell {
  aspect-ratio: 1 / 1;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.slot-cell.filled {
  background: linear-gradient(135deg, #2de3c4, #69a8ff);
  border-color: rgba(255, 255, 255, 0.4);
}

.slot-ticks {
  display: flex;
  gap: 3px;
}

.slot-tick {
  width: 10px;
  height: 12px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
}

.slot-tick.filled {
  background: linear-gradient(135deg, #f9943b, #ffcc70);
  box-shadow: 0 0 4px rgba(255, 153, 51, 0.6);
}

.slot-legend {
  font-size: 12px;
  color: var(--muted);
}

.parts-grid {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.part-tile {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  padding: 8px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  align-items: center;
}

.part-tile img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.part-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.part-name {
  font-weight: 700;
  font-size: 13px;
}

.part-slots {
  display: flex;
  gap: 6px;
  font-size: 12px;
  color: #cdd5e1;
}

.part-slots span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
}

.part-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.part-effect {
  font-size: 12px;
  color: #e5e7eb;
  line-height: 1.5;
}

.detail-right {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-stats-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-stats-table th,
.detail-stats-table td {
  padding: 6px 6px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.detail-stats-table th {
  color: #cdd5e1;
  font-weight: 600;
}

.stat-row {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 0.6fr 2fr;
  align-items: center;
  gap: 6px;
}

.stat-bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.stat-bar .fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, #f79c42, #f15b2a);
}
.stat-bar .fill.base {
  background: linear-gradient(90deg, #f79c42, #f15b2a);
}
.stat-bar .fill.bonus {
  background: linear-gradient(90deg, #34d399, #22c55e);
  opacity: 0.9;
  z-index: 1;
}

.stat-bar .cap {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #f5a524;
  opacity: 0.8;
}

.stat-meta {
  color: var(--muted);
  font-size: 12px;
}

.radar-wrap {
  background: radial-gradient(circle at 40% 40%, rgba(45, 227, 196, 0.08), rgba(255, 255, 255, 0));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  overflow: visible;
}

@media (max-width: 960px) {
  .detail-body {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .visual {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .controls {
    flex-direction: column;
  }

  .controls select {
    width: 100%;
  }
}

/* --- gbo2cstm-like list layout --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 12px;
  max-width: 1400px;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: linear-gradient(120deg, rgba(18, 28, 48, 0.9), rgba(8, 14, 26, 0.8));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.card-thumb {
  flex: 0 0 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #0f172a;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-body .name {
  margin: 0;
  font-size: 1.05rem;
}

.card-body .brief {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.slots-row {
  color: #e2e8f0;
  font-size: 0.85rem;
}

.card-radar {
  flex: 0 0 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-radar canvas {
  width: 180px;
  height: 180px;
}
