    
        :root {
            --bg-deep: #0a0a0f;
            --bg-card: #12121a;
            --bg-elevated: #1a1a25;
            --border-subtle: #2a2a3a;
            --border-glow: #4a3a6a;
            --text-primary: #e8e4f0;
            --text-secondary: #9a94a8;
            --text-muted: #6a6478;
            --accent-mystic: #7c5cbf;
            --accent-gold: #c9a84c;
            --accent-ember: #bf5c5c;
            --accent-jade: #5cbf7c;
            --accent-frost: #5c9fbf;
            --glow-mystic: rgba(124, 92, 191, 0.3);
            --glow-gold: rgba(201, 168, 76, 0.3);

            /* Terrain Colors */
            --terrain-plains: #7a9f4e;
            --terrain-forest: #2d5a3d;
            --terrain-hills: #8b7355;
            --terrain-mountains: #6b6b7a;
            --terrain-swamp: #4a5a3a;
            --terrain-desert: #c4a35a;
            --terrain-water: #2a5a7a;
            --terrain-water-deep: #1a3a5a;
            --terrain-tundra: #a8b8c8;
            --terrain-jungle: #1a4a2a;
            --terrain-wasteland: #5a4a4a;
            --terrain-unexplored: #1a1a25;
        }

        /* Frozen North Biome Color Overrides */
        body.biome-frozen_north {
            /* Frozen terrain palette - whites, blues, grays */
            --terrain-plains: #c8d8e8;      /* Snow-covered plains - pale blue-white */
            --terrain-forest: #4a6a7a;      /* Frost-covered pines - steel blue */
            --terrain-hills: #8a9aaa;       /* Snowy hills - blue-gray */
            --terrain-mountains: #5a7a9a;   /* Ice-capped peaks - slate blue */
            --terrain-swamp: #6a8a9a;       /* Frozen marsh - teal-gray */
            --terrain-desert: #d8e8f0;      /* Polar desert/ice field - bright white-blue */
            --terrain-water: #3a5a8a;       /* Frozen sea - deep cold blue */
            --terrain-water-deep: #2a4a7a;  /* Deep frozen water - darker blue */
            --terrain-tundra: #b8c8d8;      /* Permafrost - light gray-blue */
            --terrain-jungle: #e85030;      /* Geothermal/volcanic - SPECIAL: warm orange-red (stands out!) */
            --terrain-wasteland: #8060a0;   /* Cursed/magical ice - SPECIAL: eerie purple (stands out!) */
            --terrain-unexplored: #1a2030;  /* Dark frozen unknown */
        }

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

        body {
            font-family: 'Cormorant Garamond', Georgia, serif;
            background: var(--bg-deep);
            color: var(--text-primary);
            min-height: 100vh;
            line-height: 1.6;
            background-image: 
                radial-gradient(ellipse at 20% 0%, rgba(124, 92, 191, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 100%, rgba(201, 168, 76, 0.06) 0%, transparent 50%);
        }

        .container {
            max-width: 1600px;
            margin: 0 auto;
            padding: 1.5rem;
        }

        /* Header */
        header {
            text-align: center;
            padding: 2rem 0 1.5rem;
            border-bottom: 1px solid var(--border-subtle);
            margin-bottom: 1.5rem;
            position: relative;
        }

        header::after {
            content: '⬡ ⬡ ⬡';
            position: absolute;
            bottom: -0.7rem;
            left: 50%;
            transform: translateX(-50%);
            background: var(--bg-deep);
            padding: 0 1rem;
            color: var(--accent-gold);
            font-size: 1rem;
            letter-spacing: 0.3em;
        }

        h1 {
            font-family: 'Cinzel', serif;
            font-size: clamp(2rem, 5vw, 3.5rem);
            font-weight: 600;
            letter-spacing: 0.15em;
            text-transform: uppercase;
            background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-gold) 50%, var(--text-primary) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 0.5rem;
        }

        .subtitle {
            font-size: 1.1rem;
            color: var(--text-secondary);
            font-style: italic;
            letter-spacing: 0.1em;
        }

        /* Main Layout */
        .main-grid {
            display: grid;
            grid-template-columns: 1fr 320px;
            gap: 1.5rem;
        }

        .maps-column {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        /* Make both map wrappers the same height */
        .maps-column .hex-map-wrapper {
            min-height: 500px;
            height: 500px;
        }

        @media (max-width: 1100px) {
            .main-grid {
                grid-template-columns: 1fr;
            }
        }

        /* Card Styling */
        .card {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 4px;
            padding: 1.25rem;
            position: relative;
            transition: border-color 0.3s, box-shadow 0.3s;
        }

        .card:hover {
            border-color: var(--border-glow);
        }

        .card-title {
            font-family: 'Cinzel', serif;
            font-size: 1.2rem;
            font-weight: 600;
            letter-spacing: 0.1em;
            color: var(--accent-gold);
            margin-bottom: 1rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--border-subtle);
            display: -webkit-flex;
            display: flex;
            -webkit-align-items: center;
            align-items: center;
            gap: 0.75rem;
        }

        .card-title .icon {
            font-size: 1.1rem;
        }

        /* Collapsible Card Styles */
        .sidebar .card.collapsible .card-title {
            cursor: pointer;
            user-select: none;
            transition: color 0.2s;
        }

        .sidebar .card.collapsible .card-title:hover {
            color: var(--text-primary);
        }

        .sidebar .card.collapsible .card-title .collapse-icon {
            margin-left: auto;
            font-size: 0.8rem;
            transition: transform 0.3s ease;
            color: var(--text-muted);
        }

        .sidebar .card.collapsible .card-title:hover .collapse-icon {
            color: var(--accent-gold);
        }

        .sidebar .card.collapsible.collapsed .card-title {
            margin-bottom: 0;
            padding-bottom: 0;
            border-bottom: none;
        }

        .sidebar .card.collapsible.collapsed .card-title .collapse-icon {
            transform: rotate(-90deg);
        }

        .sidebar .card.collapsible .card-body {
            overflow: hidden;
            transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
            max-height: 1000px;
            opacity: 1;
        }

        .sidebar .card.collapsible.collapsed .card-body {
            max-height: 0;
            opacity: 0;
            padding-top: 0;
            padding-bottom: 0;
        }

        /* Help/Instructions Button */
        .help-btn {
            margin-left: auto;
            background: var(--bg-elevated);
            border: 1px solid var(--border-subtle);
            color: var(--accent-gold);
            padding: 0.3rem 0.6rem;
            font-family: 'Cinzel', serif;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            cursor: pointer;
            border-radius: 3px;
            -webkit-transition: all 0.2s;
            transition: all 0.2s;
            display: -webkit-flex;
            display: flex;
            -webkit-align-items: center;
            align-items: center;
            gap: 0.3rem;
        }

        .help-btn:hover {
            background: var(--accent-gold);
            color: var(--bg-deep);
            border-color: var(--accent-gold);
        }

        .help-btn .help-icon {
            font-size: 0.9rem;
        }

        /* Instructions Modal */
        .instructions-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            z-index: 1005;
            -webkit-justify-content: center;
            justify-content: center;
            -webkit-align-items: center;
            align-items: center;
            overflow-y: auto;
            padding: 2rem;
            box-sizing: border-box;
        }

        .instructions-modal.active {
            display: -webkit-flex;
            display: flex;
        }

        .instructions-content {
            background: var(--bg-card);
            border: 2px solid var(--accent-gold);
            border-radius: 8px;
            padding: 2rem;
            max-width: 800px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            -webkit-animation: modal-appear 0.3s ease-out;
            animation: modal-appear 0.3s ease-out;
            box-shadow: 0 0 40px rgba(201, 168, 76, 0.2);
        }

        .instructions-header {
            display: -webkit-flex;
            display: flex;
            -webkit-justify-content: space-between;
            justify-content: space-between;
            -webkit-align-items: center;
            align-items: center;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border-subtle);
        }

        .instructions-title {
            font-family: 'Cinzel', serif;
            font-size: 1.8rem;
            color: var(--accent-gold);
            margin: 0;
        }

        .instructions-close {
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.5rem;
            line-height: 1;
            -webkit-transition: color 0.2s;
            transition: color 0.2s;
        }

        .instructions-close:hover {
            color: var(--accent-ember);
        }

        .instructions-section {
            margin-bottom: 1.5rem;
        }

        .instructions-section h3 {
            font-family: 'Cinzel', serif;
            font-size: 1.1rem;
            color: var(--accent-gold);
            margin-bottom: 0.75rem;
            display: -webkit-flex;
            display: flex;
            -webkit-align-items: center;
            align-items: center;
            gap: 0.5rem;
        }

        .instructions-section p {
            color: var(--text-secondary);
            line-height: 1.6;
            margin-bottom: 0.5rem;
        }

        .instructions-section ul {
            color: var(--text-secondary);
            line-height: 1.8;
            margin: 0;
            padding-left: 1.5rem;
        }

        .instructions-section li {
            margin-bottom: 0.25rem;
        }

        .instructions-key {
            background: var(--bg-elevated);
            padding: 0.15rem 0.4rem;
            border-radius: 3px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.85rem;
            color: var(--accent-frost);
        }

        .instructions-highlight {
            color: var(--accent-gold);
            font-weight: 600;
        }

        /* Setup Card Overlay */
        .setup-card-overlay {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 100;
            max-width: 400px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            display: flex;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        /* Hex Map Container */
        .hex-map-wrapper {
            position: relative;
            overflow: hidden;
            background: var(--bg-elevated);
            border-radius: 4px;
            min-height: 500px;
            cursor: grab;
        }

        .hex-map-wrapper:active {
            cursor: grabbing;
        }

        .hex-map {
            position: absolute;
            transform-origin: center center;
            transition: transform 0.1s ease-out;
        }

        /* Hex Styling */
        .hex {
            position: absolute;
            width: 80px;
            height: 92px;
            cursor: pointer;
            transition: filter 0.2s, transform 0.2s;
        }

        .hex:hover {
            filter: brightness(1.2);
            transform: scale(1.05);
            z-index: 10;
        }

        .hex svg {
            width: 100%;
            height: 100%;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
            pointer-events: none;
        }

        .hex-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
            pointer-events: none;
            width: 70px;
        }

        /* Active hex (current party position) */
        .hex.active {
            z-index: 15;
        }

        .hex-note-icon {
            position: absolute;
            top: 8px;
            left: 12px;
            width: 20px;
            height: 20px;
            background: var(--accent-gold);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            color: var(--bg-deep);
            cursor: pointer;
            pointer-events: auto;
            z-index: 20;
            transition: transform 0.2s, background 0.2s, opacity 0.2s;
            box-shadow: 0 2px 4px rgba(0,0,0,0.4);
            opacity: 0;
        }

        /* Show note icon on hover if no notes */
        .hex:hover .hex-note-icon {
            opacity: 1;
        }

        /* Always show note icon if notes exist */
        .hex-note-icon.has-note {
            opacity: 1;
            background: var(--accent-jade);
        }

        .hex-note-icon:hover {
            transform: scale(1.15);
            background: var(--accent-mystic);
        }

        .hex-note-icon.has-note:hover {
            background: var(--accent-frost);
        }

        .hex-terrain-icon {
            font-size: 1.5rem;
            line-height: 1;
            margin-bottom: 2px;
        }

        .hex-coord {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.65rem;
            color: rgba(255,255,255,0.7);
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }

        .hex.unrevealed .hex-content {
            opacity: 0.4;
        }

        .hex.unrevealed:hover .hex-content {
            opacity: 0.8;
        }

        .hex.revealed-unexplored {
            opacity: 0.75;
        }

        .hex.revealed-unexplored .hex-content {
            opacity: 0.9;
        }

        .hex.current-position {
            animation: current-pulse 2s ease-in-out infinite;
        }

        @keyframes current-pulse {
            0%, 100% { filter: brightness(1) drop-shadow(0 0 8px var(--accent-gold)); }
            50% { filter: brightness(1.2) drop-shadow(0 0 15px var(--accent-gold)); }
        }

        .hex.adjacent-unrevealed {
            animation: adjacent-glow 2s ease-in-out infinite;
        }

        .hex.adjacent-revealed {
            animation: adjacent-revealed-glow 2s ease-in-out infinite;
        }

        @keyframes adjacent-glow {
            0%, 100% { filter: brightness(0.8); }
            50% { filter: brightness(1); }
        }

        @keyframes adjacent-revealed-glow {
            0%, 100% { filter: brightness(0.9); opacity: 0.85; }
            50% { filter: brightness(1.1); opacity: 1; }
        }

        /* Explore Button on Hex */
        .hex-explore-btn {
            position: absolute;
            top: 50%;
            left: 50%;
            -webkit-transform: translate(-50%, -50%);
            transform: translate(-50%, -50%);
            background: var(--accent-gold);
            color: var(--bg-deep);
            border: none;
            padding: 4px 10px;
            font-family: 'Cinzel', serif;
            font-size: 0.65rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            cursor: pointer;
            border-radius: 3px;
            -webkit-transition: all 0.2s;
            transition: all 0.2s;
            z-index: 100;
            white-space: nowrap;
            opacity: 0;
            box-shadow: 0 2px 6px rgba(0,0,0,0.4);
            pointer-events: auto;
        }

        .hex:hover .hex-explore-btn,
        .hex-explore-btn:hover,
        .hex-explore-btn:focus {
            opacity: 1;
        }

        .hex-explore-btn:hover {
            background: var(--text-primary);
            color: var(--bg-deep);
            -webkit-transform: translate(-50%, -50%) scale(1.1);
            transform: translate(-50%, -50%) scale(1.1);
        }

        .hex.unrevealed .hex-explore-btn {
            display: none;
        }

        /* Settlement Button on Hex */
        .hex-settlement-btn {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--accent-gold);
            color: var(--bg-deep);
            border: 2px solid var(--bg-deep);
            width: 32px;
            height: 32px;
            font-size: 1.2rem;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            border-radius: 50%;
            transition: all 0.2s;
            z-index: 6;
            box-shadow: 0 2px 8px rgba(0,0,0,0.4);
        }

        .hex-settlement-btn:hover {
            transform: translate(-50%, -50%) scale(1.15);
            box-shadow: 0 4px 12px var(--glow-gold);
        }

        /* Party Location Icon */
        .hex-party-icon {
            position: absolute;
            top: 5px;
            right: 8px;
            width: 40px;
            height: 40px;
            background: rgba(191, 92, 92, 0.2);
            border: 2px solid var(--accent-ember);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.8rem;
            z-index: 25;
            box-shadow: 0 0 16px rgba(191, 92, 92, 0.6);
            animation: party-pulse 2s ease-in-out infinite;
            pointer-events: auto;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .hex-party-icon:hover {
            width: 48px;
            height: 48px;
            font-size: 2rem;
            background: rgba(191, 92, 92, 0.35);
            box-shadow: 0 0 24px rgba(191, 92, 92, 0.8);
            transform: scale(1.15) !important;
        }

        @keyframes party-pulse {
            0%, 100% { 
                transform: scale(1);
                box-shadow: 0 0 16px rgba(191, 92, 92, 0.6);
            }
            50% { 
                transform: scale(1.15);
                box-shadow: 0 0 24px rgba(191, 92, 92, 0.8);
            }
        }

        /* Dungeon Room Styling */
        .dungeon-room {
            position: absolute;
            background: var(--bg-elevated);
            border: 2px solid var(--border-subtle);
            cursor: pointer;
            -webkit-transition: all 0.2s;
            transition: all 0.2s;
            display: -webkit-flex;
            display: flex;
            -webkit-flex-direction: column;
            flex-direction: column;
            -webkit-align-items: center;
            align-items: center;
            -webkit-justify-content: center;
            justify-content: center;
            font-size: 1.5rem;
            overflow: visible;
        }

        .dungeon-room:hover {
            border-color: var(--accent-mystic);
            -webkit-transform: scale(1.05);
            transform: scale(1.05);
            z-index: 10;
        }

        .dungeon-room.unexplored {
            background: var(--bg-card);
            border-style: dashed;
            opacity: 0.6;
        }

        .dungeon-room.explored {
            background: var(--bg-elevated);
            border-color: var(--accent-jade);
        }

        /* Difficulty-based explored room colors */
        .dungeon-room.explored.difficulty-easy {
            border-color: var(--accent-jade);
            box-shadow: 0 0 8px rgba(92, 191, 124, 0.4);
        }

        .dungeon-room.explored.difficulty-medium {
            border-color: var(--accent-gold);
            box-shadow: 0 0 8px rgba(201, 168, 76, 0.4);
        }

        .dungeon-room.explored.difficulty-hard {
            border-color: var(--accent-ember);
            box-shadow: 0 0 8px rgba(191, 92, 92, 0.4);
        }

        /* Current room with difficulty glow */
        .dungeon-room.current {
            border-color: var(--accent-ember);
            box-shadow: 0 0 12px rgba(191, 92, 92, 0.5);
            animation: room-pulse-red 2s ease-in-out infinite;
        }

        .dungeon-room.current.current-easy {
            border-color: var(--accent-jade);
            box-shadow: 0 0 12px rgba(92, 191, 124, 0.6);
            animation: room-pulse-easy 2s ease-in-out infinite;
        }

        .dungeon-room.current.current-medium {
            border-color: var(--accent-gold);
            box-shadow: 0 0 12px rgba(201, 168, 76, 0.6);
            animation: room-pulse-medium 2s ease-in-out infinite;
        }

        .dungeon-room.current.current-hard {
            border-color: var(--accent-ember);
            box-shadow: 0 0 12px rgba(191, 92, 92, 0.6);
            animation: room-pulse-hard 2s ease-in-out infinite;
        }

        @keyframes room-pulse-easy {
            0%, 100% { box-shadow: 0 0 12px rgba(92, 191, 124, 0.5); }
            50% { box-shadow: 0 0 20px rgba(92, 191, 124, 0.8); }
        }

        @keyframes room-pulse-medium {
            0%, 100% { box-shadow: 0 0 12px rgba(201, 168, 76, 0.5); }
            50% { box-shadow: 0 0 20px rgba(201, 168, 76, 0.8); }
        }

        @keyframes room-pulse-hard {
            0%, 100% { box-shadow: 0 0 12px rgba(191, 92, 92, 0.5); }
            50% { box-shadow: 0 0 20px rgba(191, 92, 92, 0.8); }
        }

        @keyframes room-pulse-red {
            0%, 100% { box-shadow: 0 0 12px rgba(191, 92, 92, 0.5); }
            50% { box-shadow: 0 0 20px rgba(191, 92, 92, 0.8); }
        }

        @keyframes room-pulse {
            0%, 100% { box-shadow: 0 0 12px var(--glow-gold); }
            50% { box-shadow: 0 0 20px var(--glow-gold); }
        }

        /* Dungeon Room Pin Icon - Chrome compatible */
        .dungeon-room-pin {
            position: absolute;
            top: -10px;
            right: -10px;
            font-size: 1.4rem;
            z-index: 10;
            line-height: 1;
            display: block;
            -webkit-filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
            filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
            -webkit-animation: pin-bounce 1s ease-in-out infinite;
            animation: pin-bounce 1s ease-in-out infinite;
        }

        @-webkit-keyframes pin-bounce {
            0%, 100% { -webkit-transform: translateY(0); transform: translateY(0); }
            50% { -webkit-transform: translateY(-3px); transform: translateY(-3px); }
        }

        @keyframes pin-bounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-3px); }
        }

        .dungeon-room-icon {
            font-size: 1.3rem;
            line-height: 1;
            display: block;
        }

        /* Dungeon Room Note Button */
        .dungeon-room-note-btn {
            position: absolute;
            bottom: -8px;
            left: -8px;
            width: 20px;
            height: 20px;
            padding: 0;
            margin: 0;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 50%;
            font-size: 0.7rem;
            line-height: 20px;
            text-align: center;
            cursor: pointer;
            z-index: 10;
            opacity: 0;
            -webkit-transition: all 0.2s;
            transition: all 0.2s;
        }

        .dungeon-room:hover .dungeon-room-note-btn {
            opacity: 1;
        }

        .dungeon-room-note-btn.has-note {
            opacity: 1;
            background: var(--accent-jade);
            border-color: var(--accent-jade);
        }

        .dungeon-room-note-btn:hover {
            -webkit-transform: scale(1.2);
            transform: scale(1.2);
            background: var(--accent-mystic);
            border-color: var(--accent-mystic);
        }

        /* Room Note Modal */
        .room-note-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 1003;
            -webkit-justify-content: center;
            justify-content: center;
            -webkit-align-items: center;
            align-items: center;
        }

        .room-note-modal.active {
            display: -webkit-flex;
            display: flex;
        }

        .dungeon-corridor {
            position: absolute;
            background: var(--border-subtle);
        }

        .dungeon-corridor.horizontal {
            height: 3px;
        }

        .dungeon-corridor.vertical {
            width: 3px;
        }

        .dungeon-corridor.explored {
            background: var(--accent-frost);
        }

        /* Encounter Modal */
        .encounter-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 1000;
            -webkit-justify-content: center;
            justify-content: center;
            -webkit-align-items: center;
            align-items: center;
        }

        .encounter-modal.active {
            display: -webkit-flex;
            display: flex;
        }

        .encounter-content {
            background: var(--bg-card);
            border: 2px solid var(--border-glow);
            border-radius: 8px;
            padding: 2rem;
            max-width: 500px;
            width: 90%;
            text-align: center;
            -webkit-animation: modal-appear 0.3s ease-out;
            animation: modal-appear 0.3s ease-out;
        }

        @-webkit-keyframes modal-appear {
            0% { opacity: 0; -webkit-transform: scale(0.9); transform: scale(0.9); }
            100% { opacity: 1; -webkit-transform: scale(1); transform: scale(1); }
        }

        @keyframes modal-appear {
            0% { opacity: 0; transform: scale(0.9); }
            100% { opacity: 1; transform: scale(1); }
        }

        /* Tile Set Image Rendering */
        .hex-svg {
            width: 100%;
            height: 100%;
            pointer-events: none;
        }

        .hex.unrevealed svg image {
            opacity: 0.3;
            filter: brightness(0.5);
        }

        .hex.revealed-unexplored svg image {
            opacity: 0.7;
            filter: brightness(0.8);
        }

        .hex svg image {
            opacity: 1.0;
            filter: brightness(1.0);
            transition: all 0.3s ease;
        }

        .hex svg {
            transition: all 0.3s ease;
        }

        .hex-border {
            pointer-events: none;
        }

        .encounter-terrain {
            font-size: 3rem;
            margin-bottom: 0.5rem;
        }

        .encounter-terrain-name {
            font-family: 'Cinzel', serif;
            font-size: 1.2rem;
            color: var(--text-secondary);
            margin-bottom: 1rem;
        }

        .encounter-description {
            font-size: 1.1rem;
            line-height: 1.6;
            color: var(--text-primary);
            margin-bottom: 1.5rem;
            padding: 1rem;
            background: var(--bg-elevated);
            border-radius: 4px;
            border-left: 3px solid var(--accent-gold);
            text-align: left;
        }

        .encounter-reveal-btn {
            background: var(--accent-mystic);
            border: none;
            color: white;
            padding: 0.75rem 2rem;
            font-family: 'Cinzel', serif;
            font-size: 1rem;
            cursor: pointer;
            border-radius: 3px;
            transition: all 0.2s;
            margin-bottom: 0.5rem;
        }

        .encounter-reveal-btn:hover {
            background: var(--accent-gold);
            transform: scale(1.02);
        }

        .encounter-leave-btn {
            background: transparent;
            border: 1px solid var(--border-subtle);
            color: var(--text-secondary);
            padding: 0.5rem 1.5rem;
            font-family: 'Cinzel', serif;
            font-size: 0.85rem;
            cursor: pointer;
            border-radius: 3px;
            transition: all 0.2s;
            margin-bottom: 1rem;
            display: block;
            margin-left: auto;
            margin-right: auto;
        }

        .encounter-leave-btn:hover {
            border-color: var(--accent-frost);
            color: var(--accent-frost);
        }

        .encounter-result {
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border-subtle);
            animation: fade-in 0.3s ease-out;
        }

        @keyframes fade-in {
            0% { opacity: 0; transform: translateY(-10px); }
            100% { opacity: 1; transform: translateY(0); }
        }

        .encounter-type {
            font-family: 'Cinzel', serif;
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-bottom: 1rem;
            padding: 0.3rem 0.8rem;
            border-radius: 3px;
            display: inline-block;
        }

        .encounter-type.none {
            background: var(--bg-elevated);
            color: var(--text-muted);
        }

        .encounter-type.neutral {
            background: rgba(92, 159, 191, 0.2);
            color: var(--accent-frost);
        }

        .encounter-type.danger {
            background: rgba(191, 92, 92, 0.2);
            color: var(--accent-ember);
        }

        .encounter-type.settlement {
            background: rgba(201, 168, 76, 0.2);
            color: var(--accent-gold);
        }

        .encounter-text {
            font-size: 1.3rem;
            line-height: 1.5;
            color: var(--text-primary);
            margin-bottom: 1.5rem;
        }

        .encounter-close {
            background: var(--accent-mystic);
            border: none;
            color: white;
            padding: 0.75rem 2rem;
            font-family: 'Cinzel', serif;
            font-size: 1rem;
            cursor: pointer;
            border-radius: 3px;
            transition: all 0.2s;
        }

        .encounter-close:hover {
            background: var(--accent-gold);
        }

        /* Enhanced Encounter Modal - Reveal/Leave Flow */
        .encounter-modal-content .encounter-description,
        .encounter-modal-content #encounterRoll {
            font-family: 'Cormorant Garamond', serif;
            font-size: 1.1rem;
            line-height: 1.6;
            color: var(--text-secondary);
            margin-bottom: 1.5rem;
            padding: 1rem;
            background: var(--bg-elevated);
            border-radius: 4px;
            border-left: 3px solid var(--accent-gold);
            text-align: left;
        }

        .encounter-result {
            margin-top: 1rem;
            animation: fadeIn 0.3s ease-in;
        }

        .encounter-divider {
            font-family: 'Cinzel', serif;
            font-size: 0.9rem;
            color: var(--accent-gold);
            text-align: center;
            margin: 1rem 0;
        }

        .encounter-modal-content .encounter-text,
        .encounter-modal-content #encounterText {
            font-family: 'Cormorant Garamond', serif;
            font-size: 1.1rem;
            line-height: 1.6;
            color: var(--text-primary);
            white-space: pre-wrap;
            text-align: left;
            padding: 1rem;
            background: var(--bg-elevated);
            border-radius: 4px;
        }

        .encounter-buttons {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            margin-top: 1.5rem;
        }

        .encounter-buttons .action-btn {
            width: 100%;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Note Modal */
        .note-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 1001;
            -webkit-justify-content: center;
            justify-content: center;
            -webkit-align-items: center;
            align-items: center;
        }

        .note-modal.active {
            display: -webkit-flex;
            display: flex;
        }

        .note-content {
            background: var(--bg-card);
            border: 2px solid var(--border-glow);
            border-radius: 8px;
            padding: 2rem;
            max-width: 500px;
            width: 90%;
            -webkit-animation: modal-appear 0.3s ease-out;
            animation: modal-appear 0.3s ease-out;
        }

        .note-header {
            display: -webkit-flex;
            display: flex;
            -webkit-align-items: center;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1.5rem;
            padding-bottom: 0.75rem;
            border-bottom: 1px solid var(--border-subtle);
        }

        .note-header-icon {
            font-size: 1.5rem;
        }

        .note-header-text h3 {
            font-family: 'Cinzel', serif;
            font-size: 1.2rem;
            color: var(--accent-gold);
            margin-bottom: 0.25rem;
        }

        .note-header-text .note-coords {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.85rem;
            color: var(--text-muted);
        }

        .note-textarea {
            width: 100%;
            min-height: 150px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-subtle);
            border-radius: 4px;
            padding: 0.75rem;
            color: var(--text-primary);
            font-family: 'Cormorant Garamond', Georgia, serif;
            font-size: 1rem;
            line-height: 1.6;
            resize: vertical;
            transition: border-color 0.3s;
        }

        .note-textarea:focus {
            outline: none;
            border-color: var(--accent-gold);
        }

        .note-buttons {
            display: flex;
            gap: 0.75rem;
            margin-top: 1rem;
        }

        .note-btn {
            flex: 1;
            padding: 0.75rem;
            font-family: 'Cinzel', serif;
            font-size: 0.9rem;
            border: none;
            border-radius: 3px;
            cursor: pointer;
            transition: all 0.2s;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .note-btn.save {
            background: var(--accent-jade);
            color: white;
        }

        .note-btn.save:hover {
            background: var(--accent-mystic);
        }

        .note-btn.delete {
            background: var(--accent-ember);
            color: white;
        }

        .note-btn.delete:hover {
            background: #8f3c3c;
        }

        .note-btn.cancel {
            background: var(--bg-elevated);
            color: var(--text-primary);
            border: 1px solid var(--border-subtle);
        }

        .note-btn.cancel:hover {
            border-color: var(--accent-mystic);
        }


        /* Terrain Colors for Hexes */
        .hex-fill-plains { fill: var(--terrain-plains); }
        .hex-fill-forest { fill: var(--terrain-forest); }
        .hex-fill-hills { fill: var(--terrain-hills); }
        .hex-fill-mountains { fill: var(--terrain-mountains); }
        .hex-fill-swamp { fill: var(--terrain-swamp); }
        .hex-fill-desert { fill: var(--terrain-desert); }
        .hex-fill-water { fill: var(--terrain-water); }
        .hex-fill-tundra { fill: var(--terrain-tundra); }
        .hex-fill-jungle { fill: var(--terrain-jungle); }
        .hex-fill-wasteland { fill: var(--terrain-wasteland); }
        .hex-fill-unexplored { fill: var(--terrain-unexplored); stroke: var(--border-subtle); stroke-width: 2; }

        /* Frozen North biome hex styling */
        body.biome-frozen_north .hex polygon {
            stroke: #6a8aaa;
            stroke-width: 1;
        }
        
        body.biome-frozen_north .hex.current-position polygon {
            stroke: #a0d0ff;
            stroke-width: 2;
            filter: drop-shadow(0 0 4px rgba(160, 208, 255, 0.5));
        }
        
        /* Special terrain pop colors in frozen biome */
        body.biome-frozen_north .hex-fill-jungle {
            filter: drop-shadow(0 0 3px rgba(232, 80, 48, 0.6));
        }
        
        body.biome-frozen_north .hex-fill-wasteland {
            filter: drop-shadow(0 0 3px rgba(128, 96, 160, 0.6));
        }

        /* Map Controls */
        .map-controls {
            position: absolute;
            bottom: 1rem;
            right: 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            z-index: 20;
        }

        .map-btn {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            color: var(--text-primary);
            width: 36px;
            height: 36px;
            font-size: 1.2rem;
            cursor: pointer;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .map-btn:hover {
            background: var(--accent-mystic);
            border-color: var(--accent-mystic);
        }

        /* Sidebar */
        .sidebar {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        /* Current Hex Info */
        .current-hex-display {
            text-align: center;
            padding: 1rem;
            background: var(--bg-elevated);
            border-radius: 4px;
        }

        .current-terrain-icon {
            font-size: 3rem;
            margin-bottom: 0.5rem;
        }

        .current-terrain-name {
            font-family: 'Cinzel', serif;
            font-size: 1.5rem;
            font-weight: 600;
            margin-bottom: 0.25rem;
        }

        .current-coords {
            font-family: 'JetBrains Mono', monospace;
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        .current-position-button {
            background: var(--accent-mystic);
            color: white;
            border: none;
            padding: 0.75rem 1rem;
            border-radius: 4px;
            font-family: 'Cinzel', serif;
            font-size: 0.95rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .current-position-button:hover {
            background: var(--accent-gold);
            transform: translateY(-1px);
        }

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

        .location-item {
            padding: 0.5rem;
            background: var(--bg-elevated);
            border-left: 3px solid var(--accent-jade);
            border-radius: 3px;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .location-item:hover {
            background: rgba(92, 191, 124, 0.1);
            border-left-color: var(--accent-gold);
        }

        /* Terrain Legend */
        .terrain-legend {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.4rem 0.6rem;
            background: var(--bg-elevated);
            border-radius: 3px;
            font-size: 0.85rem;
            cursor: pointer;
            border: 1px solid transparent;
            transition: all 0.2s ease;
            position: relative;
            user-select: none;
        }

        .legend-item:hover {
            background: var(--bg-card);
            border-color: var(--border-glow);
        }

        .legend-item.disabled {
            opacity: 0.5;
        }

        .legend-item.disabled::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 5%;
            width: 90%;
            height: 2px;
            background: var(--accent-ember);
            transform: translateY(-50%);
            box-shadow: 0 0 4px var(--accent-ember);
        }

        .legend-item .terrain-status {
            margin-left: auto;
            font-size: 0.7rem;
            opacity: 0;
            transition: opacity 0.2s;
        }

        .legend-item:hover .terrain-status {
            opacity: 1;
        }

        .legend-item.disabled .terrain-status {
            color: var(--accent-ember);
        }

        .legend-item:not(.disabled) .terrain-status {
            color: var(--accent-jade);
        }

        .legend-color {
            width: 20px;
            height: 20px;
            border-radius: 3px;
            flex-shrink: 0;
        }

        .legend-icon {
            font-size: 1rem;
        }

        /* Adjacency Weight Slider */
        .adjacency-control {
            padding: 1rem;
            background: var(--bg-elevated);
            border-radius: 4px;
            margin-bottom: 1rem;
        }

        .adjacency-label {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.5rem;
            font-size: 0.9rem;
        }

        .adjacency-value {
            font-family: 'JetBrains Mono', monospace;
            color: var(--accent-gold);
            font-weight: 600;
        }

        .adjacency-slider {
            width: 100%;
            height: 6px;
            -webkit-appearance: none;
            appearance: none;
            background: var(--border-subtle);
            border-radius: 3px;
            outline: none;
        }

        .adjacency-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            background: var(--accent-mystic);
            border-radius: 50%;
            cursor: pointer;
            transition: transform 0.2s;
        }

        .adjacency-slider::-webkit-slider-thumb:hover {
            transform: scale(1.2);
        }

        .adjacency-hint {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 0.5rem;
            font-style: italic;
        }

        /* Action Buttons */
        .action-btn {
            width: 100%;
            background: linear-gradient(135deg, var(--accent-mystic) 0%, #5a3c9f 100%);
            border: none;
            color: white;
            padding: 0.8rem;
            font-family: 'Cinzel', serif;
            font-size: 1rem;
            font-weight: 600;
            letter-spacing: 0.1em;
            cursor: pointer;
            transition: all 0.3s;
            border-radius: 3px;
            text-transform: uppercase;
            margin-bottom: 0.5rem;
        }

        .action-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px var(--glow-mystic);
        }

        .action-btn.danger {
            background: linear-gradient(135deg, var(--accent-ember) 0%, #8f3c3c 100%);
        }

        .action-btn.secondary {
            background: var(--bg-elevated);
            border: 1px solid var(--border-subtle);
        }

        .action-btn.secondary:hover {
            border-color: var(--accent-mystic);
            box-shadow: none;
        }

        /* Travel Log */
        .travel-log {
            max-height: 200px;
            overflow-y: auto;
            background: var(--bg-elevated);
            border-radius: 4px;
            padding: 0.75rem;
        }

        .travel-log::-webkit-scrollbar {
            width: 6px;
        }

        .travel-log::-webkit-scrollbar-track {
            background: var(--bg-card);
        }

        .travel-log::-webkit-scrollbar-thumb {
            background: var(--border-subtle);
            border-radius: 3px;
        }

        .log-entry {
            padding: 0.5rem;
            border-bottom: 1px solid var(--border-subtle);
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .log-entry:last-child {
            border-bottom: none;
        }

        .log-icon {
            font-size: 1rem;
        }

        .log-coord {
            font-family: 'JetBrains Mono', monospace;
            color: var(--text-muted);
            font-size: 0.75rem;
        }

        .log-new {
            font-size: 0.7rem;
            color: var(--accent-gold);
            font-style: italic;
        }

        .empty-state {
            color: var(--text-muted);
            font-style: italic;
            text-align: center;
            padding: 1rem;
        }

        /* Starting Terrain Select */
        .starting-terrain {
            margin-bottom: 1rem;
        }

        .terrain-select {
            width: 100%;
            background: var(--bg-elevated);
            border: 1px solid var(--border-subtle);
            color: var(--text-primary);
            padding: 0.6rem;
            font-family: 'Cormorant Garamond', serif;
            font-size: 1rem;
            border-radius: 2px;
            cursor: pointer;
        }

        .terrain-select:focus {
            outline: none;
            border-color: var(--accent-mystic);
        }

        /* Info Tooltip */
        .info-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            background: var(--border-subtle);
            border-radius: 50%;
            font-size: 0.7rem;
            color: var(--text-muted);
            cursor: help;
            margin-left: auto;
        }

        .tooltip {
            position: relative;
        }

        .tooltip .tooltip-text {
            visibility: hidden;
            opacity: 0;
            width: 250px;
            background: var(--bg-card);
            border: 1px solid var(--border-glow);
            color: var(--text-secondary);
            text-align: left;
            padding: 0.75rem;
            border-radius: 4px;
            position: absolute;
            z-index: 100;
            bottom: 125%;
            left: 50%;
            transform: translateX(-50%);
            font-family: 'Cormorant Garamond', serif;
            font-size: 0.85rem;
            line-height: 1.4;
            transition: opacity 0.2s;
            box-shadow: 0 10px 30px rgba(0,0,0,0.4);
        }

        .tooltip:hover .tooltip-text {
            visibility: visible;
            opacity: 1;
        }

        /* Stats Display */
        .stats-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }

        .stat-item {
            background: var(--bg-elevated);
            padding: 0.5rem;
            border-radius: 3px;
            text-align: center;
        }

        .stat-value {
            font-family: 'Cinzel', serif;
            font-size: 1.5rem;
            color: var(--accent-mystic);
            font-weight: 600;
        }

        .stat-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        /* Dungeon Encounter Modal */
        .dungeon-encounter-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            z-index: 1002;
            -webkit-justify-content: center;
            justify-content: center;
            -webkit-align-items: center;
            align-items: center;
        }

        .dungeon-encounter-modal.active {
            display: -webkit-flex;
            display: flex;
        }

        .dungeon-encounter-content {
            background: var(--bg-card);
            border: 2px solid var(--accent-ember);
            border-radius: 8px;
            padding: 2rem;
            max-width: 500px;
            width: 90%;
            text-align: center;
            -webkit-animation: modal-appear 0.3s ease-out;
            animation: modal-appear 0.3s ease-out;
            box-shadow: 0 0 30px rgba(191, 92, 92, 0.3);
        }

        .dungeon-encounter-header {
            margin-bottom: 1rem;
        }

        .dungeon-encounter-icon {
            font-size: 3rem;
            margin-bottom: 0.5rem;
        }

        .dungeon-encounter-title {
            font-family: 'Cinzel', serif;
            font-size: 1.5rem;
            color: var(--accent-gold);
            font-weight: 600;
        }

        .dungeon-encounter-difficulty {
            font-family: 'Cinzel', serif;
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-bottom: 0.5rem;
            padding: 0.3rem 0.8rem;
            border-radius: 3px;
            display: inline-block;
        }

        .dungeon-encounter-difficulty.easy {
            background: rgba(92, 191, 124, 0.2);
            color: var(--accent-jade);
        }

        .dungeon-encounter-difficulty.medium {
            background: rgba(201, 168, 76, 0.2);
            color: var(--accent-gold);
        }

        .dungeon-encounter-difficulty.hard {
            background: rgba(191, 92, 92, 0.2);
            color: var(--accent-ember);
        }

        .dungeon-encounter-room {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-bottom: 1rem;
        }

        .dungeon-encounter-description {
            font-size: 1.2rem;
            line-height: 1.5;
            color: var(--text-primary);
            margin-bottom: 1.5rem;
            padding: 1rem;
            background: var(--bg-elevated);
            border-radius: 4px;
            border-left: 3px solid var(--accent-mystic);
            text-align: left;
        }

        .dungeon-encounter-text {
            font-size: 1.2rem;
            line-height: 1.5;
            color: var(--text-primary);
            margin-bottom: 1.5rem;
            padding: 1rem;
            background: var(--bg-elevated);
            border-radius: 4px;
            border-left: 3px solid var(--accent-ember);
            text-align: left;
        }

        /* Difficulty-based encounter text border colors */
        .dungeon-encounter-text.difficulty-easy {
            border-left-color: var(--accent-jade);
        }

        .dungeon-encounter-text.difficulty-medium {
            border-left-color: var(--accent-gold);
        }

        .dungeon-encounter-text.difficulty-hard {
            border-left-color: var(--accent-ember);
        }

        /* Footer */
        footer {
            text-align: center;
            padding: 1.5rem;
            margin-top: 1.5rem;
            border-top: 1px solid var(--border-subtle);
            color: var(--text-muted);
            font-size: 0.85rem;
        }
    
</head>
<body>

    <div class="container">
        <header>
            <h1>HexGrinder</h1>
            <p class="subtitle">Old-School Hex Based Adventuring</p>
        </header>

        <div class="main-grid">
            <!-- Maps Area -->
/**
 * HexGrinder WordPress Plugin Styles
 * Additional styles for WordPress integration
 */

/* =====================
   WORDPRESS OVERRIDES
   ===================== */

/* Reset WordPress defaults that might conflict */
.hexgrinder-container,
.hexgrinder-dashboard {
    box-sizing: border-box;
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: var(--text-primary);
    line-height: 1.6;
}

.hexgrinder-container *,
.hexgrinder-dashboard * {
    box-sizing: border-box;
}

.hexgrinder-container a,
.hexgrinder-dashboard a {
    text-decoration: none;
}

/* =====================
   ACCOUNT BAR
   ===================== */

.hexgrinder-account-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.account-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-title {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--accent-gold);
    font-weight: 600;
}

.map-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding-left: 1rem;
    border-left: 1px solid var(--border-subtle);
}

.auto-save-status {
    font-size: 0.8rem;
    color: var(--accent-jade);
    opacity: 0;
    transition: opacity 0.3s;
}

.auto-save-status.visible {
    opacity: 1;
}

.account-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.user-greeting {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.guest-notice {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.account-btn {
    padding: 0.4rem 0.8rem;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-block;
}

.account-btn:hover {
    border-color: var(--accent-mystic);
    color: var(--text-primary);
}

.account-btn.primary {
    background: var(--accent-mystic);
    border-color: var(--accent-mystic);
    color: white;
}

.account-btn.primary:hover {
    background: #9370db;
    border-color: #9370db;
}

.account-btn.save-btn {
    background: var(--accent-jade);
    border-color: var(--accent-jade);
    color: var(--bg-deep);
}

.account-btn.save-btn:hover {
    background: #70d090;
}

.account-btn.logout {
    color: var(--accent-ember);
    border-color: var(--accent-ember);
}

.account-btn.logout:hover {
    background: var(--accent-ember);
    color: white;
}

/* =====================
   MODALS
   ===================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-appear 0.3s ease-out;
    box-shadow: 0 0 40px rgba(201, 168, 76, 0.2);
}

.modal-content.modal-large {
    max-width: 700px;
}

.modal-content.modal-small {
    max-width: 400px;
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--accent-gold);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--accent-ember);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

/* =====================
   FORMS
   ===================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input,
.form-select {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.75rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-mystic);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* =====================
   NOTES TEXTAREA
   ===================== */

.note-textarea {
    width: 100%;
    min-height: 150px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 1rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    border-radius: 4px;
    resize: vertical;
    line-height: 1.6;
}

.note-textarea:focus {
    outline: none;
    border-color: var(--accent-mystic);
}

.note-textarea.large {
    min-height: 300px;
}

/* =====================
   DASHBOARD STYLES
   ===================== */

.hexgrinder-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--bg-deep);
    min-height: 80vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--accent-gold);
    margin: 0;
}

