/* styles.css : Noël en Famille · Ultra-Clean Minimal 3D World Map UI */

:root {
  --bg-ocean: #071428;
  --surface: rgba(255, 255, 255, 0.94);
  --border: rgba(203, 213, 225, 0.85);
  --crimson: #e11d48;
  --emerald: #059669;
  --navy: #0f294a;
  --ink: #0f172a;
  --muted: #64748b;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-ocean);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

#village-3d-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  cursor: grab;
}

#village-3d-stage:active {
  cursor: grabbing;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* =========================================================================
   TINY 1-LINE 3D PINS OVER CHALETS (No Clutter)
   ========================================================================= */
.cottage-labels-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.cottage-roof-card {
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid #cbd5e1;
  border-radius: 99px;
  padding: 3px 9px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(7, 20, 40, 0.32);
  white-space: nowrap;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

/* Hide 2nd and 3rd lines inside 3D pins so they stay 1 single compact pill */
.cottage-roof-top,
.cottage-roof-sub {
  display: none;
}

.cottage-roof-name {
  font-size: 0.72rem;
  font-weight: 800;
}

.cottage-roof-card:hover {
  border-color: var(--crimson);
}

.cottage-roof-card.active {
  background: #fef08a;
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35);
  z-index: 12;
}

.cottage-roof-card.unlocked-target {
  background: #dcfce7;
  border-color: var(--emerald);
}

/* =========================================================================
   1. SLIM TOP PILL BAR
   ========================================================================= */
.app-topbar {
  position: fixed;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 25;
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 10px;
  box-shadow: 0 8px 24px rgba(7, 20, 40, 0.32);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-group,
.drawn-pill-group,
.continent-pills-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.brand-pill {
  background: var(--navy);
  color: #ffffff;
  border: none;
  border-radius: 99px;
  padding: 5px 12px;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.player-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 99px;
  padding: 4px 10px;
}

.player-pill-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}

.player-select {
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  max-width: 185px;
}

.continent-pill-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 99px;
  padding: 4px 8px;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.continent-pill-btn:hover {
  background: #f1f5f9;
}

.continent-pill-btn.active {
  background: var(--navy);
  color: #ffffff;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  border-radius: 99px;
  padding: 5px 11px;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn-crimson {
  background: var(--crimson);
  color: #ffffff;
}

.btn-emerald {
  background: var(--emerald);
  color: #ffffff;
}

.btn-gold {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

.btn-light {
  background: #f1f5f9;
  color: var(--ink);
  border: 1px solid #cbd5e1;
}

#btn-toggle-carols.active {
  background: #fef3c7;
  color: #b45309;
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.28);
}

.rec-btn.recording {
  background: var(--crimson);
  color: #ffffff;
  animation: pulse-rec 1.2s infinite ease-in-out;
}

@keyframes pulse-rec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(225, 29, 72, 0); }
}

.full-w {
  width: 100%;
}

/* =========================================================================
   HIGH-VISIBILITY FLOATING TOAST NOTIFICATION (NEVER HIDDEN BEHIND MENU)
   ========================================================================= */
.toast-banner {
  position: fixed;
  bottom: 86px;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  color: #f8fafc;
  border: 2px solid #fbbf24;
  border-radius: 16px;
  padding: 10px 16px;
  font-size: 0.78rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 3px rgba(251, 191, 36, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(640px, 92vw);
  pointer-events: auto;
}

.toast-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.toast-title {
  color: #fde047;
  font-size: 0.82rem;
  font-weight: 800;
}

.toast-line-a {
  color: #ffffff;
  font-size: 0.76rem;
  line-height: 1.35;
}

.toast-sub {
  color: #6ee7b7;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
}

.toast-close-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #fde047;
  border: 1px solid rgba(253, 224, 71, 0.35);
  border-radius: 8px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.toast-close-btn:hover {
  background: rgba(225, 29, 72, 0.85);
  color: #ffffff;
}

/* =========================================================================
   2. COMPACT FLOATING MEMBER CARD (Right Side - Auto-Height)
   ========================================================================= */
.member-card {
  position: fixed;
  top: 64px;
  right: 12px;
  width: 290px;
  max-height: calc(100vh - 80px);
  z-index: 20;
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 14px 34px rgba(7, 20, 40, 0.38);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.climate-banner {
  background: linear-gradient(90deg, #fef3c7, #e0f2fe);
  border: 1px solid #fcd34d;
  color: #0f172a;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 8px;
  line-height: 1.25;
}

.member-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.member-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-flag {
  font-size: 1.45rem;
  line-height: 1;
}

.member-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
}

.member-continent {
  font-size: 0.68rem;
  font-weight: 700;
  color: #0369a1;
}

.member-nav {
  display: flex;
  gap: 3px;
}

.icon-btn {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: var(--ink);
  font-size: 0.68rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.member-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.badge-chip {
  font-size: 0.63rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: #e0f2fe;
  color: #0369a1;
}

.badge-chip.muted {
  background: #f1f5f9;
  color: var(--muted);
}

.badge-chip.green {
  background: #dcfce7;
  color: #15803d;
}

.member-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.mini-action-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 5px 4px;
  font-family: var(--font);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.mini-action-btn:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
}

/* Locked Wishlist Box */
.locked-box {
  background: #fff1f2;
  border: 1px dashed #f43f5e;
  border-radius: 12px;
  padding: 11px;
  text-align: center;
}

.locked-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--crimson);
  margin-bottom: 4px;
}

