/* ═══════════ SLICE MASTER – STYLES ═══════════ */
@import url('https://fonts.googleapis.com/css2?family=Russo+One&display=swap');

:root {
  --bg-dark: #0a0e1a;
  --bg-mid: #111827;
  --accent: #f59e0b;
  --accent2: #ef4444;
  --accent3: #10b981;
  --text: #f1f5f9;
  --glass: rgba(255,255,255,0.06);
  --glass-border: rgba(255,255,255,0.1);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'Russo One', 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  user-select: none;
}

/* ── Screens ── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hidden { display: none !important; }

/* ── Title Screen ── */
.title-content {
  text-align: center;
  animation: fadeInUp .6s ease;
}

.title-emoji {
  font-size: 80px;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(245,158,11,0.4));
}

.game-title {
  font-size: 64px;
  background: linear-gradient(135deg, #f59e0b, #ef4444, #f59e0b);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease infinite;
  text-shadow: none;
  margin: 10px 0;
  letter-spacing: 4px;
}

.subtitle {
  font-size: 18px;
  color: #94a3b8;
  margin-bottom: 30px;
  font-family: 'Segoe UI', sans-serif;
  font-weight: 300;
}

.controls-info {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px 30px;
  margin: 20px auto;
  max-width: 400px;
  text-align: left;
}
.controls-info p {
  font-family: 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #cbd5e1;
  margin: 8px 0;
  font-weight: 400;
}

.highscore {
  margin-top: 16px;
  font-size: 16px;
  color: var(--accent);
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 14px 40px;
  border: none;
  border-radius: 14px;
  font-family: 'Russo One', sans-serif;
  font-size: 18px;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: 1px;
  margin: 6px;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }

.btn-play {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #1a1a2e;
  box-shadow: 0 4px 20px rgba(245,158,11,0.3);
}
.btn-play:hover { box-shadow: 0 6px 30px rgba(245,158,11,0.5); }

.btn-resume {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 20px rgba(16,185,129,0.3);
}

.btn-quit {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
}
.btn-quit:hover { background: rgba(255,255,255,0.1); }

.btn-icon {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.12); transform: scale(1.1); }
.btn-icon.muted { opacity: .45; }

/* ── Game Screen ── */
#gameScreen {
  flex-direction: column;
  background: var(--bg-dark);
}

/* Home button fixed top-left */
.btn-home {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 80;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  text-decoration: none;
}
.btn-home:hover { background: rgba(255,255,255,0.08); transform: translateY(-2px); }
}

#gameCanvas {
  display: block;
  margin: 0 auto;
  border-radius: 0 0 12px 12px;
  cursor: none;
}

/* ── HUD ── */
#hud {
  width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: rgba(17,24,39,0.85);
  backdrop-filter: blur(12px);
  border-radius: 12px 12px 0 0;
  border: 1px solid var(--glass-border);
  border-bottom: none;
  z-index: 10;
}

.hud-left, .hud-right { display: flex; align-items: center; gap: 16px; }
.hud-center { display: flex; align-items: center; gap: 16px; }

.hud-level {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.progress-bar {
  width: 80px;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent3), #34d399);
  border-radius: 4px;
  transition: width .3s ease;
  width: 0%;
}
.progress-text {
  font-size: 10px;
  color: #64748b;
  font-family: 'Segoe UI', sans-serif;
}

.hud-score, .hud-best {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hud-label {
  font-size: 10px;
  color: #64748b;
  letter-spacing: 2px;
}
.hud-value {
  font-size: 32px;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(245,158,11,0.3);
}
.hud-value-sm {
  font-size: 20px;
  color: #94a3b8;
}

.hud-combo {
  background: linear-gradient(135deg, #ef4444, #f97316);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 16px;
  animation: comboPop .3s ease;
}

.hud-lives {
  font-size: 24px;
  letter-spacing: 4px;
}

.hud-buttons { display: flex; gap: 8px; }

/* ── Level Complete Overlay ── */
.level-complete { animation: fadeInUp .4s ease; }
.level-emoji {
  font-size: 72px;
  animation: float 2s ease-in-out infinite;
}
.level-sub {
  font-size: 16px;
  color: #94a3b8;
  margin-top: 8px;
  font-family: 'Segoe UI', sans-serif;
  font-weight: 400;
}

/* ── Pause Overlay ── */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,14,26,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 30;
}
.overlay-content {
  text-align: center;
  animation: fadeInUp .3s ease;
}
.overlay-content h2 {
  font-size: 48px;
  margin-bottom: 30px;
  color: var(--text);
}

/* ── Game Over ── */
.gameover-content {
  text-align: center;
  animation: fadeInUp .5s ease;
}

.gameover-emoji {
  font-size: 80px;
  animation: shake .5s ease;
}

.gameover-title {
  font-size: 56px;
  color: var(--accent2);
  text-shadow: 0 0 30px rgba(239,68,68,0.4);
  margin: 10px 0 20px;
}

.gameover-stats {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px 40px;
  margin: 20px auto;
  max-width: 350px;
  text-align: left;
}
.gameover-stats p {
  font-family: 'Segoe UI', sans-serif;
  font-size: 16px;
  color: #cbd5e1;
  margin: 10px 0;
  font-weight: 400;
}
.gameover-stats strong {
  color: var(--accent);
  font-family: 'Russo One', sans-serif;
}

.new-hs {
  text-align: center;
  font-size: 20px;
  color: var(--accent);
  animation: comboPop .5s ease;
  margin-top: 10px;
}

.gameover-buttons {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity:0; transform:translateY(30px); }
  to   { opacity:1; transform:translateY(0); }
}

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-15px); }
}

@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes comboPop {
  0%   { transform: scale(0.5); opacity:0; }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity:1; }
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-10px); }
  40%     { transform: translateX(10px); }
  60%     { transform: translateX(-6px); }
  80%     { transform: translateX(6px); }
}

/* ── Responsive ── */
@media (max-width: 1000px) {
  #gameCanvas { width: 100vw; height: auto; }
  #hud { width: 100vw; border-radius: 0; }
  .game-title { font-size: 42px; }
  .title-emoji { font-size: 60px; }
}
