﻿:root {
  --bg: #ffe066;
  --bg-2: #7dd3fc;
  --ink: #0a0a0a;
  --paper: #fff;
  --hot: #ff3b30;
  --mint: #22c55e;
  --violet: #7c3aed;
  --cyan: #06b6d4;
  --scene-rx: 0deg;
  --scene-ry: 0deg;
  --shape-shift-x: 0px;
  --shape-shift-y: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%);
  overflow: hidden;
}

#openingGate {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  overflow: hidden;
}

#openingGate.is-done {
  visibility: hidden;
  pointer-events: none;
}

.cut-light {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(130vmax, 1700px);
  height: 12px;
  border-radius: 999px;
  transform: translate(-50%, -50%) rotate(-32deg) scaleX(0.02);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(225, 246, 255, 1), rgba(255, 255, 255, 0));
  box-shadow: 0 0 40px rgba(202, 237, 255, 1), 0 0 90px rgba(154, 219, 255, 0.9);
  animation: cutFlash 1500ms ease 260ms forwards;
}

.gate-half {
  position: absolute;
  inset: -6vmax;
  background: #000;
}

.gate-half-a {
  clip-path: polygon(0 0, 100% 0, 100% 44%, 0 58%);
  animation: splitA 1150ms cubic-bezier(.2,.8,.2,1) 1500ms forwards;
}

.gate-half-b {
  clip-path: polygon(0 58%, 100% 44%, 100% 100%, 0 100%);
  animation: splitB 1150ms cubic-bezier(.2,.8,.2,1) 1500ms forwards;
}

#particleField {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
}

#cursorGlow {
  position: fixed;
  width: 220px;
  height: 220px;
  margin: -110px 0 0 -110px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -2;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 59, 48, 0.2) 0%, rgba(255, 59, 48, 0) 70%);
  transition: opacity 220ms ease;
}

body.has-pointer #cursorGlow {
  opacity: 0;
}

#mangaPointer {
  position: fixed;
  top: 0;
  left: 0;
  width: 34px;
  height: 42px;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  transform: translate(-9999px, -9999px);
  transition: opacity 150ms ease;
}

#mangaPointer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    #fff 0,
    #fff 7px,
    #000 7px,
    #000 9px,
    #fff 9px,
    #fff 15px
  );
  border: 3px solid #000;
  clip-path: polygon(0% 0%, 72% 36%, 49% 42%, 60% 72%, 44% 78%, 34% 49%, 0% 73%);
  box-shadow: 3px 3px 0 #000;
}

#mangaPointer::after {
  content: none;
}

body.has-pointer #mangaPointer {
  opacity: 1;
}

body.hide-native-cursor,
body.hide-native-cursor * {
  cursor: none !important;
}

#mangaPointer.is-pop::before {
  transform: scale(1.08) rotate(-3deg);
}

#mangaPointer.is-pop::after {
  transform: none;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border: 3px solid var(--ink);
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.45;
  animation: drift 12s ease-in-out infinite alternate;
  transform: translate3d(var(--shape-shift-x), var(--shape-shift-y), 0);
  transition: transform 180ms linear;
}

.bg-shape-a {
  width: 340px;
  height: 340px;
  top: -90px;
  right: -70px;
  background: #ff8fab;
}

.bg-shape-b {
  width: 360px;
  height: 360px;
  bottom: -100px;
  left: -80px;
  background: #34d399;
  animation-delay: 0.8s;
  transform: translate3d(calc(var(--shape-shift-x) * -0.7), calc(var(--shape-shift-y) * -0.7), 0);
}

.app {
  width: min(900px, 94vw);
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  display: grid;
  place-items: center;
  perspective: 1000px;
  transform-style: preserve-3d;
  transform: rotateX(var(--scene-rx)) rotateY(var(--scene-ry));
  transition: transform 180ms ease-out;
}

.screen {
  position: absolute;
  inset: 22px 0;
  background: transparent;
  border: none;
  padding: 20px;
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateX(24px) rotateY(-5deg) scale(0.98);
  pointer-events: none;
  z-index: 0;
  transition: transform 420ms cubic-bezier(.2,.7,.2,1), opacity 320ms ease;
  transform-style: preserve-3d;
  scrollbar-width: none;
}

