/* ===================================================================== */
/* Adventure Journal (#quests-modal): the CoreCraftia fantasy frame -      */
/* bright blue border, wooden title plank, 3D tabs/cards and leaf corners. */
/* Presentation only: markup, ids and behaviour are untouched; layout stays */
/* with windows.css. Loaded last, so it uses "body #quests-modal" and       */
/* !important where the older sheets do.                                    */
/* ===================================================================== */

body #quests-modal{
  --qj-frame: #2f93ff;
  --qj-wood: linear-gradient(180deg, #d79a58 0%, #b87438 52%, #8d5226 100%);
  --qj-grain: repeating-linear-gradient(92deg, rgba(60, 28, 6, 0) 0 22px, rgba(60, 28, 6, 0.16) 22px 24px);
  --qj-card: linear-gradient(180deg, #0c2144, #081a38);
  --qj-card-on: linear-gradient(180deg, #4aa6ff 0%, #2677e6 52%, #1757bd 100%);
  --qj-leaf-tl: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%280%200%29%20scale%281%201%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --qj-leaf-tr: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%2890%200%29%20scale%28-1%201%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --qj-leaf-bl: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%280%2070%29%20scale%281%20-1%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --qj-leaf-br: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%2890%2070%29%20scale%28-1%20-1%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  font-family: Georgia, "Times New Roman", serif !important;
}

/* ---- frame ---- */
body #quests-modal{
  overflow: visible !important;
  border: 4px solid var(--qj-frame) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(90, 170, 255, 0.22), transparent 60%),
    linear-gradient(180deg, #123c72 0%, #0b2750 52%, #081b38 100%) !important;
  box-shadow:
    0 0 0 2px #082f66,
    0 18px 44px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(150, 210, 255, 0.35),
    inset 0 3px 0 rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body #quests-modal::before{ display: none !important; }
body #quests-modal::after{
  content: "";
  position: absolute;
  left: -12px;
  top: -12px;
  width: calc(100% + 24px) !important;
  height: calc(100% + 24px) !important;
  max-width: none !important;
  max-height: none !important;
  z-index: 6;
  display: block !important;
  pointer-events: none;
  background:
    var(--qj-leaf-tl) left top / 54px 42px no-repeat,
    var(--qj-leaf-tr) right top / 54px 42px no-repeat,
    var(--qj-leaf-bl) left bottom / 54px 42px no-repeat,
    var(--qj-leaf-br) right bottom / 54px 42px no-repeat !important;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}

/* ---- title plank + red X ---- */
body #quests-modal .quests-head{
  position: relative;
  margin: 2px 2px 8px;
  padding: 7px 56px 9px 16px;
  border: 3px solid #4a2a10 !important;
  border-radius: 12px !important;
  background: var(--qj-grain), var(--qj-wood) !important;
  box-shadow: 0 4px 0 #2a1507, inset 0 3px 0 rgba(255, 233, 190, 0.45), inset 0 -4px 0 rgba(60, 28, 6, 0.35) !important;
  justify-content: center !important;
}
body #quests-modal .quests-title{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  color: #fff !important;
  font: 900 clamp(18px, 2.2vw, 30px)/1.05 Georgia, "Times New Roman", serif !important;
  letter-spacing: 0.02em !important;
  -webkit-text-stroke: 5px #0a1c3c;
  paint-order: stroke fill;
  text-shadow: 0 4px 0 rgba(6, 14, 34, 0.85) !important;
}
body #quests-modal .quests-title::before{
  content: "";
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  background: url("/photos/icons_tilemap.png") no-repeat;
  background-size: 418px 304px;
  background-position: -76px -190px;
  -webkit-text-stroke: 0;
  filter: drop-shadow(0 3px 0 rgba(30, 14, 4, 0.55));
}
body #quests-modal .quests-close{
  position: absolute !important;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 38px !important;
  height: 38px !important;
  min-height: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff !important;
  border-radius: 10px !important;
  background: linear-gradient(180deg, #ff6a5c 0%, #d3201a 52%, #a31410 100%) !important;
  box-shadow: 0 0 0 2px #4a1210, 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 3px 0 rgba(255, 255, 255, 0.4) !important;
  color: #fff !important;
  font: 900 18px/1 Georgia, serif !important;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6) !important;
  cursor: pointer;
  transition: filter 120ms ease;
}
body #quests-modal .quests-close:hover{ filter: brightness(1.12); }
body #quests-modal .quests-close:active{ transform: translateY(-50%) scale(0.94); }

/* ---- left column: tabs + floors ---- */
body #quests-modal .quests-tab,
body #quests-modal .quest-floor-book{
  border: 3px solid #0b2c5e !important;
  border-radius: 14px !important;
  background: var(--qj-card) !important;
  box-shadow: 0 3px 0 #061a38, inset 0 2px 0 rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  transition: filter 120ms ease, transform 120ms ease;
}
body #quests-modal .quests-tab{ font: 900 clamp(12px, 1.2vw, 15px)/1.1 Georgia, serif !important; letter-spacing: 0.04em; text-shadow: 0 2px 0 rgba(0, 20, 60, 0.85); }
body #quests-modal .quests-tab:hover,
body #quests-modal .quest-floor-book:hover{ filter: brightness(1.12); transform: translateY(-1px); }
body #quests-modal .quests-tab.is-active,
body #quests-modal .quest-floor-book-active{
  border-color: #0b2c5e !important;
  background: var(--qj-card-on) !important;
  box-shadow: 0 3px 0 #061a38, 0 0 0 2px #8fd2ff, inset 0 3px 0 rgba(255, 255, 255, 0.45) !important;
}
body #quests-modal .quest-floor-book-title{ color: #fff !important; font: 900 clamp(13px, 1.3vw, 16px)/1.1 Georgia, serif !important; text-shadow: 0 2px 0 rgba(0, 20, 60, 0.7); }
body #quests-modal .quest-floor-book-subtitle{ color: #cfe6ff !important; font: 800 clamp(9px, 0.85vw, 11px)/1.2 Georgia, serif !important; letter-spacing: 0.04em; }
body #quests-modal .quest-floor-book-locked{ filter: saturate(0.7) brightness(0.9); }
body #quests-modal .quest-floor-book-locked:hover{ filter: saturate(0.8) brightness(1); }

