@import url("https://fonts.googleapis.com/css2?family=Fugaz+One&family=Kanit:wght@400;600&display=swap");

:root {
  --bg1: #f7e9c5;
  --bg2: #f2c17d;
  --lane: #d8a85f;
  --lane-dark: #c99650;
  --accent: #0b3d2e;
  --ember: #1aa3b6;
  --danger: #b13d2a;
  --boost: #1b7f4d;
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.3);
  --shadow-color: rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at center, #2b3541, #0f161f);
  color: var(--accent);
  font-family: "Kanit", sans-serif;
  display: grid;
  place-items: center;
  min-height: 100vh;
  overflow: hidden;
}

.frame {
  position: relative;
  width: min(96vw, 1024px);
  aspect-ratio: 16 / 9;
  border: 4px solid var(--glass-border);
  border-radius: 20px;
  background: #f5d7a0;
  overflow: hidden;
  max-height: 94vh;
  touch-action: none;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255,255,255,0.2);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  border-radius: 16px;
}

.hud {
  position: absolute;
  top: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 24px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  z-index: 10;
}

.title {
  font-family: "Fugaz One", cursive;
  letter-spacing: 2px;
  font-size: 24px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ffdd77, #ff9900);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.meta {
  text-align: right;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  background: rgba(5, 10, 15, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-weight: 600;
  letter-spacing: 1px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 20;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.overlay h1 {
  font-family: "Fugaz One", cursive;
  margin: 0 0 16px;
  font-size: 4rem;
  background: linear-gradient(135deg, #00e5ff, #005ce6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 16px rgba(0, 150, 255, 0.6));
}

.overlay p {
  margin: 12px 0;
  font-size: 1.2rem;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

kbd {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 700;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.4);
  color: #ffd700;
  font-family: "Kanit", sans-serif;
  display: inline-block;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .frame {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    aspect-ratio: auto;
  }
  .hud {
    font-size: 12px;
    top: 10px; left: 10px; right: 10px;
    padding: 8px 12px;
  }
  .title { font-size: 16px; }
  .overlay h1 { font-size: 3rem; }
  .overlay p { font-size: 1rem; }
}