.screen::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) rotateY(0deg) scale(1);
  pointer-events: auto;
  z-index: 3;
}

.screen.from-left {
  transform: translateX(-24px) rotateY(5deg) scale(0.98);
}

#screen-splash {
  display: none;
}

.chooser-head {
  text-align: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0;
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 6px 10px;
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.chooser-head h2 {
  margin: 12px 0 0;
  font-size: clamp(1.7rem, 4.2vw, 2.5rem);
  text-transform: uppercase;
  line-height: 1;
  text-shadow: 2px 2px 0 #fff;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  position: relative;
  z-index: 4;
  isolation: isolate;
}

.logo-card {
  --mx: 0px;
  --my: 0px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: center;
  font: inherit;
  color: inherit;
  display: grid;
  place-items: center;
  gap: 14px;
  position: relative;
  z-index: 5;
  pointer-events: auto;
  width: 100%;
  transform: translate3d(var(--mx), var(--my), 0) rotateX(var(--card-rx, 0deg)) rotateY(var(--card-ry, 0deg));
  transition: transform 180ms ease;
  transform-style: preserve-3d;
}

.logo-wrap {
  width: min(230px, 95%);
  aspect-ratio: 1;
  border-radius: 50%;
  perspective: 900px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border: 4px solid var(--ink);
  background: #fff;
  box-shadow: 10px 10px 0 var(--ink);
  animation: levitate 3.4s ease-in-out infinite;
  transform: translateZ(14px);
  pointer-events: none;
}

.logo-flip {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 760ms cubic-bezier(.2,.7,.2,1);
  will-change: transform;
  pointer-events: none;
}

.logo-card:nth-child(1) .logo-wrap {
  background: #d9f99d;
}

.logo-card:nth-child(2) .logo-wrap {
  background: #fde68a;
  animation-delay: 0.8s;
}

.logo-card:nth-child(3) {
  grid-column: 1 / -1;
  width: min(100%, 320px);
  justify-self: center;
}

.logo-card:nth-child(3) .logo-wrap {
  background: #07141d;
  animation-delay: 1.2s;
}

.logo-face {
  position: absolute;
  inset: 0;
  width: 92%;
  height: 92%;
  margin: auto;
  object-fit: contain;
  transform: scale(1.344347);
  transform-origin: center;
  backface-visibility: hidden;
}

.logo-back {
  transform: scale(1.344347) rotateY(180deg);
}

.logo-card:nth-child(2) .logo-face {
  transform: scale(1.285992);
}

.logo-card:nth-child(2) .logo-back {
  transform: scale(1.285992) rotateY(180deg);
}

.logo-card:nth-child(3) .logo-face {
  transform: scale(1.08);
}

.logo-card:nth-child(3) .logo-back {
  transform: scale(1.08) rotateY(180deg);
}

.timer-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 22px;
  text-align: center;
  background: rgba(7, 20, 29, 0.7);
  color: #fff;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.timer-label {
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.timer-value {
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.logo-card[data-locked="0"] .timer-overlay {
  opacity: 0;
  visibility: hidden;
}

.logo-card[data-locked="1"] .logo-wrap::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.65);
  z-index: 1;
}

.logo-card:hover .logo-flip,
.logo-card:focus-visible .logo-flip,
.logo-card:active .logo-flip {
  transform: rotateY(180deg);
}

.logo-card.is-flipping .logo-flip {
  transform: rotateY(180deg);
}

.logo-card.is-launching {
  animation: badgeLaunch 820ms cubic-bezier(.2,.72,.2,1) forwards;
}

.logo-card.is-launching .logo-flip {
  animation: badgeSpin 820ms cubic-bezier(.2,.72,.2,1) forwards;
}

.logo-fallback {
  width: 84%;
  height: 76%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.07em;
  border: 3px solid var(--ink);
  background: #fff;
}