/* ---- XP bar ---- */
body #quests-modal .quests-level-card{
  border: 3px solid rgba(120, 190, 255, 0.5) !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(4, 14, 32, 0.78), rgba(6, 20, 42, 0.62)) !important;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.4) !important;
}
body #quests-modal .quests-mini-xp-track{
  border: 2px solid #07162e !important;
  border-radius: 999px !important;
  background: #0a1a33 !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6) !important;
}
body #quests-modal .quests-mini-xp-label{ color: #fff !important; font-weight: 900 !important; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7) !important; }

/* ---- quest cards ---- */
body #quests-modal .quest-card{
  border: 3px solid rgba(120, 190, 255, 0.4) !important;
  border-radius: 14px !important;
  background: var(--qj-card) !important;
  box-shadow: 0 3px 0 #061a38, inset 0 2px 0 rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
  transition: filter 120ms ease, transform 120ms ease, border-color 120ms ease;
}
body #quests-modal .quest-card:hover{ border-color: #6fc4ff !important; filter: brightness(1.1); }
body #quests-modal .quest-card.is-selected{
  border-color: #0b2c5e !important;
  background: var(--qj-card-on) !important;
  box-shadow: 0 3px 0 #061a38, 0 0 0 2px #8fd2ff, inset 0 3px 0 rgba(255, 255, 255, 0.45) !important;
}
body #quests-modal .quest-card.is-completed{ opacity: 0.78; }
body #quests-modal .quest-card-title{ color: #fff !important; font: 900 clamp(13px, 1.3vw, 17px)/1.15 Georgia, serif !important; text-shadow: 0 2px 0 rgba(0, 20, 60, 0.75); }
body #quests-modal .quest-card-desc{ color: #d4e8ff !important; font: 700 clamp(11px, 1vw, 13px)/1.25 Georgia, serif !important; }
body #quests-modal .quest-card-progress{ border: 2px solid #07162e; border-radius: 999px; background: #0a1a33; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6); overflow: hidden; }
body #quests-modal .quest-card-meta{ color: #ffe9a0 !important; font-weight: 900 !important; }
body #quests-modal .quest-missionmap-icon{ border: 2px solid #4aa8ff !important; border-radius: 10px !important; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.45) !important; }

/* ---- detail panels ---- */
body #quests-modal .quests-detail-panel{
  position: relative;
  border: 3px solid rgba(120, 190, 255, 0.5) !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(4, 14, 32, 0.78), rgba(6, 20, 42, 0.62)) !important;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.4) !important;
}
body #quests-modal .quests-detail-section-title{
  display: block;
  width: max-content;
  max-width: 100%;
  margin: -13px auto 8px !important;
  padding: 3px 18px 4px;
  border: 2px solid #4a2a10;
  border-radius: 8px;
  background: var(--qj-grain), var(--qj-wood);
  box-shadow: 0 2px 0 #2a1507, inset 0 2px 0 rgba(255, 233, 190, 0.45);
  color: #fff !important;
  font: 900 clamp(11px, 1vw, 14px)/1.1 Georgia, serif !important;
  letter-spacing: 0.06em !important;
  text-align: center;
  -webkit-text-stroke: 3px #0a1c3c;
  paint-order: stroke fill;
  text-shadow: 0 2px 0 rgba(6, 14, 34, 0.85);
}
body #quests-modal .quests-detail-reward-line strong,
body #quests-modal .quests-detail-meta-value{ color: #fff !important; font-weight: 900 !important; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55); }
body #quests-modal .quests-detail-meta-sub{ color: #cfe6ff !important; font-weight: 800 !important; }
body #quests-modal .quests-detail-npc{ overflow: hidden !important; padding: 0 !important; border: 4px solid var(--qj-frame) !important; border-radius: 16px !important; }
body #quests-modal .quests-empty-state{ border: 2px dashed rgba(120, 190, 255, 0.35); border-radius: 14px; color: #cfe6ff; }

/* ---- scrollbars ---- */
body #quests-modal .quest-left-list,
body #quests-modal #quests-story-books,
body #quests-modal .quests-list-panel-scroller,
body #quests-modal .quests-detail{ scrollbar-color: #2f93ff rgba(0, 0, 0, 0.25); scrollbar-width: thin; }

body #quests-modal button:focus-visible{ outline: 3px solid #ffe27a; outline-offset: 2px; }

@media (max-width: 900px){
  body #quests-modal::after{ left: -8px; top: -8px; width: calc(100% + 16px) !important; height: calc(100% + 16px) !important; background-size: 38px 30px; }
  body #quests-modal .quests-title::before{ width: 28px; height: 28px; background-size: 308px 224px; background-position: -56px -140px; }
  body #quests-modal .quests-title{ -webkit-text-stroke-width: 4px; }
}
@media (prefers-reduced-motion: reduce){
  body #quests-modal .quests-tab, body #quests-modal .quest-floor-book, body #quests-modal .quest-card{ transition: none; }
}
