/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1b2a;
  --neon: #00d4ff;
  --neon-dim: rgba(0, 212, 255, 0.15);
  --neon-glow: rgba(0, 212, 255, 0.5);
  --text: #e0f7ff;
  --text-dim: #5a8fa8;
  --gold: #ffd700;
  --panel: rgba(0, 212, 255, 0.06);
  --border: rgba(0, 212, 255, 0.2);
  --penta-size: 120px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Orbitron', 'Courier New', monospace;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== SCANLINE OVERLAY ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 212, 255, 0.015) 2px,
    rgba(0, 212, 255, 0.015) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

/* ===== HEADER ===== */
.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 24px;
  background: rgba(13, 27, 42, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Points */
.points {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: 'Orbitron', 'Courier New', monospace;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}
.points-label {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 3px;
  opacity: 0.8;
}
.points-value {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.8);
}

/* Category Selector */
.category-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--neon);
  border-radius: 30px;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 12px var(--neon-glow), inset 0 0 12px var(--neon-dim);
  position: relative;
}
.category-selector:hover {
  box-shadow: 0 0 24px var(--neon-glow), inset 0 0 20px var(--neon-dim);
}
.category-selector select {
  background: transparent;
  border: none;
  color: var(--neon);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.category-selector select option {
  background: #0d1b2a;
  color: var(--neon);
}
.category-pin { font-size: 1rem; }

/* Language Selector */
/* Language Selector */
.lang-selector {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.lang-drops {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lang-drop { position: relative; }

.lang-drop-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--neon-dim);
  border: 1px solid var(--neon);
  color: var(--neon);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 10px var(--neon-glow);
}
.lang-drop-trigger:hover {
  box-shadow: 0 0 20px var(--neon-glow);
}
.lang-chevron {
  font-size: 0.55rem;
  opacity: 0.7;
  line-height: 1;
  transition: transform 0.25s;
}
.lang-drop.open .lang-chevron { transform: rotate(180deg); }

.lang-drop-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(10, 22, 36, 0.97);
  border: 1px solid var(--neon);
  border-radius: 12px;
  padding: 6px;
  min-width: 160px;
  z-index: 300;
  box-shadow: 0 0 28px rgba(0,212,255,0.25);
  backdrop-filter: blur(14px);
  display: none;
}
.lang-drop.open .lang-drop-menu { display: block; }

.lang-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  user-select: none;
}
.lang-opt-active { background: var(--neon-dim); cursor: default; }
.lang-opt-ghost {
  opacity: 0.3;
  cursor: not-allowed;
  transition: opacity 0.2s, background 0.2s;
}
.lang-opt-ghost:hover {
  opacity: 0.52;
  background: rgba(0, 212, 255, 0.04);
}
.lo-code {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--neon);
  min-width: 22px;
}
.lang-opt-ghost .lo-code { color: var(--text-dim); }
.lo-name {
  font-size: 0.6rem;
  flex: 1;
  color: var(--text);
  letter-spacing: 0.5px;
}
.lang-opt-ghost .lo-name { color: var(--text-dim); }
.lo-badge { font-size: 0.6rem; }

.lang-subtitle {
  font-size: 0.5rem;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ===== MAIN ARENA ===== */
.arena {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow-y: auto;
}

/* Ambient glow center */
.arena::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0,212,255,0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* ===== PENTAGON GRID ===== */
.pentagon-grid {
  position: relative;
  width: 790px;
  height: 790px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: perspective(900px) rotateX(0deg);
}

/* Orbit ring */
.pentagon-grid::before {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border: 1px dashed rgba(0, 212, 255, 0.12);
  border-radius: 50%;
  animation: orbit-spin 40s linear infinite;
  pointer-events: none;
}
@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.pentagon-grid::after {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  border: 1px dashed rgba(0, 212, 255, 0.08);
  border-radius: 50%;
  animation: orbit-spin 25s linear infinite reverse;
  pointer-events: none;
}

.pentagon-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  cursor: pointer;
  transition: transform 0.3s;
}
.pentagon-node .progress-bar { margin-top: -5px; }
.pentagon-node { transform: translate(-50%, -50%); }
.pentagon-node:hover { transform: translate(-50%, calc(-50% - 4px)) scale(1.08); }