.logo-card > span {
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 8px 12px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.82rem;
  max-width: min(92vw, 360px);
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.back-btn {
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  border-radius: 0;
  font: inherit;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.back-btn:hover,
.back-btn:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

#detailTitle {
  margin: 0;
  font-size: clamp(1.2rem, 3.2vw, 1.8rem);
  text-transform: uppercase;
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.link-list li {
  opacity: 0;
  transform: translateY(10px);
  animation: riseIn 380ms ease forwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 3px solid var(--ink);
  border-radius: 0;
  text-decoration: none;
  color: inherit;
  background: #fff;
  font-weight: 700;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.link-row a {
  flex: 1 1 auto;
}

.link-copy {
  flex: 0 0 auto;
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0 10px;
  min-width: 76px;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.link-copy:hover,
.link-copy:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.link-list a:hover,
.link-list a:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--ink);
  background: #fef08a;
}

.link-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.link-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--cyan);
  border: 3px solid var(--ink);
  color: #fff;
  flex: 0 0 auto;
}

.link-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-meta {
  color: #1f2937;
  font-size: 0.83rem;
  flex: 0 0 auto;
  background: #dcfce7;
  border: 2px solid var(--ink);
  padding: 3px 7px;
}

.empty {
  padding: 8px;
  font-weight: 700;
}

@keyframes cutFlash {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-32deg) scaleX(0.02);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-32deg) scaleX(1);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-32deg) scaleX(1.03);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-32deg) scaleX(1);
  }
}

@keyframes splitA {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-125vw, -110vh, 0); }
}

@keyframes splitB {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(125vw, 110vh, 0); }
}

@keyframes levitate {
  0% { transform: translateY(0); }
  50% { transform: translateY(-11px); }
  100% { transform: translateY(0); }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes badgeSpin {
  from {
    transform: rotateX(0deg) rotateZ(0deg);
  }
  to {
    transform: rotateX(1620deg) rotateZ(6deg);
  }
}

@keyframes badgeLaunch {
  0% {
    opacity: 1;
    transform: translate3d(var(--mx), var(--my), 0) scale(1);
  }
  65% {
    opacity: 1;
    transform: translate3d(var(--mx), var(--my), 0) scale(1.34);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--mx), var(--my), 0) scale(1.86);
  }
}

@keyframes drift {
  from { transform: translateY(0) translateX(0); }
  to { transform: translateY(12px) translateX(-8px); }
}

@media (max-width: 700px) {
  .screen {
    inset: 10px 0;
    padding: 12px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .logo-card:nth-child(3) {
    grid-column: auto;
    width: 100%;
  }

  .logo-wrap {
    width: min(74vw, 290px);
  }

  .logo-card > span {
    font-size: 0.78rem;
    padding: 7px 10px;
  }

  .detail-head {
    gap: 10px;
    margin-bottom: 10px;
  }

  .back-btn {
    padding: 10px 12px;
  }

  .link-list {
    gap: 9px;
  }

  .link-list a {
    align-items: flex-start;
    gap: 8px;
    padding: 11px 11px;
  }

  .link-row {
    gap: 6px;
  }

  .link-copy {
    min-width: 64px;
    font-size: 0.72rem;
    padding: 0 8px;
  }

  .link-main {
    gap: 8px;
  }

  .link-label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.15;
  }

  .link-meta {
    margin-left: auto;
    font-size: 0.76rem;
    padding: 2px 6px;
  }

  #cursorGlow {
    display: none;
  }

  #mangaPointer {
    display: none;
  }

  .app {
    transform: none;
  }

  .cut-light {
    animation-duration: 900ms;
    animation-delay: 120ms;
  }

  .gate-half-a,
  .gate-half-b {
    animation-duration: 760ms;
    animation-delay: 980ms;
  }
}

@media (max-width: 420px) {
  .screen {
    inset: 8px 0;
    padding: 10px;
  }

  .chooser-head h2 {
    font-size: clamp(1.35rem, 8vw, 1.7rem);
  }

  .logo-wrap {
    width: min(70vw, 235px);
  }

  .link-icon {
    width: 30px;
    height: 30px;
    border-width: 2px;
  }

  .link-list a {
    border-width: 2px;
    box-shadow: 3px 3px 0 var(--ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
