@font-face {
  font-family: "Kode Mono";
  src: url("fonts/KodeMono.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --screen: #040406;
  --frame: #17171b;
  --back: #0d0d10;
  --row: #0c0c10;
  --row2: #121217;
  --text: #f2f2f2;
  --muted: #8b8b94;
  --dim: #55555e;
  --line: rgba(255, 255, 255, 0.12);
  --line2: rgba(255, 255, 255, 0.22);
  --ease: cubic-bezier(0.2, 0.9, 0.25, 1);
  --pop: cubic-bezier(0.34, 1.4, 0.5, 1);
  --pad: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  background: #000;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
  scrollbar-width: none;
}

html::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  min-height: 100%;
  background: #000;
  font-family: "Kode Mono", ui-monospace, Menlo, Consolas, monospace;
  font-weight: 600;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow-x: hidden;
  overscroll-behavior: none;
}

img, svg, a { -webkit-user-drag: none; user-drag: none; }

button, a { font: inherit; color: inherit; }

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}

.shade {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 70% at 50% 45%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.35) 70%, rgba(0, 0, 0, 0.85) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 78%, rgba(0, 0, 0, 0.75) 100%);
}

.scan {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.35;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.018) 0 1px, rgba(0, 0, 0, 0) 1px 3px);
}

.page {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding:
    calc(env(safe-area-inset-top, 0px) + 14px)
    calc(env(safe-area-inset-right, 0px) + var(--pad))
    calc(env(safe-area-inset-bottom, 0px) + 14px)
    calc(env(safe-area-inset-left, 0px) + var(--pad));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 52px;
}

.mark { display: flex; align-items: center; gap: 12px; min-width: 0; }

.mark-box {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid #d6d6d6;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  flex: none;
}

.mark-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.28em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(12, 12, 16, 0.7);
  border: 2px solid var(--line2);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, background 0.2s, transform 0.15s var(--ease);
}

.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg path:first-child { fill: var(--text); stroke: none; }
.icon-btn .off { display: none; }
.icon-btn[aria-pressed="true"] .on { display: none; }
.icon-btn[aria-pressed="true"] .off { display: block; }
.icon-btn[aria-pressed="true"] { border-color: var(--line); }
.icon-btn[aria-pressed="true"] svg { opacity: 0.55; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: 0.16em;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.18s var(--ease), background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.25s;
}

.btn-primary {
  background: var(--text);
  color: #050507;
  border: 2px solid var(--text);
  height: 56px;
  padding: 0 34px;
  font-size: 15px;
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 30%, rgba(0, 0, 0, 0.14) 50%, rgba(255, 255, 255, 0) 70%);
  transform: translateX(-120%);
}

.btn-ghost {
  background: rgba(12, 12, 16, 0.7);
  border: 2px solid var(--line2);
  color: var(--text);
}

.btn-small { height: 40px; padding: 0 16px; font-size: 12px; border-radius: 10px; }

.btn-big { height: 68px; min-width: min(440px, 100%); font-size: clamp(14px, 1.6vw, 17px); padding: 0 40px; }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.08), 0 14px 40px rgba(255, 255, 255, 0.12); transform: translateY(-2px); }
  .btn-primary:hover::after { transform: translateX(120%); transition: transform 0.7s var(--ease); }
  .btn-ghost:hover, .icon-btn:hover { border-color: rgba(255, 255, 255, 0.6); background: rgba(24, 24, 30, 0.9); }
}

.btn:active, .icon-btn:active { transform: scale(0.96); }

.btn:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }

.btn.disabled { pointer-events: none; opacity: 0.5; }

.stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vh, 48px) 0;
  perspective: 1600px;
}

.board {
  width: min(960px, 100%);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  will-change: transform;
}

.bezel {
  position: relative;
  padding: clamp(10px, 1.6vw, 18px);
  border-radius: 6px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #1c1c21 0%, var(--frame) 50%, #111115 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 40px 120px rgba(0, 0, 0, 0.85),
    0 0 90px rgba(255, 255, 255, 0.03);
}

.screen {
  position: relative;
  overflow: hidden;
  background: var(--screen);
  padding: clamp(18px, 3.4vw, 40px) clamp(16px, 3.6vw, 44px) clamp(22px, 3.6vw, 40px);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 6%, rgba(0, 0, 0, 0) 94%, rgba(0, 0, 0, 0.4) 100%),
    linear-gradient(170deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 30%);
  z-index: 2;
}

