.dlg-stack { position: absolute; left: calc(var(--u)*3); right: calc(var(--u)*3); bottom: calc(var(--u)*4 + env(safe-area-inset-bottom)); display: flex; flex-direction: column; z-index: 10; pointer-events: none; }
.dlg-stack > * { pointer-events: auto; }
.dlg-tap { position: absolute; inset: 0; z-index: 9; }
.dlg-row { position: relative; height: 48px; margin-bottom: max(44px, calc(var(--u)*2.4 + 1.5em + 10px)); display: flex; justify-content: flex-end; align-items: center; gap: calc(var(--u)*1.5); pointer-events: none !important; }
.dlg-row > * { pointer-events: auto; }
.dlg-tog { min-width: 48px; height: 44px; padding: 0 calc(var(--u)*3); font-family: var(--font); font-weight: 700; font-size: max(14px, calc(var(--u)*3.6)); color: var(--ink-dim); cursor: pointer;
  background: rgba(12,22,38,0.8); border: 1.5px solid rgba(207,216,227,0.55); border-radius: 6px; transition: transform .12s, color .15s, background .15s; }
.dlg-tog:active { transform: scale(0.93); }
.dlg-tog.on { color: #2a1a05; background: var(--amber); border-color: #fff0cf; box-shadow: 0 0 10px rgba(240,182,94,0.6); }
.dlg-portrait { position: absolute; left: 0; bottom: 0; width: calc(var(--u)*34); pointer-events: none !important; z-index: 0; animation: dlgSlide .35s ease-out both; filter: drop-shadow(0 0 8px rgba(0,0,0,0.5)); }
@keyframes dlgSlide { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
.dlg-box { position: relative; min-height: 23vh; min-height: 23dvh; z-index: 1; animation: fadeUp .25s ease-out both; cursor: pointer; }
.dlg-inner { position: absolute; inset: calc(var(--u)*-3); background: rgba(12,22,38,0.55); padding: calc(var(--u)*7.5) calc(var(--u)*4) calc(var(--u)*4); overflow: hidden; }
.dlg-name { position: absolute; left: calc(var(--u)*2); bottom: calc(100% + 3px); z-index: 3; padding: calc(var(--u)*1.2) calc(var(--u)*4); min-width: calc(var(--u)*20);
  background: linear-gradient(#1c3350, #101d30); border: 2px solid var(--silver); box-shadow: 0 3px 0 rgba(0,0,0,0.5); font-weight: 700; font-size: max(16px, calc(var(--u)*4.4)); text-align: center; letter-spacing: 1px; }
.dlg-text { font-size: max(16px, calc(var(--u)*4.6)); line-height: 1.6; color: var(--ink); text-shadow: 0 1px 2px #000; white-space: pre-wrap; word-break: break-word; }
.dlg-text.narr { font-style: italic; color: #cdd8e6; }
.dlg-next { position: absolute; right: calc(var(--u)*2); bottom: calc(var(--u)*1); color: var(--amber); font-size: max(16px, calc(var(--u)*4.4)); animation: pulse 1s infinite; text-shadow: 0 1px 2px #000; }
.dlg-choices { position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 12; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u)*3); pointer-events: none; }
.dlg-choices .btn { width: calc(var(--u)*84); pointer-events: auto; animation: pop .28s ease-out both; padding-top: calc(var(--u)*1.5); padding-bottom: calc(var(--u)*1.5); }
.dlg-hud { position: absolute; left: 10px; top: calc(10px + env(safe-area-inset-top)); z-index: 11; display: flex; gap: 8px; pointer-events: none !important; }
.dlg-chip { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; background: rgba(12,22,38,0.75); border: 1.5px solid rgba(207,216,227,0.6); border-radius: 8px; font-weight: 700; font-size: 18px; }
.dlg-chip svg, .dlg-chip img { width: 22px; height: 22px; object-fit: contain; }
.dlg-bump { animation: pop .35s ease-out; }
.dlg-float { position: absolute; left: 14px; top: 44px; z-index: 12; font-weight: 700; font-size: 22px; pointer-events: none; animation: dlgFloat 1.3s ease-out forwards; }
@keyframes dlgFloat { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-34px); opacity: 0; } }
.dlg-log { position: absolute; left: 7u; left: calc(var(--u)*7); width: calc(var(--u)*86); top: 15%; height: 70%; z-index: 30; display: flex; flex-direction: column; animation: pop .25s ease-out both; }
.dlg-log-in { flex: 1; min-height: 0; margin: calc(var(--u)*-2); padding: calc(var(--u)*4) calc(var(--u)*3) calc(var(--u)*2); background: rgba(12,22,38,0.7); display: flex; flex-direction: column; gap: 8px; }
.dlg-log-title { text-align: center; font-weight: 700; font-size: max(17px, calc(var(--u)*4.6)); color: var(--amber); }
.dlg-log-list { flex: 1; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; touch-action: pan-y; }
.dlg-log-list::-webkit-scrollbar { display: none; }
.dlg-log-item { margin-bottom: 10px; font-size: max(15px, calc(var(--u)*4)); line-height: 1.5; }
.dlg-log-item b { display: block; font-size: max(14px, calc(var(--u)*3.8)); }
.dlg-gift { position: absolute; left: calc(var(--u)*5); right: calc(var(--u)*5); top: 50%; translate: 0 -50%; max-height: calc(100% - 24px); display: flex; flex-direction: column; z-index: 30; animation: pop .28s ease-out both; }
.dlg-gift .dlg-gift-in { min-height: 0; }
.dlg-gift .dlg-cards { min-height: 0; overflow-y: auto; }
.dlg-card .info b, .dlg-card .info span { display: block; }
.dlg-card.poor { opacity: 0.55; filter: grayscale(0.85); }
.dlg-card.poor .info small { color: #ff9a8a; font-weight: 700; }
.dlg-card .btn:disabled { cursor: not-allowed; }
.dlg-nogift { min-width: calc(var(--u)*40); flex: none; }
.dlg-nogift.focus { filter: brightness(1.25); transform: scale(1.04); box-shadow: 0 0 12px rgba(240,182,94,0.6); }
.dlg-gift-in { margin: calc(var(--u)*-2); padding: calc(var(--u)*3); background: rgba(12,22,38,0.7); display: flex; flex-direction: column; align-items: center; gap: calc(var(--u)*2.5); }
.dlg-gift-title { font-weight: 700; text-align: center; font-size: max(17px, calc(var(--u)*4.8)); }
.dlg-gold { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 18px; }
.dlg-gold img { width: 24px; height: 24px; object-fit: contain; }
.dlg-cards { display: flex; flex-direction: column; gap: calc(var(--u)*2); width: 100%; }
.dlg-card { display: flex; align-items: center; gap: calc(var(--u)*2); padding: 6px 8px; background: rgba(34,64,95,0.45); border: 1.5px solid rgba(207,216,227,0.4); border-radius: 8px; }
.dlg-card.focus { border-color: var(--amber); box-shadow: 0 0 10px rgba(240,182,94,0.5); }
.dlg-card img.gi { width: calc(var(--u)*13); height: calc(var(--u)*13); object-fit: contain; flex: none; }
.dlg-card .info { flex: 1; min-width: 0; font-size: max(14px, calc(var(--u)*3.6)); line-height: 1.3; }
.dlg-card .info b { font-size: max(16px, calc(var(--u)*4.2)); }
.dlg-card .info small { display: block; color: var(--ink-dim); font-size: max(12px, calc(var(--u)*3.1)); }
.dlg-card .btn { min-width: calc(var(--u)*20); flex: none; }
.dlg-card .btn img { width: 20px; height: 20px; }
