/* Página da IA — Madame Sibila (tenda de cartomante dentro do tema Taverna) + utilidades de chat compartilhadas */
.ia-hero { position: relative; padding: 3.2rem 0 2.6rem; background-size: cover; background-position: center 35%; border-bottom: 4px solid var(--gold); text-shadow: 0 2px 8px rgba(0, 0, 0, .7); overflow: hidden; }
.ia-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 78% 30%, rgba(255, 214, 120, .18), transparent 40%); animation: glow 5s ease-in-out infinite alternate; }
.ia-hero .wrap { position: relative; z-index: 1; }
.ia-kicker { font-family: var(--font-display); letter-spacing: .25em; color: var(--gold2); font-size: .9rem; display: block; margin-bottom: .3rem; }
.ia-hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0 0 .5rem; color: #fff3d6; }
.ia-hero h1 em { color: #c9a8ff; font-style: normal; text-shadow: 0 0 18px rgba(170, 120, 255, .8); }
.ia-hero .lead { max-width: 62ch; font-size: 1.2rem; color: #f2e8ff; }
@keyframes glow { from { opacity: .5; } to { opacity: 1; } }

.ia-grid { display: grid; grid-template-columns: minmax(250px, 340px) 1fr; gap: 1.6rem; align-items: start; }
.ia-side { position: sticky; top: 84px; }
.tarot { position: relative; margin: 0; padding: .8rem .8rem 1rem; background: linear-gradient(160deg, #3a1f66, #1b0d38); border: 3px solid var(--gold); border-radius: 14px; box-shadow: 0 14px 26px rgba(0, 0, 0, .55), inset 0 0 0 4px #1b0d38, inset 0 0 0 6px rgba(242, 210, 131, .5); animation: floaty 6s ease-in-out infinite; }
.tarot-frame { border-radius: 8px; overflow: hidden; border: 2px solid #1b0d38; aspect-ratio: 1; }
.tarot-frame img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .8s; }
.tarot:hover .tarot-frame img { transform: scale(1.06); }
.tarot figcaption { text-align: center; padding-top: .7rem; font-family: var(--font-display); color: var(--gold2); }
.tarot figcaption b { display: block; font-size: 1.4rem; letter-spacing: .04em; }
.tarot figcaption small { color: #cdb8ff; font-family: var(--font-body); font-size: .98rem; }
.spark { position: absolute; width: 14px; height: 14px; background: radial-gradient(circle, #fff7c2, transparent 70%); border-radius: 50%; animation: twinkle 2.6s ease-in-out infinite; pointer-events: none; }
.spark.s1 { top: 6%; left: -7px; } .spark.s2 { top: 40%; right: -8px; animation-delay: .9s; } .spark.s3 { bottom: 14%; left: -6px; animation-delay: 1.7s; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; transform: scale(1.5); } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(-6px) rotate(.6deg); } }

.ia-know { margin-top: 1.1rem; background: linear-gradient(180deg, var(--paper), var(--paper-2)); color: var(--text-dark); border: 2px solid var(--ink); border-radius: var(--radius); padding: .9rem 1rem 1rem; box-shadow: var(--shadow); }
.ia-know h2 { margin: 0 0 .5rem; font-size: 1.15rem; color: var(--vermilion); }
.ia-know ul { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .8rem; }
.ia-know li b { font-family: var(--font-display); color: var(--ink); font-size: 1.1rem; }
.ia-know p { margin: 0; font-size: .98rem; }

/* painel de conversa (usado também pela guia Lia no criador) */
.ia-chat { min-width: 0; }
.chat { display: flex; flex-direction: column; background: linear-gradient(180deg, #2a1648, #1b0d38); border: 3px solid var(--gold); border-radius: 12px; box-shadow: 0 14px 28px rgba(0, 0, 0, .5); color: #f2e8ff; overflow: hidden; }
.chat-log { height: min(62vh, 620px); overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .9rem; scroll-behavior: smooth; background: radial-gradient(circle at 20% 0%, rgba(120, 80, 220, .25), transparent 55%); }
.msg { display: flex; gap: .65rem; align-items: flex-start; max-width: 100%; animation: msgIn .35s ease both; }
.msg.me { justify-content: flex-end; }
.msg .av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); flex: none; box-shadow: 0 0 10px rgba(170, 120, 255, .6); }
.msg .bd { padding: .65rem .95rem; border-radius: 14px; max-width: min(100%, 720px); overflow-wrap: anywhere; line-height: 1.5; }
.msg.bot .bd { background: #f3e6c6; color: var(--text-dark); border: 2px solid #1b0d38; border-top-left-radius: 3px; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); }
.msg.me .bd { background: linear-gradient(135deg, #6a4fd0, #8a3a6b); color: #fff; border-top-right-radius: 3px; border: 2px solid rgba(255, 255, 255, .25); }
.msg .bd p { margin: 0 0 .55rem; } .msg .bd p:last-child, .msg .bd ul:last-child, .msg .bd ol:last-child { margin-bottom: 0; }
.msg .bd ul, .msg .bd ol { margin: 0 0 .55rem; padding-left: 1.3rem; }
.msg .bd h4 { margin: .5rem 0 .25rem; font-size: 1.05rem; color: var(--vermilion); }
.msg.bot .bd code { background: rgba(0, 0, 0, .1); padding: 0 .3em; border-radius: 3px; }
.msg .bd a { color: #6a2f9b; font-weight: 700; }
.md-tab { overflow-x: auto; margin: 0 0 .55rem; } .md-tab table { border-collapse: collapse; font-size: .95rem; } .md-tab th, .md-tab td { border: 1px solid rgba(0, 0, 0, .25); padding: .2rem .5rem; text-align: left; }
.srcs { margin-top: .6rem; padding-top: .5rem; border-top: 1px dashed rgba(0, 0, 0, .3); display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .88rem; }
.srcs span { font-weight: 700; color: var(--vermilion); }
.srcs a { background: #1b0d38; color: var(--gold2) !important; text-decoration: none; padding: .1rem .55rem; border-radius: 99px; font-weight: 600; }
.srcs a:hover { background: var(--vermilion); }
.typing { display: inline-flex; gap: 4px; vertical-align: middle; } .typing i { width: 7px; height: 7px; border-radius: 50%; background: #6a4fd0; animation: dot 1s infinite ease-in-out; } .typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.tl { font-style: italic; opacity: .8; }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.chat-sugs { display: flex; flex-wrap: wrap; gap: .4rem; padding: .2rem 1rem .6rem; }
.chat .chip, .lia .chip { font: inherit; font-size: .92rem; cursor: pointer; color: #f2e8ff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(242, 210, 131, .6); border-radius: 99px; padding: .25rem .8rem; transition: .2s; }
.chat .chip:hover, .lia .chip:hover { background: var(--gold); color: #1b0d38; transform: translateY(-2px); }
.chat-form { display: flex; gap: .5rem; padding: .7rem 1rem; border-top: 2px solid rgba(242, 210, 131, .4); background: rgba(0, 0, 0, .25); align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; font: inherit; padding: .55rem .75rem; border-radius: 8px; border: 2px solid var(--gold); background: #fff8e6; color: var(--text-dark); }
.chat-form textarea:focus { outline: 3px solid #b99cff; }
.chat-foot { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; padding: .35rem 1rem .6rem; font-size: .85rem; color: #bda9e8; }
.linklike { background: none; border: 0; color: var(--gold2); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ia-off { display: flex; gap: 1rem; align-items: center; background: #f3e6c6; color: var(--text-dark); border: 3px solid var(--gold); border-radius: 10px; padding: 1.2rem; } .ia-off img { border-radius: 50%; border: 2px solid #1b0d38; } .ia-off h3 { margin: 0 0 .3rem; }

.sfx-toggle { position: fixed; left: 14px; bottom: 14px; z-index: 50; width: 46px; height: 46px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; border: 3px solid var(--gold); background: #1b0d38; color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .5); transition: transform .2s; }
.sfx-toggle:hover { transform: scale(1.1) rotate(-6deg); }

@media (max-width: 860px) { .ia-grid { grid-template-columns: 1fr; } .ia-side { position: static; display: grid; grid-template-columns: 150px 1fr; gap: 1rem; align-items: start; } .ia-know { margin-top: 0; } .tarot figcaption b { font-size: 1.05rem; } }
@media (max-width: 560px) { .ia-side { grid-template-columns: 1fr; } .tarot { max-width: 260px; margin-inline: auto; } .chat-log { height: 56vh; } }
@media (prefers-reduced-motion: reduce) { .tarot, .spark, .ia-hero::after, .msg { animation: none !important; } }
.campaign-chatbar { display: flex; align-items: flex-end; gap: .7rem; padding: .75rem 1rem; background: rgba(0,0,0,.28); border-bottom: 2px solid rgba(242,210,131,.4); }
.campaign-chatbar label { flex: 1; display: grid; gap: .25rem; color: var(--gold2); font: 700 .82rem var(--font-display); }
.campaign-chatbar select { width: 100%; min-height: 40px; padding: .4rem .6rem; color: var(--text-dark); background: #fff8e6; border: 2px solid var(--gold); border-radius: 6px; font: 600 1rem var(--font-body); }
.campaign-new-chat { flex: none; min-height: 40px; padding: .45rem .8rem; }
.msg-author { display: block; margin-bottom: .25rem; color: var(--gold2); font: 700 .78rem var(--font-display); }
.chat [hidden], .cr-nav [hidden], .lia [hidden] { display: none !important; }
@media (max-width: 560px) { .campaign-chatbar { align-items: stretch; flex-direction: column; } }
