html {
    opacity: 1;
    
    scrollbar-color: #347cae transparent;
    scrollbar-width: thin;
}

body {
    background-color: #101010;
    margin: 0;
    padding: 0;
}

/* Header Container - Pulled tight to cut down top dead-space */
.title {
    position: relative;
    top: 0;
    display: block;
    margin: 0 auto;
    overflow: hidden;
    z-index: 1;
    height: 152px;
	margin-bottom: 10px;
    background: linear-gradient(to bottom, #000000 0%, #101010 100%);
    border-bottom: 2px solid #3a82b6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    position:relative;
}

/* Dedicated Footer Zone */
.footer {
    position: relative;
    bottom: 0px;
    text-align: center;
    font-size: 0.75rem;
    color: #74bcee;
    padding: 20px 0;
    margin-top: 30px;
    
    /* Distinct dark background band for footer */
    background: #07090c;
    
    /* Hard horizontal metallic line separating content from footer */
    border-top: 2px solid #2a5a84;
}

/* Main Layout Wrapper - Reduced top margin down to ~5px (1/4th of previous 20px) */
.main-content-area {
    display: flex;
    justify-content: space-between;
    /* Stretch forces leftbar, content, and rightbar to match height of the tallest side */
    align-items: stretch; 
    margin-top: 5px;
    width: 100%;
    box-sizing: border-box;
}

/* Left Sidebar */
.leftbar {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.85rem;
    color: #74bcee;
    box-sizing: border-box;
}

/* Phase Labels - Scale cleanly inside padded sidebar width */
.leftbar .phase-label {
    display: block;
    width: 100%; /* Changed from fixed 190px to prevent overflowing padding */
    text-align: center;
    margin: 15px auto 8px auto;
    box-sizing: border-box;
    padding: 0 2px;
}

/* Distinct background and crisp border for the main reading area */
.content {
    flex-grow: 1;
    min-height: 100vh;
    padding: 10px 10px;
    box-sizing: border-box;
    
    /* Slightly lighter metallic slate panel background to pop against dark body */
    background: #202020;
    
    border: 1px solid #2a5a84;
    border-top: 1px solid #4abcee;
    border-bottom: 1px solid #1e3d5a;
    border-radius: 2px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

/* Keeps inline images vertically aligned with text at their original dimensions */
.story-container p img {
    vertical-align: middle;
    margin: 0 2px; /* Small horizontal buffer space */
}

/* Removes the extra space between paragraphs */
.story-container p {
  margin: 0;
}

/* Right Sidebar */
.rightbar {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

/* Container for dynamic rightbar link elements */
.sidebar-links-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.85rem;
}

/* Button & Nav Image Containers */
.leftbar a, 
.rightbar a,
.leftbar .nav-button {
    margin-left: auto;
    margin-right: auto;
}

/* Centers and spaces out the row of cursor images */
.cursor-preview-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;           /* Puts clean, even spacing between each cursor asset */
    margin: 25px 0;      /* Replaces stacking <br> breaks with native margins */
}

/* Centers the download button asset on its own line */
.download-container {
    text-align: center;
    margin-top: 20px;
}

/* Keeps the download image looking clean and clickable */
.download-container img {
    display: inline-block;
    vertical-align: middle;
}

/* Container for the dynamic rightbar link elements */
.sidebar-links-group {
    text-align: center;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.85rem; /* Replaces size="2" */
}

/* Turns each link into a block element so they stack naturally without <br> tags */
.sidebar-links-group a {
    display: block;
    margin-bottom: 8px; /* Adds perfect, consistent spacing between each link */
    text-decoration: underline;
}

/* Removes the bottom margin from the last link so there's no trailing dead space */
.sidebar-links-group a:last-child {
    margin-bottom: 0;
}

/* Style for section headers inside the sidebars */
.sidebar-links-group .sidebar-heading {
    display: block;
    font-weight: bold;
    margin: 15px 0 8px 0; /* Creates perfect spacing above and below the heading */
}

/* Style for standard text inside the sidebars */
.sidebar-links-group .sidebar-basic {
    display: block;
    margin: 15px 0 8px 0; /* Creates perfect spacing above and below the heading */
}

/* Footer - Sits neatly right below the content area without empty gaps */
.footer {
    position: relative;
    text-align: center;
    font-size: 0.75rem;
    color: #74bcee;
    padding: 15px 0;
    margin-top: 15px;
    background: #07090c;
    border-top: 2px solid #2a5a84;
}

.footer a:link {
    color: #74bcee;
}

.footer a:visited {
    color: #347cae;
}

.footer a:hover {
    color: #84ccfe;
}

/* Give the footer paragraphs clean spacing without stacking <br> tags */
.footer p {
    margin: 5px 0 0 0;
}

/* Core Structural Containers */
#title-container, 
#stories-container, 
#content-container, 
#links-container {
    opacity: 1; /* Outer containers remain opaque so backgrounds are persistent */
}

