/* ═══════════════════════════════════════════════════════════════
   Super Arcade Kids — Main Stylesheet  (tema menina 🌸)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Tokens ─────────────────────────────────────────────────── */
:root {
  --color-rose:    #FF4081;
  --color-pink:    #F48FB1;
  --color-magenta: #E91E8C;
  --color-lavender:#CE93D8;
  --color-purple:  #9C4DCC;
  --color-lilac:   #B39DDB;
  --color-yellow:  #FFD600;
  --color-coral:   #FF6B9D;
  --color-dark:    #1A0A2E;
  --color-darker:  #110720;
  --color-card:    rgba(255,255,255,0.08);
  --color-card-hover: rgba(255,255,255,0.14);

  --font-main: 'Nunito', system-ui, sans-serif;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-xl: 48px;

  --shadow-card: 0 8px 32px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.2);
  --shadow-btn:  0 4px 16px rgba(0,0,0,0.25);
  --shadow-glow-pink:   0 0 20px rgba(255,64,129,0.55);
  --shadow-glow-purple: 0 0 20px rgba(156,77,204,0.5);
  --shadow-glow-yellow: 0 0 20px rgba(255,214,0,0.5);

  --transition: 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 0.15s ease;
}

/* ─── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-main);
  background: var(--color-darker);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ─── Animated Star Background ──────────────────────────────── */
.stars-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(233,30,140,0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(206,147,216,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(255,64,129,0.12) 0%, transparent 50%),
    var(--color-darker);
}

.star {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.75);
  animation: twinkle var(--tw-dur, 3s) ease-in-out infinite;
  animation-delay: var(--tw-delay, 0s);
}
.star:nth-child(1)  { width:3px; height:3px; top:10%; left:20%; --tw-dur:2.5s; }
.star:nth-child(2)  { width:2px; height:2px; top:25%; left:75%; --tw-dur:3.2s; --tw-delay:.5s; }
.star:nth-child(3)  { width:4px; height:4px; top:60%; left:10%; --tw-dur:2.8s; --tw-delay:1s; }
.star:nth-child(4)  { width:2px; height:2px; top:80%; left:60%; --tw-dur:3.5s; --tw-delay:.3s; }
.star:nth-child(5)  { width:3px; height:3px; top:40%; left:90%; --tw-dur:2.2s; --tw-delay:.8s; }
.star:nth-child(6)  { width:2px; height:2px; top:5%;  left:50%; --tw-dur:4s;   --tw-delay:1.5s; }
.star:nth-child(7)  { width:3px; height:3px; top:70%; left:35%; --tw-dur:2.6s; --tw-delay:.2s; }
.star:nth-child(8)  { width:2px; height:2px; top:90%; left:85%; --tw-dur:3.1s; --tw-delay:.7s; }

@keyframes twinkle {
  0%, 100% { opacity: .2; transform: scale(1); }
  50%       { opacity: 1;  transform: scale(1.5); }
}

/* ─── Layout ─────────────────────────────────────────────────── */
.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ─── Site Header ────────────────────────────────────────────── */
.site-header {
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(17,7,32,0.8);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-magenta), var(--color-purple));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: var(--shadow-glow-pink);
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-title {
  font-size: 1.3rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--color-rose), var(--color-lavender));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: .75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: .75rem;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .625rem 1.5rem;
  border-radius: var(--radius-xl);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: var(--shadow-btn);
  letter-spacing: .02em;
}
.btn:active { transform: scale(0.95); }

