:root {
  --bg: #071228;
  --accent: #9be7ff;
  --muted: #c8dbe8
}

* {
  box-sizing: border-box;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial
}

html,
body,
#hero {
  height: 100%
}

body {
  margin: 0;
  background: linear-gradient(180deg, #071228 0%, #0f2940 100%);
  color: #e7f6ff
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column
}

.hero {
  display: grid;
  place-items: center;
  padding: 6rem 1rem;
  height: 60vh;
  position: relative;
}

.hero-overlay {
  text-align: center;
  max-width: 900px;
  background: rgba(7, 18, 40, 0.75);
  padding: 2rem;
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  margin: 0 0 .5rem
}

.subtitle {
  color: var(--muted);
  margin: 0 0 1.25rem
}

.actions {
  display: flex;
  gap: 1rem;
  justify-content: center
}

.music-controls {
  display: flex;
  gap: .6rem;
  align-items: center;
  justify-content: center;
  margin-top: .8rem;
  color: var(--muted)
}

.muted {
  color: var(--muted);
  font-size: .95rem
}

.btn {
  background: var(--accent);
  color: #042033;
  border: 0;
  padding: .6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600
}

.btn.secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted)
}

.btn.small {
  padding: .4rem .6rem;
  font-size: .9rem
}

/* accessibility helper */
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

.game-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem
}

.hidden {
  display: none
}

.hud {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 900px;
  margin-bottom: .5rem;
  color: var(--muted)
}

#game-canvas {
  background: linear-gradient(#082032, #06202a);
  border-radius: 12px;
  max-width: 100%;
  width: 900px;
  height: 540px
}

.controls-note {
  color: var(--muted);
  margin-top: .5rem
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45)
}

.modal-content {
  background: #ffffff11;
  padding: 1.25rem;
  border-radius: 12px;
  min-width: 320px;
  max-width: 700px;
  color: #eaf6ff
}

.ticket {
  display: flex;
  gap: 1rem;
  align-items: center
}

.ticket-poster {
  width: 150px;
  height: 110px;
  background: linear-gradient(180deg, #31556d, #183b46);
  background-image: url('https://upload.wikimedia.org/wikipedia/commons/6/6e/David_Attenborough_2015.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.ticket-body {
  flex: 1;
}

.footer {
  margin-top: auto;
  padding: 1rem;
  text-align: center;
  color: var(--muted)
}

.scratch-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
}

.scratch-content {
  position: relative;
  width: 90vw;
  max-width: 800px;
  height: 70vh;
  max-height: 600px;
  background: url('https://upload.wikimedia.org/wikipedia/commons/6/6e/David_Attenborough_2015.jpg') center/cover no-repeat,
              linear-gradient(135deg, #1a4d6d 0%, #0f2940 100%);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #fff;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.scratch-gift-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}

.scratch-gift-text h2 {
  font-size: 4rem;
  font-weight: 700;
  margin: 0 0 1rem;
  text-shadow: 2px 2px 12px rgba(0,0,0,0.9);
}

.scratch-gift-text p {
  font-size: 2rem;
  font-weight: 600;
  margin: 0.5rem 0;
  text-shadow: 1px 1px 6px rgba(0,0,0,0.9);
}

.scratch-gift-text #countdown-scratch {
  font-size: 1.8rem;
  color: #9be7ff;
  margin-top: 1rem;
}

#scratch-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  cursor: grab;
  z-index: 10;
  background: #c8c8c8;
}

#scratch-canvas:active {
  cursor: grabbing;
}

@media (max-width:720px) {
  #game-canvas {
    width: calc(100vw - 40px);
    height: calc((100vw - 40px) * 0.6)
  }

  .hero {
    padding: 3rem 1rem;
    height: 50vh
  }
}