.dashboard-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0;
}

.dashboard-btn {
    padding: 0.6rem 1.2rem;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-block;
}

.dashboard-btn:hover {
    border-color: var(--accent-mystic);
    color: var(--text-primary);
}

.dashboard-btn.primary {
    background: var(--accent-mystic);
    border-color: var(--accent-mystic);
    color: white;
}

.dashboard-btn.primary:hover {
    background: #9370db;
}

.dashboard-btn.primary.large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.dashboard-btn.danger {
    background: var(--accent-ember);
    border-color: var(--accent-ember);
    color: white;
}

.dashboard-btn.danger:hover {
    background: #d06060;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: var(--border-glow);
}

.stat-number {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-mystic);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -0.5rem;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

/* Maps Grid */
.maps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.map-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

.map-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.map-card-header {
    position: relative;
    background: var(--bg-elevated);
    padding: 2rem;
    text-align: center;
}

.map-thumbnail {
    font-size: 3rem;
    position: relative;
    display: inline-block;
}

.biome-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    font-size: 1.2rem;
}

.shared-badge,
.public-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shared-badge {
    background: var(--accent-frost);
    color: white;
}

.public-badge {
    background: var(--accent-jade);
    color: var(--bg-deep);
}

.map-card-body {
    padding: 1rem;
}

