/* ============================================
   FONTS
   ============================================ */

@font-face {
    font-family: 'Avenir Next Condensed';
    src: url('../assets/fonts/avenir-next-condensed-regular/avenir-next-condensed-regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Beufort Pro Heavy';
    src: url('../assets/fonts/beaufort-pro-heavy/beaufort-pro-heavy.woff') format('woff');
    font-weight: 900;
    font-style: normal;
}

@font-face {
    font-family: 'Beufort Pro Italic';
    src: url('../assets/fonts/beaufort-pro-heavy/beaufort-pro-heavy-italicized.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* ============================================
   CSS VARIABLES
   ============================================ */

:root {
    --header-font: 'Beufort Pro Heavy', serif;
    --body-font: 'Avenir Next Condensed', sans-serif;
    --box-bg-opacity: 0.9;
}

/* ============================================
   THEME COLOR SCHEMES
   ============================================ */

.autumn {
    --page-bg: #d6c09a;
    --header-bg: rgb(91, 58, 35);
    --header-text: #f6e8c8;
    --border-dark: #3c2414;
    --border-light: #c4a97a;
    --box-bg: rgba(246, 232, 200, var(--box-bg-opacity));
    --box-bg-solid: rgba(246, 232, 200, 1);
    --text-dark: #3c2414;
    --border-color: #3c2414;
    --border-filter: brightness(0) saturate(100%) invert(11%) sepia(23%) saturate(1620%) hue-rotate(349deg) brightness(95%) contrast(94%);
}

.ocean {
    --page-bg: #b8d4e8;
    --header-bg: #1e4d6b;
    --header-text: #e8f4f8;
    --border-dark: #0f2535;
    --border-light: #7ba8c4;
    --box-bg: rgba(232, 244, 248, var(--box-bg-opacity));
    --box-bg-solid: rgba(232, 244, 248, 1);
    --text-dark: #0f2535;
    --border-color: #0f2535;
    --border-filter: brightness(0) saturate(100%) invert(10%) sepia(25%) saturate(1956%) hue-rotate(182deg) brightness(96%) contrast(93%);
}

.forest {
    --page-bg: #c8d4b8;
    --header-bg: #2d4a2b;
    --header-text: #f0f4e8;
    --border-dark: #1a2818;
    --border-light: #85a882;
    --box-bg: rgba(240, 244, 232, var(--box-bg-opacity));
    --box-bg-solid: rgba(240, 244, 232, 1);
    --text-dark: #1a2818;
    --border-color: #1a2818;
    --border-filter: brightness(0) saturate(100%) invert(12%) sepia(12%) saturate(1580%) hue-rotate(74deg) brightness(92%) contrast(90%);
}

.sunset {
    --page-bg: #e8c4b8;
    --header-bg: #8b3a2b;
    --header-text: #fff0e8;
    --border-dark: #4a1e14;
    --border-light: #d4927a;
    --box-bg: rgba(255, 240, 232, var(--box-bg-opacity));
    --box-bg-solid: rgba(255, 240, 232, 1);
    --text-dark: #4a1e14;
    --border-color: #4a1e14;
    --border-filter: brightness(0) saturate(100%) invert(10%) sepia(44%) saturate(1802%) hue-rotate(340deg) brightness(95%) contrast(92%);
}

.midnight {
    --page-bg: #9b9bb8;
    --header-bg: #2b2b4a;
    --header-text: #e8e8f4;
    --border-dark: #16162a;
    --border-light: #6b6b94;
    --box-bg: rgba(232, 232, 244, var(--box-bg-opacity));
    --box-bg-solid: rgba(232, 232, 244, 1);
    --text-dark: #16162a;
    --border-color: #16162a;
    --border-filter: brightness(0) saturate(100%) invert(9%) sepia(23%) saturate(2033%) hue-rotate(202deg) brightness(94%) contrast(95%);
}

.shadowvale {
    --page-bg: #1a1a24;
    --header-bg: #0d0d15;
    --header-text: #d4c5aa;
    --border-dark: #050508;
    --border-light: #3a3a52;
    --box-bg: rgba(37, 37, 50, var(--box-bg-opacity));
    --box-bg-solid: rgba(37, 37, 50, 1);
    --text-dark: #d4c5aa;
    --border-color: #d4c5aa;
    --border-filter: brightness(0) saturate(100%) invert(79%) sepia(13%) saturate(661%) hue-rotate(1deg) brightness(93%) contrast(87%);
}

.deepwood {
    --page-bg: #1a2419;
    --header-bg: #0f150e;
    --header-text: #b8d4a8;
    --border-dark: #060a05;
    --border-light: #3a523a;
    --box-bg: rgba(36, 46, 35, var(--box-bg-opacity));
    --box-bg-solid: rgba(36, 46, 35, 1);
    --text-dark: #b8d4a8;
    --border-color: #b8d4a8;
    --border-filter: brightness(0) saturate(100%) invert(79%) sepia(11%) saturate(840%) hue-rotate(55deg) brightness(95%) contrast(89%);
}

.crimson {
    --page-bg: #2a1414;
    --header-bg: #1a0808;
    --header-text: #f4c8c8;
    --border-dark: #0a0303;
    --border-light: #5a3030;
    --box-bg: rgba(51, 26, 26, var(--box-bg-opacity));
    --box-bg-solid: rgba(51, 26, 26, 1);
    --text-dark: #f4c8c8;
    --border-color: #f4c8c8;
    --border-filter: brightness(0) saturate(100%) invert(89%) sepia(7%) saturate(1287%) hue-rotate(305deg) brightness(102%) contrast(93%);
}

.abyss {
    --page-bg: #14181f;
    --header-bg: #0a0e14;
    --header-text: #8fa3b8;
    --border-dark: #030508;
    --border-light: #2a3847;
    --box-bg: rgba(28, 34, 43, var(--box-bg-opacity));
    --box-bg-solid: rgba(28, 34, 43, 1);
    --text-dark: #8fa3b8;
    --border-color: #8fa3b8;
    --border-filter: brightness(0) saturate(100%) invert(66%) sepia(8%) saturate(967%) hue-rotate(166deg) brightness(89%) contrast(88%);
}

.obsidian {
    --page-bg: #1f1f1f;
    --header-bg: #121212;
    --header-text: #c4b8a0;
    --border-dark: #0a0a0a;
    --border-light: #404040;
    --box-bg: rgba(42, 42, 42, var(--box-bg-opacity));
    --box-bg-solid: rgba(42, 42, 42, 1);
    --text-dark: #c4b8a0;
    --border-color: #c4b8a0;
    --border-filter: brightness(0) saturate(100%) invert(73%) sepia(9%) saturate(642%) hue-rotate(1deg) brightness(91%) contrast(89%);
}

.amethyst {
    --page-bg: #1f1424;
    --header-bg: #120a1a;
    --header-text: #d8c8f4;
    --border-dark: #080308;
    --border-light: #463052;
    --box-bg: rgba(41, 26, 51, var(--box-bg-opacity));
    --box-bg-solid: rgba(41, 26, 51, 1);
    --text-dark: #d8c8f4;
    --border-color: #d8c8f4;
    --border-filter: brightness(0) saturate(100%) invert(89%) sepia(14%) saturate(1063%) hue-rotate(208deg) brightness(98%) contrast(93%);
}

.ember {
    --page-bg: #2a1f14;
    --header-bg: #1a120a;
    --header-text: #f4d4b8;
    --border-dark: #0a0603;
    --border-light: #5a4330;
    --box-bg: rgba(51, 38, 20, var(--box-bg-opacity));
    --box-bg-solid: rgba(51, 38, 20, 1);
    --text-dark: #f4d4b8;
    --border-color: #f4d4b8;
    --border-filter: brightness(0) saturate(100%) invert(88%) sepia(14%) saturate(530%) hue-rotate(333deg) brightness(98%) contrast(92%);
}

.frostfall {
    --page-bg: #14212a;
    --header-bg: #0a1419;
    --header-text: #c8dce8;
    --border-dark: #03060a;
    --border-light: #2f4c5a;
    --box-bg: rgba(26, 43, 54, var(--box-bg-opacity));
    --box-bg-solid: rgba(26, 43, 54, 1);
    --text-dark: #c8dce8;
    --border-color: #c8dce8;
    --border-filter: brightness(0) saturate(100%) invert(88%) sepia(8%) saturate(757%) hue-rotate(162deg) brightness(94%) contrast(88%);
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

* {
    position: relative;
    box-sizing: border-box;
    margin: 0px;
    padding: 0px;
}

body {
    margin: 0;
    padding: 0;
    background: var(--page-bg);
    font-family: var(--body-font);
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: var(--header-font);
}

/* ============================================
   DECORATIVE ELEMENTS
   ============================================ */

.dice-decoration {
    --size: 400px;
    position: fixed;
    bottom: 20px;
    left: 0vw;
    width: var(--size);
    height: var(--size);
    background-image: url('../assets/d20_vines.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom left;
    pointer-events: none;
    z-index: -1;
    opacity: 1;
    filter: var(--border-filter);
}

.d20-decoration {
    --size: 400px;
    position: fixed;
    top: 100px;
    right: 0vw;
    width: var(--size);
    height: var(--size);
    background-image: url('../assets/d6_vines.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom left;
    pointer-events: none;
    z-index: -1;
    opacity: 1;
    filter: var(--border-filter);
}

/* ============================================
   LAYOUT COMPONENTS
   ============================================ */

.main {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 100vw;
    height: max-content;
    padding: 40px 40px;
    box-sizing: border-box;
}

.main .content {
    height: max-content;
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
    margin-bottom: 50px;
    padding-bottom: 80vh;
}

.main .content.large {
    width: 100%;
    min-width: 900px;
    max-width: 1600px;
    --grid-cell-size: 70px;
}

.main .content.medium {
    width: 100%;
    min-width: 600px;
    max-width: 1400px;
    --grid-cell-size: 60px;
}

.main .content.small {
    width: 100%;
    min-width: 600px;
    max-width: 950px;
    --grid-cell-size: 40px;
}

.row {
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 20px;
}

.row.sticky {
    position: sticky;
    top: -1px;
    z-index: 7;
    transition: background 0.3s ease;
}

.row.sticky.stuck {
    background: var(--header-bg);
    padding: 1rem 2rem;
    border: 3px solid var(--border-dark);
    box-shadow: 
        inset 0 0 0 3px var(--border-light),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.column {
    height: fit-content;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ============================================
   COMPONENT: HEADER
   ============================================ */

.header-wrapper {
    max-width: 960px;
    margin: 2rem auto 1.5rem auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.header {
    font-family: var(--header-font);
    background: var(--header-bg);
    color: var(--header-text);
    padding: 1.2rem 2.5rem;
    border: 3px solid var(--border-dark);
    box-shadow: inset 0 0 0 3px var(--border-light);
    box-sizing: border-box;
    z-index: 5;
}

.header h1 {
    font-family: var(--header-font);
    margin: 0;
    text-align: center;
    letter-spacing: 0.18em;
    font-size: 2rem;
    text-transform: uppercase;
}

.header h4 {
    font-family: var(--header-font);
    margin: 0;
    text-align: center;
    letter-spacing: 0.18em;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* ============================================
   COMPONENT: HEADER NAV BAR
   ============================================ */

.header-nav {
    background: var(--border-dark);
    border: 3px solid var(--border-dark);
    border-top: none;
    box-sizing: border-box;
    display: flex;
    overflow: hidden;
}

.header-nav button {
    font-family: var(--header-font);
    background: var(--header-bg);
    color: var(--header-text);
    padding: 0.8rem 1.5rem;
    border: none;
    border-right: 2px solid var(--border-dark);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    flex: 1;
}

.header-nav button:last-child {
    border-right: none;
}

.header-nav button:hover {
    background: var(--border-light);
    color: var(--text-dark);
}

.header-nav button:active {
    background: var(--border-dark);
}

/* ============================================
   COMPONENT: SECTION HEADER
   ============================================ */

.section-header {
    font-family: var(--header-font);
    background: var(--header-bg);
    color: var(--header-text);
    padding: 1rem 2rem;
    border: 3px solid var(--border-dark);
    box-shadow: 
        inset 0 0 0 3px var(--border-light),
        0 4px 8px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    width: 100%;
}

.section-header h2 {
    font-family: var(--header-font);
    margin: 0;
    text-align: center;
    letter-spacing: 0.18em;
    font-size: 1.5rem;
    text-transform: uppercase;
    color: var(--header-text);
}

/* ============================================
   COMPONENT: SECTION HEADER NAV BAR
   ============================================ */

.section-header-nav {
    background: var(--border-dark);
    border: 3px solid var(--border-dark);
    border-top: none;
    box-sizing: border-box;
    display: flex;
    overflow: hidden;
}

.section-header-nav button {
    font-family: var(--header-font);
    background: var(--header-bg);
    color: var(--header-text);
    padding: 0.5rem 1rem;
    border: none;
    border-right: 2px solid var(--border-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    flex: 1;
}

.section-header-nav button:last-child {
    border-right: none;
}

.section-header-nav button:hover {
    background: var(--border-light);
    color: var(--text-dark);
}

.section-header-nav button:active {
    background: var(--border-dark);
}

/* ============================================
   COMPONENT: BOX (Content Container)
   ============================================ */

.box {
    background: var(--box-bg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    height: fit-content;
    width: fit-content;
    padding: 20px;
    min-height: 120px;
}

.box-content {
    padding: 30px 60px;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.box h2 {
    font-family: var(--header-font);
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    color: var(--text-dark);
    text-align: center;
    letter-spacing: 0.05em;
}

.box-header {
    font-family: var(--header-font);
    font-size: 1.3rem;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border-light);
    padding: 5px 20px;
    margin-bottom: 20px;
}

.box-header .subHeading {
    font-size: 0.9rem;
    opacity: 0.8;
}

.box-content {
    min-height: 120px;
    font-family: var(--body-font);
    color: var(--text-dark);
}

/* ============================================
   COMPONENT: TEXT BUTTON
   ============================================ */

.text-button {
    font-family: var(--body-font);
    color: var(--text-dark);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.text-button:hover {
    transform: translateY(-2px);
}

.text-button:active {
    transform: translateY(0);
}

/* ============================================
   COMPONENT: TOGGLE TEXT BUTTON
   ============================================ */

.toggle-text-button {
    font-family: var(--body-font);
    color: var(--text-dark);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    opacity: 0.6;
    font-size: 1rem;
}

.toggle-text-button:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.toggle-text-button.active {
    color: var(--header-bg);
    opacity: 1;
    transform: translateY(-2px);
    font-weight: bold;
    font-size: 1.2rem;
}

.toggle-text-button.active:hover {
    transform: translateY(-3px);
}

/* ============================================
   COMPONENT: POPUP MODAL
   ============================================ */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.popup-overlay.hidden {
    display: none;
}

.popup-box {
    background: var(--box-bg);
    border: 3px solid var(--border-dark);
    box-shadow: 
        inset 0 0 0 2px var(--border-light),
        0 4px 8px rgba(0, 0, 0, 0.3);
    padding: 1.5rem 2rem;
    /* max-width: 600px; */
    min-width: 600px;
    width: max-content;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    font-family: var(--body-font);
    color: var(--text-dark);
}

.popup-box .close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-dark);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    z-index: 1000;
}

.popup-box .close-button:hover {
    color: var(--header-bg);
}

/* ============================================
   COMPONENT: BUTTON
   ============================================ */

.button-wrapper {
    display: inline-flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.button-wrapper label {
    font-family: var(--header-font);
    color: var(--text-dark);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.button {
    font-family: var(--header-font);
    background: var(--header-bg);
    color: var(--header-text);
    padding: 0.8rem 2rem;
    border: 3px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 3px 6px rgba(0, 0, 0, 0.3);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    /* transition: all 0.2s ease; */
    white-space: nowrap;
}

.button.small {
    font-family: var(--body-font);
    padding: 0.3rem 1rem;
    font-size: 0.2rem;
    letter-spacing: 0.05em;
    text-transform: none;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 5px 10px rgba(0, 0, 0, 0.4);
}

.button:active {
    transform: translateY(0);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.button.disabled,
.button:disabled {
    background: var(--border-dark);
    color: var(--border-light);
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
    transform: translateY(0);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Small, subtle, full-width flat button
   - full width
   - thin (small vertical padding)
   - mostly opaque background
   - no border, no shadow, minimal styling
*/
.button.subtle {
    display: block;
    width: 100%;
    padding: 6px 10px; /* thin */
    font-family: var(--body-font);
    font-size: 0.75rem;
    color: var(--text-dark);
    background: rgba(0, 0, 0, 0.06); /* subtle, mostly opaque */
    border: none;
    box-shadow: none;
    text-align: center;
    cursor: pointer;
    border-radius: 0; /* flat */
    opacity: 0.98;
    white-space: nowrap;
}

.button.subtle:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* ============================================
   COMPONENT: BUTTON GROUP (Merged Buttons)
   ============================================ */

.button-group {
    background: var(--border-dark);
    border: 3px solid var(--border-dark);
    box-sizing: border-box;
    display: flex;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    width: 100%;
    min-width: 600px;
    max-width: 800px;
}

.button-group button {
    font-family: var(--header-font);
    background: var(--header-bg);
    color: var(--header-text);
    padding: 0.8rem 1rem;
    border: none;
    border-right: 2px solid var(--border-dark);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    flex: 1;
}

.button-group button:last-child {
    border-right: none;
}

.button-group button:hover {
    background: var(--border-light);
    color: var(--text-dark);
}

.button-group button:active {
    background: var(--border-dark);
}

.button-group button.disabled,
.button-group button:disabled {
    background: var(--border-dark);
    color: var(--border-light);
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.button-group button.active {
    background: var(--box-bg);
    color: var(--text-dark);
    box-shadow: inset 0 0 0 2px var(--border-light);
}

/* Small variant */
.button-group.small button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* ============================================
   COMPONENT: DROPDOWN
   ============================================ */

.dropdown-wrapper {
    display: inline-flex;
    flex-direction: column;
    gap: 0px;
}

.dropdown-wrapper label {
    font-family: var(--header-font);
    color: var(--text-dark);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
    z-index: 1;
}

.dropdown select {
    font-family: var(--header-font);
    background: var(--header-bg);
    color: var(--header-text);
    padding: 0.8rem 2.5rem 0.8rem 1.5rem;
    border: 3px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 3px 6px rgba(0, 0, 0, 0.3);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    z-index: 10;
}

.dropdown select:hover {
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 4px 8px rgba(0, 0, 0, 0.35);
}

.dropdown select:focus {
    outline: none;
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 0 0 3px var(--border-light);
    z-index: 10;
}

.dropdown.small select {
    font-family: var(--body-font);
    padding: 0.4rem 2rem 0.4rem 0.8rem;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: none;
}

.dropdown::after {
    content: '▼';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--header-text);
    pointer-events: none;
    font-size: 0.8rem;
    z-index: 10;
}

/* ============================================
   COMPONENT: TEXT INPUT
   ============================================ */

.input-wrapper {
    display: flex;
    flex-direction: column;
    /* gap: 0.5rem; */
}

.input-wrapper label {
    font-family: var(--header-font);
    color: var(--text-dark);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input {
    font-family: var(--body-font);
    background: var(--box-bg);
    color: var(--text-dark);
    padding: 0.8rem 1.5rem;
    border: 3px solid var(--border-dark);
    box-shadow: 
        inset 0 0 0 2px var(--border-light),
        0 3px 6px rgba(0, 0, 0, 0.3);
    font-size: 1rem;
    width: 100%;
    transition: all 0.2s ease;
}

.input.small {
    padding: 0.4rem 2rem 0.4rem 1rem;
    width: 100%;
}

.input:hover {
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 4px 8px rgba(0, 0, 0, 0.35);
}

.input:focus {
    outline: none;
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 0 0 3px var(--border-light);
}

.input::placeholder {
    color: var(--border-light);
    opacity: 0.8;
}

/* ============================================
   COMPONENT: TEXT AREA
   ============================================ */

.textarea-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.textarea-wrapper label {
    font-family: var(--header-font);
    color: var(--text-dark);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.textarea {
    font-family: var(--body-font);
    background: var(--box-bg);
    color: var(--text-dark);
    padding: 0.8rem 1.5rem;
    border: 3px solid var(--border-dark);
    box-shadow: 
        inset 0 0 0 2px var(--border-light),
        0 3px 6px rgba(0, 0, 0, 0.3);
    font-size: 1rem;
    width: 100%;
    min-height: 120px;
    resize: vertical;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.textarea:hover {
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 4px 8px rgba(0, 0, 0, 0.35);
}

.textarea:focus {
    outline: none;
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 0 0 3px var(--border-light);
}

.textarea::placeholder {
    color: var(--border-light);
    opacity: 0.8;
}

/* ============================================
   COMPONENT: DETAILS/ACCORDION
   ============================================ */

.details {
    background: var(--box-bg-solid);
    margin-bottom: 0px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    height: fit-content;
    width: 100%;
}

.details summary {
    font-family: var(--header-font);
    background: var(--header-bg);
    color: var(--header-text);
    padding: 1rem 2rem;
    border: 3px solid var(--border-dark);
    box-shadow: inset 0 0 0 2px var(--border-light);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* transition: all 0.2s ease; */
}

.details summary::-webkit-details-marker {
    display: none;
}

.details summary::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.details[open] summary {
    background: var(--box-bg);
    color: var(--text-dark);
    border-bottom: none;
    box-shadow: none;
}

.details[open] summary::after {
    transform: rotate(180deg);
}

.details summary:hover:not(.details[open] summary) {
    box-shadow: 
        inset 0 0 0 2px var(--border-light),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

.details.small summary {
    padding: 0.6rem 1.5rem;
    font-size: 1.2rem;
}

.details.small .details-content {
    padding: 1rem 1.5rem;
    padding-top: 0px;
}

.details-content {
    padding: 1.5rem 2rem;
    padding-top: 0px;
    font-family: var(--body-font);
    color: var(--text-dark);
    border: 3px solid var(--border-dark);
    border-top: none;
}

/* ============================================
   COMPONENT: DETAILS LARGE (Full-width expandable)
   ============================================ */

.details-large {
    width: 100%;
    height: fit-content;
    margin-bottom: 0px;
}

.details-large summary {
    font-family: var(--header-font);
    background: var(--header-bg);
    color: var(--header-text);
    padding: 1rem 2rem;
    border: 3px solid var(--border-dark);
    box-shadow: inset 0 0 0 2px var(--border-light);
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.details-large summary::-webkit-details-marker {
    display: none;
}

.details-large summary::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.details-large[open] summary {
    background: var(--box-bg);
    color: var(--text-dark);
}

.details-large[open] summary::after {
    transform: rotate(180deg);
}

.details-large summary:hover {
    box-shadow: 
        inset 0 0 0 2px var(--border-light),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

.details-large-content {
    width: 100%;
    height: 100%;
    padding: 1.5rem 0;
    font-family: var(--body-font);
    color: var(--text-dark);
}

/* ============================================
   COMPONENT: CONTENT BOX
   ============================================ */

.content-box {
    background: var(--box-bg);
    border: 3px solid var(--border-dark);
    box-shadow: 
        inset 0 0 0 2px var(--border-light),
        0 4px 8px rgba(0, 0, 0, 0.3);
    padding: 1rem 1.5rem;
    font-family: var(--body-font);
    color: var(--text-dark);
    width: 100%;
}

/* ============================================
   COMPONENT: NUMBER DISPLAY
   ============================================ */

.number-wrapper {
    display: inline-flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.number-wrapper label {
    font-family: var(--header-font);
    color: var(--text-dark);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.number {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--header-font);
    background: var(--header-bg);
    color: var(--header-text);
    border: 3px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 3px 6px rgba(0, 0, 0, 0.3);
    font-size: 1.5rem;
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    flex-shrink: 0;
    text-align: center;
    gap: 0;
}

.number .label {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    opacity: 0.85;
    margin-top: 2px;
}

.number.num-small {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 1.1rem;
    border: 2px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 1px var(--border-light),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.number.num-small .label {
    font-size: 0.6rem;
    margin-top: 1px;
}

.number.num-large {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    font-size: 2rem;
}

.number.num-large .label {
    font-size: 0.8rem;
    margin-top: 3px;
}

/* ============================================
   COMPONENT: NUMBER INPUT (with +/- buttons)
   ============================================ */

.number-input-wrapper {
    display: inline-flex;
    flex-direction: column;
    gap: 0.1rem;
    align-items: center;
}

.number-input-wrapper label {
    font-family: var(--body-font);
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.number-input {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
}

.number-input .number-display {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--body-font);
    background: var(--box-bg);
    color: var(--text-dark);
    border-top: 3px solid var(--border-dark);
    border-bottom: 3px solid var(--border-dark);
    font-size: 1.5rem;
    width: fit-content;
    padding: 0px 10px;
    min-width: 75px;
    min-height: 50px;
    text-align: center;
}

.number-input button {
    font-family: var(--body-font);
    background: var(--header-bg);
    color: var(--header-text);
    border: 3px solid var(--border-dark);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    font-size: 1.2rem;
    width: 40px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.number-input button:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
}

.number-input button:active {
    background: var(--border-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.number-input button.disabled,
.number-input button:disabled {
    background: var(--border-dark);
    color: var(--border-light);
    cursor: not-allowed;
    opacity: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* ============================================
   COMPONENT: TABS PANEL
   ============================================ */

.tabs {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    max-height: 860px;
}

.tabs-header {
    display: flex;
    gap: 0;
    /* border-bottom: 3px solid var(--border-dark); */
}

.tabs-header button {
    font-family: var(--header-font);
    background: var(--header-bg);
    color: var(--header-text);
    padding: 0.8rem 1.5rem;
    border: 3px solid var(--border-dark);
    border-bottom: 3px solid var(--border-dark);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    /* transition: all 0.2s ease; */
    margin-right: -3px;
    flex: 1;
    box-shadow: inset 0 0 0 2px var(--border-light);
}

.tabs-header button:last-child {
    margin-right: 0;
}

.tabs-header button:hover:not(.active) {
    box-shadow: 
        inset 0 0 0 2px var(--border-light),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

.tabs-header button.active {
    background: var(--box-bg);
    color: var(--text-dark);
    border-bottom: none;
    box-shadow: none;
    position: relative;
    z-index: 1;
    padding-bottom: calc(0.8rem + 3px);
}

.tabs-content {
    padding: 1.5rem 2rem;
    font-family: var(--body-font);
    color: var(--text-dark);
    border: 3px solid var(--border-dark);
    border-top: 0px;
    background: var(--box-bg);
    position: relative;
    z-index: 0;
}

/* Custom scrollbar for tabs content -- uses theme variables */
.tabs-content {
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--border-dark) transparent;
}

.tabs-content::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.tabs-content::-webkit-scrollbar-track {
    background: transparent;
}

.tabs-content::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.0); /* creates spacing effect */
    box-shadow: inset 0 0 0 2px var(--border-light);
}

.tabs-content::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

.tabs-panel {
    display: none;
}

.tabs-panel.active {
    display: block;
}

/* ============================================
   COMPONENT: CORNER DECORATION (Border Image)
   ============================================ */

.corner-decoration {
    --size: 60px;
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border: var(--size) solid transparent;
    border-image-source: url('../assets/border_nine_slice.svg');
    border-image-slice: 886 fill;
    border-image-width: var(--size);
    border-image-repeat: stretch;
    filter: var(--border-filter);
}

/* ============================================
   COMPONENT: TEXT CONTAINER
   ============================================ */

.text-container {
    font-family: var(--body-font);
    background: var(--box-bg);
    color: var(--text-dark);
    padding: 1rem 1.5rem;
    border: 3px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 3px 6px rgba(0, 0, 0, 0.3);
    width: fit-content;
    min-width: 150px;
    min-height: 50px;
    line-height: 1.5;
}

/* ============================================
   COMPONENT: SPELL CONTAINER
   ============================================ */

.spell {
    background: var(--box-bg);
    border: 3px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 4px 8px rgba(0, 0, 0, 0.3);
    padding: 1.5rem 2rem;
    /* margin-bottom: 15px; */
    transition: box-shadow 0.2s;
    width: 500px;
}

.spell:hover {
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 6px 12px rgba(0, 0, 0, 0.35);
}

.spell-header {
    display: flex;
    flex-direction: column;
    gap: 0px;
    margin-bottom: 0.5rem;
}

.spell-name {
    font-family: var(--header-font);
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--text-dark);
    letter-spacing: 0.05em;
}

.spell-stats {
    font-family: var(--body-font);
    font-size: 0.9rem;
    color: var(--text-dark);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    opacity: 0.85;
}

.spell-stats span {
    white-space: nowrap;
}

.spell-description {
    font-family: var(--body-font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.spell-higher-levels {
    font-family: var(--body-font);
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text-dark);
    opacity: 0.9;
}

/* Compact variant for spells: show name and stats inline, hide description */
.spell-small {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--box-bg);
    border: 3px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 3px 6px rgba(0, 0, 0, 0.18);
    padding: 0.5rem 1rem;
    width: 100%;
    flex-wrap: nowrap;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.spell-small:hover {
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 5px 10px rgba(0, 0, 0, 0.25);
}

.spell-small .spell-name {
    font-family: var(--header-font);
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-dark);
    white-space: nowrap;
}



/* ensure small spell keeps balanced spacing on narrow layouts */
@media (max-width: 700px) {
    .spell-small {
        gap: 8px;
        padding: 0.4rem 0.75rem;
    }
    .spell-small .spell-name {
        font-size: 0.95rem;
    }
    .spell-small .spell-stats {
        font-size: 0.85rem;
        gap: 6px;
    }
}

/* ============================================
   COMPONENT: BUTTON LIST
   ============================================ */

.button-list {
    background: var(--box-bg);
    border: 3px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 4px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.button-list-header {
    font-family: var(--header-font);
    background: var(--border-dark);
    color: var(--header-text);
    padding: 0.75rem 2rem;
    border-bottom: 2px solid var(--border-dark);
    width: 100%;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: bold;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.button-list button {
    font-family: var(--header-font);
    background: var(--header-bg);
    color: var(--header-text);
    padding: 1rem 2rem;
    border: none;
    border-bottom: 2px solid var(--border-dark);
    width: 100%;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.button-list button:last-child {
    border-bottom: none;
}

.button-list button:hover {
    background: var(--border-light);
    color: var(--text-dark);
}

.button-list button:active {
    background: var(--border-dark);
}

.button-list button.disabled,
.button-list button:disabled {
    background: var(--border-dark);
    color: var(--border-light);
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

/* ============================================
   COMPONENT: FLOATING INPUT
   ============================================ */

.floating-input-container {
    position: fixed;
    z-index: 10000;
    background: var(--box-bg);
    border: 3px solid var(--border-dark);
    box-shadow: 
        inset 0 0 0 2px var(--border-light),
        0 4px 12px rgba(0, 0, 0, 0.4);
    padding: 8px;
}

.floating-input-container.hidden {
    display: none;
}

.floating-input-container input {
    font-family: var(--body-font);
    background: var(--box-bg);
    color: var(--text-dark);
    padding: 0.5rem 0.8rem;
    border: 2px solid var(--border-dark);
    box-shadow: inset 0 0 0 1px var(--border-light);
    font-size: 0.9rem;
    width: 200px;
}

.floating-input-container input:focus {
    outline: none;
    box-shadow: 
        inset 0 0 0 1px var(--border-light),
        0 0 0 2px var(--border-light);
}

/* ============================================
   COMPONENT: CONTEXT MENU
   ============================================ */

.context-menu {
    position: fixed;
    z-index: 10000;
    background: var(--box-bg);
    border: 3px solid var(--border-dark);
    box-shadow: 
        inset 0 0 0 2px var(--border-light),
        0 4px 12px rgba(0, 0, 0, 0.4);
    padding: 4px;
    min-width: 150px;
}

.context-menu.hidden {
    display: none;
}

.context-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    background: var(--box-bg-solid);
    color: var(--text-dark);
    border: 1px solid var(--border-dark);
    font-family: var(--body-font);
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 2px;
}

.context-menu button:last-child {
    margin-bottom: 0;
}

.context-menu button:hover {
    background: var(--border-light);
}

.context-menu button:active {
    background: var(--border-dark);
    color: var(--box-bg-solid);
}


/* ============================================
   COMPONENT: POP-UP SELECTOR
   ============================================ */

.popup-selector {
    position: relative;
    display: inline-block;
    z-index: 8;
}

.popup-selector-trigger {
    font-family: var(--header-font);
    background: transparent;
    color: var(--text-dark);
    width: 40px;
    height: 40px;
    border: none;
    box-shadow: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-selector-trigger:hover {
    transform: scale(1.15);
    /* color: var(--border-dark); */
}

.popup-selector-trigger:active {
    transform: scale(1);
}

.popup-selector-panel {
    position: absolute;
    top: 0;
    /* right: calc(100% + 10px); */
    background: var(--box-bg);
    border: 3px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 4px 8px rgba(0, 0, 0, 0.3);
    min-width: 150px;
    z-index: 7;
    display: none;
    width: 200px;
}

.left {
    right: calc(100% + 10px);
}

.right {
    left: calc(100% + 10px);
}

.popup-selector.active .popup-selector-panel {
    display: block;
}

.popup-selector-panel button {
    font-family: var(--header-font);
    background: var(--header-bg);
    color: var(--header-text);
    padding: 0.8rem 1.5rem;
    border: none;
    border-bottom: 2px solid var(--border-dark);
    width: 100%;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.popup-selector-panel button:last-child {
    border-bottom: none;
}

.popup-selector-panel button:hover {
    background: var(--border-light);
    color: var(--text-dark);
}

.popup-selector-panel button:active {
    background: var(--border-dark);
}

/* ============================================
   COMPONENT: HR DIVIDER
   ============================================ */

hr {
    width: 100%;
    height: 2px;
    min-height: 2px;
    background: var(--border-dark);
    border: none;
    margin: 5px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

hr.divider {
    margin: 0;
}

hr.thick {
    min-height: 5px;
    height: 5px;
    box-shadow: 
        inset 0 1px 0 var(--border-light),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

hr.light {
    background: var(--border-light);
}

hr.gradient {
    background: linear-gradient(to right, 
        transparent, 
        var(--border-dark) 20%, 
        var(--border-dark) 80%, 
        transparent
    );
    box-shadow: none;
}

/* ============================================
   COMPONENT: VERTICAL DIVIDER
   ============================================ */

.vr {
    width: 1px;
    /* height: 100%; */
    align-self: stretch;
    border: 2px solid var(--border-dark);
    margin: 0 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.vr.thick {
    border: 5px solid var(--border-dark);
    box-shadow: 
        inset 1px 0 0 var(--border-light),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

/* .vr.light {
    background: var(--border-light);
}

.vr.gradient {
    background: linear-gradient(to bottom, 
        transparent, 
        var(--border-dark) 20%, 
        var(--border-dark) 80%, 
        transparent
    );
    box-shadow: none;
} */

.character-image {
    width: 150px;
    height: 150px;
    border: 3px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 4px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.character-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================
   COMPONENT: CHARACTER VIEWER GRID
   ============================================ */

.character-viewer-grid {
    display: grid;
    grid-template-columns: repeat(19, var(--grid-cell-size, 50px));
    grid-template-rows: repeat(12, 60px);
    gap: 10px;
    width: fit-content;
    box-sizing: border-box;
}


/* ============================================
   COMPONENT: IMAGE STAT CONTAINER
   ============================================ */

.image-stat-container {
    --size: 105px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: var(--size);
    height: var(--size);
    font-family: var(--body-font);
    color: var(--text-dark);
    padding-bottom: 5px;
    padding-top: 22px;
}

.image-stat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    filter: var(--border-filter);
    z-index: 0;
}

.image-stat-container.ac::before {
    background-image: url('../assets/shield.png');
}

.image-stat-container.hp::before {
    background-image: url('../assets/hp.png');
}

.image-stat-container.initiative::before {
    background-image: url('../assets/initiative.png');
}

.image-stat-container.speed::before {
    background-image: url('../assets/speed.png');
}

.image-stat-container .value {
    position: relative;
    z-index: 1;
    font-size: 2.0rem;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 5px;
}

.image-stat-container .hp {
    font-size: 1.5rem;
    margin-top: 3px;
}

.image-stat-container .label {
    position: relative;
    z-index: 1;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.9;
}

/* ============================================
   COMPONENT: CHECK BOX
   ============================================ */
.check-box {
    --size: 20px;
    width: var(--size);
    height: var(--size);
    border: 3px solid var(--border-light);
    background: transparent;
    cursor: pointer;
    /* transition: all 0.2s ease; */
    position: relative;
}

.check-box:hover {
    /* border-color: var(--border-light); */
    transform: scale(1.1);
}

.check-box.filled::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--border-dark);
}

/* .check-box.filled {
    background: var(--text-dark);
} */


/* ============================================
   UTILITY: CLICKABLE
   ============================================ */

.clickable {
    cursor: pointer;
    /* transition: transform 0.2s ease, filter 0.2s ease; */
    /* filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15)); */
}

.clickable:hover {
    /* filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25)); */
    transform: scale(1.01);
}

.clickable:active {
    transform: scale(0.98);
}

/* Enhanced clickable variant - more noticeable */
.clickable-enhanced {
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.clickable-enhanced:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3)) brightness(1.05);
    z-index: 10;
}

.clickable-enhanced:active {
    transform: scale(0.97);
}

.clickable-subtle {
    cursor: pointer;
    transition: background 0.2s ease;
}

.clickable-subtle:hover {
     background: rgba(0, 0, 0, 0.05);
}

.clickable-subtle:active {
    background: rgba(0, 0, 0, 0.1);
}
/* ============================================
   COMPONENT: ITEM
   ============================================ */

.item {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--box-bg);
    border: 3px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 4px 8px rgba(0, 0, 0, 0.3);
    padding: 1rem 1.5rem;
    transition: box-shadow 0.2s;
    width: 100%;
}

.item.small {
    padding: 0.5rem 1rem;
}

.item-header-wrapper {
    display: flex;
    gap: 5px;
    align-items: center;
    /* width: 100%; */
    color: var(--text-dark);
    min-width: 0;
}

.item-header-wrapper .title {
    font-family: var(--header-font);
    font-weight: 900;
    text-transform: uppercase;
}

.item-header-wrapper .subtitle {
    font-family: var(--body-font);
    font-size: 14px;
    font-weight: 100;
    text-wrap: nowrap;
    width: fit-content;
}

.item-header-wrapper .subtitle-right {
    font-family: var(--body-font);
    font-weight: 100;
    text-wrap: nowrap;
    width: fit-content;
}

.item-header-wrapper .hovering {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.item.item-hoverable:hover .item-header-wrapper .hovering {
    opacity: 1;
    transform: translateX(0);
}

.item.item-hoverable:hover .item-header-wrapper .title,
.item.item-hoverable:hover .item-header-wrapper .subtitle {
    transform: translateX(5px);
}

.item-header-wrapper .title,
.item-header-wrapper .subtitle {
    transition: transform 0.2s ease;
}

.item-body {
    margin-top: 10px;
    font-family: var(--body-font);
    color: var(--text-dark);
    line-height: 1.5;
}

.item-uses {
    display: flex;
    justify-content: flex-start;
    gap: clamp(5px, 1%, 15px);
    margin-top: 10px;
}

/* ============================================
   COMPONENT: DRAWER CONTAINER
   Container that manages stacking drawers horizontally
   Usage: <div class="drawer-container">...</div>
============================================ */
.drawer-container {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: row;
    pointer-events: none;
    z-index: 120;
    height: 100vh;
}

/* ============================================
   COMPONENT: DRAWER
   Individual drawer that slides out and stacks with others
   Usage: <div class="drawer" :class="{ 'open': open }">...</div>
============================================ */
.drawer {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--box-bg);
    border: 3px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 12px 30px rgba(0,0,0,0.45);
    transition: transform 320ms cubic-bezier(.2,.8,.2,1);
    overflow: auto;
    color: var(--text-dark);
    pointer-events: auto;
    min-width: 600px;
    width: 40vw;
    max-width: 800px;
    transform: translateX(-100%);
    flex-shrink: 0;
    height: 100vh;
}

/* Open state */
.drawer.open {
    transform: translateX(0) !important;
}

/* Closed drawers are hidden */
.drawer:not(.open) {
    display: none;
}

.drawer .drawer-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0.75rem 1rem;
    background: var(--header-bg);
    color: var(--header-text);
    border-bottom: 2px solid var(--border-dark);
    box-shadow: inset 0 0 0 2px var(--border-light);
}

.drawer .drawer-title {
    font-family: var(--header-font);
    font-weight: 900;
    font-size: 1rem;
    text-transform: uppercase;
}

.drawer .drawer-close {
    background: transparent;
    border: none;
    color: var(--header-text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px 8px;
}

.drawer .drawer-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    flex: 1;
    padding: 1rem;
    font-family: var(--body-font);
    color: var(--text-dark);
}

/* Custom scrollbar for drawer -- uses theme variables */
.drawer {
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--border-dark) transparent;
}

.drawer::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.drawer::-webkit-scrollbar-track {
    background: transparent;
}

.drawer::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.0); /* creates spacing effect */
    box-shadow: inset 0 0 0 2px var(--border-light);
}

.drawer::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ============================================
   COMPONENT: DICE
   ============================================ */

.dice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--header-bg);
    color: var(--header-text);
    padding: 0.3rem 0.6rem;
    border: 2px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 1px var(--border-light),
        0 2px 4px rgba(0, 0, 0, 0.3);
    font-family: var(--body-font);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dice:hover {
    transform: translateY(-1px);
    box-shadow:
        inset 0 0 0 1px var(--border-light),
        0 3px 6px rgba(0, 0, 0, 0.35);
}

.dice:active {
    transform: translateY(0);
    box-shadow:
        inset 0 0 0 1px var(--border-light),
        0 1px 2px rgba(0, 0, 0, 0.3);
}

.dice i {
    font-size: 0.9rem;
    pointer-events: none;
}

.dice.disabled,
.dice:disabled {
    background: var(--border-dark);
    color: var(--border-light);
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
    transform: translateY(0);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ============================================
   COMPONENT: PROFILE PICTURE
   ============================================ */

.profile-picture {
    width: 100px;
    height: 100px;
    border: 3px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 4px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Size variants */
.profile-picture.small {
    width: 60px;
    height: 60px;
    border: 2px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 1px var(--border-light),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.profile-picture.large {
    width: 150px;
    height: 150px;
}

.profile-picture.xlarge {
    width: 200px;
    height: 200px;
}

/* ============================================
   COMPONENT: CUTOUT BOX
   ============================================ */

.cutout-box {
    padding: 20px 40px;
    position: relative;
    /* Create the circular cutouts using radial gradients */
    background: 
        radial-gradient(circle at top left, transparent 30px, var(--header-bg) 30px),
        radial-gradient(circle at top right, transparent 30px, var(--header-bg) 30px),
        radial-gradient(circle at bottom left, transparent 30px, var(--header-bg) 30px),
        radial-gradient(circle at bottom right, transparent 30px, var(--header-bg) 30px);
    background-size: 51% 51%;
    background-position: top left, top right, bottom left, bottom right;
    background-repeat: no-repeat;
    color: var(--header-text);
}

.cutout-box::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: 
        radial-gradient(circle at top left, transparent 30px, var(--border-dark) 30px),
        radial-gradient(circle at top right, transparent 30px, var(--border-dark) 30px),
        radial-gradient(circle at bottom left, transparent 30px, var(--border-dark) 30px),
        radial-gradient(circle at bottom right, transparent 30px, var(--border-dark) 30px);
    background-size: 51% 51%;
    background-position: top left, top right, bottom left, bottom right;
    background-repeat: no-repeat;
    z-index: -1;
}

.cutout-box > * {
    position: relative;
    z-index: 1;
}

.cutout-box h2 {
    font-family: var(--header-font);
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.05em;
}

.cutout-box p {
    font-family: var(--body-font);
    text-align: center;
}

/* ============================================
   COMPONENT: TABLE
   ============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--box-bg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    font-family: var(--body-font);
    color: var(--text-dark);
}

.table thead {
    background: var(--header-bg);
    color: var(--header-text);
}

.table th {
    font-family: var(--header-font);
    padding: 1rem 1.5rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.9rem;
    border: 3px solid var(--border-dark);
    border-bottom: none;
}

.table th:first-child {
    border-left: 3px solid var(--border-dark);
}

.table th:last-child {
    border-right: 3px solid var(--border-dark);
}

.table tbody tr {
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(0, 0, 0, 0.05);
}

.table td {
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--border-light);
    border-left: 3px solid var(--border-dark);
    border-right: 3px solid var(--border-dark);
}

.table tbody tr:first-child td {
    border-top: 3px solid var(--border-dark);
}

.table tbody tr:last-child td {
    border-bottom: 3px solid var(--border-dark);
}

.table td:first-child {
    font-weight: bold;
}

/* Small variant for compact tables */
.table.small th {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
}

.table.small td {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* ============================================
   COMPONENT: CHECKBOX LIST
   ============================================ */

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0;
    font-family: var(--body-font);
    color: var(--text-dark);
}

li input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border: 3px solid var(--border-dark);
    background: var(--box-bg);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 0 1px var(--border-light);
}

li input[type="checkbox"]:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 
        inset 0 0 0 1px var(--border-light),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

li input[type="checkbox"]:checked {
    background: var(--header-bg);
    border-color: var(--border-dark);
}

li input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--header-text);
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
}

li input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

li input[type="checkbox"]:disabled:checked {
    background: var(--border-light);
}

/* ============================================
   TOOLTIP ICON
   ============================================ */

.icon-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    color: var(--text-dark);
    opacity: 0.7;
    transition: opacity 0.2s ease;
    z-index: 6;
}

.icon-tooltip:hover {
    opacity: 1;
}

.icon-tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    background-color: var(--text-dark);
    color: var(--box-bg);
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: var(--body-font);
    font-size: 14px;
    line-height: 1.4;
    font-weight: 100;

    text-decoration: none;
    text-transform: none;
    
    /* Position */
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    
    /* Width */
    width: 200px;
    /* white-space: normal; */
    
    /* Transition */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

/* Tooltip arrow */
.icon-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-dark) transparent transparent transparent;
}

/* Show tooltip on hover */
.icon-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    z-index: 10;
}

/* ============================================
   COMPONENT: NOTIFICATION SYSTEM
   ============================================ */

/* Container fixed to screen - use position classes below */
.notification-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 400px;
}

/* Position variants */
.notification-container.bottom-left {
    bottom: 20px;
    left: 20px;
}

.notification-container.bottom-right {
    bottom: 20px;
    right: 20px;
}

.notification-container.top-left {
    top: 20px;
    left: 20px;
}

.notification-container.top-right {
    top: 20px;
    right: 20px;
}

/* Individual notification */
.notification {
    background: var(--box-bg);
    border: 3px solid var(--border-dark);
    box-shadow:
        inset 0 0 0 2px var(--border-light),
        0 6px 16px rgba(0, 0, 0, 0.4);
    padding: 1rem 1.5rem;
    font-family: var(--body-font);
    color: var(--text-dark);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    min-width: 300px;
    
    /* Entry animation */
    animation: notification-enter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Smooth position changes when notifications above/below change */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
}

/* Transform origins for different positions */
.notification-container.bottom-left .notification {
    transform-origin: bottom left;
}

.notification-container.bottom-right .notification {
    transform-origin: bottom right;
}

.notification-container.top-left .notification {
    transform-origin: top left;
}

.notification-container.top-right .notification {
    transform-origin: top right;
}

/* Entry animations for different positions */
.notification-container.bottom-left .notification {
    animation-name: notification-enter-left;
}

.notification-container.bottom-right .notification {
    animation-name: notification-enter-right;
}

.notification-container.top-left .notification {
    animation-name: notification-enter-left;
}

.notification-container.top-right .notification {
    animation-name: notification-enter-right;
}

/* Entry animation - slide from left */
@keyframes notification-enter-left {
    from {
        opacity: 0;
        transform: scale(0.8) translateX(-100px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

/* Entry animation - slide from right */
@keyframes notification-enter-right {
    from {
        opacity: 0;
        transform: scale(0.8) translateX(100px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

/* Exit animation - fade out */
.notification.removing {
    animation: notification-exit 0.3s ease-out forwards;
}

@keyframes notification-exit {
    from {
        opacity: 1;
        transform: scale(1);
        max-height: 200px;
        margin-bottom: 12px;
    }
    to {
        opacity: 0;
        transform: scale(0.9);
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* Notification header with title and close button */
.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.notification-title {
    font-family: var(--header-font);
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dark);
}

.notification-close {
    background: transparent;
    border: none;
    color: var(--text-dark);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.notification-close:hover {
    opacity: 1;
}

/* Notification body text */
.notification-body {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-dark);
}

/* Notification variants */
.notification.success {
    border-color: #2d4a2b;
}

.notification.success .notification-title::before {
    content: '✓ ';
    color: #2d4a2b;
}

.notification.error {
    border-color: #8b3a2b;
}

.notification.error .notification-title::before {
    content: '⚠ ';
    color: #8b3a2b;
}

.notification.info {
    border-color: #1e4d6b;
}

.notification.info .notification-title::before {
    content: 'ℹ ';
    color: #1e4d6b;
}

.notification.warning {
    border-color: #8b6a2b;
}

.notification.warning .notification-title::before {
    content: '⚡ ';
    color: #8b6a2b;
}

/* ============================================
   DICE ROLLER
   ============================================ */

.dice-roller-container {
    position: fixed;
    background: var(--box-bg-solid);
    border: 3px solid var(--border-dark);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    padding: 20px 0;
    min-width: 250px;
    max-width: 350px;
    z-index: 1000;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.dice-roller-container.hidden {
    display: none;
}

.dice-roller-container .roller-title {
    font-family: var(--header-font);
    font-size: 1.3rem;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 20px 5px 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-light);
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dice-roller-settings {
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.2rem;
    transition: transform 0.2s ease;
}

.dice-roller-settings:hover {
    transform: scale(1.1);
}

/* ============================================
   DICE ROLLER SETTINGS
   ============================================ */

.dice-roller-settings-container {
    position: fixed;
    background: var(--box-bg-solid);
    border: 3px solid var(--border-dark);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    padding: 20px 0;
    min-width: 250px;
    max-width: 350px;
    z-index: 999;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.dice-roller-settings-container.hidden {
    display: none;
}

.dice-roller-settings-container .settings-title {
    font-family: var(--header-font);
    font-size: 1.3rem;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 20px 5px 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-light);
}

.dice-roller-settings-container .settings-body {
    padding: 0 20px;
    font-family: var(--body-font);
    color: var(--text-dark);
}

.dice-group {
    border-top: 2px solid var(--border-dark);
    border-bottom: 2px solid var(--border-dark);
    background: var(--box-bg-solid);
    margin-bottom: -2px;
}

.dice-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    cursor: pointer;
    font-family: var(--body-font);
    font-size: 16px;
    color: var(--text-dark);
    transition: background-color 0.2s ease;
}

.dice-group-header:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dice-group-title {
    font-weight: 600;
    flex-grow: 1;
}

.dice-group-settings {
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem;
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.dice-group-settings:hover {
    transform: scale(1.1);
}

.dice-group-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--text-dark);
    transition: transform 0.2s ease;
    margin-left: 8px;
}

.dice-group.expanded .dice-group-arrow {
    transform: rotate(180deg);
}

.dice-group-content {
    /* padding: 12px 20px 12px 5px; */
    padding: 12px 0px 12px 0px;
    border-top: 2px solid var(--border-light);
    font-family: var(--body-font);
    font-size: 14px;
    color: var(--text-dark);
    display: none;
}

.dice-group.expanded .dice-group-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dice-roll {
    display: flex;
    align-items: center;
    gap: 4px;
    /* padding: 0 20px 0 5px; */
    height: 20px;
    /* cursor: pointer; */
    transition: all 0.2s ease;
    font-family: var(--body-font);
    font-size: 15px;
}

.dice-roll-label {
    color: var(--text-dark);
    font-weight: 600;
    flex-shrink: 0;
}

.dice-roll-formula {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dice-roll-primary {
    color: var(--text-dark);
    font-weight: 700;
    flex-shrink: 0;
}

.primary-dice-result.crit {
    color: #16a34a; /* Green for critical success */
}

.primary-dice-result.miss {
    color: #dc2626; /* Red for critical failure */
}

.dice-roll-additional {
    color: var(--text-dark);
    opacity: 0.7;
    font-weight: 500;
    flex-shrink: 0;
}

.dice-roll-plusminus {
    color: var(--text-dark);
    opacity: 0.7;
    font-weight: 500;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.dice-roll-modifier {
    color: var(--text-dark);
    font-weight: 600;
    flex-shrink: 0;
}

.dice-roll-advantage {
    width: 26px;
    height: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 0;
}

.dice-roll-advantage:hover {
    opacity: 0.85;
}

.dice-roll-advantage:active {
    opacity: 0.7;
}

/* Individual advantage/disadvantage indicator boxes */
.dice-roll-advantage span {
    border: 1px solid var(--border-dark);
    box-sizing: border-box;
    width: 7px;
    height: 12px;
}

/* Advantage levels - progressively more saturated green */
.dice-roll-advantage .adv-1 {
    background-color: #86efac;
    border-color: #4ade80;
}

.dice-roll-advantage .adv-2 {
    background-color: #4ade80;
    border-color: #22c55e;
}

.dice-roll-advantage .adv-3 {
    background-color: #22c55e;
    border-color: #16a34a;
}

.dice-roll-advantage .adv-0 {
    background-color: var(--text-dark);
    /* border-color: #4ade80; */
    width: 5px;
}

/* Disadvantage levels - progressively more saturated red */
.dice-roll-advantage .dis-1 {
    background-color: #fca5a5;
    border-color: #f87171;
}

.dice-roll-advantage .dis-2 {
    background-color: #f87171;
    border-color: #ef4444;
}

.dice-roll-advantage .dis-3 {
    background-color: #ef4444;
    border-color: #dc2626;
}

.dice-roll-result {
    margin-left: auto;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

/* Dice result display - shows below the dice roll formula */
.dice-result-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    height: 25px;
    /* padding: 4px 8px; */
    font-size: 1.2rem;
}

.primary-dice-result {
    color: var(--text-dark);
    font-weight: 700;
}

.additional-dice-result {
    color: var(--text-dark);
    opacity: 0.8;
    font-weight: 600;
    font-size: 1rem;
}

.modifier-dice-result {
    color: var(--text-dark);
    font-weight: 600;
}

.dice-result-equals {
    color: var(--text-dark);
    opacity: 0.6;
    font-weight: 600;
    margin: 0 4px;
}

.dice-final-result {
    color: var(--text-dark);
    font-family: var(--header-font);
    font-weight: 900;
    font-size: 1.5rem;
    margin-left: 4px;
}

/* ============================================
   MOBILE BREAKPOINTS - GLOBAL STYLES
   ============================================ */

@media (max-width: 768px) {
    /* Decorative Elements - Reduce size on tablets */
    .dice-decoration,
    .d20-decoration {
        --size: 250px;
        opacity: 0.5;
    }

    /* Main Layout - Reduce padding */
    .main {
        padding: 0px 0px;
    }

    /* Content containers - Remove min-widths and adjust spacing */
    .main .content {
        gap: 20px;
        margin-bottom: 30px;
    }

    .main .content.large,
    .main .content.medium,
    .main .content.small {
        min-width: unset;
        width: 100%;
    }

    .main .content.large {
        --grid-cell-size: 50px;
    }

    .main .content.medium {
        --grid-cell-size: 45px;
    }

    .main .content.small {
        --grid-cell-size: 35px;
    }

    /* Row layout - Reduce gap */
    .row {
        gap: 15px;
    }

    .row.sticky.stuck {
        padding: 0.75rem 1rem;
    }

    /* Column layout - Reduce gap */
    .column {
        gap: 12px;
    }

    /* Header - Reduce padding and margins */
    .header-wrapper {
        margin: 1.5rem auto 1rem auto;
    }

    .header {
        padding: 1rem 1.5rem;
    }

    .header h1 {
        font-size: 1.5rem;
        letter-spacing: 0.12em;
    }

    .header h4 {
        font-size: 0.7rem;
    }

    /* Header Nav - Reduce button padding and font size */
    .header-nav button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        letter-spacing: 0.05em;
    }

    /* Section Header - Reduce padding */
    .section-header {
        padding: 0.8rem 1.5rem;
    }

    .section-header h2 {
        font-size: 1.3rem;
        letter-spacing: 0.12em;
    }

    /* Section Header Nav - Reduce padding */
    .section-header-nav button {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    /* Box - Reduce padding */
    .box {
        padding: 15px;
    }

    .box-content {
        padding: 20px 30px;
        gap: 12px;
    }

    .box-header {
        font-size: 1.1rem;
        padding: 5px 15px;
        margin-bottom: 15px;
    }

    /* Popup Modal - Reduce size */
    .popup-box {
        min-width: 400px;
        padding: 1.25rem 1.5rem;
        max-height: 85vh;
    }

    /* Button - Reduce padding */
    .button {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Button Group - Remove min-width */
    .button-group {
        min-width: unset;
    }

    .button-group button {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Dropdown - Slightly smaller */
    .dropdown select {
        padding: 0.6rem 2rem 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    /* Input - Reduce padding */
    .input {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }

    /* Textarea - Reduce padding */
    .textarea {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }

    /* Details/Accordion - Reduce padding */
    .details summary {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .details-content {
        padding: 1.2rem 1.5rem;
        padding-top: 0;
    }

    .details.small summary {
        padding: 0.5rem 1.2rem;
        font-size: 1rem;
    }

    .details.small .details-content {
        padding: 0.8rem 1.2rem;
        padding-top: 0;
    }

    /* Details Large */
    .details-large summary {
        padding: 0.8rem 1.5rem;
        font-size: 1.3rem;
    }

    .details-large-content {
        padding: 1.2rem 0;
    }

    /* Content Box */
    .content-box {
        padding: 0.8rem 1.2rem;
    }

    /* Number Display - Slightly smaller */
    .number {
        width: 55px;
        height: 55px;
        min-width: 55px;
        min-height: 55px;
        font-size: 1.3rem;
    }

    .number.num-small {
        width: 35px;
        height: 35px;
        min-width: 35px;
        min-height: 35px;
        font-size: 1rem;
    }

    .number.num-large {
        width: 70px;
        height: 70px;
        min-width: 70px;
        min-height: 70px;
        font-size: 1.8rem;
    }

    /* Number Input */
    .number-input .number-display {
        min-width: 65px;
        min-height: 45px;
        font-size: 1.3rem;
    }

    .number-input button {
        width: 35px;
        font-size: 1.1rem;
    }

    /* Tabs */

    .tabs {
        max-width: 100vw;
    }

    .tabs-header button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .tabs-header button.active {
        padding-bottom: calc(0.6rem + 3px);
    }

    .tabs-content {
        padding: 1.2rem 1.5rem;
    }

    /* Text Container */
    .text-container {
        padding: 0.8rem 1.2rem;
        min-width: 120px;
    }

    /* Spell Container */
    .spell {
        padding: 1.2rem 1.5rem;
        width: 100%;
        max-width: 500px;
    }

    .spell-name {
        font-size: 1.3rem;
    }

    .spell-stats {
        font-size: 0.85rem;
    }

    /* Button List */
    .button-list-header {
        padding: 0.6rem 1.5rem;
        font-size: 0.8rem;
    }

    .button-list button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Floating Input */
    .floating-input-container input {
        width: 180px;
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }

    /* Context Menu */
    .context-menu {
        min-width: 130px;
    }

    .context-menu button {
        padding: 7px 10px;
        font-size: 0.85rem;
    }

    /* Popup Selector */
    .popup-selector-panel {
        min-width: 130px;
        width: 180px;
    }

    .popup-selector-panel button {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    /* Character Image */
    .character-image {
        width: 130px;
        height: 130px;
    }

    /* Character Viewer Grid */
    .character-viewer-grid {
        grid-template-rows: repeat(12, 55px);
        gap: 8px;
    }

    /* Image Stat Container */
    .image-stat-container {
        --size: 95px;
        padding-top: 20px;
    }

    .image-stat-container .value {
        font-size: 1.8rem;
    }

    .image-stat-container .hp {
        font-size: 1.3rem;
        margin-top: 3px;
    }

    .image-stat-container .label {
        font-size: 0.65rem;
    }

    /* Item */
    .item {
        padding: 0.8rem 1.2rem;
    }

    .item.small {
        padding: 0.4rem 0.8rem;
    }

    /* Corner Decoration - Reduce size */
    .corner-decoration {
        --size: 50px;
    }

    /* Drawer - Reduce width */
    .drawer {
        min-width: 500px;
        width: 50vw;
        max-width: 700px;
    }

    .drawer .drawer-header {
        padding: 0.65rem 0.9rem;
    }

    .drawer .drawer-title {
        font-size: 0.9rem;
    }

    .drawer .drawer-body {
        gap: 12px;
        padding: 0.9rem;
    }

    /* Dice Button */
    .dice {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }

    /* Profile Picture */
    .profile-picture {
        width: 90px;
        height: 90px;
    }

    .profile-picture.small {
        width: 55px;
        height: 55px;
    }

    .profile-picture.large {
        width: 130px;
        height: 130px;
    }

    .profile-picture.xlarge {
        width: 180px;
        height: 180px;
    }

    /* Cutout Box */
    .cutout-box {
        padding: 18px 35px;
    }

    /* Table */
    .table th {
        padding: 0.8rem 1.2rem;
        font-size: 0.85rem;
    }

    .table td {
        padding: 0.65rem 1.2rem;
    }

    .table.small th {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
    }

    .table.small td {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    /* Checkbox List */
    li input[type="checkbox"] {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
    }

    /* Icon Tooltip */
    .icon-tooltip .tooltip-text {
        width: 180px;
        font-size: 13px;
        padding: 7px 10px;
    }

    /* Notification System */
    .notification-container {
        max-width: 350px;
    }

    .notification {
        padding: 0.8rem 1.2rem;
        min-width: 260px;
    }

    .notification-title {
        font-size: 0.9rem;
    }

    .notification-body {
        font-size: 0.9rem;
    }

    /* Dice Roller */
    .dice-roller-container {
        padding: 18px 0;
        min-width: 220px;
        max-width: 320px;
    }

    .dice-roller-container .roller-title {
        font-size: 1.2rem;
        padding: 0 18px 5px 18px;
        margin-bottom: 18px;
    }

    .dice-roller-settings-container {
        padding: 18px 0;
        min-width: 220px;
        max-width: 320px;
    }

    .dice-roller-settings-container .settings-title {
        font-size: 1.2rem;
        padding: 0 18px 5px 18px;
        margin-bottom: 18px;
    }

    .dice-group-header {
        padding: 9px 18px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    /* Decorative Elements - Hide on small phones */
    .dice-decoration,
    .d20-decoration {
        display: none;
    }

    /* Main Layout - Minimal padding on phones */
    .main {
        padding: 0px 0px;
    }

    /* Content containers - Tighter spacing */
    .main .content {
        gap: 15px;
        margin-bottom: 20px;
        padding-bottom: 40vh;
    }

    .main .content.large {
        --grid-cell-size: 40px;
    }

    .main .content.medium {
        --grid-cell-size: 35px;
    }

    .main .content.small {
        --grid-cell-size: 30px;
    }

    /* Row layout - Stack or tighter spacing */
    .row {
        gap: 10px;
    }

    .row.sticky.stuck {
        padding: 0.5rem 0.75rem;
    }

    /* Column layout - Minimal gap */
    .column {
        gap: 10px;
    }

    /* Header - Compact for mobile */
    .header-wrapper {
        margin: 1rem auto 0.75rem auto;
    }

    .header {
        padding: 0.75rem 1rem;
    }

    .header h1 {
        font-size: 1.2rem;
        letter-spacing: 0.08em;
    }

    .header h4 {
        font-size: 0.65rem;
        letter-spacing: 0.12em;
    }

    /* Header Nav - Compact buttons */
    .header-nav button {
        padding: 0.5rem 0.5rem;
        font-size: 0.75rem;
        letter-spacing: 0.03em;
    }

    /* Section Header - Compact */
    .section-header {
        padding: 0.6rem 1rem;
    }

    .section-header h2 {
        font-size: 1.1rem;
        letter-spacing: 0.08em;
    }

    /* Section Header Nav - Compact */
    .section-header-nav button {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
        letter-spacing: 0.03em;
    }

    /* Box - Minimal padding */
    .box {
        padding: 10px;
        min-height: 80px;
    }

    .box-content {
        padding: 15px 20px;
        gap: 10px;
        min-height: 80px;
    }

    .box h2 {
        font-size: 1rem;
    }

    .box-header {
        font-size: 1rem;
        padding: 5px 10px;
        margin-bottom: 12px;
        gap: 0.3rem;
    }

    .box-header .subHeading {
        font-size: 0.8rem;
    }

    /* Text Buttons - Keep transform effects but no size changes */

    /* Popup Modal - Full width on mobile */
    .popup-box {
        min-width: unset;
        width: 90vw;
        max-width: 500px;
        padding: 1rem 1.25rem;
        max-height: 90vh;
    }

    .popup-box .close-button {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1.25rem;
        padding: 0.25rem;
    }

    /* Button - Compact */
    .button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        letter-spacing: 0.05em;
    }

    /* Button Group - Stack or shrink */
    .button-group {
        flex-wrap: wrap;
    }

    .button-group button {
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
        letter-spacing: 0.03em;
    }

    /* Dropdown - Compact */
    .dropdown select {
        padding: 0.5rem 1.75rem 0.5rem 1rem;
        font-size: 0.85rem;
        letter-spacing: 0.03em;
    }

    .dropdown::after {
        right: 10px;
        font-size: 0.7rem;
    }

    .dropdown.small select {
        padding: 0.35rem 1.5rem 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Input - Compact */
    .input {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .input.small {
        padding: 0.35rem 1rem 0.35rem 0.75rem;
    }

    /* Textarea - Compact */
    .textarea {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        min-height: 100px;
    }

    /* Button wrapper and dropdown wrapper labels */
    .button-wrapper label,
    .dropdown-wrapper label,
    .input-wrapper label,
    .textarea-wrapper label {
        font-size: 0.8rem;
    }

    /* Details/Accordion - Compact */
    .details summary {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        font-family: var(--body-font);
    }

    .details-content {
        padding: 1rem 1rem;
        padding-top: 0;
    }

    .details.small summary {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .details.small .details-content {
        padding: 0.6rem 0.8rem;
        padding-top: 0;
    }

    /* Details Large - Compact */
    .details-large summary {
        padding: 0.6rem 1rem;
        font-size: 1.1rem;
    }

    .details-large-content {
        padding: 1rem 0;
    }

    /* Content Box - Compact */
    .content-box {
        padding: 0.6rem 1rem;
    }

    /* Number Display - Smaller */
    .number {
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
        font-size: 1.2rem;
    }

    .number .label {
        font-size: 0.65rem;
    }

    .number.num-small {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        font-size: 0.95rem;
    }

    .number.num-small .label {
        font-size: 0.55rem;
    }

    .number.num-large {
        width: 65px;
        height: 65px;
        min-width: 65px;
        min-height: 65px;
        font-size: 1.7rem;
    }

    .number.num-large .label {
        font-size: 0.75rem;
    }

    /* Number Input - Compact */
    .number-input-wrapper label {
        font-size: 1rem;
    }

    .number-input .number-display {
        min-width: 55px;
        min-height: 40px;
        font-size: 1.2rem;
        padding: 0 8px;
    }

    .number-input button {
        width: 32px;
        font-size: 1rem;
    }

    /* Tabs - Compact */

    .tabs {
        max-width: 100vw;
    }

    .tabs-header button {
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
        letter-spacing: 0.03em;
        font-weight: 100;
        font-family: var(--body-font);
    }

    .tabs-header button.active {
        padding-bottom: calc(0.5rem + 3px);
    }

    .tabs-content {
        padding: 1rem 1rem;
    }

    /* Text Container - Compact */
    .text-container {
        padding: 0.6rem 1rem;
        min-width: 100px;
        font-size: 0.9rem;
    }

    /* Spell Container - Full width compact */
    .spell {
        padding: 1rem 1rem;
        width: 100%;
    }

    .spell-name {
        font-size: 1.1rem;
    }

    .spell-stats {
        font-size: 0.8rem;
        gap: 0.3rem;
    }

    .spell-description {
        font-size: 0.9rem;
    }

    .spell-higher-levels {
        font-size: 0.85rem;
    }

    /* Button List - Compact */
    .button-list-header {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .button-list button {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }

    /* Floating Input - Compact */
    .floating-input-container {
        padding: 6px;
    }

    .floating-input-container input {
        width: 160px;
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    /* Context Menu - Compact */
    .context-menu {
        min-width: 120px;
        padding: 3px;
    }

    .context-menu button {
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    /* Popup Selector - Compact */
    .popup-selector-trigger {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }

    .popup-selector-panel {
        min-width: 120px;
        width: 160px;
    }

    .popup-selector-panel button {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    /* Character Image - Smaller */
    .character-image {
        width: 100px;
        height: 100px;
    }

    /* Character Viewer Grid - Compact */
    .character-viewer-grid {
        grid-template-columns: repeat(19, var(--grid-cell-size, 35px));
        grid-template-rows: repeat(12, 45px);
        gap: 6px;
    }

    /* Image Stat Container - Smaller */
    .image-stat-container {
        --size: 80px;
        padding-top: 18px;
    }

    .image-stat-container .value {
        font-size: 1.5rem;
    }

    .image-stat-container .hp {
        font-size: 1.2rem;
        margin-top: 0px;
    }

    .image-stat-container .label {
        font-size: 0.6rem;
    }

    /* Check Box - Slightly smaller */
    .check-box {
        --size: 18px;
        border-width: 2px;
    }

    /* Item - Compact */
    .item {
        padding: 0.6rem 1rem;
    }

    .item.small {
        padding: 0.35rem 0.6rem;
    }

    .item-header-wrapper .title {
        font-size: 0.9rem;
    }

    .item-header-wrapper .subtitle {
        font-size: 0.75rem;
    }

    .item-body {
        font-size: 0.9rem;
        margin-top: 8px;
    }

    /* Corner Decoration - Smaller */
    .corner-decoration {
        --size: 40px;
    }

    /* Drawer - Full width on mobile */
    .drawer {
        min-width: unset;
        width: 100vw;
        max-width: 100vw;
    }

    .drawer .drawer-header {
        padding: 0.5rem 0.75rem;
    }

    .drawer .drawer-title {
        font-size: 0.85rem;
    }

    .drawer .drawer-close {
        font-size: 1.1rem;
    }

    .drawer .drawer-body {
        gap: 10px;
        padding: 0.75rem;
    }

    /* Dice Button - Compact */
    .dice {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }

    .dice i {
        font-size: 0.8rem;
    }

    /* Profile Picture - Smaller */
    .profile-picture {
        width: 80px;
        height: 80px;
    }

    .profile-picture.small {
        width: 50px;
        height: 50px;
    }

    .profile-picture.large {
        width: 120px;
        height: 120px;
    }

    .profile-picture.xlarge {
        width: 160px;
        height: 160px;
    }

    /* Cutout Box - Compact */
    .cutout-box {
        padding: 15px 25px;
    }

    .cutout-box h2 {
        font-size: 1rem;
    }

    .cutout-box p {
        font-size: 0.9rem;
    }

    /* Table - Compact and scrollable */
    .table {
        font-size: 0.85rem;
    }

    .table th {
        padding: 0.6rem 0.8rem;
        font-size: 0.75rem;
    }

    .table td {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    .table.small th {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
    }

    .table.small td {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }

    /* Checkbox List - Slightly smaller */
    li {
        padding: 0.4rem 0;
        gap: 8px;
        font-size: 0.9rem;
    }

    li input[type="checkbox"] {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
    }

    li input[type="checkbox"]:checked::after {
        font-size: 1.1rem;
    }

    /* Icon Tooltip - Smaller */
    .icon-tooltip .tooltip-text {
        width: 160px;
        font-size: 12px;
        padding: 6px 9px;
    }

    /* Notification System - Compact and full width */
    .notification-container {
        max-width: calc(100vw - 20px);
        left: 10px !important;
        right: 10px !important;
    }

    .notification {
        padding: 0.6rem 1rem;
        min-width: unset;
        width: 100%;
    }

    .notification-header {
        margin-bottom: 0.4rem;
    }

    .notification-title {
        font-size: 0.85rem;
    }

    .notification-close {
        font-size: 1.2rem;
    }

    .notification-body {
        font-size: 0.85rem;
    }

    /* Dice Roller - Compact */
    .dice-roller-container {
        padding: 15px 0;
        min-width: 200px;
        max-width: 280px;
    }

    .dice-roller-container .roller-title {
        font-size: 1.1rem;
        padding: 0 15px 5px 15px;
        margin-bottom: 15px;
    }

    .dice-roller-settings {
        font-size: 1.1rem;
    }

    .dice-roller-settings-container {
        padding: 15px 0;
        min-width: 200px;
        max-width: 280px;
    }

    .dice-roller-settings-container .settings-title {
        font-size: 1.1rem;
        padding: 0 15px 5px 15px;
        margin-bottom: 15px;
    }

    .dice-roller-settings-container .settings-body {
        padding: 0 15px;
        font-size: 0.9rem;
    }

    .dice-group-header {
        padding: 8px 15px;
        font-size: 14px;
    }
}

/* OTHER */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* ============================================
   MOBILE OVERLAY
   ============================================ */

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .mobile-overlay {
        display: flex;
    }
}