/* ============================================================
           HOJA DE PERSONAJE · TEMA "GRIMORIO CARMESÍ"
           Estética medieval de fantasía (D&D): cuero, oro viejo y pergamino
           ============================================================ */
        @import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Cinzel+Decorative:wght@700;900&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Alegreya:ital,wght@0,400;0,500;0,700;1,400&family=IM+Fell+English:ital@0;1&display=swap');

        :root {
            color-scheme: dark;
            --bg-color: #0a0605;
            --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23g)' opacity='0.035'/></svg>");
            --box-bg: var(--grain), linear-gradient(180deg, rgba(48, 32, 20, 0.93), rgba(21, 14, 9, 0.96));
            --box-border: #6b4f2a;
            --accent-red: #b3241f;
            --accent-red-bright: #e0524a;
            --accent-gold: #c9a45c;
            --accent-gold-bright: #f0d69a;
            --accent-cyan: #79c7cf;
            --accent-green: #69b98c;
            --text-main: #e9dec6;
            --text-muted: #a7967b;
            --white-border: #a98243;
            --line: rgba(201, 164, 92, 0.22);

            --font-title: 'Cinzel', 'IM Fell English SC', serif;
            --font-deco: 'Cinzel Decorative', 'Cinzel', serif;
            --font-text: 'EB Garamond', 'IM Fell English', serif;
            --font-ui: 'Alegreya', 'EB Garamond', serif;
        }

        * { box-sizing: border-box; margin: 0; padding: 0; }
        html { scroll-behavior: smooth; }

        body {
            background-color: var(--bg-color);
            color: var(--text-main);
            font-family: var(--font-ui);
            padding: 24px 20px 210px;
            overflow-x: hidden;
            display: flex;
            flex-direction: column;
            align-items: center;
            min-height: 100vh;
            background-image:
                radial-gradient(ellipse at 50% -20%, rgba(150, 80, 35, 0.22), transparent 55%),
                radial-gradient(ellipse at 50% 120%, rgba(130, 25, 18, 0.18), transparent 60%),
                radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.55) 100%),
                url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20512%20512%22%3E%3Cg%20stroke%3D%22%234b3320%22%20fill%3D%22none%22%20stroke-width%3D%225%22%20opacity%3D%22.65%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%22256%22%20cy%3D%22256%22%20r%3D%22222%22%2F%3E%3Ccircle%20cx%3D%22256%22%20cy%3D%22256%22%20r%3D%22201%22%20stroke-dasharray%3D%226%2014%22%2F%3E%3Cpath%20d%3D%22M256%2067v70M256%20375v70M67%20256h70M375%20256h70%22%2F%3E%3Cpath%20d%3D%22M256%20116%20345%20156v109c-6%2091-47%20133-89%20158-42-25-83-67-89-158V156z%22%2F%3E%3Cpath%20d%3D%22M256%20145%20319%20173v91c-3%2064-28%20105-63%20129-35-24-60-65-63-129v-91z%22%2F%3E%3Cpath%20d%3D%22M256%20159v207M217%20208h78M230%20299h52%22%2F%3E%3Cpath%20d%3D%22M164%20171Q114%20142%2090%20179q49%208%2074%2042M348%20171q50-29%2074%208-49%208-74%2042%22%2F%3E%3Cpath%20d%3D%22M166%20281Q116%20294%20104%20346q43-27%2087-20M346%20281q50%2013%2062%2065-43-27-87-20%22%2F%3E%3Cpath%20d%3D%22m244%2098%2012-21%2012%2021M244%20414l12%2021%2012-21%22%2F%3E%3Cpath%20d%3D%22M135%20135q-23%2013-27%2033M377%20135q23%2013%2027%2033%22%2F%3E%3Cpath%20d%3D%22m256%20232%2022%2016-8%2028h-28l-8-28z%22%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%22%234b3320%22%20opacity%3D%22.54%22%3E%3Ccircle%20cx%3D%22256%22%20cy%3D%2244%22%20r%3D%227%22%2F%3E%3Ccircle%20cx%3D%22256%22%20cy%3D%22468%22%20r%3D%227%22%2F%3E%3Ccircle%20cx%3D%2244%22%20cy%3D%22256%22%20r%3D%227%22%2F%3E%3Ccircle%20cx%3D%22468%22%20cy%3D%22256%22%20r%3D%227%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E'),
                url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='0.05'/></svg>");
            background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
            background-position: center top, center bottom, center, center, center;
            background-size: 100% 100%, 100% 100%, 100% 100%, min(78vh, 700px), 180px 180px;
            background-attachment: fixed, fixed, fixed, fixed, fixed;
        }

        body::before {
            content: "";
            position: fixed;
            inset: 0;
            z-index: 0;
            pointer-events: none;
            background: radial-gradient(ellipse at center, transparent 38%, rgba(0, 0, 0, 0.35) 76%, rgba(0, 0, 0, 0.72) 100%);
        }

        ::selection { background: rgba(179, 36, 31, 0.55); color: #fff5dd; }

        * { scrollbar-width: thin; scrollbar-color: #8a6a33 #0c0705; }
        ::-webkit-scrollbar { width: 9px; height: 9px; }
        ::-webkit-scrollbar-track { background: #0c0705; }
        ::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, #8a6a33, #4a3418);
            border: 1px solid #0c0705;
            border-radius: 2px;
        }
        ::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #b08a45, #6b4f2a); }

        /* ===================== MARCO DE PÁGINA ===================== */
        .page {
            width: 100%;
            max-width: 1220px;
            background:
                var(--grain),
                radial-gradient(ellipse at 50% 0%, rgba(201, 164, 92, 0.07), transparent 55%),
                linear-gradient(180deg, rgba(45, 30, 19, 0.97), rgba(15, 11, 8, 0.99));
            border: 1px solid #6b4f2a;
            box-shadow:
                0 0 0 2px #080504,
                0 0 0 3px rgba(201, 164, 92, 0.42),
                0 0 0 9px #080504,
                0 26px 70px rgba(0, 0, 0, 0.85),
                inset 0 0 90px rgba(0, 0, 0, 0.6);
            padding: 30px 26px 26px;
            margin-bottom: 52px;
            display: flex;
            flex-direction: column;
            gap: 18px;
            position: relative;
            z-index: 1;
        }

        .page::before {
            content: "";
            position: absolute;
            inset: 8px;
            border: 1px solid rgba(201, 164, 92, 0.18);
            pointer-events: none;
        }

        .page::after {
            content: "❖";
            position: absolute;
            top: -13px;
            left: 50%;
            transform: translateX(-50%);
            background: #0a0605;
            color: var(--accent-gold);
            font-size: 13px;
            line-height: 22px;
            padding: 0 10px;
            text-shadow: 0 0 12px rgba(201, 164, 92, 0.65);
            pointer-events: none;
        }

        .page-title-divider {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 18px;
            text-align: center;
            font-family: var(--font-title);
            font-weight: 700;
            color: var(--accent-gold-bright);
            font-size: clamp(15px, 2.1vw, 23px);
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 0.18em;
            text-shadow: 0 2px 0 #000, 0 0 22px rgba(201, 164, 92, 0.28);
        }
        .page-title-divider::before,
        .page-title-divider::after {
            content: "";
            height: 1px;
            flex: 1 1 60px;
            max-width: 240px;
            background: linear-gradient(90deg, transparent, rgba(201, 164, 92, 0.65));
        }
        .page-title-divider::after {
            background: linear-gradient(90deg, rgba(201, 164, 92, 0.65), transparent);
        }

        /* ===================== CAMPOS ===================== */
        input[type="text"], input[type="number"], textarea {
            background: transparent;
            border: none;
            color: var(--text-main);
            font-family: var(--font-text);
            font-size: 15px;
            width: 100%;
            transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
            text-align: center;
            caret-color: var(--accent-gold);
        }
        input[type="text"]:focus, input[type="number"]:focus, textarea:focus {
            outline: none;
            background: rgba(201, 164, 92, 0.07);
            border-bottom: 1px solid var(--accent-gold);
            box-shadow: 0 8px 14px -10px rgba(201, 164, 92, 0.7);
        }
        textarea {
            resize: none;
            padding: 8px 10px;
            background: rgba(6, 4, 3, 0.55);
            border: 1px solid rgba(201, 164, 92, 0.22);
            border-radius: 2px;
            overflow-y: auto;
            text-align: left;
            line-height: 1.5;
            box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.5);
        }
        textarea:focus {
            border-color: rgba(201, 164, 92, 0.55);
            box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.5), 0 0 14px rgba(201, 164, 92, 0.12);
        }
        textarea[style*="26px"] {
            padding: 2px 8px;
            line-height: 1.3;
        }

        /* ===================== CAJAS ===================== */
        .box {
            background: var(--box-bg);
            border: 1px solid rgba(201, 164, 92, 0.38);
            border-radius: 2px;
            padding: 15px;
            box-shadow:
                inset 0 0 0 1px rgba(0, 0, 0, 0.55),
                inset 0 0 30px rgba(0, 0, 0, 0.45),
                0 6px 18px rgba(0, 0, 0, 0.45);
            position: relative;
        }
        .box::before {
            content: '';
            position: absolute;
            top: -1px;
            left: -1px;
            width: 14px;
            height: 14px;
            border-top: 1px solid var(--accent-gold);
            border-left: 1px solid var(--accent-gold);
            opacity: 0.65;
        }
        .box::after {
            content: '';
            position: absolute;
            bottom: -1px;
            right: -1px;
            width: 14px;
            height: 14px;
            border-bottom: 1px solid var(--accent-gold);
            border-right: 1px solid var(--accent-gold);
            opacity: 0.65;
        }

        .box-title {
            font-family: var(--font-title);
            font-size: 11.5px;
            font-weight: 600;
            color: var(--accent-gold);
            text-align: center;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            border-top: 1px solid var(--line);
            margin-top: 12px;
            padding-top: 7px;
            clear: both;
        }
        .box-title::before,
        .box-title::after {
            content: "◆";
            font-size: 7px;
            color: var(--accent-red-bright);
            vertical-align: middle;
            opacity: 0.85;
        }
        .box-title::before { margin-right: 8px; }
        .box-title::after { margin-left: 8px; }

        /* ===================== TOOLTIPS ===================== */
        .tooltip-container { position: relative; cursor: help; }
        .tooltip-container:hover::after {
            content: attr(data-desc);
            position: absolute;
            bottom: 110%;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(180deg, #241609, #0b0604);
            border: 1px solid var(--accent-gold);
            color: var(--text-main);
            padding: 9px 13px;
            border-radius: 2px;
            width: max-content;
            max-width: 290px;
            font-family: var(--font-text);
            font-size: 13.5px;
            text-align: left;
            z-index: 1000;
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.75), 0 0 18px rgba(201, 164, 92, 0.22);
            pointer-events: none;
            text-transform: none;
            font-weight: normal;
            letter-spacing: normal;
            line-height: 1.45;
            white-space: normal;
        }

        /* ===================== BARRA FLOTANTE ===================== */
        .bottom-action-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background:
                radial-gradient(ellipse at 50% 0%, rgba(201, 164, 92, 0.08), transparent 70%),
                linear-gradient(0deg, rgba(6, 4, 3, 0.99), rgba(24, 15, 9, 0.98));
            border-top: 2px solid #8a6a33;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 7px;
            padding: 9px 10px;
            z-index: 999999;
            box-shadow:
                0 -1px 0 rgba(201, 164, 92, 0.25),
                0 -12px 45px rgba(0, 0, 0, 0.85),
                0 -22px 60px rgba(120, 20, 15, 0.15);
            backdrop-filter: blur(8px);
        }

        .bar-row {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-items: flex-start;
            gap: 7px;
            width: 100%;
        }

        .action-group {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 5px;
            padding: 5px 8px 7px;
            border: 1px solid rgba(201, 164, 92, 0.22);
            border-radius: 3px;
            background: linear-gradient(180deg, rgba(54, 35, 18, 0.42), rgba(10, 6, 4, 0.55));
            box-shadow:
                inset 0 1px 0 rgba(255, 230, 180, 0.05),
                0 2px 6px rgba(0, 0, 0, 0.35);
            flex: 0 1 auto;
        }

        .group-label {
            font-family: var(--font-title);
            color: var(--accent-gold);
            text-transform: uppercase;
            font-size: 0.6rem;
            font-weight: 600;
            letter-spacing: 0.16em;
            margin: 0;
            padding-left: 1px;
            opacity: 0.9;
            display: flex;
            align-items: center;
            gap: 4px;
            white-space: nowrap;
        }
        .group-label::after {
            content: "";
            flex: 1;
            height: 1px;
            background: linear-gradient(90deg, rgba(201, 164, 92, 0.35), transparent);
        }
        .group-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            align-items: center;
            justify-content: center;
        }
        .btn-session { border-color: rgba(201, 164, 92, 0.7); color: #f0d9a0; }
        .btn-session:hover {
            background: linear-gradient(180deg, #5a431f, #2b1d0d);
            border-color: var(--accent-gold-bright);
            color: #fff6dc;
            box-shadow: 0 0 14px rgba(201, 164, 92, 0.4);
        }

        .floating-btn {
            background: linear-gradient(180deg, #2a1a10 0%, #170e09 55%, #0e0806 100%);
            color: var(--text-main);
            border: 1px solid rgba(201, 164, 92, 0.5);
            padding: 6px 11px;
            font-family: var(--font-title);
            font-size: 0.72rem;
            font-weight: 600;
            cursor: pointer;
            border-radius: 2px;
            transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
            text-transform: uppercase;
            letter-spacing: 0.09em;
            white-space: nowrap;
            text-shadow: 0 1px 2px #000;
            box-shadow:
                inset 0 1px 0 rgba(255, 230, 180, 0.12),
                inset 0 -1px 0 rgba(0, 0, 0, 0.7),
                0 2px 5px rgba(0, 0, 0, 0.5);
        }
        .floating-btn:hover {
            background: linear-gradient(180deg, #4a3018, #2a1a0d);
            border-color: var(--accent-gold);
            color: #fff4d8;
            box-shadow:
                0 0 14px rgba(201, 164, 92, 0.35),
                inset 0 1px 0 rgba(255, 230, 180, 0.22);
            transform: translateY(-1px);
        }
        .floating-btn:active { transform: translateY(0); }

        .btn-skill { border-color: rgba(122, 167, 199, 0.55); color: #a9cbe4; }
        .btn-skill:hover {
            background: linear-gradient(180deg, #23445c, #12242f);
            border-color: #7aa7c7;
            color: #eaf6ff;
            box-shadow: 0 0 14px rgba(122, 167, 199, 0.35);
        }

        .btn-fly { border-color: rgba(121, 199, 207, 0.6); color: #b9e9ee; }
        .btn-fly:hover {
            background: linear-gradient(180deg, #1c4a50, #0d292d);
            border-color: var(--accent-cyan);
            color: #effeff;
            box-shadow: 0 0 14px rgba(121, 199, 207, 0.35);
        }
        .btn-fly.flying-active {
            background: rgba(121, 199, 207, 0.18);
            border: 2px solid var(--accent-cyan);
            color: #ffffff;
            box-shadow: 0 0 15px rgba(121, 199, 207, 0.75);
            animation: pulseFly 1.8s infinite;
        }
        @keyframes pulseFly {
            0% { box-shadow: 0 0 6px rgba(121, 199, 207, 0.5); }
            50% { box-shadow: 0 0 20px rgba(121, 199, 207, 0.9); }
            100% { box-shadow: 0 0 6px rgba(121, 199, 207, 0.5); }
        }

        .btn-turn { border-color: rgba(201, 143, 58, 0.65); color: #e0b06a; }
        .btn-turn:hover {
            background: linear-gradient(180deg, #5a3a12, #2e1d08);
            border-color: #d9a04a;
            color: #ffe9c2;
            box-shadow: 0 0 14px rgba(201, 143, 58, 0.35);
        }

        .btn-rest { border-color: rgba(105, 185, 140, 0.55); color: #9bd8b7; }
        .btn-rest:hover {
            background: linear-gradient(180deg, #1e4a32, #0e2a1c);
            border-color: var(--accent-green);
            color: #e9fff3;
            box-shadow: 0 0 14px rgba(105, 185, 140, 0.35);
        }

        .btn-help { border-color: var(--accent-gold); color: var(--accent-gold-bright); }
        .btn-help:hover {
            background: linear-gradient(180deg, #d8b25e, #8a6a33);
            color: #140c06;
            border-color: var(--accent-gold-bright);
            box-shadow: 0 0 14px rgba(201, 164, 92, 0.5);
            text-shadow: none;
        }

        .btn-save {
            background: linear-gradient(180deg, #8e1f1a, #4a0d0a);
            border: 1px solid var(--accent-gold);
            font-weight: 700;
            color: #ffe9c4;
        }
        .btn-save:hover {
            background: linear-gradient(180deg, #b3241f, #6b1410);
            border-color: var(--accent-gold-bright);
            color: #fff8e6;
            box-shadow: 0 0 16px rgba(179, 36, 31, 0.55);
        }

        .btn-reset { border-color: #5a4a36; color: #a7967b; font-size: 0.7rem; padding: 5px 8px; }
        .btn-reset:hover { background: #3a2c20; color: #eee2ca; border-color: #8a7a60; }

        .btn-inv { border-color: rgba(201, 164, 92, 0.65); color: var(--accent-gold-bright); }
        .btn-inv:hover {
            background: linear-gradient(180deg, #4a3418, #2a1d0b);
            border-color: var(--accent-gold);
            color: #fff3d0;
            box-shadow: 0 0 14px rgba(201, 164, 92, 0.35);
        }

        .btn-enemy { border-color: rgba(179, 36, 31, 0.7); color: #e88a84; }
        .btn-enemy:hover {
            background: linear-gradient(180deg, #7a1612, #3d0a08);
            border-color: var(--accent-red-bright);
            color: #fff0ea;
            box-shadow: 0 0 14px rgba(179, 36, 31, 0.45);
        }

        .btn-npc { border-color: rgba(105, 185, 140, 0.6); color: #a5e3c4; }
        .btn-npc:hover {
            background: linear-gradient(180deg, #1e5040, #0d2a21);
            border-color: #7ed9a0;
            color: #f0fff8;
            box-shadow: 0 0 14px rgba(105, 185, 140, 0.35);
        }

        .btn-stats { border-color: rgba(154, 111, 176, 0.65); color: #cbabe0; }
        .btn-stats:hover {
            background: linear-gradient(180deg, #4a2d5a, #24142d);
            border-color: #b88fd0;
            color: #f8efff;
            box-shadow: 0 0 14px rgba(154, 111, 176, 0.35);
        }

        .btn-del {
            background: transparent;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 13px;
            padding: 2px 4px;
            transition: 0.2s;
        }
        .btn-del:hover { color: var(--accent-red-bright); transform: scale(1.15); }

        /* ===================== CABECERA ===================== */
        .header-top {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: 15px;
            gap: 16px;
            width: 100%;
        }

        .portrait-frame-small {
            width: 190px;
            height: 190px;
            border-radius: 2px;
            background: #000;
            overflow: hidden;
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1;
            border: 2px solid var(--accent-gold);
            box-shadow:
                0 0 0 4px #140d07,
                0 0 0 5px rgba(201, 164, 92, 0.45),
                0 0 35px rgba(140, 40, 25, 0.4),
                inset 0 0 30px #000;
        }
        .portrait-frame-small::after,
        .portrait-frame-large::after {
            content: "";
            position: absolute;
            inset: 5px;
            border: 1px solid rgba(240, 214, 154, 0.35);
            pointer-events: none;
            z-index: 3;
        }
        .portrait-frame-small img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: top;
            filter: contrast(1.08) brightness(0.92) sepia(0.12);
            z-index: 2;
        }

        .char-name-box {
            position: relative;
            background:
                radial-gradient(ellipse at 50% 0%, rgba(160, 30, 22, 0.18), transparent 65%),
                linear-gradient(180deg, #281a10, #0f0a07);
            border: 1px solid #8a6a33;
            padding: 14px 42px;
            border-radius: 2px;
            box-shadow:
                inset 0 0 0 1px rgba(201, 164, 92, 0.18),
                inset 0 0 30px rgba(0, 0, 0, 0.6),
                0 10px 25px rgba(0, 0, 0, 0.5);
            text-align: center;
            min-width: 380px;
        }
        .char-name-box::before {
            content: "❖";
            position: absolute;
            top: -13px;
            left: 50%;
            transform: translateX(-50%);
            background: #0d0806;
            color: var(--accent-gold);
            padding: 0 9px;
            font-size: 12px;
            line-height: 22px;
            text-shadow: 0 0 10px rgba(201, 164, 92, 0.6);
        }
        .char-name-box input {
            font-family: var(--font-deco);
            font-size: clamp(23px, 3.4vw, 34px);
            color: var(--accent-gold-bright);
            font-weight: 700;
            text-align: center;
            letter-spacing: 0.02em;
            text-shadow: 0 2px 0 #000, 0 0 24px rgba(201, 164, 92, 0.28);
        }
        .char-name-box label {
            font-family: var(--font-ui);
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: var(--text-muted);
            display: block;
            margin-top: 5px;
            text-align: center;
        }

        .meta-grid {
            background: linear-gradient(180deg, rgba(28, 18, 11, 0.9), rgba(12, 8, 6, 0.95));
            border: 1px solid rgba(201, 164, 92, 0.35);
            border-radius: 2px;
            padding: 13px 18px;
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 12px;
            width: 100%;
            box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.55);
        }
        .meta-item { display: flex; flex-direction: column; }
        .meta-item input {
            font-size: 14px;
            border-bottom: 1px solid rgba(201, 164, 92, 0.28);
            padding-bottom: 3px;
            text-align: center;
        }
        .meta-item label {
            font-size: 9.5px;
            color: var(--accent-gold);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-top: 4px;
            text-align: center;
            opacity: 0.85;
        }

        /* ===================== REJILLA PRINCIPAL ===================== */
        .main-grid {
            display: grid;
            grid-template-columns: 315px 1fr 325px;
            gap: 18px;
            width: 100%;
        }

        /* ---------- Columna 1 ---------- */
        .col-1 { display: flex; flex-direction: column; gap: 16px; }
        .stat-block { display: flex; gap: 14px; align-items: flex-start; }

        .ability-scores { display: flex; flex-direction: column; gap: 14px; width: 82px; }
        .ability-box {
            background: linear-gradient(180deg, rgba(48, 31, 19, 0.92), rgba(18, 12, 8, 0.95));
            border: 1px solid rgba(201, 164, 92, 0.55);
            border-radius: 2px;
            text-align: center;
            padding: 10px 5px;
            display: flex;
            flex-direction: column;
            align-items: center;
            box-shadow:
                inset 0 0 0 1px rgba(0, 0, 0, 0.65),
                inset 0 0 22px rgba(0, 0, 0, 0.7),
                0 3px 8px rgba(0, 0, 0, 0.5);
            cursor: pointer;
            position: relative;
            margin-bottom: 10px;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        .ability-box:hover {
            border-color: var(--accent-gold);
            box-shadow:
                0 0 18px rgba(201, 164, 92, 0.28),
                inset 0 0 22px rgba(0, 0, 0, 0.7);
        }
        .ability-box label {
            font-family: var(--font-title);
            font-size: 9px;
            font-weight: 600;
            letter-spacing: 0.06em;
            line-height: 1.25;
            color: var(--accent-gold);
            margin-bottom: 5px;
        }
        .ability-box .score {
            font-family: var(--font-title);
            font-size: 25px;
            font-weight: 700;
            color: #fff3d6;
            text-align: center;
            width: 100%;
            text-shadow: 0 2px 3px #000;
        }
        .ability-box .mod {
            background: linear-gradient(180deg, #3a2412, #160d07);
            border: 1px solid rgba(201, 164, 92, 0.7);
            border-radius: 2px;
            width: 44px;
            position: absolute;
            bottom: -16px;
            font-family: var(--font-title);
            font-size: 15px;
            font-weight: 700;
            padding: 2px;
            color: var(--accent-gold-bright);
            text-align: center;
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.75);
        }

        .skills-container { flex-grow: 1; display: flex; flex-direction: column; gap: 14px; }
        .prof-insp-box {
            border: 1px solid rgba(201, 164, 92, 0.35);
            background: linear-gradient(180deg, rgba(30, 19, 11, 0.9), rgba(12, 8, 6, 0.95));
            border-radius: 2px;
            padding: 9px;
            display: flex;
            align-items: center;
            gap: 10px;
            box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
        }
        .prof-insp-box input[type="text"] {
            width: 42px;
            height: 36px;
            border: 1px solid rgba(201, 164, 92, 0.5);
            border-radius: 2px;
            text-align: center;
            font-family: var(--font-title);
            font-size: 18px;
            font-weight: 700;
            color: var(--accent-gold-bright);
            background: rgba(0, 0, 0, 0.3);
        }
        .prof-insp-box label {
            font-family: var(--font-title);
            font-size: 10.5px;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            text-align: left;
            color: var(--text-main);
            line-height: 1.3;
        }

        .list-box {
            background: linear-gradient(180deg, rgba(30, 19, 11, 0.82), rgba(12, 8, 6, 0.92));
            border: 1px solid rgba(201, 164, 92, 0.32);
            border-radius: 2px;
            padding: 13px;
            box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5);
        }
        .list-row { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
        .list-row input[type="checkbox"],
        .ds-row input[type="checkbox"],
        .spell-table input[type="checkbox"] {
            appearance: none;
            -webkit-appearance: none;
            width: 13px;
            height: 13px;
            border: 1px solid rgba(201, 164, 92, 0.65);
            border-radius: 2px;
            transform: rotate(45deg) scale(0.92);
            background: rgba(0, 0, 0, 0.4);
            cursor: pointer;
            flex-shrink: 0;
            transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
        }
        .list-row input[type="checkbox"]:checked,
        .ds-row input[type="checkbox"]:checked,
        .spell-table input[type="checkbox"]:checked {
            background: radial-gradient(circle, var(--accent-red-bright), #6b0f0b);
            border-color: var(--accent-gold);
            box-shadow: 0 0 8px rgba(179, 36, 31, 0.85);
        }
        .list-row input[type="checkbox"]:disabled { opacity: 0.55; cursor: not-allowed; }
        .list-row .val {
            width: 30px;
            border-bottom: 1px solid rgba(201, 164, 92, 0.3);
            text-align: center;
            font-family: var(--font-title);
            font-size: 12px;
            flex-shrink: 0;
            color: var(--accent-gold-bright);
        }
        .list-row span { font-size: 12.5px; cursor: pointer; transition: color 0.2s; }
        .list-row span:hover { color: var(--accent-gold-bright); }
        .list-row .attr { color: var(--text-muted); font-size: 10px; font-style: italic; }

        /* ---------- Columna 2 ---------- */
        .col-2 { display: flex; flex-direction: column; gap: 14px; }
        .combat-header { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
        .combat-stat {
            background:
                radial-gradient(ellipse at 50% 0%, rgba(201, 164, 92, 0.1), transparent 70%),
                linear-gradient(180deg, #33210f, #100b07);
            border: 1px solid rgba(201, 164, 92, 0.5);
            border-radius: 3px 3px 22px 22px;
            padding: 11px 5px 9px;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-shadow:
                inset 0 0 0 1px rgba(0, 0, 0, 0.6),
                inset 0 0 22px rgba(0, 0, 0, 0.55),
                0 4px 10px rgba(0, 0, 0, 0.45);
        }
        .combat-stat input {
            font-size: 24px;
            text-align: center;
            font-family: var(--font-title);
            font-weight: 700;
            color: var(--accent-gold-bright);
            text-shadow: 0 2px 3px #000;
        }
        .combat-stat label {
            font-family: var(--font-title);
            font-size: 9px;
            font-weight: 600;
            letter-spacing: 0.09em;
            color: var(--text-muted);
            margin-top: 5px;
            text-transform: uppercase;
            line-height: 1.3;
        }
        .ac-shield {
            border-radius: 3px 3px 50px 50px;
            border-color: var(--accent-gold);
            background:
                radial-gradient(ellipse at 50% 0%, rgba(170, 30, 22, 0.28), transparent 72%),
                linear-gradient(180deg, #33200f, #100a06);
            box-shadow:
                0 0 22px rgba(140, 35, 25, 0.3),
                inset 0 0 0 1px rgba(0, 0, 0, 0.6),
                inset 0 0 24px rgba(0, 0, 0, 0.6);
        }
        .ac-shield input { color: #ffdf9e; }

        .flight-stat-box { border-color: rgba(121, 199, 207, 0.55); cursor: pointer; transition: 0.25s; }
        .flight-stat-box label { color: var(--accent-cyan); }
        .flight-stat-box.active-flight {
            background: radial-gradient(ellipse at 50% 0%, rgba(121, 199, 207, 0.25), transparent 75%), linear-gradient(180deg, #123238, #08181b);
            border-color: var(--accent-cyan);
            box-shadow: 0 0 22px rgba(121, 199, 207, 0.45), inset 0 0 20px rgba(0, 0, 0, 0.6);
        }

        /* Economía de acciones */
        .turn-economy-bar {
            background:
                radial-gradient(ellipse at 50% 0%, rgba(201, 143, 58, 0.12), transparent 70%),
                linear-gradient(180deg, rgba(34, 21, 11, 0.96), rgba(12, 8, 6, 0.96));
            border: 1px solid rgba(201, 143, 58, 0.55);
            border-radius: 2px;
            padding: 10px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5);
        }
        .turn-top-line {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 6px;
            border-bottom: 1px dashed rgba(201, 143, 58, 0.35);
            padding-bottom: 6px;
        }
        .turn-badges-row {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 6px;
        }
        .econ-chip {
            background: rgba(0, 0, 0, 0.55);
            border: 1px solid rgba(201, 164, 92, 0.3);
            border-radius: 2px;
            padding: 5px 4px;
            font-size: 10.5px;
            text-align: center;
            cursor: pointer;
            user-select: none;
            transition: 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
        }
        .econ-chip.used {
            background: rgba(179, 36, 31, 0.22);
            border-color: rgba(179, 36, 31, 0.75);
            color: #e0928c;
            text-decoration: line-through;
        }
        .econ-chip.available {
            border-color: rgba(105, 185, 140, 0.55);
            color: #9bd8b7;
        }
        .econ-chip:hover { border-color: var(--accent-gold); }

        /* Estados */
        .status-conc-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
            background: linear-gradient(180deg, rgba(28, 18, 11, 0.92), rgba(10, 6, 4, 0.95));
            border: 1px solid rgba(201, 164, 92, 0.35);
            border-radius: 2px;
            padding: 8px 10px;
        }
        .state-pill {
            font-size: 10.5px;
            padding: 3px 9px;
            border-radius: 12px;
            border: 1px solid rgba(201, 164, 92, 0.3);
            color: var(--text-muted);
            cursor: pointer;
            background: rgba(0, 0, 0, 0.45);
            transition: 0.2s;
        }
        .state-pill:hover { border-color: var(--accent-gold); color: var(--text-main); }
        .state-pill.active-pill {
            border-color: var(--accent-gold);
            color: #140c06;
            background: linear-gradient(180deg, #e0c17a, #b8934a);
            font-weight: 700;
            box-shadow: 0 0 10px rgba(201, 164, 92, 0.45);
        }

        /* Rastreadores */
        .quick-trackers-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
        .tracker-card {
            background:
                radial-gradient(ellipse at 50% 0%, rgba(201, 164, 92, 0.08), transparent 70%),
                linear-gradient(180deg, rgba(30, 19, 11, 0.94), rgba(10, 7, 5, 0.96));
            border: 1px solid rgba(201, 164, 92, 0.35);
            border-radius: 2px;
            padding: 9px 8px;
            text-align: center;
            display: flex;
            flex-direction: column;
            gap: 5px;
            box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45);
        }
        .tracker-card .t-title {
            font-family: var(--font-title);
            font-size: 9.5px;
            font-weight: 600;
            letter-spacing: 0.06em;
            color: var(--accent-gold);
            text-transform: uppercase;
        }
        .tracker-card .t-val {
            font-family: var(--font-title);
            font-size: 21px;
            color: #fff3d6;
            font-weight: 700;
            text-shadow: 0 2px 3px #000;
        }
        .tracker-btns { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
        .mini-btn {
            background: linear-gradient(180deg, rgba(60, 38, 20, 0.9), rgba(20, 13, 8, 0.9));
            border: 1px solid rgba(201, 164, 92, 0.45);
            color: var(--text-main);
            padding: 4px 8px;
            font-size: 9.5px;
            border-radius: 2px;
            cursor: pointer;
            font-family: var(--font-title);
            font-weight: 600;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            transition: 0.2s;
        }
        .mini-btn:hover {
            background: linear-gradient(180deg, #5a3a18, #2e1d0b);
            border-color: var(--accent-gold);
            color: #fff4d8;
            box-shadow: 0 0 10px rgba(201, 164, 92, 0.3);
        }

        /* Puntos de golpe */
        .hp-box {
            background:
                radial-gradient(ellipse at 50% 0%, rgba(160, 30, 22, 0.12), transparent 70%),
                linear-gradient(180deg, rgba(36, 22, 13, 0.94), rgba(12, 8, 6, 0.96));
            border: 1px solid rgba(201, 164, 92, 0.4);
            border-radius: 2px;
            padding: 12px;
            box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5);
        }
        .hp-top {
            display: flex;
            justify-content: space-between;
            font-size: 11px;
            letter-spacing: 0.04em;
            color: var(--text-muted);
            border-bottom: 1px solid var(--line);
            padding-bottom: 4px;
            margin-bottom: 8px;
        }
        .hp-top input { width: 52px; text-align: right; color: var(--accent-gold-bright); font-family: var(--font-title); }
        .hp-current {
            text-align: center;
            font-size: 46px;
            font-weight: 700;
            font-family: var(--font-title);
            height: 56px;
            color: #ffcf9a;
            text-shadow: 0 2px 0 #000, 0 0 24px rgba(179, 36, 31, 0.55);
            background: linear-gradient(90deg, transparent, rgba(201, 164, 92, 0.1), transparent);
            border-radius: 2px;
        }
        .hp-quick-controls {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            margin-top: 6px;
            padding-top: 7px;
            border-top: 1px dashed rgba(201, 164, 92, 0.16);
        }

        .dice-death-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
        .ds-container { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
        .ds-row { display: flex; justify-content: space-between; align-items: center; }
        .ds-row > div { display: flex; gap: 6px; }

        .atk-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; table-layout: fixed; }
        .atk-table th {
            font-family: var(--font-title);
            font-size: 9px;
            font-weight: 600;
            letter-spacing: 0.08em;
            padding: 5px;
            text-align: center;
            color: var(--text-muted);
            border-bottom: 1px solid rgba(201, 164, 92, 0.3);
        }
        .atk-table td { padding: 4px 2px; border-bottom: 1px solid rgba(201, 164, 92, 0.08); }
        .atk-table tbody tr:hover { background: rgba(201, 164, 92, 0.04); }
        .atk-table input { font-size: 12.5px; text-align: center; width: 100%; box-sizing: border-box; }
        .atk-table td:first-child input { text-align: left; }
        .btn-roll {
            background: linear-gradient(180deg, rgba(60, 38, 20, 0.9), rgba(20, 13, 8, 0.9));
            border: 1px solid rgba(201, 164, 92, 0.5);
            color: var(--accent-gold-bright);
            padding: 3px 5px;
            cursor: pointer;
            border-radius: 2px;
            font-family: var(--font-title);
            font-size: 9px;
            font-weight: 600;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            width: 100%;
            transition: 0.2s;
        }
        .btn-roll:hover {
            background: linear-gradient(180deg, #7a1612, #3d0a08);
            border-color: var(--accent-red-bright);
            color: #fff0ea;
            box-shadow: 0 0 10px rgba(179, 36, 31, 0.4);
        }

        /* ---------- Columna 3 ---------- */
        .col-3 { display: flex; flex-direction: column; gap: 16px; }
        .traits-box { display: flex; flex-direction: column; gap: 10px; }
        .trait {
            background:
                linear-gradient(90deg, rgba(150, 35, 26, 0.14), rgba(20, 13, 8, 0.9) 55%);
            border: 1px solid rgba(201, 164, 92, 0.3);
            border-left: 2px solid rgba(179, 36, 31, 0.7);
            border-radius: 2px;
            padding: 9px;
            display: flex;
            flex-direction: column;
            box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.4);
        }
        .trait textarea {
            height: 48px;
            font-size: 13px;
            border: none;
            background: transparent;
            overflow: hidden;
            box-shadow: none;
            padding: 2px 3px;
        }
        .trait textarea:focus { border: none; background: transparent; box-shadow: none; }
        .trait label {
            font-family: var(--font-title);
            font-size: 9.5px;
            font-weight: 600;
            letter-spacing: 0.1em;
            text-align: center;
            color: var(--accent-gold);
            margin-top: 4px;
            text-transform: uppercase;
        }

        .features-box { display: flex; flex-direction: column; height: 100%; }
        .features-box textarea {
            flex-grow: 1;
            min-height: 320px;
            border: none;
            background: transparent;
            font-size: 13.5px;
            line-height: 1.55;
            box-shadow: none;
            padding: 2px 4px;
        }
        .features-box textarea:focus { border: none; box-shadow: none; background: transparent; }

        /* ===================== PÁGINA 2 ===================== */
        .appearance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 15px; width: 100%; }

        .portrait-frame-large {
            width: 100%;
            height: 430px;
            border: 2px solid var(--accent-gold);
            border-radius: 2px;
            background: #000;
            overflow: hidden;
            position: relative;
            box-shadow:
                0 0 0 4px #140d07,
                0 0 0 5px rgba(201, 164, 92, 0.45),
                0 0 35px rgba(140, 40, 25, 0.4),
                inset 0 0 30px #000;
        }
        .portrait-frame-large video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
            filter: contrast(1.08) brightness(0.92) sepia(0.12);
        }

        /* Monedero */
        .coin-manager-panel {
            background:
                radial-gradient(ellipse at 50% 0%, rgba(201, 164, 92, 0.08), transparent 70%),
                linear-gradient(180deg, rgba(30, 19, 11, 0.95), rgba(10, 6, 4, 0.96));
            border: 1px solid rgba(201, 164, 92, 0.35);
            border-radius: 2px;
            padding: 12px;
            margin-bottom: 14px;
            box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.5);
        }
        .coin-cards-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 6px;
            margin-bottom: 10px;
        }
        .coin-card {
            background:
                radial-gradient(ellipse at 50% 0%, rgba(201, 164, 92, 0.12), transparent 70%),
                linear-gradient(180deg, #1c120b, #0a0604);
            border: 1px solid rgba(201, 164, 92, 0.28);
            border-radius: 2px;
            padding: 7px 4px;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        .coin-card:hover {
            border-color: rgba(201, 164, 92, 0.6);
            box-shadow: 0 0 12px rgba(201, 164, 92, 0.15);
        }
        .coin-card input {
            font-family: var(--font-title);
            font-size: 16px;
            font-weight: 700;
            width: 100%;
            text-align: center;
        }
        .coin-card label {
            font-size: 9.5px;
            font-family: var(--font-title);
            font-weight: 600;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }
        .coin-pm-btns {
            display: flex;
            gap: 3px;
            width: 100%;
            justify-content: center;
        }
        .coin-pm-btns button {
            background: rgba(201, 164, 92, 0.08);
            border: 1px solid rgba(201, 164, 92, 0.25);
            color: #eee2ca;
            font-size: 11px;
            width: 22px;
            height: 20px;
            border-radius: 2px;
            cursor: pointer;
            line-height: 1;
            transition: 0.2s;
        }
        .coin-pm-btns button:hover {
            background: linear-gradient(180deg, #5a3a18, #2e1d0b);
            border-color: var(--accent-gold);
            color: #fff4d8;
        }

        .equipment-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
        .equipment-table th {
            font-family: var(--font-title);
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.1em;
            color: var(--accent-gold);
            text-align: left;
            padding-bottom: 8px;
            border-bottom: 1px solid rgba(201, 164, 92, 0.4);
            text-transform: uppercase;
        }
        .equipment-table th:nth-child(2) { width: 55px; text-align: center; }
        .equipment-table th:nth-child(3) { width: 70px; text-align: right; }
        .equipment-table th:nth-child(4) { width: 30px; text-align: center; }

        .equipment-table td { padding: 5px 0; border-bottom: 1px solid rgba(201, 164, 92, 0.08); }
        .equipment-table tbody tr:hover { background: rgba(201, 164, 92, 0.04); }
        .equipment-table input { font-size: 13.5px; text-align: left; width: 100%; box-sizing: border-box; }
        .equipment-table .item-qty { text-align: center; }
        .equipment-table .item-weight { text-align: right; }

        .weight-summary {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            gap: 10px;
            margin-top: 15px;
            padding-top: 10px;
            border-top: 1px solid rgba(201, 164, 92, 0.4);
            font-family: var(--font-title);
        }
        .weight-summary span { color: var(--text-muted); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
        .weight-summary input { width: 60px; font-size: 18px; color: var(--accent-gold-bright); font-weight: 700; text-align: right; }

        .btn-add-row {
            background: transparent;
            border: 1px dashed rgba(201, 164, 92, 0.45);
            color: var(--text-muted);
            width: 100%;
            padding: 7px;
            margin-top: 10px;
            cursor: pointer;
            border-radius: 2px;
            font-family: var(--font-title);
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            transition: 0.2s;
        }
        .btn-add-row:hover {
            border-color: var(--accent-gold);
            color: var(--accent-gold-bright);
            background: rgba(201, 164, 92, 0.05);
        }

        /* PNJ */
        .npc-grid-display { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 10px; }
        .npc-card {
            background:
                radial-gradient(ellipse at 0% 0%, rgba(201, 164, 92, 0.08), transparent 60%),
                linear-gradient(180deg, rgba(28, 18, 11, 0.9), rgba(10, 6, 4, 0.95));
            border: 1px solid rgba(201, 164, 92, 0.32);
            border-left: 3px solid rgba(179, 36, 31, 0.8);
            border-radius: 2px;
            padding: 12px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            position: relative;
            box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.45);
        }
        .npc-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(201, 164, 92, 0.18);
            padding-bottom: 5px;
            gap: 6px;
        }
        .npc-card-name {
            font-family: var(--font-title);
            font-size: 15px;
            color: var(--accent-gold-bright);
            font-weight: 700;
        }
        .npc-badge {
            font-size: 9.5px;
            padding: 2px 8px;
            border-radius: 10px;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            white-space: nowrap;
        }
        .rel-aliado { background: rgba(105, 185, 140, 0.15); color: #8fd8ae; border: 1px solid rgba(105, 185, 140, 0.7); }
        .rel-amistoso { background: rgba(122, 167, 199, 0.15); color: #9dc4dd; border: 1px solid rgba(122, 167, 199, 0.7); }
        .rel-neutral { background: rgba(200, 190, 170, 0.12); color: #d3c8b4; border: 1px solid rgba(200, 190, 170, 0.5); }
        .rel-desconfiado { background: rgba(201, 164, 92, 0.15); color: #e0c17a; border: 1px solid rgba(201, 164, 92, 0.7); }
        .rel-hostil { background: rgba(179, 36, 31, 0.2); color: #ef9089; border: 1px solid rgba(224, 82, 74, 0.75); }
        .rel-patron { background: rgba(170, 30, 22, 0.22); color: #f2b3ad; border: 1px solid var(--accent-red-bright); }
        .npc-stats-line { font-size: 11px; color: var(--accent-gold); font-family: var(--font-ui); }
        .npc-notes-line { font-size: 13px; color: var(--text-main); font-style: italic; }

        /* ===================== ACORDEONES DESPLEGABLES ===================== */
        .acc-list { display: flex; flex-direction: column; gap: 6px; text-align: left; }
        .acc-item {
            border: 1px solid rgba(201, 164, 92, 0.28);
            border-radius: 2px;
            background: linear-gradient(180deg, rgba(30, 19, 11, 0.82), rgba(10, 6, 4, 0.92));
            overflow: hidden;
            transition: border-color 0.18s ease, box-shadow 0.18s ease;
        }
        .acc-item.open {
            border-color: rgba(201, 164, 92, 0.62);
            box-shadow: 0 0 14px rgba(201, 164, 92, 0.12), inset 0 0 18px rgba(0, 0, 0, 0.35);
        }
        .acc-btn {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 8px;
            background: transparent;
            border: 0;
            border-left: 3px solid rgba(179, 36, 31, 0.75);
            color: var(--text-main);
            font-family: var(--font-text);
            font-size: 12.5px;
            text-align: left;
            padding: 8px 10px;
            cursor: pointer;
            transition: background 0.16s ease;
        }
        .acc-btn:hover { background: rgba(201, 164, 92, 0.09); }
        .acc-btn:focus-visible { outline: 1px solid var(--accent-gold); outline-offset: -2px; }
        .acc-icon { font-size: 15px; line-height: 1; }
        .acc-label {
            flex: 1;
            font-family: var(--font-title);
            font-weight: 600;
            letter-spacing: 0.03em;
            color: var(--accent-gold-bright);
        }
        .acc-label small {
            display: block;
            margin-top: 2px;
            font-family: var(--font-ui);
            font-size: 9.5px;
            font-weight: 400;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            color: var(--text-muted);
        }
        .acc-chevron {
            font-family: var(--font-title);
            font-size: 16px;
            color: var(--accent-gold);
            transition: transform 0.2s ease, color 0.2s ease;
        }
        .acc-item.open .acc-chevron { transform: rotate(45deg); color: var(--accent-red-bright); }
        .acc-panel {
            display: none;
            padding: 10px 12px 12px;
            border-top: 1px dashed rgba(201, 164, 92, 0.22);
        }
        .acc-item.open .acc-panel { display: block; animation: accFade 0.18s ease; }
        @keyframes accFade { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
        .acc-panel p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.55; color: var(--text-main); }
        .acc-panel p:last-child { margin-bottom: 0; }
        .acc-panel strong { color: var(--accent-gold-bright); }
        .acc-panel .acc-meta { color: var(--text-muted); font-size: 11.5px; }
        .acc-panel textarea { min-height: 100px; margin-top: 4px; }

        /* ===================== INVENTARIO RÁPIDO ===================== */
        .inv-section-label {
            font-family: var(--font-title);
            font-size: 10px;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: var(--text-muted);
            text-align: center;
            margin: 12px 0 6px;
        }
        .inv-quick-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 7px;
            margin-bottom: 4px;
        }
        .inv-btn {
            display: flex;
            align-items: center;
            gap: 7px;
            width: 100%;
            padding: 7px 9px;
            background: linear-gradient(180deg, rgba(38, 25, 13, 0.9), rgba(12, 7, 4, 0.96));
            border: 1px solid rgba(201, 164, 92, 0.35);
            border-left: 3px solid rgba(201, 164, 92, 0.6);
            border-radius: 2px;
            color: var(--text-main);
            font-family: var(--font-text);
            font-size: 12px;
            text-align: left;
            cursor: pointer;
            transition: all 0.16s ease;
        }
        .inv-btn:hover {
            border-color: var(--accent-gold);
            background: linear-gradient(180deg, rgba(58, 38, 18, 0.95), rgba(18, 11, 6, 0.98));
            box-shadow: 0 0 12px rgba(201, 164, 92, 0.16);
            transform: translateY(-1px);
        }
        .inv-btn.empty { opacity: 0.42; }
        .inv-btn.empty:hover { opacity: 0.7; }
        .inv-icon { font-size: 15px; line-height: 1; }
        .inv-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .inv-qty { font-family: var(--font-title); color: var(--accent-gold-bright); font-size: 12px; }

        /* ===================== CONJUROS RÁPIDOS ===================== */
        .spell-quick-box { width: 100%; margin-bottom: 15px; }
        .spell-quick-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
            gap: 7px;
            margin-bottom: 4px;
        }
        .spell-btn { border-left-color: rgba(122, 167, 199, 0.75); }
        .spell-btn:hover {
            border-color: #7aa7c7;
            background: linear-gradient(180deg, rgba(28, 52, 68, 0.95), rgba(9, 17, 22, 0.98));
            box-shadow: 0 0 12px rgba(122, 167, 199, 0.22);
        }
        .spell-btn .inv-qty { color: #a9cbe4; font-size: 10px; letter-spacing: 0.04em; }
        .spell-detail-text {
            text-align: left;
            font-size: 13px;
            line-height: 1.6;
            color: var(--text-main);
            white-space: pre-wrap;
            background: rgba(0, 0, 0, 0.35);
            border: 1px solid rgba(201, 164, 92, 0.2);
            border-radius: 3px;
            padding: 10px 12px;
            margin: 5px 0 12px;
        }
        .spell-detail-label {
            display: block;
            text-align: left;
            font-family: var(--font-title);
            font-size: 10px;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: var(--accent-gold);
            margin-top: 6px;
        }

        /* ===================== REGISTRO DE SESIONES ===================== */
        .session-form { text-align: left; }
        .session-form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 10px;
        }
        .session-form-row.one { grid-template-columns: 1fr; }
        .session-field {
            display: flex;
            flex-direction: column;
            gap: 4px;
            font-family: var(--font-title);
            font-size: 10px;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: var(--accent-gold);
        }
        .session-field input,
        .session-field textarea { margin: 0; }
        .session-field textarea { min-height: 74px; font-family: var(--font-text); }
        .session-counters-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0 18px;
            margin: 4px 0 10px;
        }
        .session-counters-grid .counter-row { font-size: 12.5px; margin-bottom: 6px; padding-bottom: 6px; }
        .session-counters-grid .counter-row.full { grid-column: 1 / -1; border-bottom: none; }
        .session-check {
            display: flex;
            align-items: center;
            gap: 7px;
            font-family: var(--font-ui);
            font-size: 12px;
            color: var(--text-muted);
            margin: 4px 0 12px;
            text-transform: none;
            letter-spacing: 0;
        }
        .session-check input { width: auto; margin: 0; }
        .session-actions {
            display: flex;
            gap: 8px;
            justify-content: center;
            flex-wrap: wrap;
            margin-bottom: 6px;
        }
        .session-actions .btn-close { margin-top: 0; }
        .session-save-status {
            text-align: center;
            font-family: var(--font-ui);
            font-size: 12px;
            color: #a5e3c4;
            min-height: 16px;
            margin-bottom: 6px;
        }
        .session-history-title {
            font-family: var(--font-title);
            font-size: 12px;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: var(--accent-gold);
            border-top: 1px solid rgba(201, 164, 92, 0.25);
            padding-top: 12px;
            margin-top: 6px;
            text-align: left;
        }
        .session-log-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 260px;
            overflow-y: auto;
            text-align: left;
            padding-right: 2px;
        }
        .session-entry {
            background: linear-gradient(180deg, rgba(30, 19, 11, 0.9), rgba(10, 6, 4, 0.95));
            border: 1px solid rgba(201, 164, 92, 0.28);
            border-left: 3px solid rgba(201, 164, 92, 0.65);
            border-radius: 3px;
            padding: 9px 11px;
        }
        .session-entry-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 8px;
            margin-bottom: 5px;
        }
        .session-entry-title {
            font-family: var(--font-title);
            color: var(--accent-gold-bright);
            font-size: 13.5px;
            font-weight: 700;
        }
        .session-entry-date { font-family: var(--font-ui); font-size: 10.5px; color: var(--text-muted); }
        .session-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
        .session-badge {
            font-family: var(--font-ui);
            font-size: 10px;
            color: #d9c79a;
            background: rgba(201, 164, 92, 0.1);
            border: 1px solid rgba(201, 164, 92, 0.28);
            border-radius: 2px;
            padding: 2px 6px;
        }
        .session-entry-notes {
            font-family: var(--font-text);
            font-size: 11.5px;
            line-height: 1.5;
            color: var(--text-main);
            white-space: pre-wrap;
            margin-top: 3px;
        }
        .session-entry-notes strong { color: #e0c17a; }

        /* ===================== ENEMIGOS DE LA HISTORIA ===================== */
        .btn-story { border-color: rgba(224, 82, 74, 0.65); color: #f2b3ad; }
        .btn-story:hover {
            background: rgba(179, 36, 31, 0.18);
            box-shadow: 0 0 14px rgba(179, 36, 31, 0.32);
            border-color: var(--accent-red-bright);
        }
        .story-card { border-left-color: var(--accent-red-bright); border-color: rgba(224, 82, 74, 0.34); }
        .story-card .npc-card-name { color: #f0a49e; }
        .story-badge {
            background: rgba(179, 36, 31, 0.22);
            color: #f2b3ad;
            border: 1px solid rgba(224, 82, 74, 0.7);
        }
        .story-badge.villain {
            background: rgba(179, 36, 31, 0.38);
            color: #ffd3cf;
            box-shadow: 0 0 10px rgba(179, 36, 31, 0.38);
        }
        .story-notes { font-size: 12px; color: var(--text-main); line-height: 1.45; }
        .story-weak { font-size: 11.5px; color: #e0c17a; line-height: 1.45; }
        .story-weak strong { color: var(--accent-red-bright); }

        /* ===================== PÁGINA 3 ===================== */
        .spell-header { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 15px; margin-bottom: 15px; width: 100%; }
        .spell-stat {
            background:
                radial-gradient(ellipse at 50% 0%, rgba(201, 164, 92, 0.08), transparent 70%),
                linear-gradient(180deg, #33210f, #100b07);
            border: 1px solid rgba(201, 164, 92, 0.5);
            border-radius: 2px;
            padding: 14px;
            text-align: center;
            box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.5);
        }
        .spell-stat input {
            font-size: 22px;
            text-align: center;
            font-family: var(--font-title);
            font-weight: 700;
            color: var(--accent-gold-bright);
            text-shadow: 0 2px 3px #000;
        }
        .spell-stat label {
            font-family: var(--font-title);
            font-size: 9.5px;
            letter-spacing: 0.1em;
            margin-top: 5px;
            display: block;
            text-transform: uppercase;
            color: var(--text-muted);
        }

        .spell-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
        .spell-table th {
            border-bottom: 1px solid rgba(201, 164, 92, 0.35);
            padding: 6px 4px;
            color: var(--accent-gold);
            font-family: var(--font-title);
            font-weight: 600;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            font-size: 9px;
            text-align: left;
        }
        .spell-table td { padding: 6px 4px; border-bottom: 1px solid rgba(201, 164, 92, 0.08); }
        .spell-table tbody tr:hover { background: rgba(201, 164, 92, 0.04); }
        .spell-table input[type="text"] { font-size: 12.5px; text-align: left; padding: 2px; width: 100%; box-sizing: border-box; }

        .spell-level-box {
            background: var(--box-bg);
            border: 1px solid rgba(201, 164, 92, 0.38);
            border-radius: 2px;
            padding: 16px;
            margin-bottom: 16px;
            width: 100%;
            box-sizing: border-box;
            box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45);
        }
        .spell-level-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(201, 164, 92, 0.45);
            padding-bottom: 6px;
            margin-bottom: 10px;
            flex-wrap: wrap;
            gap: 10px;
        }
        .spell-level-header h3 {
            font-family: var(--font-title);
            font-size: 18px;
            font-weight: 700;
            color: var(--accent-gold-bright);
            letter-spacing: 0.06em;
            margin: 0;
        }
        .spell-slots { display: flex; gap: 10px; font-size: 11px; color: var(--text-muted); align-items: center; flex-wrap: wrap; }
        .spell-slots input { width: 36px; border-bottom: 1px solid rgba(201, 164, 92, 0.35); text-align: center; color: var(--accent-gold-bright); font-family: var(--font-title); }

        /* ===================== MODALES ===================== */
        .dice-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0);
            background:
                var(--grain),
                radial-gradient(ellipse at 50% 0%, rgba(120, 30, 22, 0.16), transparent 60%),
                linear-gradient(180deg, #24160d, #090605 75%);
            border: 1px solid #8a6a33;
            box-shadow:
                0 0 0 3px #070403,
                0 0 0 4px rgba(201, 164, 92, 0.4),
                0 30px 90px rgba(0, 0, 0, 0.9),
                inset 0 0 60px rgba(0, 0, 0, 0.7);
            padding: 25px;
            z-index: 1000000;
            text-align: center;
            transition: 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            border-radius: 3px;
            min-width: 320px;
            max-height: 90vh;
            overflow-y: auto;
            display: none;
        }
        .dice-modal::before {
            content: "";
            position: absolute;
            inset: 7px;
            border: 1px solid rgba(201, 164, 92, 0.18);
            pointer-events: none;
        }
        .dice-modal.active { display: block !important; transform: translate(-50%, -50%) scale(1) !important; }
        .dice-title {
            font-family: var(--font-title);
            font-size: 21px;
            font-weight: 700;
            letter-spacing: 0.08em;
            color: var(--accent-gold-bright);
            margin-bottom: 8px;
            text-transform: uppercase;
            text-shadow: 0 2px 0 #000, 0 0 20px rgba(201, 164, 92, 0.25);
        }
        .dice-result {
            font-size: 27px;
            color: #ffdf9e;
            font-family: var(--font-title);
            font-weight: 700;
            text-shadow: 0 2px 0 #000, 0 0 18px rgba(201, 164, 92, 0.55);
            margin: 10px 0;
            border-bottom: 1px solid rgba(201, 164, 92, 0.35);
            padding-bottom: 8px;
        }
        .dice-calc {
            font-family: var(--font-text);
            font-size: 14.5px;
            color: var(--text-main);
            margin: 10px 0 15px 0;
            line-height: 1.55;
            white-space: pre-line;
            text-align: left;
            background: rgba(201, 164, 92, 0.04);
            padding: 12px;
            border-radius: 2px;
            border: 1px solid rgba(201, 164, 92, 0.22);
        }

        .btn-close {
            background: transparent;
            border: 1px solid var(--accent-gold);
            color: var(--accent-gold-bright);
            padding: 8px 22px;
            cursor: pointer;
            font-family: var(--font-title);
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.1em;
            margin-top: 8px;
            text-transform: uppercase;
            border-radius: 2px;
            transition: 0.2s;
        }
        .btn-close:hover {
            background: linear-gradient(180deg, #d8b25e, #8a6a33);
            border-color: var(--accent-gold-bright);
            color: #140c06;
            box-shadow: 0 0 14px rgba(201, 164, 92, 0.4);
        }

        .action-menu-list {
            display: flex;
            flex-direction: column;
            gap: 7px;
            margin-top: 12px;
            margin-bottom: 12px;
            max-height: 55vh;
            overflow-y: auto;
            padding-right: 5px;
        }
        .action-menu-btn {
            background: linear-gradient(180deg, rgba(60, 38, 20, 0.65), rgba(20, 13, 8, 0.85));
            border: 1px solid rgba(201, 164, 92, 0.45);
            color: var(--text-main);
            padding: 10px 13px;
            cursor: pointer;
            font-family: var(--font-text);
            font-size: 14px;
            transition: 0.2s;
            border-radius: 2px;
            text-align: left;
            line-height: 1.35;
        }
        .action-menu-btn:hover {
            background: linear-gradient(180deg, #7a1612, #3d0a08);
            border-color: var(--accent-red-bright);
            color: #fff0ea;
            box-shadow: 0 0 12px rgba(179, 36, 31, 0.4);
        }

        .enemy-select {
            background: linear-gradient(180deg, #1a110a, #0b0705);
            color: var(--text-main);
            border: 1px solid rgba(201, 164, 92, 0.4);
            padding: 8px 10px;
            border-radius: 2px;
            font-family: var(--font-text);
            font-size: 14.5px;
            outline: none;
            margin-bottom: 5px;
            width: 100%;
            text-align: left;
        }
        .enemy-select:focus {
            border-color: var(--accent-gold);
            box-shadow: 0 0 12px rgba(201, 164, 92, 0.2);
        }
        select option { background: #140d08; color: var(--text-main); }

        .enemy-row {
            background: linear-gradient(180deg, rgba(28, 18, 11, 0.92), rgba(10, 6, 4, 0.95));
            border: 1px solid rgba(201, 164, 92, 0.28);
            padding: 9px;
            margin-bottom: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-radius: 2px;
            flex-wrap: wrap;
            gap: 8px;
        }
        .enemy-row.active-turn-row {
            border: 1px solid #d9a04a;
            background: linear-gradient(180deg, rgba(201, 143, 58, 0.18), rgba(90, 58, 18, 0.14));
            box-shadow: 0 0 14px rgba(201, 143, 58, 0.35), inset 0 0 18px rgba(0, 0, 0, 0.4);
        }
        .enemy-row input[type="number"] {
            width: 45px;
            background: rgba(0, 0, 0, 0.5);
            border: 1px solid rgba(201, 164, 92, 0.35);
            color: var(--accent-gold-bright);
            text-align: center;
            border-radius: 2px;
            padding: 3px;
            font-family: var(--font-title);
        }
        .enemy-row .enemy-name {
            font-family: var(--font-title);
            color: var(--accent-gold-bright);
            font-size: 14px;
            font-weight: 700;
            flex: 1;
            min-width: 120px;
            text-align: left;
        }
        .enemy-hp {
            font-family: var(--font-ui);
            font-size: 12px;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 5px;
        }
        .enemy-actions { display: flex; gap: 5px; align-items: center; }
        .btn-dmg, .btn-heal {
            cursor: pointer;
            padding: 4px 9px;
            border-radius: 2px;
            font-family: var(--font-title);
            font-size: 9.5px;
            font-weight: 600;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            border: 1px solid;
            transition: 0.2s;
        }
        .btn-dmg { background: rgba(179, 36, 31, 0.18); border-color: rgba(224, 82, 74, 0.7); color: #ef9089; }
        .btn-dmg:hover { background: linear-gradient(180deg, #7a1612, #3d0a08); color: #fff0ea; box-shadow: 0 0 12px rgba(179, 36, 31, 0.45); }
        .btn-heal { background: rgba(105, 185, 140, 0.15); border-color: rgba(105, 185, 140, 0.7); color: #9bd8b7; }
        .btn-heal:hover { background: linear-gradient(180deg, #1e5040, #0d2a21); color: #f0fff8; box-shadow: 0 0 12px rgba(105, 185, 140, 0.4); }

        .counter-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            font-family: var(--font-ui);
            color: var(--text-main);
            font-size: 14px;
            border-bottom: 1px solid rgba(201, 164, 92, 0.15);
            padding-bottom: 8px;
        }
        .counter-controls { display: flex; align-items: center; gap: 8px; }
        .counter-controls input {
            width: 45px;
            text-align: center;
            background: rgba(0, 0, 0, 0.5);
            border: 1px solid rgba(201, 164, 92, 0.4);
            color: var(--accent-gold-bright);
            font-family: var(--font-title);
            font-weight: 700;
            border-radius: 2px;
            padding: 4px;
            font-size: 16px;
        }
        .btn-count {
            background: transparent;
            border: 1px solid rgba(201, 164, 92, 0.4);
            color: var(--text-muted);
            width: 28px;
            height: 28px;
            border-radius: 50%;
            cursor: pointer;
            font-weight: 700;
            transition: 0.2s;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .btn-count:hover {
            border-color: var(--accent-gold);
            color: var(--accent-gold-bright);
            background: rgba(201, 164, 92, 0.1);
            box-shadow: 0 0 10px rgba(201, 164, 92, 0.2);
        }

        .table-responsive {
            width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            margin-bottom: 8px;
        }
        .table-responsive::-webkit-scrollbar { height: 7px; }
        .table-responsive::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #8a6a33, #4a3418); border-radius: 2px; }

        /* ===================== RESPONSIVE ===================== */
        @media (max-width: 1100px) {
            .main-grid { grid-template-columns: minmax(0, 1fr); }
            .col-1, .col-2, .col-3 { min-width: 0; }
            .appearance-grid { grid-template-columns: minmax(0, 1fr) !important; }
            .appearance-grid > * { min-width: 0; }
            .spell-level-box { overflow-x: auto; }
        }

        @media (max-width: 950px) {
            body { padding-bottom: 280px; }
            .meta-grid { grid-template-columns: repeat(3, 1fr) !important; }
            .combat-header { grid-template-columns: repeat(2, 1fr); }
            .quick-trackers-panel { grid-template-columns: 1fr; }
            .turn-badges-row { grid-template-columns: repeat(2, 1fr); }
            .coin-cards-grid { grid-template-columns: repeat(3, 1fr); }
            .spell-header { grid-template-columns: repeat(2, 1fr); }
            .char-name-box { min-width: 100%; }
            .spell-table { min-width: 680px; }
            .equipment-table { min-width: 450px; }
            .atk-table { min-width: 480px; }
            .bottom-action-bar { max-height: 45vh; overflow-y: auto; }
            .page-title-divider { gap: 10px; letter-spacing: 0.1em; }
        }

        @media (max-width: 600px) {
            body { padding: 14px 10px 320px; }
            .page { padding: 24px 14px 18px; }
            .page-title-divider::before,
            .page-title-divider::after { max-width: 40px; }
            .char-name-box { padding: 12px 16px; }
        }

        @media (prefers-reduced-motion: reduce) {
            * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
        }


/* ===================== MEJORAS ESTÉTICAS BARRA INFERIOR Y CONJUROS ===================== */
.bottom-action-bar {
    padding: 8px 14px;
    gap: 6px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(201, 164, 92, 0.14), transparent 72%),
        linear-gradient(0deg, rgba(5, 3, 2, 0.99), rgba(22, 14, 9, 0.98));
    border-top: 2px solid #a98243;
}
.bar-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: 1220px;
}
.action-group {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 5px;
    padding: 6px 10px 7px;
    border: 1px solid rgba(201, 164, 92, 0.28);
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(52, 34, 18, 0.55), rgba(10, 6, 4, 0.72));
    box-shadow: inset 0 1px 0 rgba(255, 230, 180, 0.08), 0 3px 8px rgba(0, 0, 0, 0.45);
}
.group-label {
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    color: var(--accent-gold-bright);
}
.floating-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 3px;
    padding: 6px 11px;
    font-size: 0.72rem;
}
.spell-tag-pill {
    font-family: var(--font-title);
    font-size: 9.5px;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(122, 167, 199, 0.16);
    border: 1px solid rgba(122, 167, 199, 0.45);
    color: #bfe0f8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.spell-tag-pill.power {
    background: rgba(201, 164, 92, 0.16);
    border-color: rgba(201, 164, 92, 0.55);
    color: var(--accent-gold-bright);
}

/* Aventura: conserva colores y tipografía del Grimorio */
#turnTrackerModal { max-width: 960px !important; max-height: 92vh; overflow-y: auto; }
.adv-controls { border: 1px solid var(--box-border, #65503c); background: rgba(0,0,0,.18); margin: 12px 0; padding: 12px; border-radius: 8px; text-align: left; }
.adv-controls h3 { font-family: var(--font-title, serif); font-size: 14px; color: var(--accent-gold, #cca569); margin: 2px 0 10px; }
.adv-fields { display:flex; gap:8px; align-items:end; flex-wrap:wrap; }
.adv-fields > input,.adv-fields > select,.adv-fields > label { flex:1 1 115px; min-width: 90px; }
.adv-fields input,.adv-fields select,.adv-unit input,.adv-unit select { color: #f5e8d2; background: #211711; border:1px solid #735d45; border-radius:4px; padding:6px; box-sizing:border-box; }
.adv-fields label,.adv-unit label { font-size:11px; color:#dfc697; }
.adv-fields label input {display:block;width:100%;margin-top:3px;}
.adv-unit {display:grid;grid-template-columns:30px minmax(100px,2.4fr) minmax(78px,.9fr) repeat(3,minmax(58px,.7fr)) 27px;gap:5px;align-items:center;padding:7px 3px;border-bottom:1px solid #644936;}
.adv-unit.adv-current {background:rgba(187,140,70,.18);outline:1px solid #987448;}
.adv-unit input {width:100%;min-width:0;}
.adv-unit label input {margin-top:2px;}
.adv-condition,.adv-history-item {padding:6px;border-bottom:1px solid rgba(180,145,90,.2);font-size:12px;color:#e2cfb3;display:flex;justify-content:space-between;gap:8px;}
.adv-hint {font-size:11px;color:#d4b482;padding-top:6px;}
#adv-history {max-height:180px;overflow-y:auto;}
@media(max-width:640px) {.adv-unit {grid-template-columns:25px minmax(70px,1.4fr) minmax(60px,.8fr) repeat(3,minmax(43px,.65fr)) 25px;gap:3px;font-size:10px}.adv-unit input,.adv-unit select{padding:3px;font-size:11px}#turnTrackerModal{padding:12px !important}}
