/* 단비랩 AI 가이드 — 🏛️ 3D AI 종합 체험관 스타일
   assets/hall.js 가 그리는 화면에만 쓰입니다. 나머지 가이드 스타일(style.css)은 그대로입니다. */

/* ───────── 첫 화면 안내 카드 ───────── */
.hall-teaser {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: center;
  padding: 22px 24px;
  border-radius: var(--r-lg);
  border: 1px solid #F3DCCB;
  background:
    radial-gradient(120% 130% at 12% 10%, #FFF0E2 0%, rgba(255, 240, 226, 0) 58%),
    radial-gradient(110% 120% at 92% 90%, #EFE9FB 0%, rgba(239, 233, 251, 0) 60%),
    linear-gradient(160deg, #FFFBF6, #FDF3EA 60%, #F7F0FB);
  box-shadow: var(--shadow);
}
.hall-teaser::after {
  content: ""; position: absolute; right: -60px; top: -70px; width: 210px; height: 210px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 201, 160, .45), rgba(255, 201, 160, 0) 70%);
  pointer-events: none;
}
.ht-art { position: relative; height: 168px; }
.ht-floor {
  position: absolute; left: 50%; bottom: 14px; width: 168px; height: 40px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(ellipse at center, #F6D9BF 0%, rgba(246, 217, 191, .25) 62%, rgba(246, 217, 191, 0) 74%);
}
.ht-bot {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%);
  width: 92px; height: 92px; border-radius: 46% 46% 44% 44%;
  display: grid; place-items: center; font-size: 44px;
  background: linear-gradient(160deg, #FFFDF9, #FFEFE0);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .9), 0 14px 22px -14px rgba(180, 110, 70, .6);
  animation: ht-bob 3.6s ease-in-out infinite;
}
@keyframes ht-bob { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-7px); } }
.ht-orb { position: absolute; inset: 0; }
.ht-p {
  position: absolute; left: 50%; top: 50%;
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  display: grid; place-items: center; font-size: 19px;
  border-radius: 13px; background: #FFFDFA;
  box-shadow: 0 8px 16px -10px rgba(120, 80, 60, .55), inset 0 0 0 1px #F6E6DA;
  animation: ht-float 4.4s ease-in-out infinite;
}
.ht-p0 { transform: rotate(8deg) translate(94px) rotate(-8deg); animation-delay: -.2s; }
.ht-p1 { transform: rotate(68deg) translate(94px) rotate(-68deg); animation-delay: -.9s; }
.ht-p2 { transform: rotate(128deg) translate(94px) rotate(-128deg); animation-delay: -1.6s; }
.ht-p3 { transform: rotate(188deg) translate(94px) rotate(-188deg); animation-delay: -2.3s; }
.ht-p4 { transform: rotate(248deg) translate(94px) rotate(-248deg); animation-delay: -3s; }
.ht-p5 { transform: rotate(308deg) translate(94px) rotate(-308deg); animation-delay: -3.7s; }
@keyframes ht-float { 0%, 100% { margin-top: -19px; } 50% { margin-top: -25px; } }
.ht-txt { min-width: 0; }
.ht-kick { margin: 0 0 4px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; color: var(--coral-d); }
.hall-teaser h2 { margin: 0 0 6px; font-size: clamp(19px, 2.6vw, 24px); letter-spacing: -.03em; line-height: 1.32; }
.ht-lead { margin: 0 0 10px; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.ht-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ht-chip {
  font-size: 11px; font-weight: 700; color: var(--ink-2);
  background: rgba(255, 255, 255, .8); border: 1px solid #F0DDD0;
  border-radius: 999px; padding: 3px 10px;
}
.ht-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 999px;
  background: linear-gradient(140deg, #F08A63, #E4664B);
  color: #fff; font-size: 13.5px; font-weight: 800; letter-spacing: -.01em;
  box-shadow: 0 12px 22px -12px rgba(200, 90, 60, .8);
}
.ht-cta:hover { filter: brightness(1.04); }

/* ───────── 체험관 화면 ───────── */
.hall-wrap [hidden] { display: none !important; }
.hall-page .detail-head { margin-bottom: 14px; }
.hall-wrap {
  display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  gap: 18px; align-items: start; margin-bottom: 10px;
}
.hall-left, .hall-right { min-width: 0; }

.hall-stage {
  position: relative; overflow: hidden;
  aspect-ratio: 1.28 / 1; min-height: 320px;
  border-radius: var(--r-lg);
  border: 1px solid #F2DFD2;
  background:
    radial-gradient(78% 62% at 50% 22%, #FFFBF4 0%, rgba(255, 251, 244, 0) 62%),
    linear-gradient(168deg, #F7E3CF 0%, #F0D6C1 52%, #DEC1B4 100%);
  box-shadow: var(--shadow-2);
  touch-action: pan-y;
}
.hall-canvas {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  touch-action: none; cursor: grab;
}
.hall-canvas:active { cursor: grabbing; }

.hall-loading {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  background: rgba(255, 250, 245, .82);
}
.hl-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--coral);
  animation: hl-pulse 1s ease-in-out infinite;
}
@keyframes hl-pulse { 0%, 100% { transform: scale(.7); opacity: .5; } 50% { transform: scale(1.15); opacity: 1; } }

.hall-tools {
  position: absolute; top: 10px; right: 10px; z-index: 4;
  display: flex; gap: 5px;
}
.htool {
  width: 32px; height: 32px; border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .85);
  background: rgba(255, 253, 250, .82);
  color: var(--ink-2); font-size: 14px; font-weight: 800; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 14px -10px rgba(120, 80, 60, .7);
}
.htool:hover { color: var(--coral-d); }
.htool[aria-pressed="false"] { opacity: .5; }
.htool:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }

