﻿/* ============================================
   DSA Charakterhelfer - Medieval Fantasy Theme
   Das Schwarze Auge Style
   ============================================ */

/* CSS Variables for the medieval theme */
:root {
    /* Parchment colors */
    --parchment-light: #f4e4bc;
    --parchment-medium: #e8d5a3;
    --parchment-dark: #d4c089;
    --parchment-border: #b8a066;
    
    /* Wood/Leather colors */
    --wood-dark: #2c1810;
    --wood-medium: #4a2c17;
    --wood-light: #6b3d1f;
    --leather-brown: #8b4513;
    --leather-dark: #5c2e0a;
    
    /* Accent colors */
    --gold: #c9a227;
    --gold-light: #dbb84d;
    --gold-dark: #a68419;
    --blood-red: #8b0000;
    --blood-red-light: #a52a2a;
    --forest-green: #228b22;
    --forest-green-dark: #1a6b1a;
    --ink-black: #1a1a1a;
    --ink-brown: #3d2914;
    
    /* Text colors */
    --text-primary: #2c1810;
    --text-secondary: #5c4033;
    --text-light: #f4e4bc;
    --text-muted: #7a6a5a;
    
    /* Fonts */
    --font-heading: 'Cinzel Decorative', 'Cinzel', serif;
    --font-subheading: 'Cinzel', serif;
    --font-body: 'Crimson Text', Georgia, serif;
}

/* Base styles */
html, body {
    font-family: var(--font-body);
    background-color: var(--parchment-medium);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
    cursor: url("/img/cursor-hand.png") 12 20, auto;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-subheading);
    font-weight: 600;
    color: var(--wood-dark);
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
}

h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--wood-dark);
    border-bottom: 3px double var(--gold);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

h1:focus {
    outline: none;
}

h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--gold-dark);
    padding-bottom: 0.3rem;
}

h3 {
    font-size: 1.4rem;
}

