/* ==========================================================================
   🎮 MERONA RETRO 8-BIT / 16-BIT WEDDING INVITATION STYLESHEET
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Silkscreen:wght@400;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* --- CSS Variables & Design Tokens --- */
:root {
  --font-pixel: 'Press Start 2P', monospace;
  --font-retro: 'Silkscreen', cursive;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Palette */
  --bg-dark: #0d0f1f;
  --bg-card: #171b36;
  --bg-card-alt: #20264d;
  --border-gold: #f5c842;
  --border-gold-glow: rgba(245, 200, 66, 0.4);
  --color-gold: #fcd34d;
  --color-pink: #ff5e84;
  --color-purple: #a855f7;
  --color-blue: #38bdf8;
  --color-green: #34d399;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  /* Game Elements */
  --card-w: 48px;
  --card-h: 60px;
  --tray-w: 390px;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* CRT Screen Effect Overlay */
body.crt-active::after {
  content: " ";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
              linear-gradient(90deg, rgba(255, 0, 0, 0.04), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.04));
  z-index: 9999;
  background-size: 100% 3px, 6px 100%;
  pointer-events: none;
}

/* --- Layer Architecture --- */
.app-layer {
  display: none;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

.app-layer.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   🕹️ LAYER 1: RETRO WELCOME SCREEN
   ========================================================================== */
#layer-1-welcome {
  background: radial-gradient(circle at 50% 30%, #201a45 0%, #0d0f1f 75%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

#layer-1-welcome.active {
  display: flex;
}

/* Retro Arcade Stars & Background Grid */
.welcome-grid-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(168, 85, 247, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

/* Arcade Cabinet HUD Bar */
.arcade-top-hud {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--color-gold);
  text-shadow: 2px 2px 0 #000;
  z-index: 10;
}

.hud-item {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hud-blink {
  animation: pixelBlink 1s infinite steps(1);
}

@keyframes pixelBlink {
  50% { opacity: 0; }
}

/* Welcome Container Box */
.welcome-container {
  max-width: 540px;
  width: 100%;
  background: rgba(23, 27, 54, 0.92);
  border: 4px solid var(--border-gold);
  border-radius: 12px;
  box-shadow: 0 0 25px var(--border-gold-glow), inset 0 0 15px rgba(0, 0, 0, 0.8);
  padding: 30px 24px;
  text-align: center;
  position: relative;
  z-index: 5;
  margin-top: 30px;
}

.welcome-corner-decor {
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: var(--border-gold);
}
.corner-tl { top: -2px; left: -2px; }
.corner-tr { top: -2px; right: -2px; }
.corner-bl { bottom: -2px; left: -2px; }
.corner-br { bottom: -2px; right: -2px; }

/* Game Title */
.game-title-tag {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--color-blue);
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.game-main-title {
  font-family: var(--font-pixel);
  font-size: 20px;
  line-height: 1.4;
  color: #fff;
  text-shadow: 3px 3px 0 #ff5e84, 5px 5px 0 #000;
  margin-bottom: 12px;
}

.game-subtitle {
  font-family: var(--font-retro);
  font-size: 13px;
  color: var(--color-gold);
  letter-spacing: 1px;
  margin-bottom: 20px;
}

/* Pixel Art Centerpiece & Floating Hearts */
.pixel-couple-stage {
  position: relative;
  margin: 10px auto 22px;
  width: 250px;
  height: 250px;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid #ff5e84;
  box-shadow: 0 0 20px rgba(255, 94, 132, 0.4);
}

.pixel-couple-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transform: scale(1.02);
  transition: transform 0.5s ease;
}

.pixel-couple-stage:hover img {
  transform: scale(1.06);
}

/* Floating Pixel Hearts */
.floating-hearts-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}

.pixel-heart {
  position: absolute;
  font-size: 18px;
  animation: floatHeart 3.5s infinite ease-in;
}

.h1 { left: 15%; animation-delay: 0s; }
.h2 { left: 50%; animation-delay: 1.2s; font-size: 22px; }
.h3 { left: 80%; animation-delay: 2.1s; }