/* Ring: center (395,395), radius 210px, 72° apart clockwise from top */
.pentagon-node:nth-child(1) { top: 185px; left: 395px; }
.pentagon-node:nth-child(2) { top: 330px; left: 595px; }
.pentagon-node:nth-child(3) { top: 565px; left: 519px; }
.pentagon-node:nth-child(4) { top: 565px; left: 271px; }
.pentagon-node:nth-child(5) { top: 330px; left: 195px; }
/* P-P: center */
.pentagon-node:nth-child(6) { top: 428px; left: 395px; }
.pentagon-node:nth-child(6) .progress-bar { width: calc(var(--penta-size) * 0.56); margin-top: -18px; }

/* ===== PENTAGON SVG WRAPPER ===== */
.penta-wrap {
  position: relative;
  width: var(--penta-size);
  height: calc(var(--penta-size) * 0.95);
}

.penta-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 4px rgba(0,212,255,0.5)) drop-shadow(0 0 8px rgba(0,212,255,0.12));
  transition: filter 0.3s;
}
.pentagon-node:hover .penta-svg {
  filter: drop-shadow(0 0 6px rgba(0,212,255,0.7)) drop-shadow(0 0 14px rgba(0,212,255,0.2));
}

.penta-fill   { fill: rgba(0, 212, 255, 0.07); transition: fill 0.3s; }
.penta-stroke { fill: none; stroke: var(--neon); stroke-width: 1.5; }
.penta-inner  { fill: none; stroke: rgba(0,212,255,0.2); stroke-width: 0.8; }

.pentagon-node:hover .penta-fill { fill: rgba(0, 212, 255, 0.14); }

/* P-P dual pentagon */
.penta-intersect {
  fill: rgba(0, 212, 255, 0.42);
  transition: fill 0.3s;
}
.pentagon-node:hover .penta-intersect { fill: rgba(0, 212, 255, 0.65); }
.pp-letter {
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 16px;
  font-weight: 700;
  fill: var(--neon);
  text-anchor: middle;
  dominant-baseline: central;
  filter: drop-shadow(0 0 4px var(--neon));
}

/* Label inside pentagon */
.penta-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.penta-id {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--neon);
  text-shadow: 0 0 8px var(--neon);
}
/* ===== ARENA CUBE (above P-P) ===== */
.arena-cube {
  position: absolute;
  top: 312px;
  left: 395px;
  transform: translate(-50%, -50%);
  perspective: 100px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  z-index: 5;
}
.arena-cube .cube-3d {
  width: 34px;
  height: 34px;
}
.arena-cube .cube-face {
  width: 34px;
  height: 34px;
  font-size: 0;
}
.arena-cube .cube-front {
  font-size: 1.5rem;
}
.arena-cube .cube-front  { transform: translateZ(17px); }
.arena-cube .cube-back   { transform: rotateY(180deg) translateZ(17px); }
.arena-cube .cube-right  { transform: rotateY(90deg)  translateZ(17px); }
.arena-cube .cube-left   { transform: rotateY(-90deg) translateZ(17px); }
.arena-cube .cube-top    { transform: rotateX(90deg)  translateZ(17px); }
.arena-cube .cube-bottom { transform: rotateX(-90deg) translateZ(17px); }
.arena-cube .pp-hover-text { margin-top: 18px; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  width: calc(var(--penta-size) * 0.56);
  height: 4px;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(0, 212, 255, 0.15);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00d4ff, #00ffea);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--neon);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 16px;
  font-size: 0.6rem;
  letter-spacing: 3px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: #0d1b2a;
  border: 1px solid var(--neon);
  border-radius: 16px;
  padding: 32px;
  width: min(480px, 92vw);
  box-shadow: 0 0 40px var(--neon-glow);
  transform: scale(0.9);
  transition: transform 0.3s;
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.modal-title {
  font-size: 0.9rem;
  letter-spacing: 3px;
  color: var(--neon);
  text-shadow: 0 0 10px var(--neon);
}
.modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { border-color: var(--neon); color: var(--neon); }

.word-list { display: flex; flex-direction: column; gap: 12px; }
.word-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s;
}
.word-card:hover { border-color: var(--neon); }
.word-native {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--neon);
  letter-spacing: 1px;
}
.word-target {
  font-size: 0.8rem;
  color: var(--text);
  letter-spacing: 1px;
  text-align: right;
}