/* Inner content wrapper that handles fading */
.fade-target {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.fade-target.fade-out {
    opacity: 0 !important;
}

/* Sidebar structure layout matching links.htm */
.sidebar-links-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Base styles for unlinked entries inside the accordion drop-downs */
.sidebar-links-group .unlinked-item {
    display: block;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    padding: 2px 0;
    text-align: center;
}

/* Adjustments for normal links inside the accordion drop-downs */
.sidebar-links-group .accordion-content a {
    display: block;
    padding: 2px 0;
    text-align: center;
    text-decoration: none;
}

/* Core Layout Container for the Esper Profiles */
.esper-profile {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px; /* Replaces &nbsp; spacing cleanly */
    text-align: left;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1rem;
    margin: 20px auto;
    max-width: 1100px;
}

/* Constrain and lock the artwork container width so dividers align across pages */
.esper-artwork {
    width: 750px;         /* Locks the column width so the vertical line never drifts */
    display: flex;
    justify-content: center; /* Keeps narrower art centered inside its space */
    flex-shrink: 0;       /* Prevents the browser from squeezing this area */
}

/* Ensure the image inside scales nicely up to that maximum boundary */
.esper-artwork img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Handle the vertical divider graphic tracking */
.esper-divider-v {
    height: 400px;
    width: 15px;
    display: block;
}

/* Right side content blocks */
.esper-info {
    flex-grow: 1;
}

.esper-info h3 {
    font-size: 1.5rem; /* Equivalent to size="5" */
    margin: 0 0 15px 0;
    font-weight: bold;
}

.esper-info p {
    margin: 5px 0;
}

.esper-info .stat-group {
    margin-top: 20px;
}

/* Handle the horizontal footer tracking line */
.esper-divider-h {
    display: block;
    width: 100%;
    height: 15px;
    margin-top: 25px;
}

/* Enable scrolling within the viewport without breaking sidebar heights */
.map-viewport {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  overflow: auto;
  overflow-x: auto;
  overflow-y: auto;
  display: block;
  text-align: center;
}

.content:has(.map-viewport) {
  overflow-y: hidden;  /* Passes all vertical scrolling directly to the map viewport */
}

/* Base anchor wrapper for the image and coordinate grid */
.map-wrapper {
  position: relative !important;
  display: inline-block;
  line-height: 0;
}

.map-image {
  display: block;
  width: auto;         /* Prevents width responsiveness */
  height: auto;        /* Prevents height responsiveness */
  max-width: none;     /* Allows the image to expand past the parent's right edge */
  max-height: none;    /* Allows the image to expand past the parent's bottom edge */
}

/* Force absolute positioning so markers stay pinned to the image */
.map-marker {
  position: absolute !important;
  width: 40px;
  height: 40px;
  z-index: 100;
  transform: translate(-50%, -50%);
}

/* Fill the container with the icon and trigger the hovertitle tooltip */
.marker-hover {
  display: block !important;
  width: 40px;
  height: 40px;
  background-image: url('/ttrpg/maps/marker.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
}

.markdown-snippet {
  background-color: #121820;
  border: 1px solid #4a90e2;
  padding: 10px;
  border-radius: 4px;
  color: #00d2ff;
  font-family: monospace;
  overflow-x: auto;
}

/* YouTube Playlist Widget Container */
.yt-playlist-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    max-width: 100%;
    margin: 15px auto;
    text-align: left;
    align-items: stretch; /* Ensures grid columns stretch to match the tallest item */
}

.yt-main-player iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid #2a5a84;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    display: block; /* Removes baseline white-space gaps below iframe */
}

.yt-video-list {
    height: 0; /* Forces the flex child to calculate height relative to parent grid track */
    min-height: 100%; /* Spans full height of the column */
    max-height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 6px;
    border: 1px solid #2a5a84;
    border-radius: 4px;
    box-sizing: border-box;
}

.yt-video-card {
    display: flex;
    gap: 10px;
    padding: 8px;
    background: #151a21;
    border: 1px solid #2a5a84;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.yt-video-card:hover {
    background: #1f2834;
    border-color: #4abcee;
}

.yt-video-card.active {
    background: #243548;
    border-color: #74bcee;
}

.yt-video-card img {
    width: 90px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 2px;
}

.yt-card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.yt-card-num {
    font-size: 0.75rem;
    color: #4abcee;
    font-weight: bold;
}

.yt-card-title {
    font-size: 0.85rem;
    color: #74bcee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yt-loading {
    color: #74bcee;
    font-size: 0.85rem;
    padding: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .yt-playlist-container {
        grid-template-columns: 1fr;
    }
}