.screen::after {
  content: "";
  position: absolute;
  left: -40%;
  top: 0;
  width: 30%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.035) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg);
  animation: sweep 9s 2.4s infinite var(--ease);
  z-index: 2;
}

.screen > * { position: relative; z-index: 1; }

.board-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--line);
  text-align: left;
}

.head-title { font-size: clamp(18px, 2.4vw, 26px); font-weight: 700; letter-spacing: 0.12em; }

.chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 2px solid #d6d6d6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.head-right {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  white-space: nowrap;
}

.head-right b { color: var(--text); margin-left: 6px; }

.logo {
  margin: clamp(26px, 5vw, 56px) 0 0;
  font-weight: 700;
  line-height: 1;
}

.l1 {
  display: block;
  font-size: clamp(38px, 8.6vw, 100px);
  letter-spacing: 0.06em;
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.12);
}

.l2, .g2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 22px);
  margin-top: clamp(10px, 1.6vw, 18px);
  font-size: clamp(16px, 2.8vw, 30px);
  letter-spacing: 0.62em;
  padding-left: 0.62em;
  color: #d6d6d6;
}

.l2 i, .g2 i {
  display: block;
  width: clamp(28px, 7vw, 90px);
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6));
}

.l2 i:last-child, .g2 i:last-child { background: linear-gradient(270deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6)); }

.tag {
  margin: clamp(16px, 2.6vw, 26px) 0 0;
  font-size: clamp(11px, 1.3vw, 13px);
  letter-spacing: 0.3em;
  color: var(--muted);
}

.tag span { color: var(--text); }
.tag .sep { font-weight: inherit; }

.count-wrap { margin-top: clamp(26px, 4.4vw, 48px); }

.count-label {
  font-size: 12px;
  letter-spacing: 0.34em;
  color: var(--muted);
  margin-bottom: 14px;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 16px);
  max-width: 720px;
  margin: 0 auto;
}

.cell {
  background: var(--row);
  border: 2px solid var(--line);
  padding: clamp(12px, 2vw, 20px) 4px clamp(10px, 1.6vw, 16px);
  position: relative;
}

.cell::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.04);
}

.num {
  position: relative;
  height: clamp(40px, 7vw, 76px);
  overflow: hidden;
  font-size: clamp(34px, 6.4vw, 70px);
  font-weight: 700;
  line-height: clamp(40px, 7vw, 76px);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.num span { position: absolute; inset: 0; display: block; }
.num span.in { animation: rollIn 0.48s var(--ease) both; }
.num span.out { animation: rollOut 0.48s var(--ease) both; }

.unit {
  margin-top: clamp(6px, 1vw, 10px);
  font-size: clamp(9px, 1.1vw, 12px);
  letter-spacing: 0.28em;
  padding-left: 0.28em;
  color: var(--muted);
}

.live {
  display: none;
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 12px 0;
  animation: livePulse 2.4s ease-in-out infinite;
}

.state-live .countdown { display: none; }
.state-live .live { display: block; }
.state-tba .countdown { display: none; }
.state-tba .live { display: block; animation: none; }

.track {
  position: relative;
  height: 34px;
  margin: clamp(18px, 3vw, 30px) auto 0;
  max-width: 640px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
}

.track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: rgba(255, 255, 255, 0.35);
}

.ticks {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.85) 0 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0 2px, transparent 2px);
  background-size: 110px 22px, 22px 10px;
  background-repeat: repeat-x;
  background-position: calc(50% + var(--tx, 0px) - 1px) 50%, calc(50% + var(--tx, 0px) - 1px) 50%;
  transition: background-position 0.6s var(--ease);
}

.marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--text);
  transform: rotate(45deg) scale(0.8);
  box-shadow: 0 0 0 4px var(--screen);
  transition: transform 0.5s var(--pop), box-shadow 0.5s;
}

.marker.pulse { transform: rotate(45deg) scale(1.15); box-shadow: 0 0 0 4px var(--screen), 0 0 18px rgba(255, 255, 255, 0.55); transition: transform 0.12s, box-shadow 0.12s; }

.date {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.26em;
  color: var(--dim);
  min-height: 1.4em;
}

.cta { margin-top: clamp(22px, 3.6vw, 36px); }

.footer { text-align: center; padding-top: 6px; }

.foot-line {
  height: 2px;
  max-width: 960px;
  margin: 0 auto 16px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.14) 50%, rgba(255, 255, 255, 0));
}

