@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #08041a;
  --panel:    #0c0520;
  --border:   #c87e12;
  --border2:  #ffc832;
  --gold:     #ffc832;
  --gold-lt:  #ffeb82;
  --purple:   #501c8c;
  --cyan:     #50dcff;
  --discord:  #5865f2;
  --disc-h:   #7289ff;
  --db:       #1e96c8;
  --db-h:     #50c8f0;
  --text:     #e0d4f0;
  --muted:    #6e5f87;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

#login-screen {
  font-family: 'Press Start 2P', monospace;
}

/* ── Starfield canvas ── */
#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Floating rune particles ── */
.rune {
  position: fixed;
  font-size: 14px;
  color: var(--purple);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  animation: floatRune 8s ease-in-out infinite;
}
@keyframes floatRune {
  0%   { opacity: 0; transform: translateY(0)   rotate(0deg);   }
  20%  { opacity: .4; }
  80%  { opacity: .2; }
  100% { opacity: 0; transform: translateY(-120px) rotate(360deg); }
}

/* ── Layout ── */
.screen {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  gap: 0;
}

/* ── Title ── */
.title-wrap {
  text-align: center;
  margin-bottom: 10px;
}
.title-wrap h1 {
  font-size: clamp(16px, 4vw, 26px);
  color: var(--gold);
  text-shadow:
    0 0 8px  var(--gold),
    0 0 20px #a06000,
    2px 2px 0 #000;
  animation: titlePulse 3s ease-in-out infinite;
  letter-spacing: 2px;
}
@keyframes titlePulse {
  0%,100% { text-shadow: 0 0 8px var(--gold), 0 0 20px #a06000, 2px 2px 0 #000; }
  50%      { text-shadow: 0 0 18px var(--gold-lt), 0 0 36px #c87e12, 2px 2px 0 #000; }
}
.title-wrap .sub {
  font-size: 7px;
  color: var(--cyan);
  margin-top: 6px;
  letter-spacing: 1px;
  text-shadow: 0 0 6px var(--cyan);
}
.title-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px 0;
  color: var(--border);
  font-size: 8px;
}
.title-divider::before,
.title-divider::after {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ── Book GIF ── */
.book-wrap {
  position: relative;
  margin: 4px 0 10px;
}
.book-wrap img {
  display: block;
  width: clamp(240px, 55vw, 380px);
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 0 18px rgba(80,220,255,.35))
          drop-shadow(0 0 36px rgba(100,40,200,.4));
}

/* ── Tagline ── */
.tagline {
  font-size: 7px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 14px;
  max-width: 340px;
  line-height: 2;
}

/* ── Login Panel ── */
.panel {
  background: var(--panel);
  border: 2px solid var(--border);
  box-shadow:
    0 0 0 1px var(--border2),
    inset 0 0 24px rgba(80,28,140,.3),
    0 8px 32px rgba(0,0,0,.8);
  padding: 20px;
  width: clamp(260px, 60vw, 360px);
  position: relative;
}
/* Pixel corner gems */
.panel::before,
.panel::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}
.panel::before { top: -2px; left: -2px; }
.panel::after  { top: -2px; right: -2px; }
.panel-corner-bl,
.panel-corner-br {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}
.panel-corner-bl { bottom: -2px; left: -2px; }
.panel-corner-br { bottom: -2px; right: -2px; }

/* ── Buttons ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: 2px solid transparent;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s, transform .1s, box-shadow .15s;
  position: relative;
  overflow: hidden;
  letter-spacing: .5px;
}
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: rgba(255,255,255,.12);
  transform: skewX(-20deg);
  transition: left .4s ease;
}
.btn:hover::after { left: 140%; }
.btn:active { transform: scale(.97); }

.btn-discord {
  background: var(--discord);
  border-color: #8899ff;
  color: #fff;
  margin-bottom: 10px;
  box-shadow: 0 0 12px rgba(88,101,242,.5);
}
.btn-discord:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 22px rgba(88,101,242,.8);
}

.btn-db {
  background: var(--db);
  border-color: var(--db-h);
  color: #fff;
  box-shadow: 0 0 12px rgba(30,150,200,.5);
}
.btn-db:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 22px rgba(80,200,240,.8);
}

/* Button icons (pixel SVG inline) */
.btn-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

/* ── Footer ── */
.footer {
  margin-top: 14px;
  font-size: 6px;
  color: var(--muted);
  text-align: center;
  line-height: 2.4;
}
.footer a {
  color: var(--cyan);
  text-decoration: none;
}
.footer a:hover { text-decoration: underline; }

/* ── Scanline overlay ── */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,.06) 2px,
    rgba(0,0,0,.06) 4px
  );
}

/* ── Responsive ── */
@media (max-height: 600px) {
  .book-wrap img { width: 180px; }
  .tagline { display: none; }
}