@font-face {
  font-family: 'GT Sectra';
  src: url('../assets/fonts/GT-Sectra-Book.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F5F4F1;
  --text: #000000;
  --accent: #FF7A00;
  --accent-hover: #E56E00;
  --btn-bg: #000000;
  --btn-text: #FFFFFF;
  --success: #4A7C59;
  --danger: #C0392B;
  --card-bg: #FFFDF9;
  --border: #E0D8CC;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

#app {
  width: 100%;
  max-width: 480px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header */
header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 16px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Title & Lead */
.game-title {
  font-family: 'GT Sectra', Georgia, serif;
  font-size: 40px;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: 4px;
}

.game-lead {
  font-size: 14px;
  text-align: center;
  color: #000;
  line-height: 1.5;
  max-width: 340px;
  margin-bottom: 16px;
}

/* Age gate */
.age-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
}

.age-gate-title {
  font-family: 'GT Sectra', Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 24px;
}

.age-gate-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 280px;
}

.age-gate-buttons .btn {
  width: 100%;
}

.age-gate.fade-out {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.game-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-content.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Score display */
.score-display {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 30px;
  font-weight: 400;
}

.score-value {
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
}

.score-label {
  font-size: inherit;
  font-weight: inherit;
  text-transform: lowercase;
}

/* Lives row (hidden — rendered on canvas) */
.lives-row {
  display: none;
}

.lives-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.5;
  font-weight: 600;
  margin-right: 2px;
}

/* Hits display */
.hits-display {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.life {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  transition: opacity 0.3s, transform 0.3s;
}

.life.lost {
  opacity: 0;
  transform: translateY(100px);
}

@keyframes lifeLost {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  15% { transform: translateY(-8px) rotate(-5deg); opacity: 1; }
  40% { transform: translateY(20px) rotate(8deg); opacity: 0.8; }
  70% { transform: translateY(60px) rotate(-3deg); opacity: 0.4; }
  100% { transform: translateY(100px) rotate(5deg); opacity: 0; }
}

.life.losing {
  animation: lifeLost 0.6s ease forwards;
}

/* Canvas */
.canvas-container {
  width: 100%;
  aspect-ratio: 1;
  max-width: 400px;
  position: relative;
}

#game-canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

/* Point estimate */
.point-estimate {
  display: none;
}

/* Instructions */
.instructions {
  display: none;
}

/* Buttons */
.controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 400px;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--accent);
}

.btn-spin {
  flex: 1;
}

.btn {
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: capitalize;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:disabled {
  cursor: not-allowed;
}

.btn-accent:disabled {
  background: var(--border);
  color: rgba(0, 0, 0, 0.5);
  opacity: 1;
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
}

.btn-primary:hover:not(:disabled) {
  background: #000000;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.04);
}

.btn-accent {
  background: var(--accent);
  color: var(--btn-text);
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-hover);
}

/* Redeem section */
.redeem-section {
  width: 100%;
  text-align: center;
  margin-bottom: 16px;
}

.redeem-section h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.progress-bar-wrap {
  width: 100%;
  position: relative;
  padding-bottom: 48px;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-markers {
  position: relative;
  width: 100%;
  height: 0;
}

.progress-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.marker-line {
  width: 2px;
  height: 12px;
  background: var(--border);
  transition: background 0.3s;
}

.marker-btn {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 0;
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  cursor: default;
  transition: all 0.3s;
}

.marker-btn:disabled {
  color: rgba(0, 0, 0, 0.7);
  opacity: 1;
}

.marker-btn.redeemable {
  opacity: 1;
  cursor: pointer;
  color: var(--accent);
}

.marker-btn.redeemable:hover {
  color: var(--accent-hover);
}

.marker-pts {
  font-size: 13px;
  font-weight: 700;
}

.marker-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.marker-btn.redeemable .marker-label {
  opacity: 1;
}

/* Celebration modal */
.celebrate-content {
  text-align: center;
}

.celebrate-emoji {
  font-size: 48px;
  margin-bottom: 8px;
}

/* Share section */
.share-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.reset-link {
  font-size: 13px;
  color: #000;
  text-decoration: none;
  margin-top: -1px;
  transition: opacity 0.2s;
}

.reset-link:hover {
  color: #000;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  max-width: 340px;
  width: 90%;
}

.modal-content h3 {
  margin-bottom: 16px;
}

.coupon-code {
  font-size: 22px;
  font-weight: 700;
  font-family: monospace;
  background: var(--bg);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  letter-spacing: 2px;
  word-break: break-all;
}

.modal-content .btn {
  display: block;
  width: 100%;
  margin-bottom: 8px;
}

/* Subscribe modal */
.modal-desc {
  font-size: 14px;
  line-height: 1.5;
  color: #000;
  margin-bottom: 16px;
}

.modal-desc strong {
  color: var(--accent);
  opacity: 1;
}

.input-email {
  width: 100%;
  padding: 14px 20px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.input-email:focus {
  border-color: var(--accent);
}

.subscribe-error {
  font-size: 12px;
  color: var(--danger);
  margin-bottom: 8px;
  min-height: 16px;
}

/* Result overlay */
.result-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 50;
}

.result-text {
  font-size: 64px;
  font-weight: 700;
  animation: resultPop 1.2s ease-out forwards;
}

@keyframes resultPop {
  0% { transform: scale(0.3); opacity: 0; }
  30% { transform: scale(1.2); opacity: 1; }
  60% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

.result-text.hit {
  color: #FFFFFF;
  background: var(--accent);
  padding: 12px 40px;
  border-radius: 50px;
  font-size: 28px;
}

.result-text.miss {
  color: #FFFFFF;
  background: #000000;
  padding: 12px 40px;
  border-radius: 50px;
  font-size: 28px;
}

/* Score change animation */
@keyframes scoreBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.score-bounce {
  animation: scoreBounce 0.4s ease;
  display: inline-block;
}

/* Shake animation for misses */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.5s ease;
}

/* Decorative flowers */
.flower {
  position: fixed;
  bottom: 0;
  pointer-events: none;
  z-index: -1;
  transform: scale(0.667);
  transform-origin: bottom;
}

.flower-left {
  left: 0;
  transform-origin: bottom left;
}

.flower-right {
  right: 0;
  transform-origin: bottom right;
}

@media (max-width: 1024px) {
  .flower {
    transform: scale(0.5);
  }
}

@media (max-width: 768px) {
  .flower {
    transform: scale(0.333);
  }
  .game-active .game-title,
  .game-active .game-lead {
    display: none;
  }
}

@media (max-width: 480px) {
  .flower {
    transform: scale(0.167);
  }
}

/* Game Over modal */
.gameover-content {
  text-align: center;
  width: 60vw;
  max-width: 60vw;
}

.gameover-content h3 {
  font-family: 'GT Sectra', Georgia, serif;
  font-size: 40px;
  font-weight: 400;
  margin-bottom: 16px;
}

.gameover-cards {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.gameover-card {
  flex: 1;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gameover-card-img {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--border);
}

.gameover-card-img img {
  width: 100%;
  height: auto;
  display: block;
}

.gameover-card-title {
  font-family: 'GT Sectra', Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  text-align: center;
  line-height: 1.3;
}

.gameover-content .btn.btn-accent {
  width: auto;
  display: inline-block;
}

@media (max-width: 480px) {
  .gameover-content {
    width: 95vw;
    max-width: 95vw;
  }
  .gameover-content h3 {
    font-size: 37px;
  }
  .gameover-cards {
    gap: 8px;
  }
}
