/* web/css/style.css */
:root {
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --color-bg: #f7f4ee;
  --color-card-bg: #ffffff;
  --color-text-main: #1a202c;
  --color-text-muted: #718096;
  --color-primary: #b7791f;
  --color-primary-dark: #975a16;
  --color-terracotta: #c05621;
  --color-gold: #ecc94b;
  --color-success: #38a169;
  --color-border: #e2e8f0;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
  --radius-lg: 16px;
  --radius-pill: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  user-select: none;
}

/* Screen Transitions */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  display: flex;
  opacity: 1;
  z-index: 10;
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #d69e2e 0%, #b7791f 100%);
  color: #ffffff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #b7791f 0%, #975a16 100%);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  background: #cbd5e0;
  color: #a0aec0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: #edf2f7;
  color: #4a5568;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-hint {
  background: #fefcbf;
  color: #744210;
  border: 1px solid #ecc94b;
  padding: 8px 14px;
  font-size: 13px;
}

.btn-circle {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-text-main);
  border: 1px solid var(--color-border);
  font-size: 18px;
  font-weight: bold;
}

/* ============================================================
   Screen 1: Cover
   ============================================================ */
#screen-cover {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cover-card {
  max-width: 440px;
  width: 100%;
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.cover-visual {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #000;
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-content {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.badge-mini {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--color-primary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.main-title {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.25;
  color: var(--color-text-main);
  margin-bottom: 12px;
}

.subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ============================================================
   Screen 2: Interactive Game Screen
   ============================================================ */
#screen-game {
  flex-direction: column;
  background: #1a202c;
}

.game-hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 20;
}

.hud-instruction {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: #2d3748;
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-controls {
  display: flex;
  gap: 6px;
}

.game-viewport {
  flex: 1;
  width: 100%;
  height: calc(100% - 146px);
  margin-top: 56px;
  position: relative;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background: #111;
}

.game-viewport:active {
  cursor: grabbing;
}

.game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 2752px;
  height: 1536px;
  transform-origin: 0 0;
  will-change: transform;
}

.game-canvas img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* Game Bottom HUD */
.game-hud-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 12px;
  z-index: 20;
}

.tokens-tray {
  display: flex;
  align-items: center;
  gap: 12px;
}

.target-token {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s ease;
}

.token-avatar {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid var(--color-gold);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.token-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.check-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-success);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

.target-token.found .token-avatar {
  border-color: var(--color-success);
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(56, 161, 105, 0.5);
}

.target-token.found .check-badge {
  opacity: 1;
  transform: scale(1);
}

.token-name {
  font-size: 11px;
  font-weight: 700;
  color: #4a5568;
}

.mystery-avatar {
  background: #cbd5e0;
  border-color: #a0aec0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.question-mark {
  font-size: 24px;
  font-weight: 800;
  color: #718096;
}

.target-token.mystery.revealed .mystery-avatar {
  background: linear-gradient(135deg, #f6ad55, #ecc94b);
  border-color: var(--color-primary);
  animation: pulse-glow 1.5s infinite;
}

.target-token.mystery.revealed .question-mark {
  color: #ffffff;
}

@keyframes pulse-glow {
  0% { transform: scale(1); box-shadow: 0 0 4px rgba(236, 201, 75, 0.6); }
  50% { transform: scale(1.1); box-shadow: 0 0 16px rgba(236, 201, 75, 0.9); }
  100% { transform: scale(1); box-shadow: 0 0 4px rgba(236, 201, 75, 0.6); }
}

/* Hit halo animation */
.found-halo {
  position: absolute;
  width: 80px;
  height: 80px;
  margin-left: -40px;
  margin-top: -40px;
  border-radius: 50%;
  border: 4px solid #ecc94b;
  box-shadow: 0 0 20px #ecc94b;
  pointer-events: none;
  animation: halo-anim 1.2s ease-out forwards;
  z-index: 15;
}

@keyframes halo-anim {
  0% { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ============================================================
   Screens 3, 4, 5: Editorial & Celebration Cards
   ============================================================ */
#screen-teaser, #screen-reveal, #screen-outro {
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.editorial-card {
  max-width: 480px;
  width: 100%;
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ornament, .sparkles {
  font-size: 16px;
  color: var(--color-primary);
  letter-spacing: 4px;
  margin-bottom: 12px;
}

.editorial-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text-main);
  margin-bottom: 20px;
}

.teaser-photo-wrapper, .reveal-photo-wrapper {
  width: 100%;
  max-height: 42vh;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editorial-img {
  max-width: 100%;
  max-height: 42vh;
  object-fit: contain;
  display: block;
}

.editorial-teaser {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 19px;
  font-weight: 600;
  color: var(--color-terracotta);
  margin-bottom: 24px;
}

/* Screen 4: Reveal specific */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.reveal-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--color-text-main);
  margin-bottom: 12px;
}

.heart-pulse {
  font-size: 28px;
  margin-bottom: 16px;
  animation: heart-beat 1.4s infinite;
}

@keyframes heart-beat {
  0% { transform: scale(1); }
  14% { transform: scale(1.2); }
  28% { transform: scale(1); }
  42% { transform: scale(1.2); }
  70% { transform: scale(1); }
}

.date-announcement {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-terracotta);
  letter-spacing: 0.5px;
  margin-bottom: 24px;
}

/* Screen 5: Outro specific */
.outro-card {
  max-width: 480px;
  width: 100%;
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: center;
}

.outro-visual {
  width: 100%;
  max-height: 44vh;
  overflow: hidden;
  background: #000;
}

.outro-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.outro-content {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.outro-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 24px;
}

.outro-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

@media (min-width: 600px) {
  .outro-actions {
    flex-direction: row;
    justify-content: center;
  }
}
