:root {
  --level-color: #ff003d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  height: 100dvh;
  background: var(--level-color);
  transition: background 1.5s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  font-family: "Courier New", Courier, monospace;
}

.page {
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 20px 8px;
  gap: 6px;
}

.logo {
  max-width: 320px;
  max-height: 110px;
  display: block;
  align-self: center;
  user-select: none;
  -webkit-user-drag: none;
  position: relative;
  z-index: 5;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top center;
}

.logo--splash {
  transform: scale(1.6);
}

.game-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: visible;
  position: relative;
  flex: 1;
  min-height: 0;
}

.cassette-tray {
  width: 100%;
  position: relative;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.cassette-slot {
  width: 100%;
  height: 100%;
  transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.cassette-slot--offscreen {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  transform: translateX(110%);
}

.game-canvas {
  display: block;
  width: 100%;
  background: transparent;
  position: relative;
  z-index: 0;
  margin-bottom: -10px;
}

.cassette {
  display: block;
  max-height: 100%;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  user-select: none;
  -webkit-user-drag: none;
  position: relative;
  z-index: 1;
}

@keyframes cassette-jump {
  0%   { transform: rotate(0deg) scale(1); }
  25%  { transform: rotate(-2.5deg) scale(1.02); }
  75%  { transform: rotate(1.5deg) scale(0.99); }
  100% { transform: rotate(0deg) scale(1); }
}

.cassette-bounce {
  animation: cassette-jump 0.45s ease-out;
  transform-origin: center bottom;
}

.controls-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.btn-restart {
  padding: 12px 24px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  background: transparent;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: none;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.01em;
}

.btn-help {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: transparent;
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: none;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
}

.btn-jump {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 999px;
  background: white;
  color: var(--level-color);
  font-size: 1.5rem;
  font-weight: 900;
  cursor: pointer;
  touch-action: none;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.02em;
}

.hint {
  margin: 0;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

.level-label {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.6875rem;
  font-weight: 700;
  text-align: center;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hint-sound {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  font-family: 'Inter', sans-serif;
}

.album-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 20;
  user-select: none;
  -webkit-user-drag: none;
}

.btn-listen {
  display: none;
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 999px;
  background: white;
  color: var(--level-color);
  font-size: 1.5rem;
  font-weight: 900;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.instructions {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.instructions-card {
  background: white;
  border-radius: 20px;
  padding: 28px 24px 24px;
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.instructions-title {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--level-color);
  text-align: center;
}

.instructions-list {
  margin: 0;
  padding: 0 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  color: #111;
  line-height: 1.4;
}

.instructions-close {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 999px;
  background: var(--level-color);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  touch-action: none;
}

.crash-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.crash-board {
  position: absolute;
  display: none;
  transform-origin: center center;
}
