.home-view{
  position: fixed;
  inset: 0;
  background: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 100;
  padding-top: 40px;
}
.home-view h1{
  font-size: 52px;
  letter-spacing: 6px;
  color: #eee;
  margin-bottom: 30px;
  flex-shrink: 0;
}
.home-map{
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90%;
  max-height: 65vh;
  overflow: hidden;
}
.home-map img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.home-frame-left,
.home-frame-right{
  position: absolute;
  background: #1a1a1a;
  border: 1px solid #333;
}
.home-frame-left{
  top: 0; bottom: 0; left: 0;
  width: 64px;
}
.home-frame-right{
  top: 0; bottom: 0; right: 0;
  width: 48px;
}

.home-menu{
  position: absolute;
  bottom: 70px;
  left: 70px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.home-menu > button{
  padding: 14px 28px;
  background: #222;
  border: 1px solid #555;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  border-radius: 6px;
  min-width: 200px;
  text-align: center;
  font-family: Georgia, serif;
}
.home-menu > button:hover{
  background: #333;
  border-color: #888;
}.home-menu{
  position: absolute;
  bottom: 70px;
  left: 70px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.home-menu > button{
  padding: 14px 28px;
  background: #222;
  border: 1px solid #555;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  border-radius: 6px;
  min-width: 200px;
  text-align: center;
  font-family: Georgia, serif;
}
.home-menu > button:hover{
  background: #333;
  border-color: #888;
}
.home-menu > button#btnMainMenu,
.home-menu > button#btnGoBoutique{
  padding: 14px 28px;
  background: #222;
  border: 1px solid #555;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  border-radius: 6px;
  min-width: 200px;
  text-align: center;
}
.home-menu > button#btnMainMenu:hover,
.home-menu > button#btnGoBoutique:hover{
  background: #333;
  border-color: #888;
}
.home-sub{
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
  position: absolute;
  bottom: 100%;
  left: 0;
}
.home-sub.visible{ display: flex; }
.home-sub button{
  padding: 8px 18px;
  background: #1e1e1e;
  border: 1px solid #444;
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  min-width: 160px;
  text-align: left;
}
.home-sub button:hover{
  background: #2a2a2a;
  border-color: #666;
  color: #fff;
}

/* Aperçu deck de départ */
#starterOverlay .login-box{
  min-width: min(920px, 92vw);
  max-width: 960px;
  max-height: 90vh;
  overflow-y: auto;;
}
#starterPreview{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 18px 0 20px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 8px;
}

/* Bouton démarrer combat */
.btn-start-battle{
  margin-top: 18px;
  padding: 12px 28px;
  background: #2a2218;
  border: 1px solid #c9a227;
  color: #f0d78c;
  font-size: 16px;
  font-family: Georgia, serif;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.5px;
  z-index: 20;
  flex-shrink: 0;
}
.btn-start-battle:hover{
  background: #3a3218;
  border-color: #e8c84a;
}

/* ===== BANDEAU QUÊTES ===== */
.quest-panel{
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80px;
  background: #1a1a1a;
  border-left: 1px solid #444;
  z-index: 30;
  transition: width 0.35s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}
.quest-panel.expanded{
  width: 400px;
}

.quest-toggle{
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 40;
}
.quest-toggle img{
  width: 100px;
  height: 100px;
  display: block;
  transition: transform 0.35s ease;
  pointer-events: none;
}
.quest-panel.expanded .quest-toggle img{
  transform: rotate(180deg);
}

.quest-header{
  width: 100%;
  padding: 16px 8px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  z-index: 2;
  box-sizing: border-box;
  position: relative;
  min-height: 70px;
}

.quest-parchemin{
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  position: absolute;
  top: 16px;
  right: 12px;
  left: auto;
  transition: right 0.35s ease, left 0.35s ease, transform 0.35s ease;
}
.quest-panel.expanded .quest-parchemin{
  right: auto;
  left: 50%;
  transform: translateX(-50%);
}
.quest-panel.expanded.show-title .quest-parchemin{
  left: calc(50% - 40px);
  transform: translateX(-50%);
}

.quest-title{
  font-size: 20px;
  color: #f0d78c;
  letter-spacing: 1px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  margin-left: 36px;
}
.quest-panel.expanded.show-title .quest-title{
  opacity: 1;
}

.quest-content{
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 10px 20px 14px;
  width: 100%;
  box-sizing: border-box;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #c9a227 rgba(0, 0, 0, 0.3);
}
.quest-panel.expanded.show-title .quest-content{
  opacity: 1;
  pointer-events: auto;
}

