/* ==========================================================================
   Showcase sections (About, Projects, Certs): 3D / game-inspired UI.
   Builds on the tokens from styles9.css.
   ========================================================================== */

:root {
  --violet: #b794ff;
  --gold: #ffd166;
  --blue: #7ab8ff;
}

.pixel {
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  line-height: 1.7;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Retro perspective floor */
.grid-floor {
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 80%);
  mask-image: linear-gradient(to top, #000 0%, transparent 80%);
}

.grid-floor::before {
  content: "";
  position: absolute;
  left: -50%;
  width: 200%;
  top: 0;
  height: 220%;
  background-image:
    linear-gradient(rgba(51, 255, 245, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 255, 245, 0.3) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(420px) rotateX(64deg);
  transform-origin: 50% 0;
  animation: gridRun 2.2s linear infinite;
}

@keyframes gridRun {
  to { background-position: 0 64px; }
}

.live-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
  animation: blink 1.4s ease-in-out infinite;
}

/* ==========================================================================
   ABOUT: player profile
   ========================================================================== */
.about.pg {
  background:
    radial-gradient(60rem 36rem at 15% 25%, rgba(183, 148, 255, 0.11), transparent 60%),
    radial-gradient(50rem 30rem at 90% 85%, rgba(51, 255, 245, 0.08), transparent 60%),
    #0a0a0c;
  padding-bottom: 10rem;
}

.about-3d {
  display: block;
}

.player-scene {
  position: relative;
  perspective: 1300px;
  display: grid;
  place-items: center;
  padding: 2rem 0;
}

.player-float {
  width: min(100%, 360px);
  transform-style: preserve-3d;
  animation: pfloat 8s ease-in-out infinite;
}

@keyframes pfloat {
  0%, 100% { transform: translateY(0) rotateY(-6deg); }
  50% { transform: translateY(-14px) rotateY(6deg); }
}

.player-card {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  padding: 1.3rem;
  border-radius: 1.6rem;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025) 60%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 50px 90px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(51, 255, 245, 0.08);
  backdrop-filter: blur(6px);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.25s ease-out;
}

.pc-foil {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from 90deg, var(--mint), var(--blue), var(--violet), var(--gold), var(--mint));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.7;
  animation: foil 6s linear infinite;
  pointer-events: none;
}

@keyframes foil {
  to { filter: hue-rotate(360deg); }
}

.pc-top,
.pc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform: translateZ(30px);
}

.pc-lvl {
  color: var(--ink);
  background: var(--mint);
  padding: 0.35rem 0.6rem;
  border-radius: 0.3rem;
}

.pc-tag {
  color: var(--gold);
}

.pc-avatar {
  position: relative;
  margin: 1rem 0;
  aspect-ratio: 1 / 0.8;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(51, 255, 245, 0.4);
  transform: translateZ(60px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(51, 255, 245, 0.15);
}

.pc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  display: block;
}

.pc-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

.pc-scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(transparent, rgba(51, 255, 245, 0.25), transparent);
  animation: scanline 3.5s linear infinite;
}

@keyframes scanline {
  from { top: -30%; }
  to { top: 100%; }
}

.pc-name {
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  transform: translateZ(45px);
}

.pg .pc-class {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--mint);
  margin-bottom: 1.1rem;
  transform: translateZ(35px);
}

.pc-stats {
  list-style: none;
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.2rem;
  transform: translateZ(25px);
}

.pc-stats li {
  display: grid;
  grid-template-columns: 6.2rem 1fr;
  align-items: center;
  gap: 0.6rem;
}

.pc-stats .pixel {
  font-size: 0.5rem;
  color: #b9b9b9;
}

.pc-stats i {
  display: block;
  height: 0.55rem;
  border-radius: 0.15rem;
  background:
    repeating-linear-gradient(90deg, var(--mint) 0 7px, transparent 7px 9px) 0 0 / 0% 100% no-repeat,
    rgba(255, 255, 255, 0.08);
  transition: background-size 1.3s cubic-bezier(0.2, 0.8, 0.2, 1) 0.4s;
}