/* Links */
a, .btn-link {
    color: var(--blood-red);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover, .btn-link:hover {
    color: var(--blood-red-light);
    text-decoration: underline;
}

/* Buttons - Medieval style */
.btn {
    font-family: var(--font-subheading);
    font-weight: 500;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn:hover {
    cursor: url("/img/cursor-point.png") 10 30, pointer;
}

.btn-primary {
    color: var(--text-light);
    background: linear-gradient(180deg, var(--blood-red-light) 0%, var(--blood-red) 100%);
    border: 2px solid var(--gold-dark);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(180deg, var(--blood-red) 0%, #6b0000 100%);
    border-color: var(--gold);
    color: var(--text-light);
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 8px rgba(0, 0, 0, 0.4);
}

.btn-outline-primary {
    color: var(--blood-red);
    border: 2px solid var(--blood-red);
    background: transparent;
}

.btn-outline-primary:hover {
    color: var(--text-light);
    background: var(--blood-red);
    border-color: var(--blood-red);
}

.btn-secondary {
    color: var(--text-light);
    background: linear-gradient(180deg, var(--wood-light) 0%, var(--wood-medium) 100%);
    border: 2px solid var(--leather-brown);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(180deg, var(--wood-medium) 0%, var(--wood-dark) 100%);
    border-color: var(--gold-dark);
    color: var(--text-light);
}

.btn-outline-secondary {
    color: var(--wood-medium);
    border: 2px solid var(--wood-medium);
    background: transparent;
}

.btn-outline-secondary:hover {
    color: var(--text-light);
    background: var(--wood-medium);
    border-color: var(--wood-medium);
}

.btn-warning {
    color: var(--wood-dark);
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
    border: 2px solid var(--gold-dark);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
    border-color: var(--wood-medium);
    color: var(--wood-dark);
}

.btn-outline-warning {
    color: var(--gold-dark);
    border: 2px solid var(--gold);
    background: transparent;
}

.btn-outline-warning:hover {
    color: var(--wood-dark);
    background: var(--gold);
    border-color: var(--gold);
}

.btn-danger {
    color: var(--text-light);
    background: linear-gradient(180deg, #c0392b 0%, #96281b 100%);
    border: 2px solid #7b1f15;
}

.btn-outline-danger {
    color: #96281b;
    border: 2px solid #96281b;
    background: transparent;
}

.btn-outline-danger:hover {
    color: var(--text-light);
    background: #96281b;
    border-color: #96281b;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.15rem var(--gold), 0 0 0 0.3rem rgba(201, 162, 39, 0.3);
}

/* Form controls - Parchment style */
.form-control, .form-select {
    font-family: var(--font-body);
    background-color: var(--parchment-light);
    border: 2px solid var(--parchment-border);
    border-radius: 2px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    background-color: #fff9e6;
    border-color: var(--gold);
    box-shadow: 0 0 0 0.2rem rgba(201, 162, 39, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.form-label {
    font-family: var(--font-subheading);
    font-weight: 500;
    color: var(--wood-medium);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.valid.modified:not([type=checkbox]) {
    outline: 2px solid var(--forest-green);
}

.invalid {
    outline: 2px solid var(--blood-red);
}

.validation-message {
    color: var(--blood-red);
    font-style: italic;
}

/* Content area */
.content {
    padding-top: 1.5rem;
    background: 
        linear-gradient(to right, rgba(0,0,0,0.03) 0%, transparent 5%, transparent 95%, rgba(0,0,0,0.03) 100%),
        linear-gradient(to bottom, rgba(0,0,0,0.02) 0%, transparent 10%);
}

/* Page layout */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    background: 
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23b8a066' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(180deg, var(--parchment-light) 0%, var(--parchment-medium) 100%);
}

/* Sidebar - Dark wood/leather style */
.sidebar {
    background: 
        linear-gradient(180deg, var(--wood-dark) 0%, var(--leather-dark) 50%, var(--wood-dark) 100%);
    border-right: 4px solid var(--gold-dark);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.1' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* Top row */
.top-row {
    background: linear-gradient(180deg, var(--wood-medium) 0%, var(--wood-dark) 100%);
    border-bottom: 3px solid var(--gold-dark);
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.top-row ::deep a, .top-row ::deep .btn-link {
    white-space: nowrap;
    margin-left: 1.5rem;
    text-decoration: none;
    color: var(--parchment-light);
    font-family: var(--font-subheading);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
    color: var(--gold);
    text-decoration: none;
}

.top-row ::deep a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-row span {
    color: var(--parchment-light);
    font-family: var(--font-body);
}

@media (max-width: 640.98px) {
    .top-row {
        justify-content: space-between;
    }

    .top-row ::deep a, .top-row ::deep .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 280px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .top-row.auth ::deep a:first-child {
        flex: 1;
        text-align: right;
        width: 0;
    }

    .top-row, article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

/* Navigation */
.nav-scrollable {
    display: block;
    background: rgba(0, 0, 0, 0.2);
}

.gm-roll {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
}

.roll-dice {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
}

.dice-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-right: 0.25rem;
}

.dice-chip {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    background: #f8f9fa;
    border: 1px solid #ced4da;
    color: #212529;
}

.dice-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.dice-svg polygon {
    fill: #f1f3f5;
    stroke: #868e96;
    stroke-width: 3;
}

.dice-svg-wrap {
    position: relative;
    width: 1.5rem;
    height: 1.5rem;
    display: inline-block;
    vertical-align: middle;
}

.dice-number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #212529;
    pointer-events: none;
}

.dice-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #212529;
    outline: none;
}

.dice-input::-webkit-outer-spin-button,
.dice-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.dice-input[type="number"] {
    -moz-appearance: textfield;
}

.roll-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.roll-detail {
    font-weight: 600;
}

.roll-meta {
    font-size: 0.85rem;
}

.roll-critical {
    font-size: 0.75rem;
    margin-left: 0.4rem;
}

.gm-probe {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.35rem;
}

.gm-probe-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 2.4rem;
    gap: 0.15rem;
}

.probe-label {
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.probe-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.probe-dice {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.1rem;
}

.navbar-toggler {
    appearance: none;
    cursor: pointer;
    width: 3.5rem;
    height: 2.5rem;
    color: var(--gold);
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    border: 2px solid var(--gold-dark);
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23c9a227' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

.navbar-toggler:checked {
    background-color: rgba(201, 162, 39, 0.3);
}

.navbar-brand {
    font-family: var(--font-heading) !important;
    font-size: 1.2rem !important;
    color: var(--gold) !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.nav-item ::deep .nav-link {
    color: var(--parchment-light);
    border-radius: 2px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
    padding: 0 1rem;
    font-family: var(--font-subheading);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item ::deep a.active {
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.3) 0%, transparent 100%);
    color: var(--gold);
    border-left-color: var(--gold);
}

.nav-item ::deep .nav-link:hover {
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.15) 0%, transparent 100%);
    color: var(--gold-light);
    border-left-color: var(--gold-dark);
}

@media (min-width: 641px) {
    .navbar-toggler {
        display: none;
    }

    .nav-scrollable {
        height: calc(100vh - 3.5rem);
        overflow-y: auto;
    }
}

/* Cards - Parchment style with ornate borders */
.card {
    background: 
        linear-gradient(135deg, var(--parchment-light) 0%, var(--parchment-medium) 100%);
    border: 3px solid var(--parchment-border);
    border-radius: 4px;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.15),
        inset 0 0 30px rgba(0, 0, 0, 0.03);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid var(--gold-dark);
    border-radius: 2px;
    pointer-events: none;
    opacity: 0.5;
}

.card-header {
    background: linear-gradient(180deg, var(--wood-light) 0%, var(--wood-medium) 100%);
    border-bottom: 2px solid var(--gold-dark);
    color: var(--parchment-light);
    font-family: var(--font-subheading);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.75rem 1rem;
}

.card-header h5, .card-header h6 {
    color: var(--parchment-light);
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.card-title {
    font-family: var(--font-subheading);
    color: var(--wood-dark);
    border-bottom: 1px solid var(--gold-dark);
    padding-bottom: 0.5rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: rgba(0, 0, 0, 0.05);
    border-top: 2px solid var(--parchment-border);
    padding: 0.75rem 1rem;
}

/* Special card variants */
.card.border-warning {
    border-color: var(--gold);
}

.card.border-warning::before {
    border-color: var(--gold);
    opacity: 0.7;
}

.card.border-warning .card-header,
.card .card-header.bg-warning {
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
    color: var(--wood-dark);
}

.card.border-warning .card-header h6,
.card .card-header.bg-warning h6 {
    color: var(--wood-dark);
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
}

/* List groups */
.list-group-item {
    background: transparent;
    border-color: var(--parchment-border);
    color: var(--text-primary);
    font-family: var(--font-body);
    padding: 0.75rem 1rem;
}

.list-group-item:first-child {
    border-top: none;
}

.list-group-flush > .list-group-item:last-child {
    border-bottom: none;
}

/* Alerts */
.alert {
    border-radius: 4px;
    border-width: 2px;
    font-family: var(--font-body);
}

.alert-info {
    background: linear-gradient(135deg, #d4edfc 0%, #b8dff5 100%);
    border-color: #5ba3c8;
    color: #1a4a6b;
}

.alert-info .alert-heading {
    font-family: var(--font-subheading);
    color: #1a4a6b;
}

.alert-warning {
    background: linear-gradient(135deg, var(--parchment-light) 0%, #f5e6c8 100%);
    border-color: var(--gold);
    color: var(--wood-dark);
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: var(--blood-red);
    color: #721c24;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: var(--forest-green);
    color: #155724;
}

/* Tables */
.table {
    font-family: var(--font-body);
}

.table thead th {
    background: linear-gradient(180deg, var(--wood-light) 0%, var(--wood-medium) 100%);
    color: var(--parchment-light);
    font-family: var(--font-subheading);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gold-dark);
}

.table tbody tr {
    background: var(--parchment-light);
}

.table tbody tr:nth-child(even) {
    background: var(--parchment-medium);
}

.table tbody tr:hover {
    background: #f5e6c8;
}

/* Spinner */
.spinner-border {
    color: var(--gold);
}

/* Error UI */
#blazor-error-ui {
    background: linear-gradient(180deg, var(--blood-red-light) 0%, var(--blood-red) 100%);
    bottom: 0;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.4);
    display: none;
    left: 0;
    padding: 0.75rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: var(--parchment-light);
    font-family: var(--font-body);
    border-top: 3px solid var(--gold);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.5rem;
    color: var(--gold);
}

#blazor-error-ui a {
    color: var(--gold);
}

.blazor-error-boundary {
    background: linear-gradient(180deg, var(--blood-red-light) 0%, var(--blood-red) 100%);
    padding: 1rem 1.5rem;
    color: var(--parchment-light);
    border: 2px solid var(--gold);
    border-radius: 4px;
}

.blazor-error-boundary::after {
    content: "Ein Fehler ist aufgetreten.";
    font-family: var(--font-body);
}

/* Ingame clock */
.ingame-clock {
    position: relative;
    width: 220px;
    height: 220px;
    flex: 0 0 auto;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.2));
}

.ingame-clock__face-graphic {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-image: url("/images/ingame-clock-face.png");
    background-size: cover;
    background-position: center;
    border: 3px solid var(--ink-black);
}

.ingame-clock__center-cover {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 88px;
    height: 88px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--parchment-light);
    border: 3px solid var(--ink-black);
}