.quest-content::-webkit-scrollbar{
  width: 8px;
}
.quest-content::-webkit-scrollbar-track{
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}
.quest-content::-webkit-scrollbar-thumb{
  background: #c9a227;
  border-radius: 4px;
}
.quest-content::-webkit-scrollbar-thumb:hover{
  background: #e8c84a;
}

.periodic-dock{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  right:132px;
  bottom:auto;
  width:300px;
  z-index:20;
  display:flex;
  flex-direction:column;
  gap:6px;
  pointer-events:auto;
  transition: opacity .25s ease, transform .25s ease;
  max-height:calc(100% - 16px);
  overflow:auto;
}
.home-view:has(.quest-panel.expanded) .periodic-dock{
  opacity:0;
  pointer-events:none;
}
.periodic-heading{
  margin:6px 0 0;
  padding:0 2px;
  color:#f0d78c;
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-weight:bold;
}
.periodic-heading:first-child{ margin-top:0; }
.periodic-card{
  flex:0 0 auto;
  height:96px;
  min-height:96px;
  max-height:96px;
  display:flex;
  background:#222;
  border:1px solid #444;
  border-radius:8px;
  overflow:hidden;
}
.periodic-card.quest-ready{
  border-color:#c9a227;
}
.periodic-card.is-done{
  border-color:#3a3;
  opacity:.92;
}
.periodic-card-main{
  flex:2;
  min-width:0;
  padding:4px 8px 6px;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  gap:2px;
}
.periodic-card-main .quest-card-title{
  font-size:13px;
  margin:0 0 1px;
  line-height:1.15;
}
.periodic-status{
  font-size:13px;
  color:#bbb;
  line-height:1.25;
  white-space:normal;
  overflow:hidden;
  display:-webkit-box;
  line-clamp:2;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  min-height:32px;
}
.periodic-card.is-done .periodic-status{
  color:#7d7;
  font-style:italic;
}
.periodic-card-main .quest-bar-wrap{
  margin:6px 0 0;
  margin-top:auto;
  height:14px;
}
.periodic-card-main .quest-claim-btn{
  margin-top:2px;
  padding:3px 8px;
  font-size:11px;
  width:auto;
  align-self:flex-start;
}
.periodic-card-rew{
  flex:1;
  min-width:72px;
  max-width:38%;
  border-left:1px solid #333;
  background:#1c1c1c;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:6px;
  color:#f0d78c;
  font-size:12px;
  text-align:center;
}
.periodic-card-rew .quest-reward{
  transform:scale(.85);
  transform-origin:center;
}

.quest-card{
  background: #222;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 14px 12px;
  color: #ddd;
  flex-shrink: 0;
}
.quest-card.quest-ready{
  border-color: #c9a227;
  box-shadow: 0 0 0 1px rgba(201,162,39,0.25);
}
.quest-card-title{
  font-size: 16px;
  color: #f0d78c;
  font-weight: bold;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.quest-card-desc{
  font-size: 13px;
  color: #bbb;
  line-height: 1.4;
  white-space: pre-line;
  margin-bottom: 10px;
}

.quest-bar-wrap{
  position: relative;
  height: 18px;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 10px;
}
.quest-bar-fill{
  height: 100%;
  background: linear-gradient(90deg, #c9a227, #e8c84a);
  border-radius: 9px;
  transition: width 0.4s ease;
  min-width: 0;
}
.quest-bar-nums{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #eee;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}
.quest-bar-fill.bar-low{
  background: linear-gradient(90deg, #c45a12, #e07a30);
}
.quest-bar-fill.bar-mid{
  background: linear-gradient(90deg, #c9a227, #e8c84a);
}
.quest-bar-fill.bar-done{
  background: linear-gradient(90deg, #2a8a3a, #4caf50);
}

.quest-rewards-label{
  font-size: 12px;
  color: #aaa;
  margin-bottom: 6px;
}
.quest-rewards-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  min-height: 40px;
}
.quest-reward{
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #f0d78c;
}
.quest-reward-canette{
  width: 28px;
  height: 36px;
  object-fit: contain;
}

.quest-claim-btn{
  width: 100%;
  padding: 10px;
  background: #2a2218;
  border: 1px solid #c9a227;
  color: #f0d78c;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: Georgia, serif;
  letter-spacing: 0.5px;
}
.quest-claim-btn:hover{
  background: #3a3218;
  border-color: #e8c84a;
}
.quest-empty{
  text-align: center;
  color: #666;
  font-size: 13px;
  padding: 20px 0;
}

.profile-title{
  font-size: 12px;
  color: #c9a227;
  font-style: italic;
  text-align: right;
  margin-top: 2px;
}

.quest-reward-booster{
  width: 62px;
  height: 86px;
  object-fit: contain;
  display: block;
}