:root {
  --bg: #0f111a;
  --surface: #181c2b;
  --surface-2: #21273b;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f3f5fc;
  --muted: #a2acc8;
  --primary: #ff5ca8;
  --primary-hover: #ff3e97;
  --accent: #4cc9f0;
  --good: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 16px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top center, #1e2340 0%, var(--bg) 52%);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(15, 17, 26, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  flex-wrap: wrap;
  padding-top: 6px;
  padding-bottom: 6px;
}

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

.brand-logo {
  font-size: 1.6rem;
}

.brand-name {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  margin-left: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(76, 201, 240, 0.16);
  color: var(--accent);
  border: 1px solid rgba(76, 201, 240, 0.35);
}

.top-nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.top-nav a:hover {
  color: var(--text);
}

/* Hero */
.hero {
  padding: 28px 0 12px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #ff7eb3, #ffd166, #4cc9f0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0 auto 18px;
  max-width: 660px;
  color: var(--muted);
  font-size: 1rem;
}

/* Filter chips */
.quick-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.chip {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--text);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Cards & Grid */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 20px;
  align-items: start;
  text-align: left;
}

@media (max-width: 860px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* Wheel */
.wheel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wheel-stage {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0 18px;
}

#wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 0 6px #28304d, 0 16px 40px rgba(0, 0, 0, 0.45);
}

.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  line-height: 1;
  color: #ffd166;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
  z-index: 5;
  pointer-events: none;
}

.center-hub {
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: linear-gradient(135deg, #ff5ca8, #7b2cbf);
  color: #fff;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  z-index: 4;
  transition: transform 0.15s ease;
}

.center-hub:hover:not(:disabled) {
  transform: scale(1.07);
}

.center-hub:disabled {
  opacity: 0.7;
  cursor: wait;
}

.wheel-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  justify-content: center;
  margin-bottom: 14px;
}

.wheel-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.88rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #ff7a59);
  color: #fff;
  flex: 1 1 220px;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  flex: 0 1 auto;
}

.btn-secondary:hover:not(:disabled) {
  background: #2b324c;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(76, 201, 240, 0.45);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(76, 201, 240, 0.12);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--muted);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.84rem;
}

.text-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
}

/* Result panel */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.result-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.synergy-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.synergy-badge.meta { background: rgba(52, 211, 153, 0.18); color: var(--good); }
.synergy-badge.chaos { background: rgba(248, 113, 113, 0.2); color: var(--danger); }
.synergy-badge.balanced { background: rgba(251, 191, 36, 0.18); color: var(--warn); }

.slots-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.trinket-slot {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  min-height: 106px;
}

.trinket-slot.filled {
  border-color: rgba(255, 92, 168, 0.45);
}

.slot-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.slot-empty {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 12px 0;
}

.slot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.slot-title {
  font-size: 1.08rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.tag-Speed { background: rgba(76, 201, 240, 0.18); color: #7ae2ff; }
.tag-Extraction { background: rgba(52, 211, 153, 0.18); color: #6ee7b7; }
.tag-SkillCheck { background: rgba(251, 191, 36, 0.18); color: #fde047; }
.tag-Stamina { background: rgba(167, 139, 250, 0.2); color: #c4b5fd; }
.tag-Stealth { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.tag-Utility { background: rgba(244, 114, 182, 0.2); color: #f9a8d4; }
.tag-Debuff { background: rgba(248, 113, 113, 0.22); color: #fca5a5; }

.slot-effect {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: #e2e8f8;
}

.slot-source {
  font-size: 0.78rem;
  color: var(--muted);
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.result-actions .btn-outline {
  flex: 1 1 200px;
}

.copy-feedback {
  min-height: 20px;
  margin: 6px 0 10px;
  font-size: 0.84rem;
  color: var(--good);
}

.history-box {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.history-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
}

.history-list li {
  font-size: 0.84rem;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.history-empty {
  color: var(--muted);
  justify-content: center !important;
}

/* Sections */
.section-block {
  margin-top: 22px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.muted {
  color: var(--muted);
  margin: 0;
  font-size: 0.9rem;
}

.pool-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input, .select-input {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.search-input {
  min-width: 220px;
}

.pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.pool-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.86rem;
  user-select: none;
}

.pool-item.unchecked {
  opacity: 0.45;
}

.pool-item input {
  accent-color: var(--primary);
}

/* Table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.faq-list details {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}

.faq-list summary {
  font-weight: 700;
  cursor: pointer;
}

.faq-list p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Footer */
.site-footer {
  margin-top: 36px;
  border-top: 1px solid var(--border);
  padding: 22px 0 36px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
}

.footer-inner p {
  margin: 4px 0;
}

/* Floating Feedback Button & Modal */
.fab-feedback {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  border: 1px solid rgba(255, 92, 168, 0.5);
  background: rgba(24, 28, 43, 0.94);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.fab-feedback:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(8, 10, 18, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.icon-close {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.icon-close:hover {
  color: var(--text);
}

.modal-desc {
  margin-bottom: 14px;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.textarea-input {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.92rem;
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.modal-actions a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fb-status {
  margin: 2px 0 0;
  min-height: 20px;
  font-size: 0.86rem;
}

.fb-status.ok { color: var(--good); }
.fb-status.err { color: var(--warn); }