.btn-primary {
  background: linear-gradient(135deg, var(--color-magenta), var(--color-rose));
  color: #fff;
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: var(--shadow-btn), var(--shadow-glow-pink);
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-secondary:hover { background: rgba(255,255,255,0.18); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, #EF5350, #C62828);
  color: #fff;
}
.btn-danger:hover { transform: translateY(-2px); }

.btn-yellow {
  background: linear-gradient(135deg, var(--color-yellow), #FFA000);
  color: #2d0a1e;
}
.btn-yellow:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: var(--shadow-btn), var(--shadow-glow-yellow);
}

.btn-green {
  background: linear-gradient(135deg, var(--color-rose), var(--color-magenta));
  color: #fff;
}
.btn-green:hover { transform: translateY(-2px) scale(1.03); box-shadow: var(--shadow-btn), var(--shadow-glow-pink); }

.btn-sm  { padding: .4rem 1rem; font-size: .875rem; }
.btn-lg  { padding: 1rem 2.5rem; font-size: 1.25rem; }
.btn-icon { padding: .625rem .75rem; border-radius: 50%; }

/* ─── Game Cards Grid ────────────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
  padding: 2rem 0;
}

.game-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}
.game-card:hover {
  background: var(--color-card-hover);
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-card);
  border-color: rgba(255,255,255,0.2);
}

.game-card-art {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.game-card-art img, .game-card-art svg { width: 100%; height: 100%; object-fit: cover; }

.game-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  flex: 1;
}
.game-card-name  { font-size: 1.5rem; font-weight: 900; line-height: 1.1; }
.game-card-desc  { font-size: .9rem; color: rgba(255,255,255,0.65); line-height: 1.5; }

.game-card-score {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 700;
  color: var(--color-yellow);
  padding: .4rem .75rem;
  background: rgba(255,214,0,0.1);
  border-radius: var(--radius-xl);
  width: fit-content;
}

.game-card-footer { padding: 0 1.5rem 1.5rem; }
.game-card-footer .btn { width: 100%; justify-content: center; }

/* ─── Hero section ───────────────────────────────────────────── */
.hero { text-align: center; padding: 3rem 0 1.5rem; }

.hero-greeting {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: .5rem;
  background: linear-gradient(135deg, #fff 0%, var(--color-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { font-size: 1.15rem; color: rgba(255,255,255,0.6); font-weight: 600; }

/* ─── High Scores Page ───────────────────────────────────────── */
.scores-page { padding: 2rem 0 4rem; }

.scores-title {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 2rem;
  background: linear-gradient(90deg, var(--color-rose), var(--color-lavender));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.scores-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }

.scores-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
}
.scores-card-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.3rem;
  font-weight: 900;
}
.scores-card-high {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,214,0,0.08);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.scores-card-high .trophy  { font-size: 1.5rem; }
.scores-card-high .score-value { font-size: 1.75rem; font-weight: 900; color: var(--color-yellow); }
.scores-card-high .score-label { font-size: .75rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: .06em; }

.scores-list { list-style: none; padding: .75rem 0; }
.scores-list li { display: flex; align-items: center; gap: .75rem; padding: .5rem 1.5rem; font-size: .9rem; transition: background var(--transition-fast); }
.scores-list li:hover { background: rgba(255,255,255,0.04); }
.score-rank  { font-size: 1.1rem; width: 2rem; text-align: center; flex-shrink: 0; }
.score-num   { font-weight: 800; font-size: 1rem; flex: 1; }
.score-date  { font-size: .75rem; color: rgba(255,255,255,0.4); }

/* ─── Login Page ─────────────────────────────────────────────── */
body.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
}

.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 1.5rem;
  margin: auto;        /* belt + suspenders centering */
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo .logo-icon {
  width: 90px;
  height: 90px;
  margin: 0 auto 1rem;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--color-magenta), var(--color-purple));
  box-shadow: var(--shadow-glow-pink);
}
.login-logo .logo-title { font-size: 2rem; }

.login-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,64,129,0.2);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 40px rgba(233,30,140,0.08);
}

.login-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.5rem;
}

/* PIN dots */
.pin-display {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.pin-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25);
  background: transparent;
  transition: all .2s ease;
}
.pin-dot.filled {
  background: var(--color-magenta);
  border-color: var(--color-magenta);
  box-shadow: 0 0 10px rgba(233,30,140,0.6);
  transform: scale(1.1);
}
.pin-dot.error {
  border-color: #FF5252;
  background: #FF5252;
  animation: shake .4s ease;
}

