/* ── Tasty Travels: Cocktail Merge Shooter ─────────────────────────────── */

* { box-sizing:border-box; margin:0; padding:0;
    user-select:none; -webkit-user-select:none; touch-action:none; }

body {
  background:#111;
  height:100vh; height:100dvh;
  display:flex; justify-content:center; align-items:center;
  overflow:hidden;
  font-family:'Fredoka', sans-serif;
  touch-action:none;
}

/* ── Container ───────────────────────────────────────────────────────────── */
#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  /* Maintain exact 575:1024 aspect ratio on all screen widths/heights */
  max-width: calc(100vh * 575 / 1024);
  max-height: calc(100vw * 1024 / 575);
  aspect-ratio: 575 / 1024;
  background: #000;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

/* HUD and tickets are drawn directly on the canvas to align perfectly with the background image */

/* ── Game Canvas ─────────────────────────────────────────────────────────── */
#game-canvas {
  position:absolute; top:0; left:0; width:100%; height:100%;
  z-index:20; pointer-events:auto; /* receives touch input */
}

/* ── Game Over ───────────────────────────────────────────────────────────── */
.gameover {
  position:absolute; inset:0;
  background:rgba(0,0,0,.82); backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center;
  z-index:100; transition:opacity .3s;
}
.gameover.hidden { opacity:0; pointer-events:none; }

.gameover-card {
  width:78%; background:#fffef9;
  border:5px solid #d4a55a; border-radius:22px;
  padding:36px 20px; text-align:center;
  box-shadow:0 20px 40px rgba(0,0,0,.55);
  animation:popIn .35s cubic-bezier(.175,.885,.32,1.275);
}
.gameover-title { font-family:'Fredoka One',cursive; font-size:32px; color:#c00; margin-bottom:10px; }
.gameover-coins { font-size:18px; color:#333; margin-bottom:26px; }
.game-btn {
  font-family:'Fredoka One',cursive; font-size:22px; color:#fff;
  background:linear-gradient(180deg,#ffb703,#f08000);
  border:none; border-radius:28px; padding:11px 36px; cursor:pointer;
  box-shadow:0 6px 0 #a05800, 0 8px 16px rgba(0,0,0,.3);
  transition:transform .1s, box-shadow .1s;
  outline: none;
}
.game-btn:active { transform:translateY(4px); box-shadow:0 2px 0 #a05800; }

/* ── Keyframes ───────────────────────────────────────────────────────────── */
@keyframes ticketSway {
  0%,100%{ transform:rotate(-1.5deg); }
  50%     { transform:rotate(1.5deg); }
}
@keyframes popIn {
  from { transform:scale(.65); opacity:0; }
  to   { transform:scale(1);   opacity:1; }
}

/* ── HUD Buttons ── */
.hud-btn {
  position: absolute;
  width: 9.0%; /* modern, compact icon sizing */
  aspect-ratio: 1 / 1;
  background: none;
  border: none;
  box-shadow: none;
  cursor: pointer;
  z-index: 50; /* above game-canvas, below gameover overlay */
  transition: transform 0.1s;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}
.hud-btn.hidden {
  display: none;
}
.hud-btn:active {
  transform: scale(0.85);
}
.hud-btn svg {
  width: 100%;
  height: 100%;
}

#replay-btn {
  top: 15.1%;
  left: 4.5%;
}

#pause-btn {
  top: 21.0%;
  left: 4.5%;
  width: 10.8%;
}

#settings-btn {
  top: 19.5%;
  right: 4.5%;
}

/* ── Back to Home Button ── */
.back-home-btn {
  position: absolute;
  top: 9.4%; /* positioned below the game logo with a small spacing */
  left: 4.5%; /* aligned on the left side of the screen */
  width: 8.0%;
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #fffef9;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.55);
  transition: transform 0.1s, background 0.1s;
  text-decoration: none;
  outline: none;
}
.back-home-btn:active {
  transform: scale(0.85);
}
.back-home-btn svg {
  width: 55%;
  height: 55%;
  stroke: #fffef9;
}

/* ── Start Screen Cover & Glassmorphic Overlay ── */
#start-screen {
  background: url('assets/juice_merge_game_home.png') no-repeat center center;
  background-size: cover;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12%;
}

#start-screen .gameover-card {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  color: #ffffff;
  padding: 0;
  width: auto;
}

#start-screen .gameover-title {
  display: none;
}

@keyframes pulse-btn {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 8px 0 #b35000, 0 14px 28px rgba(0, 0, 0, 0.55); }
  100% { transform: scale(1); }
}

#start-screen #start-btn {
  background: linear-gradient(180deg, #ffc83b, #ff8008);
  box-shadow: 0 6px 0 #b35000, 0 10px 20px rgba(0, 0, 0, 0.45);
  font-size: 24px;
  padding: 14px 44px;
  border-radius: 32px;
  transition: transform 0.1s, box-shadow 0.1s;
  animation: pulse-btn 1.8s infinite ease-in-out;
  transform-origin: center;
}

#start-screen #start-btn:active {
  transform: translateY(4px) scale(0.95);
  box-shadow: 0 2px 0 #b35000;
  animation: none;
}