.footer p {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted);
  line-height: 1.8;
}

.footer .fine { color: var(--dim); font-size: 9px; letter-spacing: 0.18em; }

#gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  background: radial-gradient(ellipse at 50% 50%, rgba(8, 8, 10, 0.88) 0%, rgba(0, 0, 0, 0.97) 70%);
  cursor: pointer;
  padding: 24px;
}

.js #gate { display: grid; }
.js.entered #gate { opacity: 0; visibility: hidden; transition: opacity 0.6s var(--ease), visibility 0s 0.6s; }
.js.entered #gate .gate-inner { transform: scale(1.06); filter: blur(6px); transition: transform 0.6s var(--ease), filter 0.6s var(--ease); }

.gate-inner { text-align: center; animation: gateIn 1.2s var(--ease) both; }

.gate-logo { font-weight: 700; margin-bottom: 40px; }
.g1 { display: block; font-size: clamp(34px, 9vw, 72px); letter-spacing: 0.06em; }
.g2 { font-size: clamp(14px, 3vw, 24px); }

#enter { min-width: 220px; animation: breathe 2.6s 1.2s ease-in-out infinite; }

.gate-hint { margin: 22px 0 0; font-size: 10px; letter-spacing: 0.3em; color: var(--dim); }

.js .rise { opacity: 0; transform: translateY(18px); }
.js.entered .rise { opacity: 1; transform: none; transition: opacity 0.7s var(--ease), transform 0.8s var(--ease); transition-delay: calc(0.25s + var(--i, 0) * 0.08s); }

[data-i="0"] { --i: 0; }
[data-i="1"] { --i: 1; }
[data-i="2"] { --i: 2; }
[data-i="3"] { --i: 3; }
[data-i="4"] { --i: 4; }
[data-i="5"] { --i: 5; }
[data-i="6"] { --i: 6; }
[data-i="7"] { --i: 7; }
[data-i="8"] { --i: 8; }

.js .bezel { opacity: 0; transform: scaleY(0.006) scaleX(0.4); }
.js.entered .bezel { opacity: 1; transform: none; animation: boardOpen 0.9s var(--ease) 0.08s both; }

.noscript {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 30;
  padding: 12px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.2em;
  background: #000;
}

@keyframes boardOpen {
  0% { opacity: 0; transform: scaleY(0.006) scaleX(0.3); }
  12% { opacity: 1; transform: scaleY(0.006) scaleX(0.3); }
  45% { opacity: 1; transform: scaleY(0.006) scaleX(1); }
  100% { opacity: 1; transform: scaleY(1) scaleX(1); }
}

@keyframes rollIn { from { transform: translateY(70%); opacity: 0; filter: blur(3px); } to { transform: none; opacity: 1; filter: none; } }
@keyframes rollOut { from { transform: none; opacity: 1; } to { transform: translateY(-70%); opacity: 0; filter: blur(3px); } }
@keyframes sweep { 0% { left: -40%; } 40%, 100% { left: 130%; } }
@keyframes gateIn { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.22); } 50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } }
@keyframes livePulse { 0%, 100% { text-shadow: 0 0 0 rgba(255, 255, 255, 0); } 50% { text-shadow: 0 0 30px rgba(255, 255, 255, 0.45); } }

@media (max-width: 640px) {
  .mark-text { font-size: 11px; letter-spacing: 0.2em; }
  .board-head { gap: 10px; padding-bottom: 14px; flex-wrap: wrap; }
  .head-right { font-size: 10px; letter-spacing: 0.14em; }
  .chip { height: 26px; font-size: 10px; padding: 0 8px; }
  .btn-big { width: 100%; height: 60px; min-width: 0; padding: 0 18px; letter-spacing: 0.1em; }
  .footer .fine { letter-spacing: 0.1em; }
  .countdown { gap: 6px; }
  .tag .sep { display: none; }
  .tag span { display: block; margin-top: 8px; }
  .date { font-size: 10px; letter-spacing: 0.14em; }
  .cell { border-width: 1px; }
}

@media (max-width: 380px) {
  #topWishlist { display: none; }
  .head-right { display: none; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .logo { margin-top: 16px; }
  .l1 { font-size: 40px; }
  .count-wrap { margin-top: 16px; }
  .num { height: 40px; line-height: 40px; font-size: 34px; }
  .track { margin-top: 10px; }
  .cta { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .screen::after { display: none; }
}