@keyframes floatHeart {
  0% { transform: translateY(180px) scale(0.6); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 0.9; }
  100% { transform: translateY(-30px) scale(1.2); opacity: 0; }
}

/* Retro RPG Dialogue Box for Guest */
.guest-dialogue-box {
  background: #0f1226;
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 24px;
  position: relative;
  text-align: left;
}

.guest-dialogue-box::before {
  content: "NPC / HERALD";
  position: absolute;
  top: -9px;
  left: 14px;
  background: var(--border-gold);
  color: #000;
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 1px 6px;
  font-weight: bold;
  border-radius: 3px;
}

.guest-greeting-title {
  font-family: var(--font-retro);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.guest-target-name {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--color-gold);
  line-height: 1.5;
  word-break: break-word;
}

.guest-invitation-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Big Flashing START Button */
.btn-press-start {
  font-family: var(--font-pixel);
  font-size: 14px;
  background: linear-gradient(180deg, #ff5e84 0%, #e11d48 100%);
  color: #fff;
  border: 3px solid #fff;
  border-radius: 8px;
  padding: 16px 28px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 6px 0 #9f1239, 0 10px 20px rgba(225, 29, 72, 0.4);
  transition: all 0.15s ease;
  position: relative;
  text-shadow: 2px 2px 0 #000;
}

.btn-press-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #9f1239, 0 14px 25px rgba(225, 29, 72, 0.5);
  background: linear-gradient(180deg, #ff7597 0%, #f43f5e 100%);
}

.btn-press-start:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #9f1239, 0 4px 10px rgba(225, 29, 72, 0.3);
}

.start-hint {
  font-family: var(--font-retro);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 12px;
  letter-spacing: 1px;
}

/* ==========================================================================
   🎮 LAYER 2: DETAIL UNDANGAN PERNIKAHAN (THE WEDDING QUEST)
   ========================================================================== */
#layer-2-invitation {
  background: #0d0f1f;
  padding-bottom: 60px;
}

/* Floating Retro HUD Toolbar */
.floating-retro-hud {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 18, 38, 0.92);
  border: 2px solid var(--border-gold);
  border-radius: 30px;
  padding: 6px 14px;
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.hud-btn {
  background: #20264d;
  color: #fff;
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.hud-btn:hover {
  background: var(--color-purple);
}

.hud-btn.active {
  background: #10b981;
  border-color: #34d399;
}

/* Main Container */
.invitation-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 70px 16px 20px;
}