.player-scene.in .pc-stats i {
  background-size: var(--v) 100%, 100% 100%;
}

.pc-foot .pixel {
  font-size: 0.5rem;
  color: #8d8d8d;
}

.pc-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 30%) var(--gy, 0%), rgba(255, 255, 255, 0.22), transparent 50%);
  mix-blend-mode: overlay;
}

/* Floating tech tokens */
.orb {
  position: absolute;
  padding: 0.55rem 0.8rem;
  border-radius: 0.5rem;
  color: #fff;
  background: rgba(20, 20, 24, 0.85);
  border: 1px solid rgba(51, 255, 245, 0.5);
  box-shadow: 0 0 24px rgba(51, 255, 245, 0.25);
  animation: orbit 6s ease-in-out infinite;
  font-size: 0.55rem;
}

.o1 { top: 6%; left: -2%; animation-delay: -1s; }
.o2 { top: 24%; right: -4%; border-color: rgba(183, 148, 255, 0.6); box-shadow: 0 0 24px rgba(183, 148, 255, 0.3); animation-delay: -3s; }
.o3 { bottom: 24%; left: -6%; border-color: rgba(122, 184, 255, 0.6); box-shadow: 0 0 24px rgba(122, 184, 255, 0.3); animation-delay: -2s; }
.o4 { bottom: 6%; right: 6%; border-color: rgba(255, 209, 102, 0.6); box-shadow: 0 0 24px rgba(255, 209, 102, 0.3); animation-delay: -4s; }

@keyframes orbit {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-16px) translateX(8px); }
}

/* Spinning loot cube */
.cube {
  --s: 56px;
  position: absolute;
  right: 4%;
  top: -2%;
  width: var(--s);
  height: var(--s);
  transform-style: preserve-3d;
  animation: cubeSpin 14s linear infinite;
}

.cube i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: var(--mint);
  background: rgba(51, 255, 245, 0.08);
  border: 1px solid rgba(51, 255, 245, 0.55);
  box-shadow: inset 0 0 18px rgba(51, 255, 245, 0.25);
}

.cube i:nth-child(1) { transform: translateZ(calc(var(--s) / 2)); }
.cube i:nth-child(2) { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.cube i:nth-child(3) { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.cube i:nth-child(5) { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }

@keyframes cubeSpin {
  from { transform: rotateX(-24deg) rotateY(0deg); }
  to { transform: rotateX(-24deg) rotateY(360deg); }
}

/* Statement */
.pp-label {
  display: inline-block;
  color: var(--mint);
  margin-bottom: 2.6rem;
}

.statement {
  font-family: "Cabin", sans-serif;
  font-size: clamp(2rem, 4.4vw, 4.4rem);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: #fff;
  text-align: center;
}

.statement .w {
  display: inline-block;
  opacity: 0.16;
  transition: opacity 0.35s ease, color 0.35s ease, transform 0.35s ease;
}

.statement .w.lit {
  opacity: 1;
}

.statement .w {
  margin-right: 0.28em;
}

.kw {
  position: relative;
  cursor: help;
}

.kw .w.lit {
  color: var(--mint);
}

.kw::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 0.6rem);
  left: 50%;
  width: max-content;
  max-width: 18rem;
  transform: translate(-50%, 8px);
  padding: 0.6rem 0.8rem;
  border-radius: 0.5rem;
  background: #1b1b20;
  border: 1px solid rgba(51, 255, 245, 0.4);
  color: #e9e9e9;
  font-family: "Cabin", sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 20;
}

.kw:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

@media (hover: hover) and (min-width: 769px) {
  .kw::after {
    display: none;
  }
}

