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

:root {
  --bg: #080810;
  --purple: #7c4dff;
  --purple-dim: rgba(124,77,255,0.18);
  --purple-glow: rgba(124,77,255,0.35);
  --text: #f0f0f0;
  --muted: rgba(220,210,255,0.5);
  --card-bg: rgba(12,10,28,0.88);
  --card-border: rgba(124,77,255,0.22);
  --btn-bg: rgba(16,12,36,0.72);
  --btn-border: rgba(124,77,255,0.2);
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, 'Arial Nova', sans-serif;
  overflow-x: hidden;
}

/* ─── LOADER ────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.hidden {
  opacity: 0;
  visibility: hidden;
}
.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.loader-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(124,77,255,0.15);
  border-top-color: var(--purple);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--purple);
  letter-spacing: 0.15em;
  text-transform: lowercase;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity:0.5; } 50% { opacity:1; } }

/* ─── CANVAS ────────────────────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ─── LAYOUT ────────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "left right";
  align-items: center;
  gap: 0 40px;
  padding: 56px 6vw 32px;
}

/* ─── LEFT PANEL ────────────────────────────────────── */
.left-panel {
  grid-area: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.brand {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 0 48px rgba(124,77,255,0.6), 0 0 12px rgba(124,77,255,0.3);
}

.url-tag {
  font-size: clamp(0.8rem, 1.3vw, 1rem);
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 28px;
}

/* ─── FADE-UP ────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
.delay-1  { transition-delay: 0.12s; }
.delay-2  { transition-delay: 0.20s; }
.delay-3  { transition-delay: 0.28s; }
.delay-4  { transition-delay: 0.36s; }
.delay-5  { transition-delay: 0.44s; }
.delay-6  { transition-delay: 0.52s; }
.delay-7  { transition-delay: 0.60s; }
.delay-8  { transition-delay: 0.68s; }
.delay-9  { transition-delay: 0.76s; }

/* ─── BUTTONS ────────────────────────────────────────── */
.buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}

.game-btn {
  position: relative;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 13px;
  padding: 15px 20px;
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s, transform 0.15s;
  transform-style: preserve-3d;
  will-change: transform;
}

.game-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: radial-gradient(ellipse at 50% 50%, rgba(124,77,255,0.18), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.game-btn:hover::after { opacity: 1; }
.game-btn:hover, .game-btn.active {
  border-color: rgba(124,77,255,0.6);
  background: rgba(30,16,70,0.8);
  box-shadow: 0 0 32px rgba(124,77,255,0.25), 0 2px 18px rgba(0,0,0,0.45);
}
.game-btn.active {
  border-color: var(--purple);
  box-shadow: 0 0 40px rgba(124,77,255,0.4);
}

.btn-arrow {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--purple);
  opacity: 0.45;
  transition: opacity 0.2s, transform 0.2s;
}
.game-btn:hover .btn-arrow,
.game-btn.active .btn-arrow {
  opacity: 1;
  transform: translateY(-50%) rotate(90deg);
}

/* nudge neighboring buttons */
.game-btn.nudge-up   { transform: translateY(-6px) !important; }
.game-btn.nudge-down { transform: translateY(6px) !important; }

/* ─── INFO DROP ──────────────────────────────────────── */
.info-drop-row {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 6vw;
  /* width matches left panel roughly */
  max-width: calc(50% + 6vw);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1),
              opacity 0.4s ease,
              margin-bottom 0.4s ease;
  margin-bottom: 0;
}
.info-drop-row.open {
  max-height: 600px;
  opacity: 1;
  margin-bottom: 24px;
}

.info-drop-rope {
  margin-left: calc(var(--rope-offset, 20px));
  transition: margin-left 0.35s ease;
}

.info-drop-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px 22px 22px;
  width: 100%;
  max-width: 340px;
  backdrop-filter: blur(18px);
  box-shadow: 0 0 48px rgba(124,77,255,0.2), 0 8px 32px rgba(0,0,0,0.55);
  transform: translateY(-10px);
  transition: transform 0.45s cubic-bezier(0.4,0,0.2,1);
}
.info-drop-row.open .info-drop-card {
  transform: translateY(0);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 13px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s;
}
.close-btn:hover { color: #fff; }

.info-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--purple);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.info-block {
  background: rgba(124,77,255,0.07);
  border: 1px solid rgba(124,77,255,0.16);
  border-radius: 10px;
  padding: 10px 13px;
  box-shadow: 0 0 16px rgba(124,77,255,0.1);
  animation: dropIn 0.35s ease both;
}

@keyframes dropIn {
  from { opacity:0; transform: translateY(-8px); }
  to   { opacity:1; transform: translateY(0); }
}

.info-block:nth-child(2) { animation-delay: 0.07s; }
.info-block:nth-child(3) { animation-delay: 0.14s; }

.info-block label {
  display: block;
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 5px;
}

.info-block code {
  display: block;
  font-family: 'Courier New', monospace;
  font-size: 0.68rem;
  color: #c5b8ff;
  word-break: break-all;
  line-height: 1.55;
}

.copy-btn {
  display: inline-block;
  margin-top: 7px;
  background: rgba(124,77,255,0.18);
  border: 1px solid rgba(124,77,255,0.38);
  border-radius: 6px;
  color: #c5b8ff;
  font-size: 0.63rem;
  padding: 3px 9px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: Arial, sans-serif;
}
.copy-btn:hover { background: rgba(124,77,255,0.38); color: #fff; }

/* ─── RIGHT PANEL ────────────────────────────────────── */
.right-panel {
  grid-area: right;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.typewriter-text {
  font-size: clamp(0.88rem, 1.55vw, 1.1rem);
  line-height: 1.9;
  color: var(--muted);
  max-width: 400px;
}
.typewriter-text strong { color: #fff; font-weight: 700; }
.typewriter-text a {
  color: var(--purple);
  text-decoration: none;
  border-bottom: 1px solid rgba(124,77,255,0.4);
  transition: color 0.2s, border-color 0.2s;
}
.typewriter-text a:hover { color: #b49dff; border-color: #b49dff; }

.cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--purple);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0;} }

/* ─── FOOTER ─────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px 0 32px;
  font-size: 0.75rem;
  color: rgba(180,160,255,0.4);
  letter-spacing: 0.06em;
}
.footer-dc { color: rgba(180,160,255,0.6); }

/* ─── MOBILE ─────────────────────────────────────────── */
@media (max-width: 700px) {
  .page-wrapper {
    grid-template-columns: 1fr;
    grid-template-areas: "left" "right";
    padding: 44px 6vw 24px;
    gap: 36px 0;
    align-items: start;
  }
  .right-panel { justify-content: flex-start; }
  .info-drop-row { max-width: 100%; }
  .info-drop-card { max-width: 100%; }
  .buttons-grid { max-width: 100%; }
}