.map-name {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
}

.map-owner {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

.map-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.map-stat {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.map-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.map-card-footer {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

.map-btn {
    flex: 1;
    padding: 0.5rem;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    text-align: center;
    text-decoration: none;
}

.map-btn:hover {
    border-color: var(--accent-mystic);
    color: var(--text-primary);
}

.map-btn.primary {
    background: var(--accent-mystic);
    border-color: var(--accent-mystic);
    color: white;
}

.map-btn.primary:hover {
    background: #9370db;
}

.map-btn.danger {
    flex: 0;
    padding: 0.5rem 0.75rem;
    color: var(--accent-ember);
    border-color: var(--accent-ember);
}

.map-btn.danger:hover {
    background: var(--accent-ember);
    color: white;
}

/* Empty State */
.empty-state-large {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-subtle);
    border-radius: 8px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state-large h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin: 0 0 0.5rem;
}

.empty-state-large p {
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
}

/* Share Modal Styles */
.share-map-name {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.share-section {
    margin-bottom: 1.5rem;
}

.share-section h4 {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--accent-gold);
    margin: 0 0 0.75rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.toggle-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.share-user-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-user-form .form-input {
    flex: 2;
    min-width: 150px;
}

.share-user-form .form-select {
    flex: 1;
    min-width: 100px;
}

.current-shares {
    background: var(--bg-elevated);
    border-radius: 4px;
    padding: 1rem;
}

.no-shares {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    margin: 0;
}

.shares-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.share-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.share-item:last-child {
    border-bottom: none;
}

.share-user {
    flex: 1;
    color: var(--text-primary);
}

.share-permission {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.remove-share-btn {
    background: none;
    border: none;
    color: var(--accent-ember);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.remove-share-btn:hover {
    opacity: 1;
}

.warning-text {
    color: var(--accent-ember);
    font-size: 0.9rem;
}

/* =====================
   RESPONSIVE
   ===================== */

@media (max-width: 768px) {
    .hexgrinder-account-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .account-right {
        width: 100%;
        justify-content: flex-start;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .maps-grid {
        grid-template-columns: 1fr;
    }
    
    .map-card-footer {
        flex-wrap: wrap;
    }
    
    .share-user-form {
        flex-direction: column;
    }
}
