/* ---------- VATSAL FONT ---------- */
@font-face {
  font-family: "Vatsal-logo";
  src: url("../../assets/data/vatsal-logo-font.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #FFF8E8;
  --card: #FFFFFF;
  --primary: #FF7A00;
  --secondary: #4FA8FF;
  --text: #222222;
  --border: #E8E0D0;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Pixelify Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ==========================================
SCREEN SYSTEM
========================================== */

.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.screen.active {
  display: flex;
}

.screen-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px clamp(16px, 5vw, 48px);
  overflow-y: auto;
}

.screen-body.center {
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ==========================================
VATSAL HEADER
========================================== */

.vatsal-home {
  font-family: "Vatsal-logo" !important;
  font-size: 20px !important;
  color: var(--text) !important;
  text-decoration: none;
  pointer-events: all;
  cursor: pointer;
}

.vatsal-home:hover {
  color: var(--primary) !important;
}

/* ==========================================
MENU / DIFFICULTY SCREENS
========================================== */

h1 { font-size: clamp(2.4rem, 8vw, 4rem); margin-bottom: 10px; }
h2 { font-size: clamp(1.4rem, 5vw, 2rem); margin-bottom: 20px; }

.emoji { font-size: clamp(50px, 12vw, 70px); margin-bottom: 20px; }
.subtitle { margin-top: 20px; opacity: .7; font-size: 0.9rem; }

.btn {
  width: min(340px, 100%);
  border: none;
  border-radius: 18px;
  padding: 16px;
  margin-top: 14px;
  cursor: pointer;
  font-size: 1.1rem;
  font-family: inherit;
  transition: .25s;
}

.btn:hover { transform: translateY(-3px); }
.btn:active { transform: scale(.97); }

.primary { background: var(--primary); color: white; }
.secondary { background: var(--secondary); color: white; }
.ghost { background: #f4f0e8; color: var(--text); }

.difficulty-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.difficulty-btn span {
  font-size: .8rem;
  opacity: .8;
}

/* ==========================================
GAME SCREEN
========================================== */

#gameScreen {
  background: #FDF6E6;
}

.game-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  position: relative;
  height: 100%;
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(1200px, 94vw);
  margin-bottom: 12px;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
}

.score {
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--primary);
  transition: .25s;
}

.score.pop { transform: scale(1.25); }

canvas {
  width: min(1200px, 94vw);
  max-height: calc(100vh - 140px);
  background: #FDF6E6;
  border-radius: 16px;
  border: 2px solid var(--border);
  display: block;
  touch-action: none;
}

.controls-box {
  text-align: center;
  padding: 6px;
  margin-bottom: 6px;
  color: #555;
  font-size: 0.85rem;
  min-height: 28px;
}

.pause-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
  z-index: 5;
}

.pause-btn:hover { transform: scale(1.1); }

/* ==========================================
WIN SCREEN
========================================== */

.trophy { font-size: clamp(50px, 12vw, 70px); margin-bottom: 16px; }
.final-score { font-size: 1.4rem; opacity: .7; margin-bottom: 8px; }

/* ==========================================
FOOTER IN WIN SCREEN
========================================== */

#winScreen .vatsal-related {
  width: min(420px, 92%);
  margin: 32px auto 0;
}

#winScreen .vatsal-related[hidden] {
  display: none !important;
}

.vatsal-footer a {
  color: var(--text) !important;
  opacity: .6;
}

/* ==========================================
MOBILE — VERTICAL CANVAS
========================================== */

@media (max-width: 768px) {

  /* Hide keyboard controls hint on mobile */
  .controls-box { display: none; }

  /* HUD stacks vertically for mobile portrait game */
  .hud {
    flex-direction: row;
    font-size: 0.75rem;
    width: 100%;
    padding: 0 8px;
  }

  .score { font-size: 1.2rem; }

  /* Canvas becomes portrait (tall) on mobile */
  canvas {
    width: min(340px, 90vw);
    /* height controlled by JS resizing canvas to 340x560 on mobile */
    border-radius: 12px;
  }

  .pause-btn {
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}