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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #5B9C6B;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #fff;
}

#app-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ================= UNIFIED DISPLAY STAGE (Standby, Reveal, & Grid) ================= */
#mosaic-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: block;
  background-color: #5B9C6B;
}

#standby-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background-color: #5B9C6B;
  opacity: 1;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

#reveal-full-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background-color: #0a3a2a;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  pointer-events: none;
}

/* When full reveal is triggered, fade in full reveal artwork */
.state-revealed #reveal-full-img {
  opacity: 1;
}

.state-revealed #standby-img {
  opacity: 0;
}

/* ================= MOSAIC GRID LAYER ================= */
#mosaic-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  display: grid;
  gap: 0px !important;
  row-gap: 0px !important;
  column-gap: 0px !important;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent !important;
}

/* Single Tile Slot (Covers 1fr x 1fr with zero gaps) */
.mosaic-slot {
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  overflow: hidden;
  box-sizing: border-box;
}

/* NO border or background on unplaced slots -- everything else remains the Standby image! */

/* Tile Container when placed */
.tile-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: none;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.tile-inner.placed {
  display: block;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Layer 1: Participant Photo (Base) */
.layer-participant {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% + 0.6px);
  height: calc(100% + 0.6px);
  object-fit: cover;
  z-index: 1;
  opacity: 1;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  transition: opacity 1.2s ease;
}

/* Layer 2: Reveal Crop Overlay at 90% VISIBILITY */
.layer-reveal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% + 0.6px);
  height: calc(100% + 0.6px);
  object-fit: fill;
  z-index: 2;
  opacity: 0.9; /* 90% visibility as requested */
  pointer-events: none;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  transition: opacity 1.2s ease;
}


/* Keep participant photos and overlays intact when mosaic is filled / revealed */
.tile-inner.revealed .layer-reveal-overlay,
.state-revealed .layer-reveal-overlay {
  opacity: 0.9 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.tile-inner.revealed .layer-participant,
.state-revealed .layer-participant {
  opacity: 1.0 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}



/* ================= FEATURED ENTRANCE ANIMATION (Phase 10) ================= */
#featured-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.featured-card {
  position: absolute;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(212, 175, 55, 0.5);
  border: 4px solid #D4AF37;
  transform-origin: center center;
  transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

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

/* ================= ADMIN OVERLAY (Phase 13) ================= */
#admin-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 20, 12, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#admin-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.admin-window {
  background: #113822;
  border: 2px solid #5B9C6B;
  border-radius: 12px;
  width: 90%;
  max-width: 1100px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0b2918;
  padding: 16px 24px;
  border-bottom: 2px solid #285e3a;
}

.admin-title {
  font-size: 20px;
  font-weight: 700;
  color: #D4AF37;
}

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

.admin-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.admin-login-box {
  max-width: 360px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #3d7951;
  background: #072012;
  color: #fff;
  font-size: 16px;
}

.admin-btn {
  padding: 12px 20px;
  background: #5B9C6B;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-btn:hover {
  background: #6bb37d;
}

.admin-btn-secondary {
  background: #254d33;
}

.admin-btn-danger {
  background: #a82424;
}
