/* Game 19 « Week-end à petit budget » */
.bg-app {
  display: flex; flex-direction: column; height: 100%; width: 100%;
  font-family: system-ui, -apple-system, sans-serif; box-sizing: border-box;
}
.bg-header {
  background: var(--title-bg, #ffffff); border-radius: 8px;
  padding: 6px 14px; margin-bottom: 4px; text-align: center; flex-shrink: 0;
}
.bg-header h1 { font-size: 1.05rem; font-weight: 700; color: var(--title-color, #1e293b); margin: 0; }
.bg-header p { font-size: 0.74rem; color: var(--hint-color, #64748b); margin: 2px 0 0; }

.bg-controls {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px;
  background: var(--ctrl-bg, #f8fafc); border: 1.5px solid var(--ctrl-border, #cbd5e1);
  border-radius: 6px; padding: 4px 8px; margin-bottom: 3px; flex-shrink: 0;
}
.bg-ctrl-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bg-btn {
  background: var(--btn-bg, #ffffff); color: var(--btn-color, #1e293b);
  border: 1.5px solid var(--btn-border, #94a3b8); border-radius: 4px;
  padding: 3px 8px; font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s, transform 0.05s; font-family: inherit; line-height: 1.2;
}
.bg-btn:hover { background: var(--btn-hover, #f1f5f9); }
.bg-btn:active { transform: translateY(1px); }
.bg-btn-play {
  background: var(--play-bg, #2563eb); color: #ffffff; border-color: var(--play-border, #1d4ed8);
}
.bg-btn-play:hover { background: var(--play-hover-bg, #1d4ed8); }
.bg-step-num { font-weight: 700; font-size: 0.82rem; color: var(--title-color, #1e293b); }

.bg-sub-bar {
  background: var(--sub-bg, #eff6ff); color: var(--sub-color, #1e3a8a);
  border: 1px dashed var(--ctrl-border, #93c5fd); border-radius: 4px;
  padding: 4px 8px; font-size: 0.8rem; text-align: center; margin-bottom: 2px;
  flex-shrink: 0; font-weight: 500; min-height: 24px;
}
.bg-sub-speaker { font-weight: 700; color: #1d4ed8; }
.bg-sub-fr { margin-top: 1px; }
.bg-sub-yue { font-size: 0.72rem; color: #64748b; margin-top: 2px; }

.bg-feedback {
  border-radius: 4px; padding: 4px 8px; font-size: 0.8rem; font-weight: 600;
  text-align: center; margin-bottom: 3px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 26px;
}
.bg-fb-correct { background: var(--banner-correct-bg, #dcfce7); color: var(--banner-correct-color, #166534); border: 1px solid #86efac; }
.bg-fb-wrong { background: var(--banner-wrong-bg, #fee2e2); color: var(--banner-wrong-color, #991b1b); border: 1px solid #fca5a5; }
.bg-fb-neutral { background: #f1f5f9; color: #475569; }

.bg-hint-area {
  background: var(--banner-wrong-bg, #fef2f2); color: var(--banner-wrong-color, #991b1b);
  border: 1px dashed #f87171; border-radius: 4px; padding: 4px 8px;
  font-size: 0.75rem; text-align: center; margin-bottom: 3px; flex-shrink: 0;
}

.bg-main {
  display: flex; flex: 1; min-height: 0; gap: 8px; position: relative;
}

.bg-tray {
  width: 260px; min-width: 260px; background: var(--tray-bg, #f1f5f9);
  border-radius: 8px; padding: 8px; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
}

.bg-card {
  background: var(--card-bg, #ffffff); border: 2px solid var(--card-border, #cbd5e1);
  border-radius: 8px; padding: 8px 6px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: grab; user-select: none;
  touch-action: none; transition: transform 0.1s, box-shadow 0.1s, border-color 0.15s;
}
.bg-card:hover {
  transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.08); border-color: #94a3b8;
}
.bg-card:active { cursor: grabbing; transform: scale(0.97); }
.bg-card.bg-card-selected {
  border-color: #2563eb; outline: 3px solid #60a5fa; box-shadow: 0 0 12px rgba(37,99,235,0.3);
}
.bg-card svg { width: 84px; height: 84px; pointer-events: none; }

.bg-scene-wrap {
  flex: 1; min-width: 0; min-height: 0; background: #ffffff;
  border: 1.5px solid var(--card-border, #cbd5e1); border-radius: 8px;
  position: relative; overflow: hidden; display: flex; flex-direction: column;
}

.bg-scene {
  width: 100%; height: 100%; position: relative;
}
.bg-scene-bg-svg {
  width: 100%; height: 100%; display: block;
}

.bg-slot {
  position: absolute; border: 3px dashed #3b82f6; border-radius: 12px;
  background: rgba(255, 255, 255, 0.85); display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer;
  transition: all 0.2s ease; box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.bg-slot:hover {
  background: rgba(239, 246, 255, 0.95); border-color: #1d4ed8; transform: scale(1.02);
}
.bg-slot.bg-slot-active {
  border-color: #16a34a; background: rgba(240, 253, 244, 0.95);
  box-shadow: 0 0 16px rgba(22, 163, 74, 0.4);
}
.bg-slot-label {
  font-size: 0.78rem; font-weight: 700; color: #1e293b; margin-top: 4px; text-align: center;
  padding: 0 4px; pointer-events: none;
}
.bg-slot-content {
  width: 90px; height: 90px; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.bg-slot-content svg { width: 80px; height: 80px; }

/* End overlay */
.bg-end-overlay {
  position: absolute; inset: 0; background: rgba(15, 23, 42, 0.75);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.bg-end-card {
  background: #ffffff; border-radius: 14px; max-width: 600px; width: 100%;
  padding: 24px; text-align: center; box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  max-height: 90%; overflow-y: auto;
}
.bg-end-title { font-size: 1.4rem; font-weight: 800; color: #0f172a; margin-bottom: 6px; }
.bg-end-score { font-size: 1.1rem; font-weight: 700; color: #16a34a; margin-bottom: 14px; }
.bg-end-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.bg-end-review {
  text-align: left; background: #f8fafc; border-radius: 8px; padding: 12px; margin-top: 14px;
  font-size: 0.78rem; line-height: 1.4; border: 1px solid #e2e8f0;
}
.bg-review-line { margin-bottom: 6px; }
.bg-review-speaker { font-weight: 700; color: #2563eb; }
.bg-review-yue { color: #64748b; font-size: 0.72rem; }

/* Mobile */
@media (max-width: 700px) {
  .bg-main { flex-direction: column-reverse; }
  .bg-tray {
    width: 100%; min-width: 0; height: 110px; flex: 0 0 110px;
    flex-direction: row; overflow-x: auto; overflow-y: hidden;
  }
  .bg-card { min-width: 90px; width: 90px; height: 95px; padding: 4px; }
  .bg-card svg { width: 65px; height: 65px; }
  .bg-slot { width: 110px !important; height: 110px !important; }
  .bg-slot-content { width: 70px; height: 70px; }
  .bg-slot-content svg { width: 60px; height: 60px; }
}