.cursor-circle.about-joke {
  width: min(260px, 65vw);
  height: 170px;
  padding: 1.25rem;
  border: 1px solid rgba(51, 255, 245, 0.75);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(20, 28, 28, 0.97), rgba(27, 27, 32, 0.94));
  box-shadow: 0 0 28px rgba(51, 255, 245, 0.24), inset 0 0 24px rgba(51, 255, 245, 0.06);
  transform: translate(-50%, -50%) scale(1);
  animation: joke-cursor-pulse 2.2s ease-in-out infinite;
}

.cursor-circle.about-joke::after {
  content: attr(data-joke);
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: #f4fffe;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.95rem, 1.45vw, 1.2rem);
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-shadow: 0 0 12px rgba(51, 255, 245, 0.4);
  animation: joke-cursor-reveal 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes joke-cursor-pulse {
  0%, 100% {
    box-shadow: 0 0 22px rgba(51, 255, 245, 0.2), inset 0 0 20px rgba(51, 255, 245, 0.05);
  }
  50% {
    box-shadow: 0 0 38px rgba(51, 255, 245, 0.38), inset 0 0 28px rgba(51, 255, 245, 0.1);
  }
}

@keyframes joke-cursor-reveal {
  from {
    opacity: 0;
    transform: scale(0.82) translateY(8px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

.about-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 4.5rem;
}

.about-timeline::before {
  content: "";
  position: absolute;
  top: 0.42rem;
  right: 12.5%;
  left: 12.5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(51, 255, 245, 0.55) 12%, rgba(51, 255, 245, 0.55) 88%, transparent);
}

.about-timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
  padding: 1.9rem 0.25rem 0;
}

.about-timeline-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid var(--mint);
  border-radius: 50%;
  background: #101014;
  box-shadow: 0 0 14px rgba(51, 255, 245, 0.32);
  transform: translateX(-50%);
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.about-timeline-item:hover::before {
  background: var(--mint);
  box-shadow: 0 0 22px rgba(51, 255, 245, 0.65);
  transform: translateX(-50%) scale(1.2);
}

.about-timeline-item .pixel {
  color: var(--mint);
  font-size: 0.55rem;
  text-align: center;
  text-transform: uppercase;
}

.about-timeline-item strong {
  color: #f4f4f5;
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
}

/* ==========================================================================
   PROJECTS: level select
   ========================================================================== */
.projects.levels {
  display: block;
  padding: 0;
  min-height: 0;
  overflow: visible;
  background: #07070a;
}

.lv-track {
  position: relative;
  height: calc(var(--n) * 100vh);
}

.lv-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(70rem 40rem at 50% 30%, rgba(51, 255, 245, 0.08), transparent 60%),
    radial-gradient(40rem 30rem at 80% 10%, rgba(183, 148, 255, 0.1), transparent 60%),
    #07070a;
}

.lv-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lv-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 30px 40px, #fff, transparent),
    radial-gradient(1px 1px at 120px 90px, #a6fffa, transparent),
    radial-gradient(1.5px 1.5px at 200px 160px, #fff, transparent),
    radial-gradient(1px 1px at 80px 210px, #c9b4ff, transparent),
    radial-gradient(1px 1px at 260px 30px, #fff, transparent);
  background-size: 300px 260px;
  background-position-x: calc(var(--pos, 0) * -70px);
  opacity: 0.7;
}

.lv-hud {
  position: relative;
  z-index: 5;
  padding-top: 4.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.lv-title {
  color: var(--mint);
  text-shadow: 0 0 14px rgba(51, 255, 245, 0.7);
  animation: blink 2.4s ease-in-out infinite;
}

@keyframes blink {
  50% { opacity: 0.45; }
}

.lv-segs {
  display: flex;
  gap: 0.5rem;
}

.lv-seg {
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  width: 2.6rem;
  height: 2rem;
  border-radius: 0.3rem;
  color: #7c7c7c;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.3s ease;
}

.lv-seg:hover {
  color: #fff;
  border-color: var(--mint);
}

.lv-seg.is-active {
  color: var(--ink);
  background: var(--mint);
  border-color: var(--mint);
  box-shadow: 0 0 18px rgba(51, 255, 245, 0.6);
}

.lv-hint {
  font-size: 0.5rem;
  color: #6c6c6c;
  transition: opacity 0.4s ease;
}

.lv-hint.gone {
  opacity: 0;
}

.lv-deck {
  position: relative;
  flex: 1;
  min-height: 0;
  perspective: 1500px;
  z-index: 3;
}

.lv-card {
  --h: min(44vh, 400px);
  position: absolute;
  left: 50%;
  top: 50%;
  height: var(--h);
  aspect-ratio: 16 / 10;
  padding: 0;
  border-radius: 1.1rem;
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  transform-style: preserve-3d;
  will-change: transform, opacity;
  -webkit-box-reflect: below 8px linear-gradient(transparent 72%, rgba(255, 255, 255, 0.16));
}

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

.lv-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.55)),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px);
  pointer-events: none;
}