/* ===== RESPONSIVE ===== */
/* Medium: tablets and small laptops */
@media (max-width: 900px) and (min-width: 601px) {
  :root { --penta-size: 180px; }

  .pentagon-grid { width: 580px; height: 580px; }
  .pentagon-grid::before { width: 380px; height: 380px; }

  /* Ring: center (290,290), radius 190px, 72° apart */
  .pentagon-node:nth-child(1) { top: 100px; left: 290px; }
  .pentagon-node:nth-child(2) { top: 231px; left: 471px; }
  .pentagon-node:nth-child(3) { top: 444px; left: 402px; }
  .pentagon-node:nth-child(4) { top: 444px; left: 179px; }
  .pentagon-node:nth-child(5) { top: 231px; left: 109px; }
  /* P-P + cube centered at (290,290) */
  .arena-cube { top: 201px; left: 290px; }
  .pentagon-node:nth-child(6) { top: 312px; left: 290px; }
  .pentagon-node:nth-child(6) .progress-bar { width: calc(var(--penta-size) * 0.56); }

  .penta-id { font-size: 1.1rem; }
}

@media (max-width: 600px) {
  :root { --penta-size: 110px; }

  .header { padding: 14px 16px; }
  .points { font-size: 0.75rem; }
  .category-selector { padding: 6px 14px; }
  .category-selector select { font-size: 0.7rem; letter-spacing: 2px; }
  .lang-btn { padding: 5px 10px; font-size: 0.65rem; }

  .pentagon-grid {
    width: 370px;
    height: 370px;
  }
  .pentagon-grid::before { width: 250px; height: 250px; }

  /* Ring: center (185,185), radius 125px, 72° apart */
  .pentagon-node:nth-child(1) { top: 60px;  left: 185px; }
  .pentagon-node:nth-child(2) { top: 146px; left: 304px; }
  .pentagon-node:nth-child(3) { top: 286px; left: 259px; }
  .pentagon-node:nth-child(4) { top: 286px; left: 112px; }
  .pentagon-node:nth-child(5) { top: 146px; left: 66px;  }
  /* P-P + cube centered at (185,185) */
  .arena-cube { top: 129px; left: 185px; }
  .pentagon-node:nth-child(6) { top: 206px; left: 185px; }

  .penta-id { font-size: 0.85rem; }
  .progress-bar { width: calc(var(--penta-size) * 0.56); }
}

@media (max-width: 380px) {
  :root { --penta-size: 92px; }
  .pentagon-grid { width: 320px; height: 320px; }
  .pentagon-grid::before { width: 210px; height: 210px; }
  /* Ring: center (160,160), radius 105px, 72° apart */
  .pentagon-node:nth-child(1) { top: 55px;  left: 160px; }
  .pentagon-node:nth-child(2) { top: 128px; left: 260px; }
  .pentagon-node:nth-child(3) { top: 245px; left: 222px; }
  .pentagon-node:nth-child(4) { top: 245px; left: 98px;  }
  .pentagon-node:nth-child(5) { top: 128px; left: 60px;  }
  /* P-P + cube centered at (160,160) */
  .arena-cube { top: 112px; left: 160px; }
  .pentagon-node:nth-child(6) { top: 181px; left: 160px; }
  .penta-id { font-size: 0.7rem; }
}

/* ===== PULSE ANIMATION ===== */
@keyframes neon-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

/* ===== LESSON SCREEN ===== */
.lesson-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
  font-family: 'Orbitron', 'Courier New', monospace;
}
.lesson-screen.active {
  transform: translateX(0);
  visibility: visible;
}