/* Section Box Retro Styling */
.retro-section {
  background: var(--bg-card);
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  padding: 28px 22px;
  margin-bottom: 30px;
  position: relative;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.section-badge-icon {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  border: 2px solid var(--border-gold);
  color: var(--color-gold);
  font-family: var(--font-pixel);
  font-size: 11px;
  padding: 4px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

/* Section Headings */
.section-title {
  font-family: var(--font-pixel);
  font-size: 14px;
  text-align: center;
  color: var(--color-gold);
  margin-top: 10px;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.section-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

/* Ayat / Basmalah */
.bismillah-text {
  font-size: 20px;
  text-align: center;
  margin-bottom: 12px;
  color: var(--color-gold);
  font-family: 'Amiri', serif, var(--font-body);
}

.quran-quote {
  font-size: 13px;
  font-style: italic;
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.quran-ref {
  font-family: var(--font-retro);
  font-size: 11px;
  text-align: center;
  color: var(--color-pink);
}

/* Character Profiles: Player 1 & Player 2 */
.couple-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 16px;
}

@media (max-width: 600px) {
  .couple-grid {
    grid-template-columns: 1fr;
  }
}

.player-card {
  background: var(--bg-card-alt);
  border: 2px solid #334155;
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.player-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-gold);
}

.player-tag {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.tag-p1 { background: #1e3a8a; color: #93c5fd; border: 1px solid #3b82f6; }
.tag-p2 { background: #831843; color: #fbcfe8; border: 1px solid #ec4899; }

.player-avatar-circle {
  width: 90px;
  height: 90px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid var(--border-gold);
  overflow: hidden;
  background: #0f1226;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.player-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.player-name {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.4;
}

.player-role {
  font-size: 12px;
  color: var(--color-gold);
  margin-bottom: 10px;
  font-weight: 600;
}

.player-parents {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #334155;
}

/* RPG Stats Bar inside Player Card */
.player-rpg-stats {
  font-family: var(--font-pixel);
  font-size: 8px;
  text-align: left;
  background: #0b0d1b;
  padding: 8px 10px;
  border-radius: 6px;
  margin-top: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.stat-row:last-child {
  margin-bottom: 0;
}

.stat-label { color: var(--text-muted); }
.stat-val-hp { color: #34d399; }
.stat-val-mp { color: #38bdf8; }
.stat-val-skill { color: var(--color-gold); font-size: 7px; }

/* Countdown Quest Timer */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0 20px;
}

.countdown-box {
  background: #0b0d1b;
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  padding: 12px 6px;
  text-align: center;
}

.countdown-val {
  font-family: var(--font-pixel);
  font-size: 20px;
  color: var(--color-gold);
  display: block;
  text-shadow: 2px 2px 0 #000;
}

.countdown-lbl {
  font-family: var(--font-retro);
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
  letter-spacing: 1px;
}

/* Event Schedules (Akad & Resepsi) */
.event-quest-card {
  background: var(--bg-card-alt);
  border: 2px solid #334155;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
  position: relative;
}

.event-quest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #334155;
}

.event-quest-badge {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--color-gold);
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-details-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
  font-size: 13px;
}

.event-details-icon {
  font-size: 16px;
  min-width: 22px;
}

.event-details-content strong {
  display: block;
  color: #fff;
}

.event-details-content span {
  color: var(--text-secondary);
  font-size: 12px;
}

/* Map Section */
.venue-map-wrapper {
  margin-top: 14px;
  border: 2px solid var(--border-gold);
  border-radius: 10px;
  overflow: hidden;
  height: 240px;
}

.venue-map-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.venue-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-secondary-retro {
  flex: 1;
  background: #20264d;
  color: #fff;
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  font-family: var(--font-retro);
  font-size: 11px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-secondary-retro:hover {
  background: var(--color-purple);
  transform: translateY(-2px);
}

/* Prewedding Memory Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.gallery-item {
  position: relative;
  border: 2px solid #334155;
  border-radius: 10px;
  overflow: hidden;
  background: #0f1226;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.gallery-item:hover {
  transform: scale(1.02);
  border-color: var(--color-pink);
}

.gallery-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
}

.gallery-caption {
  font-family: var(--font-retro);
  font-size: 10px;
  padding: 6px 10px;
  background: rgba(15, 18, 38, 0.95);
  color: var(--text-secondary);
  text-align: center;
}

/* RSVP & Wishes */
.rsvp-form-group {
  margin-bottom: 14px;
}

.rsvp-form-group label {
  display: block;
  font-family: var(--font-retro);
  font-size: 11px;
  color: var(--color-gold);
  margin-bottom: 6px;
}

.retro-input, .retro-select, .retro-textarea {
  width: 100%;
  background: #0f1226;
  border: 2px solid #334155;
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.retro-input:focus, .retro-select:focus, .retro-textarea:focus {
  border-color: var(--border-gold);
}

.wishes-container {
  margin-top: 24px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
}

.wish-card {
  background: var(--bg-card-alt);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.wish-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.wish-avatar {
  font-size: 20px;
}

.wish-meta {
  flex: 1;
}

.wish-author {
  font-size: 12px;
  color: #fff;
  display: block;
}

.wish-tag {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-retro);
}

.status-hadir { background: #065f46; color: #a7f3d0; border: 1px solid #10b981; }
.status-ragu-ragu { background: #854d0e; color: #fde68a; border: 1px solid #f59e0b; }
.status-berhalangan { background: #7f1d1d; color: #fecaca; border: 1px solid #ef4444; }

.wish-time {
  font-size: 10px;
  color: var(--text-muted);
}

.wish-message {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.wish-empty-state {
  text-align: center;
  padding: 32px 16px;
  background: var(--bg-card-alt);
  border: 1px dashed var(--border-arcade);
  border-radius: 6px;
  margin-top: 14px;
}
.wish-empty-state .empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.wish-empty-state .empty-text {
  font-size: 13px;
  color: #e2e8f0;
  font-family: var(--font-retro);
  margin-bottom: 4px;
}
.wish-empty-state .empty-subtext {
  font-size: 11px;
  color: var(--text-muted);
}

/* Digital Envelope & Gift */
.bank-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 540px) {
  .bank-cards-grid {
    grid-template-columns: 1fr;
  }
}

.bank-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid var(--border-gold);
  border-radius: 10px;
  padding: 16px;
  position: relative;
}

.bank-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bank-logo-text {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--color-blue);
}

.bank-acc-number {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--color-gold);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.bank-acc-holder {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.btn-copy-account {
  width: 100%;
  background: #20264d;
  color: #fff;
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  font-family: var(--font-retro);
  font-size: 10px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-account:hover {
  background: var(--color-purple);
}

/* ==========================================================================
   🚪 DOORPRIZE GATEWAY (FOOTER LAYER 2 -> LAYER 3)
   Exact styling according to BRIEF-LAYER-3-AND-GATEWAY.md
   ========================================================================== */
.gamification-cta-wrapper {
  background: radial-gradient(circle at 50% 50%, #2a1f54 0%, #171b36 100%);
  border: 3px solid var(--border-gold);
  border-radius: 16px;
  padding: 34px 24px;
  text-align: center;
  box-shadow: 0 0 30px var(--border-gold-glow);
  position: relative;
  overflow: hidden;
  margin-top: 40px;
}

.cta-trophy-badge {
  font-size: 42px;
  margin-bottom: 8px;
  animation: bounceTrophy 2s infinite ease-in-out;
}

@keyframes bounceTrophy {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.cta-heading {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--color-gold);
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 12px;
}

.cta-subtext {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.cta-subtext strong {
  color: var(--color-pink);
}

.btn-level-up {
  font-family: var(--font-pixel);
  font-size: 13px;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: 3px solid #6ee7b7;
  border-radius: 10px;
  padding: 16px 30px;
  cursor: pointer;
  box-shadow: 0 6px 0 #047857, 0 10px 25px rgba(16, 185, 129, 0.4);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-shadow: 1px 1px 0 #000;
}

.btn-level-up:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
}

.btn-level-up:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #047857;
}

/* ==========================================================================
   🎮 LAYER 3: GAME COCOKI HARD MODE
   ========================================================================== */
#layer-3-game {
  background: #090b16;
  padding: 16px 12px 40px;
  display: none;
}

#layer-3-game.active {
  display: block;
}

.game-top-bar {
  max-width: 440px;
  margin: 0 auto 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-return-invitation {
  background: #20264d;
  color: #fff;
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  font-family: var(--font-retro);
  font-size: 10px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-display-name {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--color-gold);
}

.game-signboard-wrapper {
  max-width: 380px;
  margin: 0 auto 14px;
  text-align: center;
}

.game-signboard {
  background: #8b4513;
  border: 3px solid #d4a373;
  border-radius: 8px;
  padding: 8px 16px;
  display: inline-block;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.game-signboard h2 {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: #fff;
  letter-spacing: 1px;
}

.game-signboard span {
  font-family: var(--font-retro);
  font-size: 10px;
  color: #faedcd;
}

/* Cocoki Game Board Canvas */
.cocoki-container {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cocoki-board-wrapper {
  width: 350px;
  height: 330px;
  background: radial-gradient(circle, #1a223f 0%, #0d1124 100%);
  border: 3px solid #334155;
  border-radius: 12px;
  position: relative;
  overflow: visible;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7);
}

.cocoki-board {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}

/* Staged Reserve Area (Booster Remove 3) */
.cocoki-staged-area {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px dashed var(--border-gold);
  border-radius: 6px;
  min-height: 40px;
  min-width: 140px;
  justify-content: center;
  align-items: center;
  z-index: 50;
}

/* Cocoki Cards */
.cocoki-card {
  position: absolute;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 7px;
  border: 2px solid #fff;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 0 4px rgba(255, 255, 255, 0.5);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.cocoki-card:active {
  transform: scale(0.95);
}

.cocoki-card .card-inner {
  width: 100%;
  height: 100%;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cocoki-card .card-icon {
  font-size: 26px;
}

/* Covered (Disabled) Card Physics */
.cocoki-card.is-covered {
  filter: brightness(0.42) grayscale(0.4);
  cursor: not-allowed;
  pointer-events: none;
}

.cocoki-card.is-covered::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 5px;
}

/* Moving to tray animation */
.cocoki-card.is-moving-to-tray {
  animation: moveToTray 0.22s ease-out;
}

@keyframes moveToTray {
  to { transform: scale(0.9); opacity: 0.8; }
}

/* Matching 3 animation */
.cocoki-card.is-matching {
  animation: matchCard 0.35s ease-out forwards;
}

@keyframes matchCard {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.35) rotate(8deg); filter: brightness(1.6); }
  100% { transform: scale(0) rotate(-15deg); opacity: 0; }
}

/* Combo Banner */
.combo-banner {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, #ff5e84, #f5c842);
  color: #000;
  font-family: var(--font-pixel);
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 20px;
  border: 2px solid #fff;
  box-shadow: 0 0 20px rgba(245, 200, 66, 0.8);
  z-index: 100;
  animation: popCombo 0.7s ease-out forwards;
}

@keyframes popCombo {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  75% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(0.8); opacity: 0; }
}

/* Cocoki Tray (Keranjang 7 Kartu) */
.cocoki-tray-wrapper {
  margin-top: 16px;
  width: 360px;
  position: relative;
}

.cocoki-tray {
  width: 100%;
  height: 74px;
  background: #6b3e1b;
  border: 3px solid #d4a373;
  border-radius: 12px;
  padding: 5px 6px;
  position: relative;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6), inset 0 2px 6px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
}

.tray-slots {
  position: absolute;
  top: 5px; left: 6px; right: 6px; bottom: 5px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  pointer-events: none;
}

.tray-slot-marker {
  border: 1.5px dashed rgba(212, 163, 115, 0.4);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
}

.tray-cards-container {
  display: flex;
  gap: 4px;
  width: 100%;
  height: 100%;
  align-items: center;
  position: relative;
  z-index: 2;
}

.tray-cards-container .cocoki-card {
  position: relative !important;
  left: 0 !important;
  top: 0 !important;
  flex-shrink: 0;
  width: 44px;
  height: 58px;
}

/* Boosters Bar */
.cocoki-boosters {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  width: 100%;
}

.booster-btn {
  background: #20264d;
  border: 2px solid var(--border-gold);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 85px;
  position: relative;
  transition: all 0.15s ease;
}

.booster-btn:hover {
  background: var(--color-purple);
  transform: translateY(-2px);
}

.booster-badge {
  position: absolute;
  top: -8px;
  right: -6px;
  background: #ff5e84;
  color: #fff;
  border: 1.5px solid #fff;
  border-radius: 10px;
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 1px 6px;
}

.booster-icon-box {
  font-size: 20px;
}

.booster-label {
  font-family: var(--font-retro);
  font-size: 9px;
  color: var(--text-secondary);
}

/* ==========================================================================
   🏆 MODALS (MODAL 1: RULES, MODAL 2: GUEST FORM, WIN, LOSE)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.modal-backdrop.active {
  display: flex;
  animation: modalFade 0.25s ease-out;
}

@keyframes modalFade {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-dialog {
  background: var(--bg-card);
  border: 3px solid var(--border-gold);
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  position: relative;
  box-shadow: 0 0 30px rgba(245, 200, 66, 0.4);
}

.modal-header-wood {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px dashed #334155;
}

.modal-header-wood h3 {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--color-gold);
}

.modal-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

/* Modal 1: Rules List */
.rules-list {
  list-style: none;
  margin-bottom: 16px;
}

.rules-list li {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}

.rules-icon {
  font-size: 16px;
}

/* Prize Box in Modal 1 */
.prize-box {
  background: #0f1226;
  border: 1.5px solid var(--border-gold);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 20px;
}

.prize-title {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--color-gold);
  margin-bottom: 8px;
  text-align: center;
}

.prize-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.prize-item strong {
  color: #34d399;
}

/* Modal Primary Button */
.btn-primary-game {
  width: 100%;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: 2px solid #6ee7b7;
  border-radius: 8px;
  font-family: var(--font-pixel);
  font-size: 11px;
  padding: 14px;
  cursor: pointer;
  box-shadow: 0 4px 0 #047857;
  transition: all 0.15s ease;
}

.btn-primary-game:hover {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
}

.btn-secondary-link {
  width: 100%;
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-family: var(--font-retro);
  font-size: 11px;
  padding: 10px;
  cursor: pointer;
  text-align: center;
  margin-top: 6px;
}

.btn-secondary-link:hover {
  color: #fff;
}

/* ==========================================================================
   🐣 MODAL LOSE & CANDY-STRIPES PROGRESS BAR
   Exact implementation of Section 5.2 BRIEF-LAYER-3-AND-GATEWAY.md
   ========================================================================== */
.result-popup {
  text-align: center;
}

.result-badge-icon {
  font-size: 44px;
  margin-bottom: 8px;
}

.result-title.lose {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: #ef4444;
  margin-bottom: 8px;
}

.result-title.win {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--color-gold);
  margin-bottom: 8px;
}

/* Progress Bar Card */
.lose-progress-card {
  background: #0f1226;
  border: 2px solid #334155;
  border-radius: 10px;
  padding: 14px;
  margin: 14px 0 18px;
  text-align: left;
}

.lose-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.lose-progress-title {
  font-family: var(--font-retro);
  font-size: 11px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.lose-progress-percent {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: #f59e0b;
}

.lose-progress-track {
  width: 100%;
  height: 16px;
  background: #1e293b;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
  border: 1px solid #475569;
}

.lose-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f2994a 0%, #eb5757 100%);
  background-size: 20px 20px;
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.25) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0.25) 75%,
    transparent 75%,
    transparent
  );
  animation: candyStripe 1.2s linear infinite;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes candyStripe {
  0% { background-position: 0 0; }
  100% { background-position: 40px 0; }
}

.lose-progress-stats {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
  margin-bottom: 6px;
}

.lose-progress-note {
  font-size: 12px;
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
  padding: 6px 10px;
  border-radius: 4px;
  line-height: 1.4;
}

/* Modal Win Ticket */
.ticket-box {
  background: #0f1226;
  border: 2px dashed var(--border-gold);
  border-radius: 8px;
  padding: 14px;
  margin: 14px 0 18px;
}

.ticket-code {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--color-gold);
  letter-spacing: 2px;
  margin: 6px 0;
  display: block;
}

/* Confetti Container */
.confetti-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 14px;
  top: -20px;
  animation: confettiFall 2.5s linear infinite;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(500px) rotate(720deg); opacity: 0; }
}

/* Toast Notification */
.retro-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: #171b36;
  color: #fff;
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  font-family: var(--font-retro);
  font-size: 11px;
  padding: 10px 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.retro-toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 16px;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border: 3px solid var(--border-gold);
  border-radius: 8px;
  image-rendering: pixelated;
}

.lightbox-close {
  position: absolute;
  top: -36px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

.lightbox-caption {
  font-family: var(--font-retro);
  font-size: 12px;
  color: var(--color-gold);
  margin-top: 10px;
}

/* Pixel Wipe Screen Transition */
.pixel-wipe-curtain {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #0d0f1f;
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s steps(6);
}

.pixel-wipe-curtain.animate-wipe {
  opacity: 1;
  pointer-events: auto;
}

/* Secret Leaderboard Table in Admin Modal */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 11px;
}

.leaderboard-table th {
  background: #0f1226;
  color: var(--color-gold);
  font-family: var(--font-retro);
  padding: 8px;
  text-align: left;
  border-bottom: 2px solid #334155;
}

.leaderboard-table td {
  padding: 8px;
  border-bottom: 1px solid #1e293b;
}

.ticket-badge {
  background: #1e3a8a;
  color: #bfdbfe;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-pixel);
  font-size: 8px;
}
