/* ============================================
   BASECOIN — 8-bit CRT cabinet
   ============================================ */

:root {
  --bg: #000814;
  --screen: #001428;
  --blue: #0052FF;
  --blue-bright: #4D8BFF;
  --cyan: #65E0FF;
  --yellow: #FFD93D;
  --pink: #FF4D9D;
  --green: #6BFF6B;
  --text: #E8F4FF;
  --dim: rgba(232, 244, 255, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(ellipse at center, #001a33 0%, var(--bg) 70%),
    var(--bg);
  font-family: 'Press Start 2P', monospace;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px;
  image-rendering: pixelated;
}

/* ============ CRT FX ============ */
.crt {
  position: fixed; inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(0, 20, 40, 0.18) 0px,
    rgba(0, 20, 40, 0.18) 2px,
    transparent 2px,
    transparent 4px
  );
  pointer-events: none;
  z-index: 50;
}

.grain {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 51;
}

/* ============ CABINET ============ */
.cabinet {
  width: 100%;
  max-width: 880px;
  position: relative;
  z-index: 2;
}

.screen {
  background:
    radial-gradient(ellipse at 50% 30%, #002b55 0%, var(--screen) 70%),
    var(--screen);
  border: 6px solid var(--blue);
  box-shadow:
    0 0 0 4px #001428,
    0 0 0 10px var(--blue-bright),
    0 0 60px rgba(77, 139, 255, 0.5),
    inset 0 0 80px rgba(0, 82, 255, 0.25);
  padding: 0;
  position: relative;
  overflow: hidden;
  animation: flicker 5s steps(8) infinite;
}

@keyframes flicker {
  0%, 100%   { opacity: 1; }
  92%        { opacity: 1; }
  93%        { opacity: 0.92; }
  94%        { opacity: 1; }
}

/* ============ MARQUEE ============ */
.marquee {
  background: rgba(0, 82, 255, 0.18);
  border-top: 2px solid rgba(101, 224, 255, 0.4);
  border-bottom: 2px solid rgba(101, 224, 255, 0.4);
  overflow: hidden;
  padding: 14px 0;
  position: relative;
}

.marquee-track {
  display: flex;
  gap: 26px;
  white-space: nowrap;
  width: max-content;
  font-size: 0.85rem;
  color: var(--cyan);
  letter-spacing: 0.06em;
  text-shadow: 0 0 8px rgba(101, 224, 255, 0.5);
}
.marquee-top    .marquee-track { animation: scroll-left  22s linear infinite; }
.marquee-bottom .marquee-track { animation: scroll-right 22s linear infinite; }

@keyframes scroll-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes scroll-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

.marquee-track span { display: inline-block; }
.marquee-track span:nth-child(even) { color: var(--yellow); }

/* ============ STAGE ============ */
.stage {
  text-align: center;
  padding: 50px 28px 40px;
}

.logo {
  font-size: clamp(1.6rem, 5vw, 3rem);
  letter-spacing: 0.06em;
  color: var(--cyan);
  text-shadow:
    3px 3px 0 var(--blue),
    6px 6px 0 rgba(0, 82, 255, 0.5),
    0 0 20px rgba(101, 224, 255, 0.6);
  margin-bottom: 10px;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.sub {
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  color: var(--blue-bright);
  letter-spacing: 0.1em;
  margin-bottom: 28px;
}

/* COIN */
.coin-wrap {
  position: relative;
  display: inline-block;
  padding: 20px;
}

.coin {
  width: clamp(140px, 22vw, 200px);
  height: auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  filter: drop-shadow(0 0 25px rgba(77, 139, 255, 0.6));
  animation: spin-bob 3s ease-in-out infinite;
}

@keyframes spin-bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-8px) rotate(3deg); }
}

.dust {
  position: absolute;
  font-size: 0.7rem;
  color: var(--yellow);
  text-shadow: 1px 1px 0 var(--blue);
  pointer-events: none;
  opacity: 0;
}
.dust-1 { top: 10%;  left: -10%; animation: dust-up 2.2s ease-out infinite; }
.dust-2 { top: 30%;  right: -15%; animation: dust-up 2.5s ease-out 0.6s infinite; }
.dust-3 { bottom: 10%; left: 50%; animation: dust-up 2.8s ease-out 1.2s infinite; }

@keyframes dust-up {
  0%   { transform: translateY(0); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateY(-40px); opacity: 0; }
}

/* ============ ACTIONS ============ */
.actions {
  display: flex;
  justify-content: center;
  gap: 36px;
  padding: 20px 0 40px;
}

.key {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.key:hover { transform: translateY(-3px); }
.key:active { transform: translateY(1px); }

.kbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--blue-bright), var(--blue));
  border: 3px solid var(--cyan);
  box-shadow:
    0 4px 0 #001a33,
    0 0 20px rgba(101, 224, 255, 0.4);
  transition: box-shadow 0.2s ease;
}
.kbtn img {
  width: 32px;
  height: 32px;
  filter: invert(1) brightness(1.4) drop-shadow(0 0 4px rgba(255,255,255,0.4));
}
.key:hover .kbtn {
  box-shadow:
    0 4px 0 #001a33,
    0 0 35px rgba(101, 224, 255, 0.8);
}

.klabel {
  font-size: 0.75rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 600px) {
  html, body { overflow: auto; }
  body { padding: 12px; align-items: flex-start; min-height: 100vh; }
  .stage { padding: 36px 18px 28px; }
  .marquee-track { font-size: 0.7rem; gap: 18px; }
  .actions { gap: 22px; padding-bottom: 32px; }
  .kbtn { width: 56px; height: 56px; }
  .kbtn img { width: 26px; height: 26px; }
}
