/* ===== RESET ===== */
html, body {
    margin: 0;
    padding: 0;
    background: #000;
    overflow-x: hidden;
}

/* ===== BACKGROUND IMAGE ===== */
.page-container {
    position: relative;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
}

.page-bg {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== BUTTON LAYER ===== */
.button-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 2844px;
    transform-origin: top left;
    z-index: 500;
}

/* ===== DRAWER BUTTON SYSTEM ===== */
.drawer-btn {
    position: absolute;
    width: 260px;
    height: 50px;
    cursor: pointer;
}

/* Wider bottom navigation button */
.archive-btn {
    width: 357px;
    height: 63px;
}

/* ===== DRAWER HOVER COMPASS ===== */
.drawer-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 54px;
    height: 54px;
    background: url("/assets/Icons/crossroads_compass.png") center / contain no-repeat;
    transform: translate(-50%, -50%) scale(0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.drawer-btn:hover::after,
.drawer-btn:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Archive artwork remains unchanged on hover. */
.archive-btn::after {
    display: none;
}

/* DEBUG MODE (REMOVE LATER) */
.drawer-btn.debug {
    background: rgba(255, 0, 0, 0.25);
    border: 2px solid white;
    box-sizing: border-box;
}

/* ===== OVERLAY ===== */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 900;
}

#overlay.active {
    opacity: 1;
    pointer-events: all;
}


/* ===== PANEL ===== */
#cardPanel {
    position: fixed;
    top: 0;
    right: -900px;
    width: 900px;
    height: calc(100vh + 25px);
    max-height: calc(100vh + 25px);
    overflow-y: auto;
    overflow-x: hidden;
    transition: 0.4s ease;
    z-index: 1000;
}

#cardPanel.active {
    right: 0;
}

/* ===== CARD ===== */
.rune-card {
    width: 100%;
    min-height: calc(100vh + 25px);
    box-sizing: border-box;

    background: url("/assets/Cards/card_background.png") no-repeat top center;
    background-size: 100% 100%;

    padding: 80px 60px 115px;
    display: flex;
    gap: 40px;
    position: relative;
}

/* ===== IMAGE ===== */
.rune-image {
    position: relative;
    width: 220px;
    height: 260px;
    flex: 0 0 220px;
}

.rune-image img {
    position: absolute;
    top: 22px;
    left: 17px;
    width: 140px;
    transform: rotate(-4deg);
}

/* ===== TEXT ===== */
.rune-content {
    flex: 1;
    margin-top: 40px;
    color: #2b1a0f;
}

.rune-title {
    font-size: 32px;
    font-weight: bold;
}

.rune-subtitle {
    font-style: italic;
    margin-bottom: 10px;
}

.rune-body {
    font-size: 18px;
}

.rune-card-content {
    max-width: 560px;
    padding-bottom: 40px;
    position: relative;
    left: -40px;
    padding-right: 10px;
}

.rune-quote {
    font-size: 14px;
    font-style: italic;
    line-height: 1.25;
    margin: 0 0 10px;
}

.card-section {
    border-top: 1px solid rgba(43, 26, 15, 0.55);
    margin-top: 19px;
    padding-top: 16px;
}

.card-section h3 {
    margin: 0 0 5px;
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-variant: small-caps;
}

.card-section p {
    margin: 0 0 5px;
    font-size: 11.5px;
    line-height: 1.22;
}

.effect-grid,
.component-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
}

.effect-grid {
    row-gap: 13px;
}

.card-section:has(h3 + .component-grid:not(.three)) .component-grid {
    row-gap: 13px;
}

.component-grid:not(.three) {
    row-gap: 13px;
}

.component-grid.three {
    grid-template-columns: repeat(3, 1fr);
}

.effect-grid p,
.component-grid p {
    margin: 0;
}

.notes-section p {
    font-style: italic;
}

/* ===== CLOSE ===== */
#closeCard {
    position: absolute;
    top: 20px;
    right: 20px;

    background: #3a2415;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

/* ===== ELEMENT RUNE CARD LAYOUT ===== */
.element-discharge {
    margin-top: 22px;
    padding: 15px 18px;
    border: 1px solid rgba(43, 26, 15, 0.65);
    background: rgba(96, 67, 39, 0.08);
    text-align: center;
}
.element-discharge-label {
    margin-bottom: 7px;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-variant: small-caps;
}
.element-discharge-rule {
    max-width: 470px;
    margin: 0 auto;
    font-size: 12.5px;
    line-height: 1.35;
}
.element-component-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 24px;
    border-top: 1px solid rgba(43, 26, 15, 0.55);
    border-bottom: 1px solid rgba(43, 26, 15, 0.55);
}
.element-component-column {
    min-height: 390px;
    padding: 16px 14px 12px;
}
.element-component-column + .element-component-column {
    border-left: 1px solid rgba(43, 26, 15, 0.38);
}
.element-component-column h3 {
    margin: 0 0 16px;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
    font-variant: small-caps;
}
.element-component-column p {
    margin: 0 0 20px;
    font-size: 11.5px;
    line-height: 1.28;
}
.element-notes { margin-top: 22px; }

/* ===== FOCUS RUNE CARD LAYOUT ===== */
.focus-card-layout {
    width: 100%;
}

.focus-word-board,
.sigil-example-board {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(43, 26, 15, 0.55);
}

.focus-word-board h3,
.sigil-example-board h3 {
    margin: 0 0 12px;
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-variant: small-caps;
}

.focus-word-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.focus-word-grid p {
    margin: 0;
    padding: 9px 10px;
    border: 1px solid rgba(43, 26, 15, 0.38);
    background: rgba(96, 67, 39, 0.06);
    font-size: 11.5px;
    line-height: 1.25;
}

.sigil-example {
    margin-bottom: 10px;
    padding: 9px 11px;
    border-left: 3px solid rgba(43, 26, 15, 0.55);
    background: rgba(96, 67, 39, 0.06);
}

.sigil-example strong,
.sigil-example span {
    display: block;
}

.sigil-example strong {
    font-size: 12.5px;
}

.sigil-example span {
    margin-top: 2px;
    font-size: 11.5px;
    font-style: italic;
}

.sigil-example p {
    margin: 4px 0 0;
    font-size: 11.5px;
    line-height: 1.25;
}

/* ===== RUNE BUTTON FINALIZATION NOTES =====
   Keep .debug on while aligning.
   When placement is final:
   - remove the debug class from HTML buttons, OR
   - replace the debug rule below with transparent styles.
   Hover icon pass should happen after placement is locked.
===== */

