/* Game 1.1 « Vivre dans une maison ou dans un appartement ? » — Interactive Verb & French Logic Engine */
.pa-app {
  display: flex; flex-direction: column; height: 100%; width: 100%;
  font-family: system-ui, -apple-system, sans-serif; box-sizing: border-box;
}
.pa-header {
  background: var(--title-bg, #ffffff); border-radius: 8px;
  padding: 5px 14px; margin-bottom: 4px; text-align: center; flex-shrink: 0;
}
.pa-header h1 { font-size: 1.02rem; font-weight: 700; color: var(--title-color, #1e293b); margin: 0; }
.pa-header p { font-size: 0.73rem; color: var(--hint-color, #64748b); margin: 2px 0 0; }

.pa-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;
}
.pa-ctrl-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pa-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;
}
.pa-btn:hover { background: var(--btn-hover, #f1f5f9); }
.pa-btn[aria-pressed="true"] { outline: 2px solid var(--play-bg, #2563eb); background: #dbeafe; color: #1e3a8a; }
.pa-btn-play {
  background: var(--play-bg, #2563eb); color: #ffffff; border-color: var(--play-border, #1d4ed8);
}
.pa-btn-play:hover { background: var(--play-hover-bg, #1d4ed8); }
.pa-step-num { font-weight: 700; font-size: 0.82rem; color: var(--title-color, #1e293b); }
.pa-verb-pill {
  background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; border-radius: 999px;
  padding: 2px 9px; font-size: 0.73rem; font-weight: 700;
}

.pa-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;
}
.pa-sub-speaker { font-weight: 700; color: #1d4ed8; }
.pa-sub-fr { margin-top: 1px; }
.pa-sub-yue { font-size: 0.72rem; color: #64748b; margin-top: 2px; }

.pa-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: 10px; min-height: 26px;
}
.pa-fb-correct { background: var(--banner-correct-bg, #dcfce7); color: var(--banner-correct-color, #166534); border: 1px solid #86efac; }
.pa-fb-wrong { background: var(--banner-wrong-bg, #fee2e2); color: var(--banner-wrong-color, #991b1b); border: 1px solid #fca5a5; }
.pa-fb-neutral { background: #f1f5f9; color: #475569; }
.pa-hint-btn {
  background: none; border: none; text-decoration: underline; color: inherit;
  font-weight: 700; font-size: 0.76rem; cursor: pointer; padding: 0 4px;
}

.pa-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;
}

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

.pa-tray {
  width: 245px; min-width: 245px; background: var(--tray-bg, #e4edf5);
  border-radius: 8px; padding: 8px; overflow-y: auto; overflow-x: hidden;
  display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 8px; flex-shrink: 0;
}

.pa-card {
  background: var(--card-bg, #ffffff); border: 2px solid var(--card-border, #cbd5e1);
  border-radius: 10px; padding: 6px 4px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: grab; user-select: none;
  touch-action: none; transition: transform 0.12s, box-shadow 0.12s, border-color 0.15s;
  min-height: 98px;
}
.pa-card:hover {
  transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border-color: #3b82f6;
}
.pa-card:active { cursor: grabbing; transform: scale(0.96); }
.pa-card.pa-card-selected {
  border-color: #2563eb; outline: 3px solid #60a5fa; box-shadow: 0 0 12px rgba(37,99,235,0.35);
}
.pa-card svg { width: 78px; height: 78px; pointer-events: none; display: block; }
.pa-card-caption {
  font-size: 0.66rem; font-weight: 700; color: var(--card-label, #334155);
  text-align: center; margin-top: 3px; line-height: 1.15; pointer-events: none;
}

.pa-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;
}

.pa-scene {
  width: 100%; height: 100%; position: relative; touch-action: none;
}
.pa-scene-bg-svg {
  width: 100%; height: 100%; display: block; pointer-events: none;
}

.pa-slot, .pa-decoy-zone {
  position: absolute; border-radius: 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer;
  transition: all 0.18s ease; box-sizing: border-box;
}
.pa-slot {
  border: 3px dashed #2563eb; background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.14); z-index: 5;
}
.pa-slot:hover, .pa-slot.pa-slot-hover {
  background: rgba(219, 234, 254, 0.96); border-color: #1d4ed8; transform: scale(1.03);
}
.pa-slot.pa-slot-active, .pa-slot.pa-slot-filled {
  border-style: solid; border-color: #16a34a; background: rgba(240, 253, 244, 0.96);
  box-shadow: 0 0 18px rgba(22, 163, 74, 0.45);
}
.pa-decoy-zone {
  border: 2px dashed rgba(100, 116, 139, 0.35); background: rgba(255, 255, 255, 0.25); z-index: 3;
}
.pa-decoy-zone:hover, .pa-decoy-zone.pa-slot-hover {
  border-color: #f59e0b; background: rgba(254, 243, 199, 0.55);
}
.pa-slot-label {
  font-size: 0.74rem; font-weight: 800; color: #0f172a; margin-top: 3px; text-align: center;
  padding: 2px 6px; background: rgba(255,255,255,0.92); border-radius: 6px; pointer-events: none;
}
.pa-slot-content {
  width: 78px; height: 78px; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.pa-slot-content svg { width: 74px; height: 74px; }

.pa-drag-ghost {
  position: fixed; z-index: 10000; pointer-events: none; transform: translate(-50%, -50%);
  width: 88px; height: 88px; background: #ffffff; border: 2.5px solid #2563eb;
  border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.28);
  display: flex; align-items: center; justify-content: center; opacity: 0.94;
}
.pa-drag-ghost svg { width: 76px; height: 76px; }

@keyframes pa-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}
.pa-shake { animation: pa-shake 0.32s ease-in-out; border-color: #dc2626 !important; }

/* End overlay */
.pa-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;
}
.pa-end-card {
  background: #ffffff; border-radius: 14px; max-width: 620px; width: 100%;
  padding: 22px; text-align: center; box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  max-height: 90%; overflow-y: auto; color: #0f172a;
}
.pa-end-title { font-size: 1.35rem; font-weight: 800; color: #0f172a; margin-bottom: 6px; }
.pa-end-score { font-size: 1.05rem; font-weight: 700; color: #16a34a; margin-bottom: 12px; }
.pa-end-actions { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.pa-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;
}
.pa-review-line { margin-bottom: 6px; }
.pa-review-speaker { font-weight: 700; color: #2563eb; }
.pa-review-yue { color: #64748b; font-size: 0.72rem; }

/* Mobile */
@media (max-width: 700px) {
  .pa-main { flex-direction: column-reverse; }
  .pa-tray {
    width: 100%; min-width: 0; height: 112px; flex: 0 0 112px;
    display: flex; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 6px;
  }
  .pa-card { min-width: 92px; width: 92px; height: 96px; min-height: 96px; padding: 4px; flex-shrink: 0; }
  .pa-card svg { width: 64px; height: 64px; }
  .pa-slot { width: 125px !important; height: 105px !important; }
  .pa-slot-content { width: 62px; height: 62px; }
  .pa-slot-content svg { width: 56px; height: 56px; }
}