.locked-desc {
  font-size: 0.69rem;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 9px;
}

/* Unlocked Wishlist Box */
.unlocked-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.unlocked-tag {
  background: #dcfce7;
  color: #166534;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 7px;
  text-align: center;
}

.wishlist-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wishlist-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 6px 8px;
}

.wishlist-item-card.purchased {
  background: #ecfdf5;
  border-color: #34d399;
}

.wish-item-title {
  font-size: 0.71rem;
  font-weight: 700;
  color: var(--ink);
}

.wish-item-meta {
  font-size: 0.62rem;
  color: var(--muted);
}

.buy-gift-btn {
  background: var(--emerald);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 0.63rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.compact-specs {
  font-size: 0.67rem;
  color: var(--ink);
  background: #f8fafc;
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* =========================================================================
   3. SLIM BOTTOM DEMO PILL (Appears Only During Guided Demo)
   ========================================================================= */
.slim-tour-pill {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(620px, 92vw);
  z-index: 22;
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px 12px;
  box-shadow: 0 12px 32px rgba(7, 20, 40, 0.4);
}

.tour-pill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.tour-step-title {
  font-size: 0.74rem;
  font-weight: 800;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tour-dots {
  display: flex;
  gap: 3px;
}

.sim-dot {
  width: 12px;
  height: 5px;
  border-radius: 99px;
  background: #cbd5e1;
  border: none;
  cursor: pointer;
}

.sim-dot.active {
  width: 22px;
  background: var(--crimson);
}

.tour-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tour-subtitle {
  font-size: 0.73rem;
  color: var(--muted);
  line-height: 1.35;
}

.tour-subtitle .word.spoken {
  color: var(--ink);
}

.tour-subtitle .word.current {
  color: var(--crimson);
  background: #fef08a;
  font-weight: 700;
}

/* =========================================================================
   MODALS (<dialog>)
   ========================================================================= */
.app-dialog {
  margin: auto;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(7, 20, 40, 0.6);
  width: min(820px, 94vw);
  max-height: 86vh;
  overflow-y: auto;
  padding: 0;
}

.small-dialog {
  width: min(480px, 92vw);
}

.app-dialog::backdrop {
  background: rgba(7, 20, 40, 0.55);
  backdrop-filter: blur(4px);
}

.dialog-inner {
  padding: 16px 18px;
}

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

.dialog-title {
  font-size: 1rem;
  font-weight: 800;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.admin-tab {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-tab.active {
  background: var(--navy);
  color: #ffffff;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.admin-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
}

.admin-box h3 {
  font-size: 0.84rem;
  margin-bottom: 8px;
}

.box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.quick-btns {
  display: flex;
  gap: 4px;
}

.badge-btn,
.chip-action-btn {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
  border-radius: 99px;
  padding: 3px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.5fr;
  gap: 6px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 5px 8px;
  font-family: var(--font);
  font-size: 0.73rem;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 310px;
  overflow-y: auto;
}

.admin-member-row,
.admin-rule-row,
.admin-draw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 9px;
}

.solvability-banner {
  margin-top: 8px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
}

.email-preview-box {
  background: #f8fafc;
  border: 1px dashed var(--crimson);
  border-radius: 10px;
  padding: 12px;
  font-size: 0.78rem;
}

.email-body {
  margin: 10px 0;
  white-space: pre-line;
  line-height: 1.45;
}

.video-preview {
  width: 100%;
  max-height: 300px;
  border-radius: 10px;
  background: #000;
  margin-bottom: 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