.ingame-clock__day-night {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 36px;
    height: 36px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--ink-black);
    z-index: 2;
    overflow: hidden;
}

.ingame-clock__day-night::before,
.ingame-clock__day-night::after {
    content: "";
    position: absolute;
    border-radius: 50%;
}

.ingame-clock__day-night--day {
    background: #f0c645;
    box-shadow: 0 0 10px rgba(240, 198, 69, 0.5);
}

.ingame-clock__day-night--day::before {
    width: 3px;
    height: 3px;
    background: var(--ink-black);
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow:
        0 50px 0 var(--ink-black),
        -18px 8px 0 var(--ink-black),
        18px 8px 0 var(--ink-black),
        -18px 42px 0 var(--ink-black),
        18px 42px 0 var(--ink-black),
        -10px 25px 0 var(--ink-black),
        10px 25px 0 var(--ink-black);
}

.ingame-clock__day-night--night {
    background: #1f2a44;
    box-shadow: 0 0 8px rgba(15, 20, 35, 0.35);
    border-color: #0f1423;
}

.ingame-clock__day-night--night::before {
    width: 26px;
    height: 26px;
    background: #f2edd9;
    top: 4px;
    left: 5px;
    box-shadow: 0 0 6px rgba(242, 237, 217, 0.35);
}