/* ---- Shared nav button (back arrow circle) ---- */
.ls-nav-btn {
  position: absolute;
  left: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
}
.ls-nav-btn:hover {
  border-color: var(--neon);
  color: var(--neon);
  box-shadow: 0 0 14px var(--neon-glow);
}

/* ---- Lesson Header ---- */
.lesson-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 14px 20px;
  flex-shrink: 0;
}
.lesson-prog-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}
.lesson-prog-label {
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 0.6rem;
  letter-spacing: 3px;
  color: var(--neon);
  opacity: 0.7;
}
.lesson-prog-track {
  width: 260px;
  height: 7px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: 2px;
  overflow: hidden;
}
.lesson-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon), #00ffea);
  box-shadow: 0 0 8px var(--neon);
  border-radius: 2px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.lesson-menu-btn {
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  perspective: 80px;
  padding: 0;
}

.cube-3d {
  width: 26px;
  height: 26px;
  position: relative;
  transform-style: preserve-3d;
  animation: cube-spin 2s linear infinite;
}

@keyframes cube-spin {
  0%   { transform: rotate3d(1, 1, 0.5, 0deg); }
  100% { transform: rotate3d(1, 1, 0.5, 360deg); }
}

.cube-face {
  position: absolute;
  width: 26px;
  height: 26px;
  border: none;
  background: rgba(0, 212, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neon);
  font-size: 1rem;
  text-shadow: 0 0 6px var(--neon);
}

.cube-front  { transform: translateZ(13px);               border: 1px solid var(--neon); box-shadow: 0 0 6px var(--neon), inset 0 0 6px rgba(0,212,255,0.2); }
.cube-back   { transform: rotateY(180deg) translateZ(13px); border: 1px solid var(--neon); box-shadow: 0 0 6px var(--neon); }
.cube-right  { transform: rotateY(90deg)  translateZ(13px); border-top: 1px solid var(--neon); border-bottom: 1px solid var(--neon); }
.cube-left   { transform: rotateY(-90deg) translateZ(13px); border-top: 1px solid var(--neon); border-bottom: 1px solid var(--neon); }
.cube-top    { transform: rotateX(90deg)  translateZ(13px); }
.cube-bottom { transform: rotateX(-90deg) translateZ(13px); }

