/* Dragones game table + waiting-room styles. Extracted from GameLive.Show. */

/* Height chain: body -> LiveView wrapper -> main.game-layout -> .game.
   Only .game-log scrolls; every parent clips and passes a bounded height. */
.game { position:relative; flex:1 1 0; width:100%; min-height:0; overflow:hidden; display:flex; flex-direction:column; gap:.6rem; padding:.6rem; box-sizing:border-box; }
.game-topbar { flex:0 0 auto; min-height:0; }
.turn-bar{display:flex; align-items:center; gap:1rem; background:#1f1f1f; border:1px solid #333; border-radius:6px; padding:.4rem .8rem; font-size:.9rem; min-width:0;}
.game-body { flex:1 1 0; min-height:0; display:grid; grid-template-columns:220px minmax(0,1fr) 220px; gap:.6rem; overflow:hidden; }
.game-rail { min-height:0; display:flex; flex-direction:column; gap:.6rem; overflow:hidden; }
.game-center { min-width:0; min-height:0; display:flex; flex-direction:column; gap:.4rem; overflow:hidden; }
.round{font-weight:bold; color:#fb0;}
.initiative{display:flex; gap:.4rem; list-style:none; padding:0; margin:0;}
.initiative li{padding:.15rem .5rem; background:#2a2a2a; border-radius:4px; border:1px solid #333;}
.initiative li.active{background:#3a3a1a; border-color:#bb0; color:#ff5;}
.whose-turn{font-weight:bold;}
.controls{margin-left:auto; display:flex; gap:.4rem; align-items:center;}
.viewer-tag{font-size:.8rem; color:#7ab;}
.ctl-btn{padding:.25rem .7rem; font-size:.8rem; border-radius:4px; border:1px solid #555; background:#2c2c2c; color:#eee; cursor:pointer; text-decoration:none;}
.ctl-btn:hover{background:#3a3a3a;}
/* Botón de ajustes de IA: engranaje SVG + provider/modelo (razonamiento) */
.ai-btn{display:inline-flex;align-items:center;gap:.45rem;padding:.2rem .65rem .2rem .5rem;}
.ai-btn .ai-gear{display:inline-flex;align-items:center;color:#fc8;line-height:0;}
.ai-btn .ai-gear svg{width:19px;height:19px;display:block;transition:transform .55s cubic-bezier(.4,0,.2,1);}
.ai-btn:hover .ai-gear svg{transform:rotate(120deg);color:#ffe08a;}
.ai-btn .ai-label{font-size:.7rem;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:#9ab;max-width:34ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:ltr;}
.ctl-active{background:#3a2a1a !important;border-color:#a72 !important;color:#fc8 !important;}
.toast-stack{position:absolute; top:3.4rem; left:50%; transform:translateX(-50%); z-index:5; display:flex; flex-direction:column; align-items:center; gap:.4rem; width:min(720px, calc(100% - 2rem)); pointer-events:none;}
.game-toast{max-width:100%; background:rgba(58,42,10,.96); border:1px solid #ea0; color:#ff5; padding:.45rem .9rem; border-radius:999px; font-weight:bold; box-shadow:0 8px 24px rgba(0,0,0,.35); pointer-events:auto;}
.my-turn-banner{animation:pulse 1.5s infinite;}
@keyframes pulse{0%,100%{opacity:1;}50%{opacity:.6;}}
.intent-banner{display:flex; align-items:center; gap:.6rem; background:rgba(26,42,58,.96); border-color:#4af; color:#cdf; font-size:.85rem;}
.game-input{display:flex; gap:.4rem;}
.game-input-area{flex:0 0 auto; min-height:0;}
.game-input input{flex:1 1 auto; min-width:0; padding:.5rem; font-size:1rem; background:#222; color:#eee; border:1px solid #444; border-radius:4px;}
.game-input button{flex:0 0 auto; padding:.5rem 1.2rem; font-size:1rem; background:#2c2c2c; color:#eee; border:1px solid #555; border-radius:4px; cursor:pointer;}
.game-input button:hover:not(:disabled){background:#3a3a3a;}
.game-log{flex:1 1 0; min-height:0; background:#111; border:1px solid #333; border-radius:6px; padding:.8rem; font-size:.95rem; line-height:1.4; overflow:auto;}
.load-more-btn{display:block; width:100%; margin:0 0 .8rem; padding:.4rem; font-size:.78rem; color:#7ab; background:#1a1a1a; border:1px dashed #333; border-radius:4px; cursor:pointer; font-family:inherit;}
.load-more-btn:hover{color:#cdf; background:#222; border-color:#555;}
.turn-block{margin:0 0 .9rem; padding:0; border-left:2px solid #2a2a2a; padding-left:.6rem;}
.turn-block:first-child{margin-top:0;}
.turn-head{margin:0 0 .4rem; padding-bottom:.2rem; border-bottom:1px solid #222;}
.th-line{display:flex; align-items:baseline; gap:.4rem; flex-wrap:wrap; font-size:.78rem; color:#9ab;}
.th-round{font-weight:bold; color:#fb0; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:.74rem;}
.th-sep{color:#444;}
.th-actor{font-weight:bold; color:#cdf;}
.th-actor.dm-side{color:#b08a3e;}
.th-actor.mine{color:#4fbf90;}
.th-actor.auto{color:#c8a8ff;}
.th-you{font-size:.62rem; padding:.05rem .3rem; margin-left:.3rem; border-radius:3px; background:#1a3a2a; color:#7e7; border:1px solid #2f6a4a;}
.th-phase{font-size:.7rem; color:#a55; padding:.05rem .35rem; border-radius:3px; background:#2a1a1a; border:1px solid #422;}
.msg{margin:0 0 .6rem;} .msg .who{display:inline-block; margin-right:.4rem; font-weight:bold; color:#7ab;}
/* The chip for a player's chat-input action: discrete icon-only by
   default, full text on hover as a tooltip. Never inline in the
   timeline — it's the player's intent, not narration. */
.player-declared-chip{display:inline-flex; align-items:center; gap:.25rem; font-size:.78rem; color:#666; background:transparent; padding:.05rem .25rem; border-radius:4px; cursor:help; opacity:.5;}
.player-declared-chip:hover{opacity:1; background:#1a1a1a;}
.msg-dm{color:#e8dcc4;} .msg-dm .who{color:#b08a3e;}
.msg-pc{color:#ffe9b0; border-left:2px solid #a55; padding-left:.5rem; margin-left:.2rem; font-style:italic;} .msg-pc .who{color:#fb0; font-style:normal; font-weight:bold;}
.msg-roll{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:.86rem; color:#9cdec8; background:#11221c; border:1px solid #1f4a39; border-radius:4px; padding:.25rem .5rem; margin:.15rem 0;} .msg-roll .who{color:#4fbf90; font-family:Georgia,serif; font-size:.78rem;}
.msg-roll.roll-hit,.msg-roll.roll-crit,.msg-roll.roll-success,.msg-roll.roll-revive{border-color:#2f6a4a; color:#bdf0d4;}
.msg-roll.roll-miss,.msg-roll.roll-failure,.msg-roll.roll-crit_fail{border-color:#5a2a2a; color:#f0bdb0;}
.msg-system{color:#777; font-style:italic;}
.msg-system.thinking::after{content:" ⋯"; animation:dots 1.2s infinite;}
@keyframes dots{0%{opacity:.3;}50%{opacity:1;}100%{opacity:.3;}}
.live-streaming{position:relative; opacity:.92;}
.live-streaming .cursor{display:inline-block; color:#fc8; animation:blink 1s steps(2) infinite; margin-left:1px;}
@keyframes blink{0%,50%{opacity:1;}51%,100%{opacity:0;}}
.sheet{flex:1 1 0; min-height:0; display:flex;}
.card,.empty-sheet{flex:1 1 auto; min-height:0; overflow:hidden; background:#222; border:1px solid #3a3a3a; border-radius:8px; padding:.6rem;}
.card h3{margin:0; font-size:1rem;} .card p{margin:.2rem 0; font-size:.85rem;}
.side-enemy{border-color:#5a2222;} .card.your-turn{box-shadow:0 0 0 2px #bb0 inset;}
.card.mine{box-shadow:0 0 0 2px #4af inset;}
.you-tag{font-size:.7rem;color:#4af;font-weight:bold;margin-left:.4rem;}
.conds{display:flex;flex-wrap:wrap;gap:.2rem;margin:.2rem 0 0;}
.cond-badge{font-size:.65rem;padding:.08rem .3rem;border-radius:3px;background:#3a2222;border:1px solid #744;color:#faa;}
.hp{height:8px; background:#400; border-radius:4px; margin:.3rem 0; overflow:hidden;}
.hp-fill{height:100%; background:#3c3;}
.combat-tracker{flex:1 1 0; min-height:0; display:flex; flex-direction:column; background:#1a1a1a; border:1px solid #3a2222; border-radius:8px; overflow:hidden;}
.ct-header{display:flex; align-items:center; gap:.4rem; padding:.45rem .6rem; background:#2a1818; border-bottom:1px solid #3a2222; color:#fc8; font-weight:bold; font-size:.85rem;}
.ct-header .ct-round{margin-left:auto; color:#fb0; font-size:.78rem;}
.ct-list{flex:1 1 auto; min-height:0; overflow:auto; padding:.4rem; display:flex; flex-direction:column; gap:.35rem;}
.combatant{display:flex; gap:.4rem; padding:.4rem; background:#222; border:1px solid #333; border-radius:6px;}
.combatant.acting{border-color:#bb0; box-shadow:0 0 0 2px rgba(187,170,0,.3);}
.combatant.mine{box-shadow:0 0 0 2px #4af inset;}
.combatant.side-enemy{background:#2a1a1a; border-color:#5a2222;}
.ct-mark{color:#ff5; width:.7rem; flex:0 0 auto; font-size:.8rem;}
.ct-body{flex:1 1 auto; min-width:0;}
.ct-name{font-weight:bold; font-size:.88rem;}
.ct-down{color:#f55;}
.ct-stats{font-size:.72rem; color:#9ab;}
.combatant .hp{margin:.2rem 0;}
.modal{position:fixed; inset:0; background:rgba(0,0,0,.6); display:flex; align-items:center; justify-content:center; z-index:10;}
.modal-box{background:#222; border:1px solid #555; border-radius:10px; padding:1.2rem 2rem; text-align:center;}
.modal-box ul{list-style:none; padding:0; font-size:1.3rem;}
.dice-hidden{display:none !important;}
.dice-overlay{backdrop-filter:blur(2px);}
.dice-modal-box{min-width:320px;}
.dice-modal-box h2{color:#fc8; font-size:1.1rem;}
.dice-modal-box .dicex-roller{margin:.6rem auto;}
.dice-modal-box .dicex-engine-3d{width:min(460px,80vw);--dicex-stage-h:320px;}
.dice-modal-box .dicex-engine-2d{width:fit-content;min-width:220px;--dicex-stage-h:200px;}
.dice-results{display:flex;flex-direction:column;align-items:center;gap:.55rem;margin-top:.4rem;}
.dice-results-title{font-size:.75rem;color:#9ab;text-transform:uppercase;letter-spacing:.08em;}
.dice-result-list{display:flex;flex-wrap:wrap;justify-content:center;gap:.45rem;max-width:min(440px,76vw);}
.die-result{display:flex;align-items:center;gap:.35rem;background:#171717;border:1px solid #444;border-radius:999px;padding:.28rem .65rem;}
.die-kind{font-size:.78rem;color:#9ab;}
.die-value{font-size:1.25rem;font-weight:bold;color:#ff5;line-height:1;}
.dice-rolling-text{font-size:1.1rem; color:#fc8; font-style:italic; margin-top:.4rem;}
.dice-groups{display:flex;flex-direction:column;gap:.5rem;margin-top:.5rem;width:100%;max-width:min(440px,80vw);margin-left:auto;margin-right:auto;}
.dice-group{background:#161616;border:1px solid #3a3a3a;border-left:4px solid #777;border-radius:8px;padding:.5rem .7rem;text-align:left;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;}
.dice-group.dg-win{border-left-color:#3c3;color:#cfe;}
.dice-group.dg-lose{border-left-color:#c33;color:#fdc;}
.dice-group.dg-neutral{color:#cbd;}
.dg-head{display:flex;justify-content:space-between;gap:.6rem;align-items:baseline;margin-bottom:.2rem;font-family:Georgia,serif;}
.dg-who{font-weight:bold;color:#fc8;font-size:.9rem;}
.dg-reason{font-size:.78rem;color:#9ab;font-style:italic;}
.dg-line{font-size:.92rem;color:#e8e8e8;}
.dg-against{color:#9ab;margin-left:.3rem;}
.dg-outcome{margin-top:.25rem;font-weight:bold;font-size:.95rem;font-family:Georgia,serif;}
.dg-win .dg-outcome{color:#7e7;}
.dg-lose .dg-outcome{color:#f99;}
.loading{flex:1 1 auto; display:flex; align-items:center; justify-content:center; color:#888; font-size:1.2rem;}
.back-link{color:#7ab; text-decoration:none; font-size:.8rem;}
.picker{position:fixed; inset:0; background:rgba(0,0,0,.75); display:flex; align-items:center; justify-content:center; z-index:20;}
.picker-box{background:#222; border:1px solid #555; border-radius:10px; padding:1.5rem 2rem; text-align:center; min-width:280px;}
.picker h2{margin:0 0 1rem;}
.picker button{display:block; width:100%; margin:.3rem 0; padding:.6rem; font-size:1rem; background:#2c2c2c; color:#eee; border:1px solid #555; border-radius:6px; cursor:pointer;}
.picker button:hover{background:#3a3a3a;}

.wr{max-width:960px;margin:0 auto;padding:1.5rem;font-family:Georgia,'Times New Roman',serif;}
.wr-header{text-align:center;margin-bottom:1.5rem;}
.wr-header h1{color:#fc8;font-size:1.6rem;margin-bottom:.3rem;}
.wr-header .scene{color:#889;font-size:.85rem;font-style:italic;}
.wr-layout{display:grid;grid-template-columns:1fr 320px;gap:1.5rem;align-items:start;}
@media(max-width:768px){.wr-layout{grid-template-columns:1fr;}}
.slots-area h2{color:#7ab;font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;margin:0 0 .8rem;}
.slots-circle{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:.8rem;}
.slot-card{background:#1a1a1a;border:2px solid #333;border-radius:12px;padding:1rem;text-align:center;transition:all .2s;}
.slot-card.ready{border-color:#474;}
.slot-card.you{border-color:#a72;box-shadow:0 0 12px rgba(170,100,30,.2);}
.slot-card.empty{border-style:dashed;opacity:.6;}
.slot-card .avatar{font-size:2rem;margin-bottom:.3rem;}
.slot-card .sname{font-weight:700;color:#eee;font-size:.9rem;}
.slot-card .shero{color:#889;font-size:.75rem;margin-top:.1rem;}
.slot-card .sbadge{display:inline-block;font-size:.65rem;padding:.15rem .4rem;border-radius:10px;margin-top:.4rem;}
.sbadge-ready{background:#1a2a1a;color:#9f9;border:1px solid #474;}
.sbadge-waiting{background:#2a2a1a;color:#fc8;border:1px solid #553;}
.sbadge-empty{background:#222;color:#666;border:1px solid #333;}
.hero-picker{margin-top:.8rem;padding:.6rem;background:#222;border-radius:8px;}
.hero-picker-label{font-size:.68rem;color:#7ab;text-transform:uppercase;margin-bottom:.4rem;text-align:left;}
.hero-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(90px,1fr));gap:.3rem;}
.hero-btn{padding:.4rem .2rem;background:#1a1a1a;border:1px solid #333;border-radius:6px;cursor:pointer;text-align:center;font-size:.75rem;color:#ccc;transition:all .12s;}
.hero-btn:hover{border-color:#a72;background:#3a2a1a;color:#fc8;}
.hero-btn .hn{font-weight:600;}
.hero-btn .hd{font-size:.65rem;color:#666;margin-top:.1rem;}
.sidebar{display:flex;flex-direction:column;gap:1rem;}
.panel{background:#1a1a1a;border:1px solid #333;border-radius:10px;padding:1rem;}
.panel h3{color:#7ab;font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;margin:0 0 .5rem;}
.share-link{color:#7ab;font-size:.78rem;word-break:break-all;background:#222;padding:.4rem;border-radius:4px;margin:.3rem 0;}
.copy-btn{width:100%;padding:.5rem;border-radius:6px;border:1px solid #444;background:#2c2c2c;color:#eee;font-size:.82rem;cursor:pointer;font-family:inherit;margin-top:.3rem;}
.copy-btn:hover{background:#3a3a3a;}
.start-btn{width:100%;padding:.8rem;border-radius:8px;border:1px solid #a72;background:#3a2a1a;color:#fc8;font-size:1.05rem;cursor:pointer;font-family:inherit;}
.start-btn:hover{background:#4a3520;}
.info-row{font-size:.75rem;color:#889;padding:.2rem 0;}
.no-hero{color:#666;font-size:.78rem;font-style:italic;padding:.5rem;}

/* --- Ajustes de IA modal -------------------------------------------------- */
.settings-modal{flex-direction:column;}
.settings-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.65);backdrop-filter:blur(2px);}
.settings-box{position:relative;z-index:1;min-width:min(420px,90vw);max-width:520px;text-align:left;padding:1.3rem 1.5rem;}
.settings-box h2{margin:0 0 1rem;color:#fc8;font-size:1.05rem;text-align:center;}
.settings-section{margin-bottom:1rem;}
.settings-label{font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:#7ab;margin-bottom:.4rem;display:flex;align-items:center;gap:.4rem;}
.settings-refresh{margin-left:auto;background:#2c2c2c;border:1px solid #555;color:#9ab;border-radius:4px;cursor:pointer;font-size:.85rem;line-height:1;padding:.15rem .45rem;}
.settings-refresh:hover{background:#3a3a3a;color:#eee;}
.settings-providers{display:flex;flex-wrap:wrap;gap:.4rem;}
.settings-pbtn{display:inline-flex;align-items:center;gap:.35rem;padding:.4rem .7rem;font-size:.8rem;border-radius:6px;border:1px solid #555;background:#2c2c2c;color:#ccc;cursor:pointer;font-family:inherit;}
.settings-pbtn:hover:not(:disabled){background:#3a3a3a;color:#eee;}
.settings-pbtn.sel{background:#3a2a1a;border-color:#a72;color:#fc8;}
.settings-pbtn.disabled{opacity:.45;cursor:not-allowed;}
.settings-dot{width:.5rem;height:.5rem;border-radius:50%;background:#555;}
.settings-dot.on{background:#5b5;background:#6d6;}
.settings-dot.off{background:#555;}
.settings-select,.settings-input{width:100%;box-sizing:border-box;padding:.5rem .6rem;font-size:.85rem;background:#1a1a1a;color:#eee;border:1px solid #444;border-radius:5px;font-family:inherit;}
.settings-select:focus,.settings-input:focus{outline:none;border-color:#a72;}
.settings-input{margin-top:.4rem;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.8rem;}
.settings-msg{font-size:.8rem;color:#9ab;padding:.45rem .6rem;background:#1a1a1a;border:1px solid #333;border-radius:5px;}
.settings-msg.warn{color:#fc8;border-color:#553;background:#2a2a1a;}
.settings-reasoning{display:flex;gap:.4rem;}
.settings-rbtn{flex:1 1 0;padding:.45rem;font-size:.82rem;border-radius:6px;border:1px solid #555;background:#2c2c2c;color:#ccc;cursor:pointer;font-family:inherit;}
.settings-rbtn:hover{background:#3a3a3a;color:#eee;}
.settings-rbtn.sel{background:#3a2a1a;border-color:#a72;color:#fc8;}
.settings-actions{display:flex;gap:.5rem;justify-content:flex-end;margin-top:1.2rem;}
.settings-hint{font-size:.72rem;color:#777;font-style:italic;margin:.7rem 0 0;line-height:1.4;}