.hall-hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  z-index: 4; margin: 0; padding: 5px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: #7A5A46;
  background: rgba(255, 253, 250, .86);
  box-shadow: 0 6px 16px -12px rgba(120, 80, 60, .8);
  transition: opacity .5s ease; white-space: nowrap;
  pointer-events: none;
}
.hall-hint.off { opacity: 0; }
.hall-hint.on { opacity: 1; }

.hall-fallback-note {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 4;
  margin: 0; font-size: 10.5px; line-height: 1.5; color: var(--ink-3); text-align: center;
}

.hall-chips-lab { margin: 12px 0 6px; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.hall-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hall-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px 7px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid #F0DDD0; background: #FFFDFA;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.hall-chip:hover { transform: translateY(-1px); box-shadow: 0 8px 16px -12px rgba(120, 80, 60, .8); }
.hall-chip.on {
  border-color: #E9744F; color: #8A3E28;
  background: linear-gradient(140deg, #FFEFE5, #FFE0D3);
}
.hc-em { font-size: 14px; }
.hc-n {
  width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 9.5px; font-weight: 800; line-height: 1;
  color: #A85637; background: #FBE0D2;
  transition: background .15s ease, color .15s ease;
}
.hall-chip.on .hc-n { color: #fff; background: #E0714D; }

/* 오른쪽 패널 */
.hall-panel {
  background: var(--paper);
  border: 1px solid #F1E3D8;
  border-radius: var(--r-lg);
  padding: 15px 15px 13px;
  box-shadow: var(--shadow);
  min-height: 240px;
}
.hall-panel:empty { display: none; }
.hp-head { margin-bottom: 9px; }
.hp-kick { margin: 0 0 2px; font-size: 11px; font-weight: 800; color: var(--coral-d); letter-spacing: .01em; }
.hp-title { margin: 0; font-size: 16px; letter-spacing: -.02em; line-height: 1.4; }

.hall-chat {
  max-height: 424px; overflow-y: auto; overscroll-behavior: contain;
  padding-right: 2px; scrollbar-width: thin;
}
.msg { margin-bottom: 9px; }
.msg-lab { margin: 0 0 3px; font-size: 10.5px; font-weight: 800; color: var(--ink-3); }
.bubble {
  margin: 0; padding: 9px 12px; font-size: 13px; line-height: 1.62;
  border-radius: 14px; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere;
}
.msg-me .bubble {
  background: linear-gradient(140deg, #FFF1E7, #FFE3D6);
  color: #6B4230; border: 1px solid #FBD9C7;
}
.bubble-ai {
  background: #FFFDFA; border: 1px solid #EFE1D5;
  font-size: 13px; color: var(--ink);
}
.typed { margin: 0; white-space: pre-wrap; }
.thinking { margin: 0; display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-3); font-weight: 700; }
.thinking[hidden] { display: none; }
.thinking i, .typing-dots i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--coral); display: inline-block;
  animation: th-dot 1s ease-in-out infinite;
}
.thinking i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes th-dot { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
.typing-dots { margin: 0; display: flex; gap: 4px; padding-top: 2px; }
.typing-dots[hidden] { display: none; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }

.hall-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.hbtn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid #F0DDD0; background: #FFFDFA;
  font-size: 12px; font-weight: 700; color: var(--ink-2);
}
.hbtn:hover { border-color: #E9B99F; color: var(--coral-d); }
.hbtn-main { background: linear-gradient(140deg, #FFF3EA, #FFE6D9); border-color: #F7CDB8; color: #8A3E28; }
.hbtn.ok { background: #E9F6EE; border-color: #A9D9C0; color: #2F6B4E; }
.hbtn-skip { border-style: dashed; color: var(--ink-3); }
.hall-learn {
  display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--ink-3);
}
.hall-learn:hover { color: var(--coral-d); }

/* 직접 입력 */
.hall-trybox { margin-top: 14px; }
.htb-lab { margin: 0 0 6px; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.hall-try { display: flex; gap: 6px; }
.hall-try input {
  flex: 1; min-width: 0;
  padding: 10px 13px; border-radius: 13px;
  border: 1px solid #EEDCCE; background: #FFFDFA;
  font-family: inherit; font-size: 13px; color: var(--ink);
}
.hall-try input::placeholder { color: #B4A79E; }
.hall-try input:focus { outline: 2px solid #F7C6AC; outline-offset: 1px; border-color: #EFB597; }
.try-send {
  flex: none; padding: 0 16px; border-radius: 13px; cursor: pointer;
  border: 0; background: linear-gradient(140deg, #F08A63, #E4664B); color: #fff;
  font-size: 13px; font-weight: 800;
}
.try-send:hover { filter: brightness(1.04); }
.try-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.try-chip {
  padding: 5px 10px; border-radius: 999px; cursor: pointer;
  border: 1px dashed #EBD5C6; background: transparent;
  font-size: 11.5px; font-weight: 600; color: var(--ink-3);
}
.try-chip:hover { border-color: #E9B99F; color: var(--coral-d); background: #FFF8F3; }
.hall-note { margin: 10px 0 0; font-size: 11px; line-height: 1.6; color: var(--ink-3); }

/* ───────── 2D 대체 화면 ───────── */
.h2d { position: absolute; inset: 0; }
.h2d-plat {
  position: absolute; left: 50%; bottom: 16%; width: 68%; height: 26%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, #FFF6EC 0%, #FCE4D6 60%, #F3D3C4 100%);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .8);
}
.h2d-bot {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: 74px; height: 74px; border-radius: 46%;
  background: linear-gradient(160deg, #FFFDF9, #FFEEDF);
  box-shadow: inset 0 0 0 1.5px #fff, 0 12px 20px -14px rgba(160, 100, 70, .7);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  animation: ht-bob 3.4s ease-in-out infinite;
}
.h2d-bot i { width: 9px; height: 9px; border-radius: 50%; background: #342D3A; display: block; }
.h2d-prop {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  width: 74px; margin: 0; padding: 6px 4px;
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(-108px) rotate(calc(-1 * var(--a)));
  border-radius: 14px; border: 1px solid #F2DDCE; background: rgba(255, 253, 250, .94);
  cursor: pointer; box-shadow: 0 10px 18px -14px rgba(120, 80, 60, .8);
}
.h2d-prop .h2d-em { font-size: 21px; line-height: 1.2; }
.h2d-prop .h2d-tx { font-size: 9.5px; font-weight: 700; color: var(--ink-2); text-align: center; line-height: 1.25; }
.h2d-prop.on { border-color: #E9744F; background: #FFF1E7; box-shadow: 0 0 0 3px rgba(233, 116, 79, .18); }

/* ───────── 반응형 ───────── */
@media (max-width: 980px) {
  .hall-wrap { grid-template-columns: 1fr; }
  .hall-stage { aspect-ratio: 1.3 / 1; min-height: 300px; }
  .hall-chat { max-height: 300px; }
}
@media (max-width: 760px) {
  .hall-teaser { grid-template-columns: 1fr; padding: 18px; }
  .ht-art { height: 132px; order: -1; }
  .ht-bot { width: 74px; height: 74px; font-size: 34px; bottom: 24px; }
  .ht-p { width: 32px; height: 32px; margin: -16px 0 0 -16px; font-size: 16px; }
  .ht-p0 { transform: rotate(8deg) translate(72px) rotate(-8deg); }
  .ht-p1 { transform: rotate(68deg) translate(72px) rotate(-68deg); }
  .ht-p2 { transform: rotate(128deg) translate(72px) rotate(-128deg); }
  .ht-p3 { transform: rotate(188deg) translate(72px) rotate(-188deg); }
  .ht-p4 { transform: rotate(248deg) translate(72px) rotate(-248deg); }
  .ht-p5 { transform: rotate(308deg) translate(72px) rotate(-308deg); }
}
@media (max-width: 560px) {
  .hall-stage { aspect-ratio: 1.12 / 1; min-height: 280px; }
  .hall-panel { padding: 13px 12px 12px; border-radius: 20px; }
  .h2d-prop { width: 62px; transform: translate(-50%, -50%) rotate(var(--a)) translateY(-92px) rotate(calc(-1 * var(--a))); }
  .h2d-prop .h2d-em { font-size: 18px; }
  .hall-chip { font-size: 11.5px; padding: 6px 10px 6px 8px; }
  .hall-hint { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .ht-bot, .ht-p, .h2d-bot { animation: none; }
  .hl-dot, .thinking i, .typing-dots i { animation: none; }
}