@keyframes shake {
  0%,100% { transform: translateX(0) scale(1); }
  20%      { transform: translateX(-6px) scale(1.05); }
  40%      { transform: translateX(6px) scale(1.05); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

/* Numpad */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}

.numpad-btn {
  aspect-ratio: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,64,129,0.15);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-main);
  font-size: 1.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.numpad-btn:hover  { background: rgba(255,64,129,0.15); transform: scale(1.05); }
.numpad-btn:active { transform: scale(0.93); background: rgba(233,30,140,0.3); }

.numpad-btn.btn-delete {
  font-size: 1.25rem;
  background: rgba(255,64,129,0.1);
  border-color: rgba(255,64,129,0.2);
  color: var(--color-pink);
}
.numpad-btn.btn-clear {
  font-size: 1rem;
  background: rgba(239,83,80,0.12);
  border-color: rgba(239,83,80,0.2);
  color: #EF9A9A;
}
.numpad-btn.btn-enter {
  background: linear-gradient(135deg, var(--color-magenta), var(--color-purple));
  border-color: transparent;
  grid-column: 3;
  font-size: 1.5rem;
  box-shadow: var(--shadow-glow-pink);
}
.numpad-btn.btn-enter:hover { transform: scale(1.05); }

.login-error {
  margin-top: 1rem;
  padding: .75rem 1rem;
  background: rgba(255,82,82,0.12);
  border: 1px solid rgba(255,82,82,0.3);
  border-radius: var(--radius-sm);
  color: #EF9A9A;
  font-size: .9rem;
  font-weight: 700;
  text-align: center;
  display: none;
}
.login-error.visible { display: block; }

/* ─── Site Footer ────────────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  padding: 1.25rem 0;
  text-align: center;
  font-size: .8rem;
  color: rgba(255,255,255,0.3);
  border-top: 1px solid rgba(255,255,255,0.06);
  position: relative;
  z-index: 1;
}

/* ─── New Record Overlay ─────────────────────────────────────── */
.new-record-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  animation: fadeIn .3s ease;
}
.new-record-overlay.active { display: flex; }

.new-record-box {
  background: linear-gradient(135deg, #2D0A3A, #1A0A2E);
  border: 2px solid var(--color-rose);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 0 60px rgba(255,64,129,0.3);
  animation: popIn .5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.new-record-emoji  { font-size: 4rem; line-height: 1; margin-bottom: .75rem; }
.new-record-title  { font-size: 1.75rem; font-weight: 900; color: var(--color-rose); margin-bottom: .5rem; text-shadow: 0 0 20px rgba(255,64,129,0.5); }
.new-record-score  { font-size: 3rem; font-weight: 900; color: #fff; margin-bottom: 1.5rem; }

@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes popIn  { from { transform:scale(0.5); opacity:0; } to { transform:scale(1); opacity:1; } }

/* ─── Game pages ─────────────────────────────────────────────── */
.game-page { padding: 1rem 0; }
.game-topbar { display:flex; align-items:center; gap:1rem; padding:.75rem 0 1rem; flex-wrap:wrap; }
.game-topbar-title { font-size:1.3rem; font-weight:900; flex:1; }
.game-controls-bar { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }

/* ─── Utility ────────────────────────────────────────────────── */
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero-greeting { font-size: 1.75rem; }
  .games-grid    { grid-template-columns: 1fr; gap: 1.25rem; }
  .scores-grid   { grid-template-columns: 1fr; }
  .logo-text     { display: none; }
  .logo-icon     { width: 42px; height: 42px; font-size: 1.5rem; }
  .game-topbar-title { font-size: 1.1rem; }
  .numpad-btn    { font-size: 1.5rem; }
}
@media (min-width: 601px) and (max-width: 900px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-darker); }
::-webkit-scrollbar-thumb { background: rgba(255,64,129,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,64,129,0.5); }
