@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Share+Tech+Mono&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #07071A;
  --surface:  #0C0C22;
  --border:   rgba(255,255,255,0.07);
  --bright:   #E0E0EE;
  --body:     #A0A0BC;
  --dim:      #5A5A7A;
  --font-head: 'Orbitron', sans-serif;
  --font-body: 'Share Tech Mono', monospace;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.04) 3px,
    rgba(0,0,0,0.04) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── Typography ── */
h1, h2, h3, .orb { font-family: var(--font-head); }
h1 { font-size: clamp(1.4rem, 4vw, 2.2rem); font-weight: 900; color: var(--bright); letter-spacing: 0.06em; }
h2 { font-size: 1rem; font-weight: 700; letter-spacing: 0.1em; color: var(--bright); }
h3 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; }

p, li { font-size: 0.85rem; line-height: 1.75; }

/* ── Site Header ── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(0.9rem, 2.5vw, 1.15rem);
  color: var(--bright);
  letter-spacing: 0.08em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  font-family: var(--font-head);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--body);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: color 0.2s, border-color 0.2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--bright);
  border-color: rgba(255,255,255,0.25);
}

/* ── Blink cursor ── */
.blink {
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Corner brackets ── */
.bracketed { position: relative; }
.bracketed::before,
.bracketed::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--dim);
  border-style: solid;
  transition: border-color 0.25s;
}
.bracketed::before { top: 0; left: 0; border-width: 2px 0 0 2px; }
.bracketed::after  { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

/* ── Buttons ── */
.btn {
  font-family: var(--font-head);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--body);
  padding: 10px 24px;
  cursor: pointer;
  border-radius: 3px;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:hover {
  color: var(--bright);
  border-color: rgba(255,255,255,0.3);
}
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.btn-accent {
  border-color: currentColor;
  color: var(--bright);
}

/* ── Page container ── */
.page { max-width: 1200px; margin: 0 auto; padding: 40px 24px 80px; }

/* ── Section label ── */
.section-label {
  font-family: var(--font-head);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ── Card Avatar ── */
.card-avatar-area {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: 5px 5px 0 0;
  background: var(--bg);
}
.card-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  mix-blend-mode: lighten;
  transition: transform 0.3s ease;
}
.player-card:hover .card-avatar-img {
  transform: scale(1.04);
}
.card-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 2.5rem;
  opacity: 0.5;
}
.card-avatar-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ── Modal Avatar ── */
.modal-avatar-area {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  border: 2px solid var(--c, #00E5FF);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 0 16px var(--glow, rgba(0,229,255,0.2));
}
.modal-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  mix-blend-mode: lighten;
}
.modal-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.6rem;
}

/* ── Prompt badge strip ── */
.prompt-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.prompt-icon {
  font-size: 0.8rem;
  opacity: 0.5;
  transition: opacity 0.2s;
}

/* ── Modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7,7,26,0.88);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(40px);
  transition: transform 0.3s ease;
  position: relative;
}
.modal-backdrop.open .modal {
  transform: translateY(0);
}
.modal-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 24px 28px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 2;
}
.modal-header .avatar-frame { width: 52px; height: 52px; }
.modal-header .avatar-initials { font-size: 1rem; }
.modal-title { flex: 1; }
.modal-title .name { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--bright); }
.modal-title .role { font-size: 0.72rem; color: var(--body); margin-top: 2px; }
.modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--body);
  font-family: var(--font-head);
  font-size: 0.6rem;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 3px;
  letter-spacing: 0.1em;
  transition: color 0.2s, border-color 0.2s;
}
.modal-close:hover { color: var(--bright); border-color: rgba(255,255,255,0.3); }

.modal-body { padding: 24px 28px; }

.prompt-section {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.prompt-section-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.prompt-section-icon { font-size: 1rem; }
.prompt-section-tag {
  font-family: var(--font-head);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--bright);
}
.prompt-section-sub {
  font-size: 0.65rem;
  color: var(--dim);
  letter-spacing: 0.06em;
}
.prompt-section p { font-size: 0.82rem; color: var(--body); }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 40px;
  text-align: center;
  font-family: var(--font-head);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  color: var(--dim);
}

/* ── Custom Dropdown ── */
.custom-select-wrap {
  position: relative;
  user-select: none;
}
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.custom-select-trigger:hover { border-color: rgba(255,255,255,0.2); }
.custom-select-trigger.open { border-color: rgba(255,255,255,0.3); }
.custom-select-label {
  font-family: var(--font-head);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--body);
}
.custom-select-label.placeholder { color: var(--dim); }
.custom-select-arrow { color: var(--dim); font-size: 0.6rem; transition: transform 0.2s; }
.custom-select-trigger.open .custom-select-arrow { transform: rotate(180deg); }

.custom-select-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #10102A;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  z-index: 500;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.25s ease, opacity 0.2s;
}
.custom-select-list.open {
  max-height: 320px;
  opacity: 1;
  pointer-events: all;
  overflow-y: auto;
}
.custom-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.78rem;
  color: var(--body);
}
.custom-select-option:hover { background: rgba(255,255,255,0.05); color: var(--bright); }
.custom-select-option.selected { background: rgba(255,255,255,0.04); color: var(--bright); }
.custom-select-option .opt-initials {
  font-family: var(--font-head);
  font-size: 0.6rem;
  font-weight: 700;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  flex-shrink: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 3px; }