.lv-card.is-active {
  border-color: var(--mint);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 50px rgba(51, 255, 245, 0.3);
}

.lv-badge {
  position: absolute;
  left: 0.9rem;
  top: 0.9rem;
  z-index: 2;
  padding: 0.4rem 0.6rem;
  border-radius: 0.3rem;
  color: var(--ink);
  background: var(--mint);
}

.lv-info {
  position: relative;
  z-index: 6;
  display: grid;
  margin-bottom: 2.2rem;
  padding: 1.4rem 1.8rem;
  border-radius: 1.2rem;
  background: rgba(14, 14, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.5);
}

.lv-panel {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2.5rem;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s;
}

.lv-panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.lv-meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.7rem;
}

.lv-meta .pixel {
  font-size: 0.55rem;
  color: #8a8a8a;
}

.lv-status {
  padding: 0.3rem 0.55rem;
  border-radius: 0.3rem;
}

.pg .lv-meta .lv-status.cleared {
  color: var(--ink);
  background: var(--mint);
}

.pg .lv-meta .lv-status.wip {
  color: var(--ink);
  background: var(--gold);
}

.pg .lv-meta .lv-status.feat {
  color: var(--ink);
  background: var(--violet);
}

.lv-card[data-i="0"] {
  background: linear-gradient(135deg, #1b1038, #0a2a3a);
}

.lv-card[data-i="0"] img {
  object-fit: contain;
}

.lv-card[data-i="1"] {
  background: linear-gradient(135deg, #fff4e6, #ffd9a8);
}

.lv-card[data-i="1"] img {
  object-fit: contain;
}

.lv-panel h3 {
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.pg .lv-sub {
  color: var(--mint);
  font-weight: 700;
  margin-top: 0.2rem;
}

.pg .lv-desc {
  margin-top: 0.6rem;
  font-size: 0.92rem;
  line-height: 1.55;
}

.lv-side {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: flex-start;
}

.lv-label {
  font-size: 0.5rem;
  color: #7a7a7a;
}

.lv-side .chip {
  font-size: 0.7rem;
  padding: 0.3rem 0.7rem;
}

.lv-side .btn-mint {
  margin-top: 0.4rem;
}

/* ==========================================================================
   CERTS: trophy room
   ========================================================================== */
.certs.pg {
  background:
    radial-gradient(55rem 35rem at 85% 10%, rgba(255, 209, 102, 0.07), transparent 60%),
    radial-gradient(50rem 30rem at 5% 90%, rgba(183, 148, 255, 0.09), transparent 60%),
    #0b0b0d;
}

.ach-meter {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 2rem;
  max-width: 36rem;
}

.ach-meter .pixel {
  font-size: 0.55rem;
  color: #9a9a9a;
  white-space: nowrap;
}

.ach-meter b {
  color: var(--mint);
  font-weight: 400;
}

.ach-meter .bar {
  flex: 1;
  height: 0.9rem;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.25rem;
}

.ach-meter .bar i {
  display: block;
  height: 100%;
  width: calc(var(--u, 0) * 100%);
  background: repeating-linear-gradient(90deg, var(--mint) 0 9px, transparent 9px 12px);
  box-shadow: 0 0 14px rgba(51, 255, 245, 0.5);
  transition: width 0.7s ease;
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem;
  perspective: 1500px;
}

.ach {
  --c: var(--blue);
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  height: 25rem;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.25s ease-out;
}

.ach[data-rarity="legendary"] { --c: var(--gold); }
.ach[data-rarity="epic"] { --c: var(--violet); }
.ach[data-rarity="rare"] { --c: var(--blue); }

.ach::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1.2rem;
  border: 2px solid var(--c);
  opacity: 0;
  pointer-events: none;
}

.ach.unlocked::after {
  animation: ring 1s 0.55s ease-out;
}

@keyframes ring {
  from { opacity: 0.9; transform: scale(1); }
  to { opacity: 0; transform: scale(1.2); }
}

.ach-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateY(180deg);
  transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ach.unlocked .ach-inner {
  transform: rotateY(0deg);
}

.ach-face {
  position: absolute;
  inset: 0;
  border-radius: 1.2rem;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.ach-back {
  transform: rotateY(180deg);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  color: #5c5c64;
  font-size: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: repeating-linear-gradient(45deg, #15151a 0 10px, #1a1a20 10px 20px);
}

.ach-back .pixel {
  font-size: 0.55rem;
}

.ach-front {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: linear-gradient(170deg, color-mix(in srgb, var(--c) 16%, #101013), #0d0d10 62%);
  box-shadow: inset 0 0 40px color-mix(in srgb, var(--c) 8%, transparent), 0 24px 50px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.4s ease;
}

.ach.unlocked:hover .ach-front {
  box-shadow: inset 0 0 40px color-mix(in srgb, var(--c) 14%, transparent), 0 0 44px color-mix(in srgb, var(--c) 40%, transparent);
}

.ach-rarity {
  font-size: 0.5rem;
  color: var(--c);
}

.ach-coin {
  width: 4.2rem;
  height: 4.2rem;
  margin: 1.1rem 0 1.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.6rem;
  color: #0b0b0d;
  background: conic-gradient(from 0deg, var(--c), #fff 25%, var(--c) 50%, #fff 75%, var(--c));
  box-shadow: 0 0 28px color-mix(in srgb, var(--c) 55%, transparent);
}

.ach.unlocked .ach-coin {
  animation: coinSpin 5s ease-in-out infinite;
}

@keyframes coinSpin {
  0%, 60%, 100% { transform: rotateY(0deg); }
  80% { transform: rotateY(360deg); }
}

.ach-front h3 {
  font-size: 1.12rem;
  line-height: 1.25;
}

.pg .ach-issuer {
  margin-top: 0.3rem;
  color: var(--c);
  font-weight: 700;
  font-size: 0.9rem;
}

.pg .ach-desc {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.ach-year {
  margin-top: auto;
  font-size: 0.55rem;
  color: #7d7d85;
}

.ach-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: overlay;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.35), transparent 50%);
  transition: opacity 0.3s ease;
}

.ach.unlocked:hover .ach-shine {
  opacity: 1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 2.4rem;
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.4rem 0.9rem 1rem;
  border-radius: 0.9rem;
  background: rgba(16, 16, 20, 0.92);
  border: 1px solid var(--gold);
  box-shadow: 0 0 40px rgba(255, 209, 102, 0.35);
  transform: translate(-50%, 200%);
  transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  pointer-events: none;
}

.toast.show {
  transform: translate(-50%, 0);
}

.toast > i {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #0b0b0d;
  background: var(--gold);
}

.toast .pixel {
  display: block;
  font-size: 0.5rem;
  color: var(--gold);
  margin-bottom: 0.3rem;
}

.toast strong {
  font-size: 0.95rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .about-timeline {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding-left: 1.5rem;
  }

  .about-timeline::before {
    top: 0.4rem;
    bottom: 0.4rem;
    left: 0.4rem;
    right: auto;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, transparent, rgba(51, 255, 245, 0.55) 10%, rgba(51, 255, 245, 0.55) 90%, transparent);
  }

  .about-timeline-item {
    padding: 0 0.5rem 0 1.2rem;
  }

  .about-timeline-item::before {
    top: 0.1rem;
    left: 0;
    transform: none;
  }

  .about-timeline-item:hover::before {
    transform: scale(1.2);
  }

  .about-timeline-item .pixel,
  .about-timeline-item strong {
    text-align: left;
  }

  .ach-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .lv-panel {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .lv-info {
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
  }

  .lv-side .chips {
    gap: 0.4rem;
  }

  .lv-side .chip:nth-child(n + 5) {
    display: none;
  }

  .lv-card {
    height: auto;
    width: min(76vw, 46vh);
  }

  .lv-hint {
    display: none;
  }
}

@media (max-width: 768px) {
  .about-timeline {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .about-timeline-item {
    padding-left: 1rem;
  }

  .orb,
  .cube {
    display: none;
  }

  .pg .lv-desc {
    font-size: 0.82rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

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

  .ach {
    height: 23rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .grid-floor::before,
  .player-float,
  .orb,
  .cube,
  .pc-foil,
  .pc-scan::after,
  .ach-coin {
    animation: none !important;
  }
}

/* Custom scrollbar (desktop only; enabled by js/scrollbar.js) */
html.custom-scrollbar {
  scrollbar-width: none;
}
html.custom-scrollbar::-webkit-scrollbar {
  display: none;
}
.fx-scrollbar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 22px;
  z-index: 1000;
  opacity: 0.4;
  transition: opacity 0.4s ease;
}
.fx-scrollbar.is-active,
.fx-scrollbar:hover,
.fx-scrollbar.is-dragging {
  opacity: 1;
}
.fx-scrollbar.is-empty {
  display: none;
}
.fx-track {
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: 8px;
  width: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease;
}
.fx-scrollbar:hover .fx-track,
.fx-scrollbar.is-dragging .fx-track {
  width: 6px;
  background: rgba(255, 255, 255, 0.1);
}
.fx-thumb {
  position: absolute;
  top: 0;
  right: 6px;
  width: 6px;
  border-radius: 6px;
  background: linear-gradient(180deg, #33fff5, #7ab8ff);
  box-shadow: 0 0 14px rgba(51, 255, 245, 0.55);
  will-change: transform;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1), right 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
  touch-action: none;
}
.fx-scrollbar:hover .fx-thumb,
.fx-scrollbar.is-dragging .fx-thumb {
  width: 10px;
  right: 4px;
  box-shadow: 0 0 22px rgba(51, 255, 245, 0.8);
}
.fx-scrollbar.is-dragging .fx-thumb {
  background: linear-gradient(180deg, #ffffff, #33fff5);
}
.fx-tip {
  position: absolute;
  top: 50%;
  right: 22px;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font: 700 0.72rem/1 "JetBrains Mono", monospace;
  color: #0a0a0b;
  background: #33fff5;
  box-shadow: 0 6px 20px rgba(51, 255, 245, 0.35);
  opacity: 0;
  transform: translate(8px, -50%) scale(0.85);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.fx-scrollbar:hover .fx-tip,
.fx-scrollbar.is-dragging .fx-tip {
  opacity: 1;
  transform: translate(0, -50%) scale(1);
}
@media (prefers-reduced-motion: reduce) {
  .fx-scrollbar, .fx-track, .fx-thumb, .fx-tip { transition: none; }
}
