@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Orbitron:wght@400;600;700;800&display=swap");

:root {
  --bg: #070a16;
  --panel: rgba(12, 17, 37, 0.82);
  --panel-2: rgba(17, 23, 52, 0.9);
  --line: rgba(130, 153, 255, 0.22);
  --text: #edf3ff;
  --muted: #b7c2ff;
  --neon: #6de7ff;
  --pink: #ff5fd2;
  --red: #ff6b7e;
  --purple: #8a6dff;
  --yellow: #ffd86b;
  --green: #67f2a6;
  --shadow: 0 20px 50px rgba(0,0,0,0.35);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(92, 25, 117, 0.25), transparent 30%),
    radial-gradient(circle at bottom left, rgba(17, 128, 184, 0.22), transparent 24%),
    linear-gradient(180deg, #090c19 0%, #05070f 100%);
  font-family: "Orbitron", system-ui, sans-serif;
}
button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.hidden { display: none !important; }
.app { min-height: 100vh; position: relative; overflow: hidden; }
.scanlines::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.03), rgba(255,255,255,0.03) 1px, transparent 1px, transparent 4px);
  opacity: 0.17;
  mix-blend-mode: screen;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 15;
  backdrop-filter: blur(10px);
  background: rgba(5, 7, 15, 0.55);
}
.brand h1 {
  margin: 0;
  font-family: "Cinzel", serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(109,231,255,0.5), 0 0 26px rgba(255,95,210,0.35);
}
.brand-small {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.24em;
}
.top-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.mini-btn, .secondary-btn, .primary-btn {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  color: white;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.mini-btn:hover, .secondary-btn:hover, .primary-btn:hover { transform: translateY(-2px); }
.primary-btn {
  background: linear-gradient(135deg, var(--pink), var(--red));
  box-shadow: 0 10px 24px rgba(255, 95, 210, 0.25);
}
.secondary-btn, .mini-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
}
.primary-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.screen { display: none; padding: 1.25rem; }
.screen.active { display: block; }
.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.hero-screen {
  min-height: calc(100vh - 84px);
  display: grid;
  place-items: center;
  position: relative;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 30%, rgba(255,95,210,0.18), transparent 15%),
    radial-gradient(circle at 80% 28%, rgba(109,231,255,0.18), transparent 18%),
    radial-gradient(circle at 50% 70%, rgba(138,109,255,0.16), transparent 23%),
    linear-gradient(180deg, rgba(8, 10, 22, 0.2), rgba(8, 10, 22, 0.7)),
    url("assets/julen.png") center/cover no-repeat;
  filter: saturate(0.6) brightness(0.35) blur(2px);
  transform: scale(1.08);
}
.hero-panel {
  position: relative;
  max-width: 860px;
  padding: 2rem;
  border-radius: 28px;
}
.eyebrow { color: var(--yellow); text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.78rem; }
.hero-panel h2 {
  font-family: "Cinzel", serif;
  font-size: clamp(2rem, 5vw, 4.2rem);
  margin: 0.3rem 0 1rem;
  line-height: 1.02;
}
.hero-buttons { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.6rem; }
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.selection-meta { padding: 1rem; border-radius: 18px; text-align: right; min-width: 240px; }
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}
.character-card {
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(16,21,47,0.95), rgba(10,14,29,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  position: relative;
}
.character-card:hover { transform: translateY(-4px); border-color: rgba(109,231,255,0.45); }
.character-card.selected { outline: 2px solid var(--neon); box-shadow: 0 0 0 4px rgba(109,231,255,0.16), var(--shadow); }
.character-card img { width: 100%; height: 210px; object-fit: cover; display: block; }
.character-info { padding: 1rem; }
.character-title { display: flex; justify-content: space-between; gap: 0.5rem; align-items: start; }
.character-title h3 { margin: 0; font-size: 1rem; }
.character-role { color: var(--yellow); font-size: 0.74rem; }
.quote { font-size: 0.79rem; color: var(--muted); min-height: 44px; }
.stats-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin-top: 0.7rem; }
.stats-mini span {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 0.4rem;
  text-align: center;
  font-size: 0.73rem;
}
.game-layout { display: grid; grid-template-columns: 340px 1fr; gap: 1rem; }
.sidebar, .board-area { border-radius: 24px; padding: 1rem; }
.sidebar { max-height: calc(100vh - 120px); overflow: auto; }
.sidebar h3, .board-area h2 { margin-top: 0; }
.mission-box, .message-box, .dice-panel, .turn-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 0.9rem;
  margin-bottom: 0.9rem;
}
.progress-line {
  height: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.progress-line span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon), var(--pink));
}
.turn-box { display: grid; grid-template-columns: repeat(3,1fr); gap: 0.5rem; text-align: center; }
.label { display: block; color: var(--muted); font-size: 0.74rem; margin-bottom: 0.2rem; }
.dice-panel { text-align: center; }
.dice {
  width: 88px;
  height: 88px;
  margin: 0.7rem auto;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(145deg, rgba(109,231,255,0.22), rgba(255,95,210,0.22));
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 0 20px rgba(109,231,255,0.2);
}
.dice.rolling { animation: spinDice 0.7s ease; }
@keyframes spinDice {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(220deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}
.party-panel { display: grid; gap: 0.65rem; }
.party-card {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.55rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
}
.party-card img { width: 58px; height: 58px; object-fit: cover; border-radius: 14px; }
.bars { display: grid; gap: 0.25rem; }
.bar {
  position: relative;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; }
.hp span { background: linear-gradient(90deg, #7effa5, #21d95b); }
.en span { background: linear-gradient(90deg, #7be3ff, #3198ff); }
.sa span { background: linear-gradient(90deg, #ffd66c, #ff8a4b); }
.inventory-panel, .clue-list { display: flex; flex-wrap: wrap; gap: 0.55rem; padding-left: 0; list-style: none; }
.item-chip, .clue-chip {
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.07);
  font-size: 0.74rem;
}
.item-chip button {
  margin-left: 0.4rem;
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  background: rgba(109,231,255,0.16);
  color: white;
}
.log-panel {
  max-height: 180px;
  overflow: auto;
  display: grid;
  gap: 0.5rem;
}
.log-entry { font-size: 0.82rem; line-height: 1.4; color: #dbe5ff; }
.board-top { display: flex; justify-content: space-between; gap: 1rem; align-items: start; margin-bottom: 1rem; }
.objective-chip {
  padding: 0.7rem 0.9rem;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  font-size: 0.82rem;
  max-width: 320px;
}
.board {
  position: relative;
  min-height: 680px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(109,231,255,0.08), transparent 22%),
    radial-gradient(circle at bottom right, rgba(255,95,210,0.08), transparent 22%),
    linear-gradient(180deg, rgba(20,20,32,0.82), rgba(10,11,20,0.92)),
    url("assets/nora.png") center/cover no-repeat;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.board::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6,7,14,0.35), rgba(6,7,14,0.75));
}
.board svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.node {
  position: absolute;
  width: 110px;
  transform: translate(-50%, -50%);
  z-index: 3;
}
.node-btn {
  width: 100%;
  border-radius: 20px;
  padding: 0.8rem 0.55rem;
  background: rgba(8, 12, 26, 0.88);
  color: white;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.node-btn small { display: block; margin-top: 0.25rem; color: var(--muted); }
.node-btn.available { border-color: rgba(109,231,255,0.7); box-shadow: 0 0 0 4px rgba(109,231,255,0.14); }
.node-btn.current { border-color: rgba(255,216,107,0.8); box-shadow: 0 0 0 4px rgba(255,216,107,0.16); }
.node-btn.locked { opacity: 0.58; }
.node-icon {
  position: absolute;
  top: -10px;
  right: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  box-shadow: 0 0 14px rgba(0,0,0,0.2);
}
.event { background: var(--pink); }
.clue { background: var(--yellow); color: black; }
.enemy { background: var(--red); }
.safe { background: var(--green); color: black; }
.portal { background: var(--purple); }
.party-token {
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  z-index: 4;
  overflow: hidden;
  border: 3px solid rgba(255,216,107,0.88);
  box-shadow: 0 0 0 6px rgba(255,216,107,0.14), 0 8px 24px rgba(0,0,0,0.4);
}
.party-token img { width: 100%; height: 100%; object-fit: cover; }
.board-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; color: var(--muted); }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 0.35rem; }
.event-dot { background: var(--pink); }
.clue-dot { background: var(--yellow); }
.enemy-dot { background: var(--red); }
.safe-dot { background: var(--green); }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 10, 0.7);
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal-box {
  width: min(920px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 26px;
  padding: 1.2rem;
}
.modal-box h2, .modal-box h3 { margin-top: 0; }
.modal-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.8rem; }
.event-card, .combat-card, .ending-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 1rem;
}
.choice-btn {
  width: 100%;
  padding: 0.9rem;
  border-radius: 16px;
  text-align: left;
  margin-bottom: 0.65rem;
  background: rgba(255,255,255,0.06);
  color: white;
  border: 1px solid rgba(255,255,255,0.08);
}
.combat-layout { display: grid; grid-template-columns: 1fr 360px; gap: 1rem; }
.combat-roster { display: grid; gap: 0.7rem; }
.fighter {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 0.8rem;
  align-items: center;
  background: rgba(255,255,255,0.05);
  padding: 0.7rem;
  border-radius: 18px;
}
.fighter img { width: 70px; height: 70px; object-fit: cover; border-radius: 16px; }
.combat-actions button { width: 100%; margin-bottom: 0.55rem; }
.tutorial-list { line-height: 1.6; color: #dbe3ff; }
.credits-list { line-height: 1.8; }
@media (max-width: 1100px) {
  .game-layout { grid-template-columns: 1fr; }
  .sidebar { max-height: none; order: 2; }
  .board-area { order: 1; }
}
@media (max-width: 720px) {
  .topbar { padding: 0.8rem; }
  .brand h1 { font-size: 1.35rem; }
  .hero-panel { padding: 1.2rem; }
  .board { min-height: 540px; }
  .node { width: 96px; }
  .combat-layout { grid-template-columns: 1fr; }
  .section-title-row, .board-top { flex-direction: column; }
}