.ingame-clock__day-night--night::after {
    width: 26px;
    height: 26px;
    background: #1f2a44;
    top: 2px;
    left: 12px;
}

.ingame-clock__day-night--night {
    background-image: radial-gradient(circle at 10px 9px, #ffffff 1px, transparent 1.5px),
        radial-gradient(circle at 24px 7px, #ffffff 1px, transparent 1.5px),
        radial-gradient(circle at 8px 23px, #ffffff 1px, transparent 1.5px),
        radial-gradient(circle at 26px 21px, #ffffff 1px, transparent 1.5px);
}

.ingame-clock__day-night--hidden {
    display: none;
}

.ingame-clock__hand {
    position: absolute;
    left: 50%;
    bottom: 50%;
    transform-origin: 50% 100%;
    background: var(--ink-black);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.ingame-clock__hand--hour {
    height: 38%;
    width: 6px;
    transform: translateX(-50%) rotate(var(--ingame-hour, 0deg));
}

.ingame-clock__hand--minute {
    height: 52%;
    width: 4px;
    transform: translateX(-50%) rotate(var(--ingame-minute, 0deg));
}

.ingame-clock__pin {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ink-black);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ============================================
   DSA Character specific styles
   ============================================ */

.stat-card {
    background: 
        linear-gradient(135deg, var(--wood-medium) 0%, var(--wood-dark) 100%);
    border: 3px solid var(--gold);
    border-radius: 4px;
    color: var(--parchment-light);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 1px solid var(--gold-dark);
    border-radius: 2px;
    pointer-events: none;
    opacity: 0.5;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.stat-label {
    font-family: var(--font-subheading);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.attribute-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
}

.attribute-card {
    background: 
        linear-gradient(135deg, var(--parchment-light) 0%, var(--parchment-medium) 100%);
    border: 2px solid var(--parchment-border);
    border-radius: 4px;
    padding: 0.75rem;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
}

.attribute-card::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px solid var(--gold-dark);
    border-radius: 2px;
    pointer-events: none;
    opacity: 0.3;
}

.attribute-card:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.attribute-card:hover::before {
    opacity: 0.6;
}

.attribute-abbr {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--blood-red);
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

.attribute-name {
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attribute-value {
    font-family: var(--font-subheading);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--wood-dark);
}

.derived-stats {
    background: 
        linear-gradient(135deg, var(--parchment-medium) 0%, var(--parchment-dark) 100%);
    border: 2px solid var(--parchment-border);
    border-radius: 4px;
    padding: 1rem;
}

.weapon-card, .spell-card, .ability-card {
    background: 
        linear-gradient(135deg, var(--parchment-light) 0%, var(--parchment-medium) 100%);
    border: 2px solid var(--parchment-border);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.weapon-card:hover, .spell-card:hover, .ability-card:hover {
    border-color: var(--gold-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.weapon-card.active {
    border-color: var(--forest-green);
    background: 
        linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    box-shadow: 0 0 10px rgba(34, 139, 34, 0.2);
}

.skill-note-panel {
    background: linear-gradient(135deg, var(--parchment-medium) 0%, var(--parchment-dark) 100%);
    border-color: var(--parchment-border);
}

.modifier-positive {
    color: var(--forest-green);
    font-weight: 600;
}

.modifier-negative {
    color: var(--blood-red);
    font-weight: 600;
}

/* Character list attribute display */
.card .attribute-grid .text-center small.text-muted {
    font-family: var(--font-subheading);
    font-size: 0.7rem;
    color: var(--blood-red) !important;
    text-transform: uppercase;
    font-weight: 600;
}

.card .attribute-grid .text-center .fw-bold {
    font-family: var(--font-subheading);
    font-size: 1.1rem;
    color: var(--wood-dark);
}

/* Small text styling */
.small, small {
    font-family: var(--font-body);
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Badge styling */
.badge {
    font-family: var(--font-subheading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

/* Decorative elements */
.ornament-top, .ornament-bottom {
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20'%3E%3Cpath d='M0 10 Q25 0 50 10 Q75 20 100 10' stroke='%23c9a227' stroke-width='2' fill='none'/%3E%3C/svg%3E") repeat-x center;
    opacity: 0.6;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--parchment-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--wood-light) 0%, var(--wood-medium) 100%);
    border: 2px solid var(--parchment-dark);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--wood-medium) 0%, var(--wood-dark) 100%);
}

/* Selection styling */
::selection {
    background: var(--gold);
    color: var(--wood-dark);
}

/* Form floating labels */
.form-floating > .form-control,
.form-floating > .form-select {
    background-color: var(--parchment-light);
    border: 2px solid var(--parchment-border);
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    background-color: #fff9e6;
    border-color: var(--gold);
}

.form-floating > label {
    font-family: var(--font-body);
    color: var(--text-muted);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--wood-medium);
}

/* Checkbox styling */
.form-check-input {
    background-color: var(--parchment-light);
    border: 2px solid var(--parchment-border);
}

.form-check-input:checked {
    background-color: var(--forest-green);
    border-color: var(--forest-green-dark);
}

.form-check-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 0.2rem rgba(201, 162, 39, 0.25);
}

/* Favorites drag-and-drop */
.favorite-draggable {
    position: relative;
}

.favorite-drag-handle {
    display: inline-flex;
    align-items: center;
    cursor: url("/img/cursor-grab.png") 20 10, grab !important;
}

.favorite-drag-handle:active {
    cursor: url("/img/cursor-grab.png") 20 10, grabbing !important;
}

.favorite-drag-handle * {
    cursor: inherit !important;
}

.favorite-drop-target::before {
    content: "";
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    top: -4px;
    height: 6px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.7) 0%, rgba(219, 184, 77, 0.9) 50%, rgba(201, 162, 39, 0.7) 100%);
    box-shadow: 0 2px 4px rgba(44, 24, 16, 0.25);
}

.favorite-drop-target .bi-grip-vertical {
    cursor: grabbing;
}

.bi-grip-vertical {
    cursor: grab;
}

/* Login/Register page specific */
section h2 {
    font-family: var(--font-subheading);
    font-size: 1.2rem;
    color: var(--wood-medium);
    border-bottom: 1px solid var(--gold-dark);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

section hr {
    border-color: var(--parchment-border);
    opacity: 0.5;
}

/* Modal styling */
.modal-content {
    background: linear-gradient(135deg, var(--parchment-light) 0%, var(--parchment-medium) 100%);
    border: 3px solid var(--parchment-border);
    border-radius: 4px;
}

.modal-header {
    background: linear-gradient(180deg, var(--wood-light) 0%, var(--wood-medium) 100%);
    border-bottom: 2px solid var(--gold-dark);
    color: var(--parchment-light);
}

.modal-header .modal-title {
    font-family: var(--font-subheading);
    color: var(--parchment-light);
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-footer {
    background: rgba(0, 0, 0, 0.05);
    border-top: 2px solid var(--parchment-border);
}

/* Dropdown styling */
.dropdown-menu {
    background: var(--parchment-light);
    border: 2px solid var(--parchment-border);
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.dropdown-item {
    font-family: var(--font-body);
    color: var(--text-primary);
}

.dropdown-item:hover, .dropdown-item:focus {
    background: var(--parchment-medium);
    color: var(--wood-dark);
}

.dropdown-item.active, .dropdown-item:active {
    background: var(--blood-red);
    color: var(--text-light);
}

/* Pagination styling */
.pagination .page-link {
    font-family: var(--font-subheading);
    background: var(--parchment-light);
    border: 2px solid var(--parchment-border);
    color: var(--wood-medium);
}

.pagination .page-link:hover {
    background: var(--parchment-medium);
    border-color: var(--gold-dark);
    color: var(--wood-dark);
}

.pagination .page-item.active .page-link {
    background: var(--blood-red);
    border-color: var(--blood-red);
    color: var(--text-light);
}

.pagination .page-item.disabled .page-link {
    background: var(--parchment-dark);
    color: var(--text-muted);
}

/* Tooltip styling */
.tooltip-inner {
    background: var(--wood-dark);
    font-family: var(--font-body);
    border: 1px solid var(--gold-dark);
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--wood-dark);
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: var(--wood-dark);
}

/* Progress bar styling */
.progress {
    background: var(--parchment-dark);
    border: 1px solid var(--parchment-border);
    border-radius: 4px;
}

.progress-bar {
    background: linear-gradient(180deg, var(--blood-red-light) 0%, var(--blood-red) 100%);
}

/* Breadcrumb styling */
.breadcrumb {
    background: transparent;
    font-family: var(--font-body);
}

.breadcrumb-item a {
    color: var(--blood-red);
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--gold);
    content: "›";
}

/* Collapsible talent group */
details.card > summary.card-header {
    list-style: none;
    cursor: pointer;
}

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

details.card > summary.card-header::after {
    content: "▾";
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--text-muted);
}

details.card:not([open]) > summary.card-header::after {
    content: "▸";
}

.skill-field-input {
    width: 72px;
}

/* Print styles */
@media print {
    .sidebar, .top-row, .navbar-toggler {
        display: none !important;
    }
    
    main {
        background: white !important;
    }
    
    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}
