:root {
    --bg: #0e0f1a;
    --text: #f8f9ff;
    --muted: #c6c7d1;
    --accent: #ff5fa2;
    --accent-2: #6c5ce7;
    --box: #ffd166;
    --box-shadow: #b08900;
    --lid: #ff006e;
    --lid-shadow: #b0004b;
    --success: #2dd4bf;
  }
  
  * { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  html, body {
    height: 100%;
    margin: 0;
    font-family: 'Fredoka', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
    background: radial-gradient(1200px 800px at 50% -10%, #1c1d2a, var(--bg));
    color: var(--text);
  }

  body {
    background-image: url('./assets/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
  
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 16px 28px;
  }
  
  .title {
    text-align: center;
    font-size: 50px;
    line-height: 1.2;
    margin: 50px 0 0;
  }
  
  .subtitle {
    text-align: center;
    color: var(--muted);
    margin: 2px 0 12px;
    font-size: 24px;
  }
  
.stage {
    display: grid;
    place-items: center;
    position: relative; /* allow reward overlay positioning */
    flex: 1;
    min-height: 0;
  }
  
  .present {
    position: relative;
    width: min(90vw, 500px);
    height: min(67.5vw, 375px);
    touch-action: none; /* we manage gestures */
    -ms-touch-action: none;
  }
  
  .box-base {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
  }
  
  .box-lid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform-origin: 50% 50%;
    transform: translateY(0) rotate(0deg);
    transition: transform 280ms cubic-bezier(.2,.9,.2,1);
    will-change: transform;
    z-index: 2;
  }
  
  .box-lid.open { transform: translateY(-50%) rotate(-8deg); }

  /* Images fill the entire container */
  #boxBaseImg, #boxLidImg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
  }
  
  .helper, .desktop-note {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    margin: 8px 0 0;
  }
  
  .reward {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(85vw, 450px);
    text-align: center;
    padding: 20px 24px;
    border-radius: 16px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.08);
    display: none;
    z-index: 10;
  }
  
  .reward.show {
    display: block;
    animation: fadeInOverlay 250ms ease-out;
  }

  .reward h2 {
    font-size: 24px;
    margin: 8px 0 12px;
  }

  .reward p {
    font-size: 16px;
    margin: 0 0 12px;
    color: var(--text);
  }

  .reward .instructions {
    list-style: disc;
    text-align: left;
    margin: 0 auto;
    padding: 0;
    list-style-position: inside;
    max-width: 90%;
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
  }

  .reward .instructions li {
    margin-bottom: 6px;
  }
  
  .btn {
    font: inherit;
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    color: #0a0b12;
    background: linear-gradient(135deg, var(--success), #9ef1df);
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Opacity-only to avoid overriding centering transform */
  @keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  /* Simple confetti dots */
  .confetti {
    position: absolute;
    pointer-events: none;
    inset: 0;
  }
  
  .confetti::before, .confetti::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle at 10% 20%, #ffadad 6px, transparent 7px),
      radial-gradient(circle at 80% 30%, #ffd6a5 6px, transparent 7px),
      radial-gradient(circle at 30% 70%, #fdffb6 6px, transparent 7px),
      radial-gradient(circle at 60% 60%, #caffbf 6px, transparent 7px),
      radial-gradient(circle at 50% 10%, #9bf6ff 6px, transparent 7px),
      radial-gradient(circle at 20% 50%, #bdb2ff 6px, transparent 7px);
    opacity: 0;
    transform: translateY(0);
  }
  
  .confetti.burst::before,
  .confetti.burst::after {
    animation: confetti 1000ms ease-out forwards;
  }
  
  @keyframes confetti {
    0%   { opacity: 0; transform: translateY(0) scale(0.9); }
    20%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(40px) scale(1.1); }
  }
  
  /* Desktop/Tablet Warning */
  .desktop-warning {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
  }

  .warning-content {
    text-align: center;
    max-width: 600px;
    background: rgba(255,255,255,0.1);
    padding: 40px 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  }

  .warning-content h1 {
    font-size: 48px;
    margin: 0 0 20px;
    color: #fff;
  }

  .warning-content p {
    font-size: 20px;
    line-height: 1.6;
    margin: 15px 0;
    color: rgba(255,255,255,0.95);
  }

  /* Debug info */
  .debug {
    display: none; /* Disabled for production */
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.8);
    color: lime;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    z-index: 999;
  }

  .debug p {
    margin: 4px 0;
  }

  /* Responsive tweaks */
  @media (min-width: 740px) {
    .title { font-size: 52px; }
    .subtitle { font-size: 28px; }
  }


