﻿/* ─── CHATBOT FLOAT ─── */
#chatbot-btn{
  position:fixed;bottom:72px;left:14px;z-index:500;
  width:50px;height:50px;border-radius:50%;
  background:linear-gradient(135deg,#6a0808,#da251d);
  border:2px solid rgba(201,168,76,.5);
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  box-shadow:0 4px 20px rgba(218,37,29,.4),0 0 0 0 rgba(218,37,29,.3);
  animation:chatPulse 2.5s infinite;
  transition:transform .2s;
}
#chatbot-btn:hover{transform:scale(1.1);}
@keyframes chatPulse{
  0%,100%{box-shadow:0 4px 20px rgba(218,37,29,.4),0 0 0 0 rgba(218,37,29,.3);}
  50%{box-shadow:0 4px 20px rgba(218,37,29,.5),0 0 0 10px rgba(218,37,29,0);}
}
.chatbot-modal{
  position:fixed;bottom:130px;left:8px;z-index:501;
  width:320px;max-height:480px;
  background:linear-gradient(180deg,#2a0800,#1a0400);
  border:1px solid rgba(201,168,76,.3);border-radius:14px;
  display:none;flex-direction:column;
  box-shadow:0 12px 40px rgba(0,0,0,.7);
  overflow:hidden;
}
.chatbot-modal.open{display:flex;}
.chatbot-header{display:flex;align-items:center;justify-content:space-between;
  padding:12px 16px;background:rgba(0,0,0,.4);
  border-bottom:1px solid rgba(201,168,76,.15);}
.chatbot-title{font-family:var(--ui-font);font-weight:700;font-size:14px;color:var(--gold2);letter-spacing:.5px;}
.chatbot-close{background:none;border:none;color:var(--warm);font-size:18px;cursor:pointer;padding:0 4px;}
.chatbot-close:hover{color:var(--gold2);}
.chatbot-messages{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:10px;
  scrollbar-width:thin;scrollbar-color:rgba(201,168,76,.2) transparent;}
.chat-msg{display:flex;}
.chat-msg.bot{justify-content:flex-start;}
.chat-msg.user{justify-content:flex-end;}
.chat-bubble{max-width:85%;padding:9px 13px;border-radius:14px;font-size:13px;line-height:1.6;}
.chat-msg.bot .chat-bubble{background:rgba(201,168,76,.1);border:1px solid rgba(201,168,76,.2);color:var(--parch);border-bottom-left-radius:4px;}
.chat-msg.user .chat-bubble{background:rgba(218,37,29,.2);border:1px solid rgba(218,37,29,.3);color:var(--parch);border-bottom-right-radius:4px;}
.chat-typing{display:flex;gap:4px;padding:10px 13px;}
.chat-dot{width:7px;height:7px;border-radius:50%;background:var(--gold);
  animation:chatDot .9s infinite;}
.chat-dot:nth-child(2){animation-delay:.15s;}
.chat-dot:nth-child(3){animation-delay:.3s;}
@keyframes chatDot{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}
.chatbot-input-row{display:flex;gap:8px;padding:10px 12px;
  border-top:1px solid rgba(201,168,76,.12);background:rgba(0,0,0,.3);}
.chatbot-input{flex:1;background:rgba(255,255,255,.07);border:1px solid rgba(201,168,76,.2);
  border-radius:20px;padding:8px 14px;color:var(--parch);font-size:13px;outline:none;
  font-family:var(--ui-font);}
.chatbot-input:focus{border-color:var(--gold);}
.chatbot-input::placeholder{color:rgba(255,255,255,.3);}
.chatbot-send{width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,#7a0808,#da251d);
  border:none;color:var(--gold2);font-size:16px;cursor:pointer;
  display:flex;align-items:center;justify-content:center;transition:transform .2s;}
.chatbot-send:hover{transform:scale(1.1);}


/* ─── PATH MAP FULL WIDTH + ARROW NAV ─── */
.path-map-wrap{flex:1;display:flex;flex-direction:column;position:relative;overflow:hidden;min-height:240px;}
.path-map-viewport{
  flex:1;overflow-x:hidden;overflow-y:hidden;position:relative;
  min-height:220px;
}
.path-map-canvas{position:absolute;top:0;left:0;height:100%;transition:transform .4s cubic-bezier(.4,0,.2,1);}

/* Arrow buttons overlay */
.path-arrow{
  position:absolute;top:50%;transform:translateY(-50%);
  width:38px;height:64px;z-index:15;
  background:rgba(0,0,0,.7);border:1px solid rgba(255,255,255,.12);
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;color:rgba(255,255,255,.7);font-size:20px;
  transition:all .2s;border-radius:4px;
  backdrop-filter:blur(4px);
}
.path-arrow:hover{background:rgba(0,0,0,.9);color:#fff;}
.path-arrow:disabled,.path-arrow[disabled]{opacity:.2;cursor:not-allowed;}
.path-arrow-l{left:0;border-left:none;border-radius:0 4px 4px 0;}
.path-arrow-r{right:0;border-right:none;border-radius:4px 0 0 4px;}

/* nav bar below */
.path-nav{
  display:flex;justify-content:center;align-items:center;
  padding:5px 16px 6px;background:rgba(0,0,0,.3);
  border-top:1px solid rgba(201,168,76,.1);flex-shrink:0;
}
.path-nav-btn{display:none;}/* hidden — using overlay arrows instead */
.path-nav-counter{font-size:11px;color:rgba(201,168,76,.55);letter-spacing:.5px;}


/* ─── PATH MAP FILL HEIGHT FIX ─── */
#s-map{display:flex;flex-direction:column;}
#s-map .path-map-wrap{
  flex:1 1 0;
  min-height:0;
  overflow:hidden;
}
#s-map .path-map-viewport{
  flex:1 1 0;
  min-height:0;
  height:100%;
  overflow-x:hidden;
  overflow-y:hidden;
  position:relative;
}
#s-map .path-map-canvas{
  position:absolute;top:0;left:0;
  height:100%;
  transition:transform .4s cubic-bezier(.4,0,.2,1);
}
/* Background fill full area */
.theme-myth #s-map .path-map-wrap,
.theme-myth .path-map-viewport{background:linear-gradient(180deg,#2a0840,#0d0118);}
.theme-battle #s-map .path-map-wrap,
.theme-battle .path-map-viewport{background:linear-gradient(180deg,#3a0808,#0d0102);}
.theme-dynasty #s-map .path-map-wrap,
.theme-dynasty .path-map-viewport{background:linear-gradient(180deg,#2a1a00,#0d0a01);}


/* ─── LANDING OVERFLOW FIX ─── */
#s-landing{overflow:hidden;min-height:100vh;max-height:100vh;}
.screen.active{min-height:100vh;}


/* ─── PATH MAP FOR FIXED SCREEN ─── */
.path-map-wrap{flex:1;min-height:0;display:flex;flex-direction:column;position:relative;overflow:hidden;}
.path-map-viewport{flex:1;min-height:0;overflow:hidden;position:relative;}
.path-map-canvas{position:absolute;top:0;left:0;height:100%;transition:transform .4s cubic-bezier(.4,0,.2,1);}
#s-map{display:none;position:fixed;top:0;left:0;width:100%;height:100%;flex-direction:column;overflow:hidden;}
#s-map.active{display:flex;}
#s-event{overflow:hidden !important;}
#s-event .evbody{overflow-y:auto !important;}
#s-journal,#s-catselect,#s-pay,#s-auth,#s-payment{overflow-y:auto;}


/* ══════════════════════════════════════════════
/* ════════════════════════════════════════════════════
   CHATBOT — Final overrides (moved from cleanup.js)
   Loaded after base chatbot.css rules; takes precedence
   over earlier rules via cascade + !important.
   ════════════════════════════════════════════════════ */
#chatbot-btn{
  position:fixed !important;
  left:14px !important;
  bottom:72px !important;
  width:62px !important;
  height:62px !important;
  z-index:100101 !important;
  pointer-events:auto !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  border-radius:50% !important;
  background:linear-gradient(145deg,rgba(18,22,40,.96),rgba(44,18,64,.96)) !important;
  border:1px solid rgba(201,168,76,.28) !important;
  box-shadow:0 12px 28px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.06) !important;
  backdrop-filter:blur(12px) !important;
  -webkit-backdrop-filter:blur(12px) !important;
  overflow:hidden !important;
}

#chatbot-btn .asset-icon{
  width:48px;
  height:48px;
  border-radius:50%;
  box-shadow:0 0 0 2px rgba(240,208,128,.42), 0 8px 18px rgba(0,0,0,.26) !important;
}

.chatbot-modal{
  left:14px !important;
  bottom:136px !important;
  width:min(360px, calc(100vw - 28px)) !important;
  max-height:min(520px, calc(100vh - 170px)) !important;
  z-index:100100 !important;
  pointer-events:auto !important;
}

.chatbot-messages{
  min-height:0 !important;
}

.chat-bubble{
  word-break:break-word;
}

/* Hide auto-generated greeting bot bubble; chatbot.js renders its own */
#chatbot-msgs .chat-msg.bot[data-auto-greeting]{
  display:none !important;
}