/* ---- Lesson Dynamic Title ---- */
.lesson-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  padding: 10px 20px 18px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0, 212, 255, 0.12);
  order: 2;
}
.lesson-header { order: 1; }
.lesson-title-main {
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--neon);
  text-shadow: 0 0 16px var(--neon);
}
.lesson-title-sub {
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 0.48rem;
  font-weight: 400;
  letter-spacing: 2px;
  color: rgba(0, 212, 255, 0.65);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

/* ---- Sequence Scroll Container ---- */
.ls-seq-container {
  flex: 1;
  overflow-y: auto;
  position: relative;
  order: 3;
  padding: 30px 0 60px;
}

.ls-seq {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ---- Sequence Group (one per pentagon + its diamonds) ---- */
.seq-group {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.seq-group + .seq-group .ls-step:first-child { margin-top: 0; }

/* ---- Sequence Step ---- */
.ls-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1px 0;
}

/* ---- Sequence Pentagon ---- */
.seq-penta-wrap {
  position: relative;
  z-index: 2;
  width: 120px;
  height: calc(120px * 0.88);
  cursor: pointer;
  transition: transform 0.25s;
}
.seq-penta-wrap:hover { transform: scale(1.12) translateY(-3px); }
.seq-penta-sub { width: 95px; height: calc(95px * 0.88); }

.seq-penta-svg {
  width: 100%;
  height: 100%;
}
.seq-penta-base   { fill: #0d1b2a; }
.seq-penta-fill   { fill: rgba(0, 212, 255, 0.07); transition: fill 0.3s; }
.seq-penta-stroke { fill: none; stroke: var(--neon); stroke-width: 1.5; }
.seq-penta-inner  { fill: none; stroke: rgba(0,212,255,0.2); stroke-width: 0.8; }
.seq-penta-wrap:hover .seq-penta-fill { fill: rgba(0, 212, 255, 0.14); }

.seq-penta-blue .seq-penta-svg {
  filter: drop-shadow(0 0 6px rgba(0,212,255,0.5));
}
.seq-penta-blue:hover .seq-penta-svg {
  filter: drop-shadow(0 0 10px rgba(0,212,255,0.7));
}

.seq-penta-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.seq-penta-code {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--neon);
  text-shadow: 0 0 8px var(--neon);
}

/* ---- Sequence Diamond ---- */
.seq-diamond-wrap {
  position: relative;
  z-index: 2;
  width: 120px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s;
}
.seq-diamond-wrap:hover { transform: scale(1.12) translateY(-3px); }

/* ---- Diamond hover label ---- */
.diamond-label {
  position: absolute;
  left: 100%;
  top: 50%;
  pointer-events: none;
  z-index: 20;
}
.dl-diag {
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 1px;
  background: #00d4ff;
  box-shadow: 0 0 6px #00d4ff;
  transform-origin: left center;
  transform: rotate(-45deg);
  transition: width 0.25s ease;
}
.dl-horiz {
  position: absolute;
  left: 21px; top: -21px;
  width: 0; height: 1px;
  background: #00d4ff;
  box-shadow: 0 0 6px #00d4ff;
  transition: width 0.25s ease 0.25s;
}
.dl-text {
  position: absolute;
  left: 77px; top: -21px;
  transform: translateY(-50%);
  color: #00d4ff;
  font-family: 'Orbitron', 'Courier New', monospace;
  font-weight: 700;
  font-size: 0.42rem;
  letter-spacing: 2px;
  white-space: nowrap;
  text-shadow: 0 0 8px #00d4ff;
  opacity: 0;
  transition: opacity 0.2s ease 0.5s;
}
.diamond-label.active .dl-diag  { width: 30px; }
.diamond-label.active .dl-horiz { width: 50px; }
.diamond-label.active .dl-text  { opacity: 1; }
.dl-text-sub {
  display: block;
  font-size: 0.32rem;
  letter-spacing: 2px;
  opacity: 0.6;
  margin-top: 3px;
}

/* ---- Arena pentagon hover label (text above line) ---- */
.penta-hover-label {
  position: absolute;
  left: 100%;
  top: 50%;
  pointer-events: none;
  z-index: 20;
}
.phl-diag {
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 1px;
  background: #00d4ff;
  box-shadow: 0 0 6px #00d4ff;
  transform-origin: left center;
  transform: rotate(-45deg);
  transition: width 0.25s ease;
}
.phl-horiz {
  position: absolute;
  left: 21px; top: -21px;
  width: 0; height: 1px;
  background: #00d4ff;
  box-shadow: 0 0 6px #00d4ff;
  transition: width 0.25s ease 0.25s;
}
.phl-texts {
  position: absolute;
  left: 21px;
  top: -40px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.2s ease 0.5s;
}
.phl-texts.phl-has-sub {
  top: -56px;
}
.phl-title {
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--neon);
  text-shadow: 0 0 12px var(--neon);
  white-space: nowrap;
}
.phl-sub {
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 0.48rem;
  font-weight: 400;
  letter-spacing: 1.5px;
  color: rgba(0, 212, 255, 0.7);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
  white-space: nowrap;
}
.penta-hover-label.active .phl-diag  { width: 30px; }
.penta-hover-label.active .phl-horiz { width: var(--horiz-w, 80px); }
.penta-hover-label.active .phl-texts { opacity: 1; }

/* Left-side variant (P-04, P-05) */
.penta-hover-label.phl-left { left: auto; right: 100%; }
.penta-hover-label.phl-left .phl-diag  { left: auto; right: 0; transform-origin: right center; transform: rotate(45deg); }
.penta-hover-label.phl-left .phl-horiz { left: auto; right: 21px; }
.penta-hover-label.phl-left .phl-texts { left: auto; right: 21px; align-items: flex-end; }

/* P-P below-bar hover text */
.pp-hover-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.pp-hover-text.active { opacity: 1; }
.pp-hover-title {
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: none;
  white-space: nowrap;
}
.pp-hover-sub {
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 0.48rem;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: none;
  white-space: nowrap;
}

.seq-diamond-shape {
  position: absolute;
  width: 72px;
  height: 72px;
  transform: rotate(45deg);
  border-radius: 8px;
  border: 2px solid currentColor;
}
.seq-diamond-code {
  position: relative;
  z-index: 1;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Diamond color variants */
.seq-diamond-yellow {
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(255,215,0,0.5));
}
.seq-diamond-yellow .seq-diamond-shape { border-color: var(--gold); background: #0d1b2a; }
.seq-diamond-yellow .seq-diamond-code  { color: var(--gold); text-shadow: 0 0 8px rgba(255,215,0,0.9); }

.seq-diamond-green {
  color: #00ff88;
  filter: drop-shadow(0 0 6px rgba(0,255,136,0.45));
}
.seq-diamond-green .seq-diamond-shape { border-color: #00ff88; background: #0d1b2a; }
.seq-diamond-green .seq-diamond-code  { color: #00ff88; text-shadow: 0 0 8px rgba(0,255,136,0.9); }

.seq-diamond-blue {
  color: var(--neon);
  filter: drop-shadow(0 0 6px var(--neon-glow));
}
.seq-diamond-blue .seq-diamond-shape { border-color: var(--neon); background: #0d1b2a; }
.seq-diamond-blue .seq-diamond-code  { color: var(--neon); text-shadow: 0 0 8px var(--neon); }

.seq-diamond-purple {
  color: #ff7700;
  filter: drop-shadow(0 0 6px rgba(255,119,0,0.5));
}
.seq-diamond-purple .seq-diamond-shape { border-color: #ff7700; background: #0d1b2a; }
.seq-diamond-purple .seq-diamond-code  { color: #ff7700; text-shadow: 0 0 8px rgba(255,119,0,0.9); }

.seq-penta-purple .seq-penta-svg {
  filter: drop-shadow(0 0 6px rgba(255,119,0,0.5));
}
.seq-penta-purple .seq-penta-stroke { stroke: #ff7700; }
.seq-penta-purple .seq-penta-inner  { stroke: rgba(255,119,0,0.3); }
.seq-penta-purple .seq-penta-code   { color: #ff7700; }


/* Step subtitle label — positioned above the line */
.seq-step-label {
  position: relative;
  z-index: 2;
  padding: 0 6px;
  font-size: 0.42rem;
  letter-spacing: 2.5px;
  color: var(--text-dim);
  margin-top: 9px;
  text-align: center;
}

/* ===== DETAIL SUB-SCREEN ===== */
.detail-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 450;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
  font-family: 'Orbitron', 'Courier New', monospace;
}
.detail-screen.active {
  transform: translateX(0);
  visibility: visible;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.detail-title {
  flex: 1;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--neon);
  text-shadow: 0 0 12px var(--neon);
}

.detail-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  letter-spacing: 3px;
  color: var(--text-dim);
  opacity: 0.35;
}

/* ===== SQUARE HU-01 ===== */
.seq-square-step {
  margin-top: 80px;
  display: flex;
  justify-content: center;
  padding-bottom: 60px;
}
.seq-square-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  cursor: pointer;
}
.seq-square-shape {
  width: 100%;
  height: 100%;
  border: 1.5px solid var(--neon);
  background: rgba(0, 212, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, box-shadow 0.3s;
}
.seq-square-wrap:hover .seq-square-shape {
  background: rgba(0, 212, 255, 0.12);
  box-shadow: 0 0 14px rgba(0, 212, 255, 0.25);
}
.seq-square-code {
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--neon);
  text-shadow: 0 0 10px var(--neon);
}

@media (max-width: 600px) {
  .seq-penta-wrap  { width: 96px; height: calc(96px * 0.95); }
  .seq-penta-sub   { width: 76px; height: calc(76px * 0.95); }
  .seq-diamond-wrap { width: 96px; height: 96px; }
  .seq-diamond-shape { width: 58px; height: 58px; border-radius: 6px; }
  .lesson-title-main { font-size: 0.72rem; letter-spacing: 3px; }
}
