:root {
  color-scheme: dark;
  --kt-bg: #05060a;
  --kt-panel: rgba(7, 10, 16, 0.78);
  --kt-ink: #f8f7ef;
  --kt-muted: rgba(248, 247, 239, 0.62);
  --kt-line: rgba(224, 255, 45, 0.26);
  --kt-lime: #e7ff1f;
  --kt-cyan: #7defff;
  --kt-magenta: #ff2b9a;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--kt-ink);
  background: linear-gradient(140deg, #05060a 0%, #100914 52%, #030407 100%);
  font-family: Inter, "Noto Sans JP", system-ui, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.kt-page {
  position: relative;
  min-height: 100svh;
  padding-top: 85px;
  overflow: hidden;
}

.kt-page::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.78), transparent 84%);
}

.kt-theater {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(280px, 0.52fr);
  gap: clamp(20px, 4vw, 48px);
  min-height: calc(100svh - 85px);
  padding: clamp(22px, 4vw, 58px);
}

.kt-frame {
  position: relative;
  align-self: center;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid rgba(231, 255, 31, 0.22);
  background: #020307;
  box-shadow:
    0 0 0 1px rgba(125, 239, 255, 0.08),
    0 32px 90px rgba(0, 0, 0, 0.62);
  isolation: isolate;
}

.kt-frame::after {
  position: absolute;
  inset: 42% 0 0;
  z-index: 4;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(2, 3, 7, 0.88));
  pointer-events: none;
}

.kt-screen {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
  background: #05060a;
}

.kt-screen img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  opacity: 0.82;
  transform: scale(1.02);
  transition:
    opacity 900ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 1400ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 900ms ease;
}

.kt-page[data-state="playing"] .kt-screen img {
  opacity: 0.98;
  transform: scale(1.075);
  filter: saturate(1.14) contrast(1.08);
}

.kt-page[data-state="loading"] .kt-screen img {
  opacity: 0.5;
  filter: saturate(0.55);
}

.kt-page[data-state="error"] .kt-screen img {
  opacity: 0.46;
  filter: grayscale(0.72);
}

.kt-page[data-state="registered"] .kt-screen img {
  opacity: 0.92;
  transform: scale(1.03);
}

.kt-noise,
.kt-scan {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.kt-noise {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 52% 52%, transparent 0 48%, rgba(0, 0, 0, 0.34) 100%);
  mix-blend-mode: screen;
  opacity: 0.24;
}

.kt-scan {
  background:
    linear-gradient(90deg, transparent 0 32%, rgba(231, 255, 31, 0.00) 38%, rgba(231, 255, 31, 0.38) 48%, rgba(125, 239, 255, 0.34) 54%, transparent 66%);
  clip-path: polygon(-28% 0, -14% 0, -28% 100%, -42% 100%);
  opacity: 0;
}

.kt-page[data-state="playing"] .kt-scan {
  animation: kt-scan 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.kt-caption {
  position: absolute;
  right: clamp(16px, 3vw, 36px);
  bottom: clamp(18px, 4vw, 44px);
  z-index: 6;
  max-width: min(520px, 70%);
  padding-left: 18px;
  border-left: 2px solid var(--kt-lime);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.82);
}

.kt-caption p {
  margin: 0 0 8px;
  color: var(--kt-muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.kt-caption h1 {
  margin: 0 0 8px;
  color: var(--kt-ink);
  font-size: clamp(2.4rem, 7vw, 7rem);
  line-height: 0.9;
}

.kt-console {
  align-self: center;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: var(--kt-panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.kt-kicker {
  margin: 0 0 12px;
  color: var(--kt-lime);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.kt-console h2 {
  margin: 0 0 16px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.08;
}

.kt-console p {
  margin: 0 0 22px;
  color: var(--kt-muted);
  line-height: 1.85;
}

.kt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.kt-actions button,
.kt-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  color: var(--kt-ink);
  border: 1px solid rgba(231, 255, 31, 0.42);
  background: rgba(231, 255, 31, 0.10);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.kt-actions button {
  color: #05060a;
  background: var(--kt-lime);
}

.kt-actions button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.kt-meta {
  display: grid;
  gap: 10px;
  margin: 0;
}

.kt-meta div {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.kt-meta dt,
.kt-meta dd {
  margin: 0;
  font-size: 0.78rem;
}

.kt-meta dt {
  color: var(--kt-lime);
  font-weight: 900;
  text-transform: uppercase;
}

.kt-meta dd {
  color: var(--kt-muted);
}

@keyframes kt-scan {
  0% {
    clip-path: polygon(-28% 0, -14% 0, -28% 100%, -42% 100%);
    opacity: 0;
  }

  18%,
  74% {
    opacity: 0.72;
  }

  100% {
    clip-path: polygon(114% 0, 128% 0, 114% 100%, 100% 100%);
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .kt-theater {
    grid-template-columns: 1fr;
  }

  .kt-caption {
    max-width: calc(100% - 34px);
  }
}

@media (max-width: 760px) {
  .kt-page {
    padding-top: 80px;
  }

  .kt-theater {
    min-height: calc(100svh - 80px);
  }
}

@media (max-width: 620px) {
  .kt-theater {
    padding: 18px;
  }

  .kt-caption {
    right: 14px;
    bottom: 14px;
    left: 14px;
    max-width: none;
    padding-left: 12px;
  }

  .kt-caption h1 {
    font-size: clamp(1.65rem, 9vw, 2.5rem);
  }

  .kt-console {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kt-screen img,
  .kt-scan {
    animation: none;
    transition: none;
  }
}
