:root {
    color-scheme: dark;
    font-family: "Segoe UI", Roboto, sans-serif;
    --accent-color: #66b2ff;
    --accent-accent: #1c488a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background: radial-gradient(circle at top left, #1a2533, #070b12 60%);
    color: #e6edf3;
    /* Medieval sword cursor as default - larger and more detailed */
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><defs><linearGradient id="blade" x1="0%25" y1="0%25" x2="100%25" y2="0%25"><stop offset="0%25" style="stop-color:%23c0c0c0"/><stop offset="50%25" style="stop-color:%23f0f0f0"/><stop offset="100%25" style="stop-color:%23c0c0c0"/></linearGradient></defs><g><path d="M24 2 L26 22 L22 22 Z" fill="url(%23blade)" stroke="%23333" stroke-width="1.5"/><path d="M23 22 L25 22 L25 35 L23 35 Z" fill="url(%23blade)" stroke="%23333" stroke-width="1.5"/><rect x="20" y="35" width="8" height="4" rx="1" fill="%23ffd700" stroke="%23b8860b" stroke-width="1.5"/><ellipse cx="24" cy="40" rx="3.5" ry="2" fill="%23ffd700" stroke="%23b8860b" stroke-width="1.5"/><circle cx="24" cy="42" r="2.5" fill="%23c0c0c0" stroke="%23333" stroke-width="1.5"/><circle cx="24" cy="3" r="1.5" fill="%23ff0000" stroke="%238b0000" stroke-width="1"/></g></svg>') 4 4, auto;
}

/* ===== TITLE SCREEN ===== */
#title-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    animation: fadeIn 0.5s ease-in;
    overflow: hidden;
}

#title-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(26, 37, 51, 0.7), rgba(7, 11, 18, 0.9) 70%),
                url('assets/title.png') center center / cover no-repeat;
    filter: blur(0px);
    z-index: 1;
}

#title-screen.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

#title-content {
    position: relative;
    z-index: 2;
    text-align: center;
    animation: slideUp 0.8s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#title-logo {
    max-width: 600px;
    width: 80%;
    height: auto;
    filter: drop-shadow(0 0 30px rgba(102, 178, 255, 0.5));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
        filter: drop-shadow(0 0 30px rgba(102, 178, 255, 0.5));
    }
    50% {
        transform: translateY(-10px);
        filter: drop-shadow(0 0 40px rgba(102, 178, 255, 0.7));
    }
}

#title-subtitle {
    font-size: 1.2rem;
    margin: 0;
    color: #94a9c9;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.title-button {
    font-size: 1.5rem;
    padding: 1rem 3rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-accent) 100%);
    color: white;
    border: 2px solid rgba(102, 178, 255, 0.6);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(102, 178, 255, 0.4);
}

.title-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 178, 255, 0.6);
    background: linear-gradient(135deg, #7fc4ff 0%, var(--accent-color) 100%);
}

.title-button:active {
    transform: translateY(-1px);
}

/* ===== LOBBY SCREEN ===== */
#lobby-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, #1a2533, #070b12 70%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lobby-screen.fade-in {
    animation: fadeIn 0.5s ease-in;
}

#lobby-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 640px) {
    #title-logo {
        max-width: 400px;
        width: 90%;
    }

    #title-subtitle {
        font-size: 1rem;
    }

    .title-button {
        font-size: 1.2rem;
        padding: 0.8rem 2rem;
    }
}

main#game-layout {
    width: 100%;
    /* Remove max-width so the app can use full window width */
    /* max-width: 1600px; */
    height: 100vh; /* Fill full viewport height */
    padding: 28px 34px 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

#board-container { 
    position: relative; 
    min-height: 0; /* allow shrink to fit viewport */
    width: 100%;
    background: #050b12; /* Fallback si canvas ne charge pas */
}

#pixi-container {
    width: 100%;
    min-height: 0; /* allow shrink to fit viewport */
    display: block;
    position: relative;
    z-index: 1;
}

#pixi-container canvas {
    display: block !important;
    position: relative !important;
    z-index: 1 !important;
}
#modal-root {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 9999;
}

/* ===== HUD 10x2 UNIFORM GRID LAYOUT ===== */
#hud {
    background: rgba(12, 18, 25, 0.88);
    border: 1px solid color-mix(in srgb, var(--accent-color) 45%, transparent);
    border-radius: 20px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    grid-template-rows: repeat(2, 110px);
    gap: 8px 10px;
    align-items: stretch;
    max-width: 1500px;
    margin: 0 auto;
    backdrop-filter: blur(16px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 0 1px rgba(8, 13, 20, 0.6), 0 18px 42px rgba(8, 13, 20, 0.35);
    width: 100%;
}

/* Branding - 2x1 (cols 1-2, row 1) */
#branding {
    grid-column: 1 / span 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}

#branding h1 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.1;
}

#branding p {
    margin: 0;
    font-size: 0.7rem;
    color: #94a9c9;
    line-height: 1.2;
}

.info-card {
    background: rgba(19, 33, 52, 0.68);
    border: 1px solid color-mix(in srgb, var(--accent-color) 35%, transparent);
    border-radius: 8px;
    padding: 6px 10px;
    display: grid;
    gap: 4px;
    font-size: 0.8rem;
    flex-shrink: 0;
    min-width: 0;
    overflow: hidden;
}

.info-card span:not(.resource-icon) {
    display: block;
    color: #7fa0cc;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.info-card strong {
    font-size: 0.95rem;
}

/* Briefing - 2x1 (cols 1-2, row 2) */
#action-brief {
    grid-column: 1 / span 2;
    grid-row: 2;
    grid-template-rows: min-content 1fr;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
    height: 110px; /* Hauteur fixe pour éviter le reflow */
}

#action-brief strong {
    color: var(--accent-color);
    font-size: 0.8rem;
    flex-shrink: 0;
}

#action-brief p {
    margin: 0;
    font-size: 0.75rem;
    color: #c5d7f1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    flex: 1; /* Prend l'espace disponible */
    min-height: 0; /* Permet le shrink */
}

#action-usage {
    font-size: 0.75rem;
    color: #7fa0cc;
}

/* Turn panel - 1x1 (col 3, row 2) */
#turn-panel {
    grid-column: 3;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(16, 28, 44, 0.85);
    border-radius: 14px;
    padding: 6px 8px;
    border: 1px solid rgba(102, 178, 255, 0.25);
}

#turn-panel div {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 0.75rem;
}

#turn-panel span {
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    color: #7fa0cc;
}

#turn-panel strong {
    font-size: 0.85rem;
    color: #f2f6ff;
}

/* Player 1 Resources - 2x1 (cols 4-5, row 2) */
#blue-resources {
    grid-column: 4 / span 2;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px 6px;
    background: rgba(16, 28, 44, 0.85);
    border-radius: 14px;
    padding: 6px 8px;
    border: 1px solid rgba(102, 178, 255, 0.25);
    transition: opacity 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    width: 100%; /* Largeur fixe */
    min-width: 0; /* Évite l'expansion */
}

/* Player 2 Resources - 2x1 (cols 6-7, row 2) */
#red-resources {
    grid-column: 6 / span 2;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px 6px;
    background: rgba(16, 28, 44, 0.85);
    border-radius: 14px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 107, 107, 0.25);
    transition: opacity 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    width: 100%; /* Largeur fixe */
    min-width: 0; /* Évite l'expansion */
}

#resource-panel {
    display: contents;
}

.player-resources .player-name {
    grid-column: 1 / -1;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    text-align: center;
}

#blue-resources .player-name {
    color: #66b2ff;
}

#red-resources .player-name {
    color: #ff8787;
}

.player-resources .resource-line {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    font-size: 0.9rem;
}

.resource-icon {
    width: 24px;
    height: 24px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.resource-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.icon-gold,
.icon-crystal,
.icon-food,
.icon-materials {
    display: inline-block;
    vertical-align: middle;
}

#blue-resources strong,
#red-resources strong {
    font-size: 1rem;
    font-weight: 700;
}

/* Actions - Build, Train, Move each 2x1 */
#actions {
    display: contents;
}

#primary-actions {
    display: contents;
}

/* Build button - 2x1 (cols 3-4, row 1) */
#primary-actions .action-button:nth-child(1) {
    grid-column: 3 / span 2;
    grid-row: 1;
}

/* Train button - 2x1 (cols 5-6, row 1) */
#primary-actions .action-button:nth-child(2) {
    grid-column: 5 / span 2;
    grid-row: 1;
}

/* Move button - 2x1 (cols 7-8, row 1) */
#primary-actions .action-button:nth-child(3) {
    grid-column: 7 / span 2;
    grid-row: 1;
}
.action-button {
    border: 1px solid color-mix(in srgb, var(--accent-color) 25%, transparent);
    border-radius: 14px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(28, 72, 138, 0.4), rgba(15, 27, 44, 0.9));
    color: #e6edf3;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.action-button strong {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.action-button span {
    font-size: 0.78rem;
    color: #c5d7f1;
    letter-spacing: 0.02em;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.action-button:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-color) 65%, #21334d), #16253a);
    box-shadow: 0 10px 24px rgba(39, 116, 193, 0.32);
    border-color: color-mix(in srgb, var(--accent-color) 55%, transparent);
}

.action-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

[data-action="build"].action-button {
    background: linear-gradient(135deg, #16243a, #1f3050);
}

[data-action="train"].action-button {
    background: linear-gradient(135deg, #1b2238, #283a5f);
}

[data-action="move"].action-button {
    background: linear-gradient(135deg, #1a1f33, #2a3654);
}

[data-action="build"].action-button,
[data-action="train"].action-button,
[data-action="move"].action-button {
    border-color: rgba(102, 178, 255, 0.25);
}

/* End Turn Button - restored to original position */
.end-turn {
    grid-column: 8;
    grid-row: 2;
    border-radius: 999px;
    padding: 8px 12px;
    border: 1px solid color-mix(in srgb, var(--accent-color) 55%, transparent);
    background: color-mix(in srgb, var(--accent-color) 45%, #0c1a2a);
    color: inherit;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    font-size: 0.8rem;
    transition: transform 0.18s ease, background 0.2s ease;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
}

.end-turn:hover {
    background: color-mix(in srgb, var(--accent-color) 65%, #0c1a2a);
}

.end-turn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Log header with menu button */
#log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

#log-header h2 {
    margin: 0;
}

.menu-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 12px;
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.menu-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

/* ===== CANVAS DONUT - 2x2 (cols 9-10, rows 1-2) ===== */
#harvest-actions { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    grid-column: 9 / span 2; 
    grid-row: 1 / span 2;
    padding: 5px;
}

#harvest-donut-wrapper {
    position: relative;
    width: 100%;
    max-width: 250px;
    aspect-ratio: 1;
}

#harvest-donut-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#donut-center {
    position: absolute; 
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center; 
    pointer-events: none;
    font-weight: 900; 
    font-size: 1.2rem; 
    gap: 4px; 
    color: #d7ecff;
    text-shadow: 0 2px 4px rgba(0,0,0,.8);
}

.crystal-icon { 
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); 
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.crystal-icon svg {
    width: 100%;
    height: 100%;
}

/* Action Options - Row 3, Full Width */
#action-options {
    grid-column: 1 / span 10;
    grid-row: 3;
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(16, 26, 40, 0.85);
    border-radius: 12px;
    border: 1px solid rgba(102, 178, 255, 0.15);
}

#action-options[data-visible="true"] {
    display: flex;
}

#action-options .option-label {
    width: 100%;
    font-size: 0.9rem;
    color: #a9bedb;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}

/* Option buttons theme-matched */
.option-button {
    border: 1px solid color-mix(in srgb, var(--accent-color) 30%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-accent) 40%, #0f1b2c), #0f1b2c);
    color: inherit;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
    transition: transform 0.18s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.option-button strong {
    font-size: 0.98rem;
}

.option-button:hover {
    border-color: color-mix(in srgb, var(--accent-color) 55%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-color) 55%, #16263a), #16263a);
    box-shadow: 0 10px 22px rgba(39, 116, 193, 0.18);
}

.option-button.selected {
    border-color: color-mix(in srgb, var(--accent-color) 70%, white 10%);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-color) 30%, transparent);
}

.option-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.option-button .cost-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.option-button .cost-chip {
    margin-top: 0;
}

.resource-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
}

@keyframes goldGlow {
    0%, 100% { 
        box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 rgba(255, 215, 0, 0);
    }
    50% { 
        box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 12px rgba(255, 215, 0, 0.4);
    }
}

@keyframes crystalShimmer {
    0%, 100% { 
        box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 rgba(135, 206, 235, 0);
    }
    50% { 
        box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 12px rgba(135, 206, 235, 0.5);
    }
}

@keyframes resourcePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.resource-icon.gold:hover {
    animation: goldGlow 1.5s ease-in-out infinite;
}

.resource-icon.crystal:hover {
    animation: crystalShimmer 1.5s ease-in-out infinite;
}

.resource-icon.updated {
    animation: resourcePulse 0.6s ease-in-out;
}

.resource-line {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    padding: 4px 0;
    transition: all 0.2s ease;
}

.resource-line:hover {
    opacity: 0.95;
}

.resource-line strong {
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: color 0.2s ease;
}

.resource-line:hover strong {
    color: var(--accent-color);
}

.cost-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.cost-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 32, 0.6);
    border: 1px solid rgba(120, 150, 185, 0.35);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.cost-chip svg {
    vertical-align: middle;
    margin-right: 2px;
}

.cost-chip.gold {
    color: #ffd700;
}

.cost-chip.crystal {
    color: #87ceeb;
}

.cost-chip.food {
    color: #90ee90;
}

.cost-chip.materials {
    color: #d7ccc8;
}

.cost-note {
    font-size: 0.78rem;
    color: #9eb7d7;
}

.action-button .action-cost {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
}

.action-button .action-cost .cost-chip {
    margin-top: 0;
}

.player-resources.active-player {
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 8px;
    background: rgba(58, 141, 255, 0.05);
    box-shadow: 0 0 8px rgba(58, 141, 255, 0.2);
    animation: activePlayerPulse 2s ease-in-out infinite;
}

@keyframes activePlayerPulse {
    0%, 100% { 
        box-shadow: 0 0 8px rgba(58, 141, 255, 0.2);
    }
    50% { 
        box-shadow: 0 0 12px rgba(58, 141, 255, 0.4);
    }
}

/* Modal styles... (keeping existing modal CSS) */
.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.6) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    pointer-events: auto !important;
    width: 100vw !important;
    height: 100vh !important;
}

#exploration-popup {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: linear-gradient(135deg, #1a2332 0%, #2d3748 100%) !important;
    border: 3px solid #3a8dff !important;
    border-radius: 16px !important;
    padding: 25px !important;
    text-align: center !important;
    color: white !important;
    font-size: 16px !important;
    font-weight: bold !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8) !important;
    z-index: 10002 !important;
    min-width: 480px !important;
    max-width: 600px !important;
    width: auto !important;
    height: auto !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    pointer-events: auto !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-sizing: border-box !important;
}

#exploration-popup h3 {
    margin: 0 0 15px 0 !important;
    color: #3a8dff !important;
    font-size: 24px !important;
}

#dice-container {
    margin: 15px 0 !important;
}

#dice-container div {
    margin-bottom: 10px !important;
}

#d100-display, #second-dice-display, .d100-display-popup, .second-dice-display-popup {
    font-size: 36px !important;
    font-weight: bold !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #87ceeb !important;
}

#second-dice-display, .second-dice-display-popup {
    color: #ffd700 !important;
}

.dice-container-popup {
    margin: 20px 0 !important;
}

.dice-container-popup div {
    margin-bottom: 15px !important;
}

.result-display-popup {
    margin-top: 20px !important;
}

#result-display {
    margin-top: 20px !important;
}

#exploration-popup .result-icon {
    font-size: 32px !important;
    margin-bottom: 15px !important;
}

#exploration-popup .result-message {
    font-size: 20px !important;
    margin-bottom: 10px !important;
}

#exploration-popup .result-rewards {
    font-size: 24px !important;
    font-weight: bold !important;
}

#exploration-popup.popup-entering {
    transform: translate(-50%, -50%) scale(0.8) !important;
    opacity: 0 !important;
    animation: popupEnter 0.3s ease-out forwards !important;
}

@keyframes popupEnter {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

#exploration-popup.popup-exiting {
    animation: popupExit 0.3s ease-in forwards !important;
}

@keyframes popupExit {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

.modal-panel {
    min-width: 480px !important;
    max-width: 600px !important;
    width: auto !important;
    height: auto !important;
    max-height: 85vh !important;
    background: #8fb3d9 !important;
    color: #0b121b !important;
    border: 2px solid #1250a6 !important;
    border-radius: 12px !important;
    padding: 20px !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8) !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    z-index: 10001 !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}

.modal-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1250a6;
}

.modal-title {
    font-weight: 700 !important;
    color: #1250a6 !important;
    font-size: 18px !important;
}

.modal-close {
    border: 2px solid #1250a6 !important;
    background: #3a8dff !important;
    color: #ffd54a !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    transition: all 0.2s ease !important;
}

.modal-close:hover {
    background: #1250a6 !important;
    transform: scale(1.1) !important;
}

.unit-chip-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
    max-height: 280px;
    overflow: auto;
}

#unit-select-modal .unit-chip {
    text-align: left !important;
    width: 100% !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    border: 2px solid rgba(120, 150, 185, 0.35) !important;
    background: #000 !important;
    color: #9aa7b8 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

#unit-select-modal .unit-chip:hover {
    border-color: #3a8dff !important;
    box-shadow: 0 2px 8px rgba(58, 141, 255, 0.3) !important;
}

#unit-select-modal .unit-chip .unit-text { 
    display: flex !important; 
    gap: 8px !important; 
    align-items: baseline !important; 
    flex: 1 !important;
}

#unit-select-modal .unit-chip .unit-name { 
    font-weight: 700 !important; 
    font-size: 16px !important;
}

#unit-select-modal .unit-chip .unit-meta { 
    font-size: 0.85rem !important; 
    color: inherit !important; 
}

#unit-select-modal .unit-chip .unit-check { 
    margin-left: auto !important; 
    opacity: 0.8 !important;
    font-size: 16px !important;
}

#unit-select-modal .unit-chip.selected {
    background: #3a8dff !important;
    border-color: #1250a6 !important;
    color: #ffd54a !important;
    box-shadow: 0 4px 12px rgba(58, 141, 255, 0.4) !important;
}

#unit-select-modal .unit-chip.selected .unit-name,
#unit-select-modal .unit-chip.selected .unit-meta { 
    color: #ffd54a !important; 
}

#unit-select-modal .unit-chip.deselected {
    background: #000 !important;
    color: #9aa7b8 !important;
    border-style: dashed !important;
    opacity: 0.6 !important;
}

.modal-controls {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: flex-end;
}

.modal-controls .option-button {
    background: #3a8dff !important;
    color: #ffd54a !important;
    border: 2px solid #1250a6 !important;
    font-weight: 700 !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.modal-controls .option-button:hover {
    background: #1250a6 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.modal-controls .option-button.primary {
    background: #28a745 !important;
    border-color: #1e7e34 !important;
    color: white !important;
}

#combat-modal .units-container {
  display: flex !important;
  gap: 20px !important;
  margin: 20px 0 !important;
  flex: 1 !important;
  min-height: 0 !important;
}

#combat-modal .unit-list {
  flex: 1 !important;
  background: rgba(0, 0, 0, 0.3) !important;
  border-radius: 8px !important;
  padding: 10px !important;
  max-height: 300px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  border: 1px solid rgba(58, 141, 255, 0.3) !important;
}

#combat-modal .unit-list::-webkit-scrollbar {
  width: 8px !important;
}

#combat-modal .unit-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2) !important;
  border-radius: 4px !important;
}

#combat-modal .unit-list::-webkit-scrollbar-thumb {
  background: rgba(58, 141, 255, 0.6) !important;
  border-radius: 4px !important;
}

#combat-modal .unit-list::-webkit-scrollbar-thumb:hover {
  background: rgba(58, 141, 255, 0.8) !important;
}

#combat-modal .combat-button {
  margin-top: auto !important;
  flex-shrink: 0 !important;
}

/* ===== MOBILE & RESPONSIVE OPTIMIZATIONS ===== */
@media (max-width: 1024px) {
  body {
    overflow-x: hidden;
  }

  main#game-layout {
    padding: 12px;
    gap: 12px;
  }

  /* HUD mobile: passer en layout vertical scrollable */
  #hud {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 8px;
    padding: 8px;
    max-height: none;
    overflow-y: auto;
  }

  #branding,
  #turn-panel,
  #resource-panel,
  #action-brief,
  #actions,
  #harvest-actions,
  #action-options,
  #end-turn {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  #resource-panel {
    display: flex;
    flex-direction: row;
    gap: 12px;
  }

  .player-resources {
    flex: 1;
  }

  #actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .action-button {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 100px;
    padding: 8px;
    font-size: 0.85rem;
  }

  #harvest-donut-wrapper {
    max-width: 200px;
    margin: 0 auto;
  }

  #harvest-donut-canvas {
    width: 200px !important;
    height: 200px !important;
  }

  /* Board mobile: responsive */
  #board-wrapper {
    flex-direction: column;
  }

  #board-container {
    max-width: 100%;
    overflow-x: auto;
    min-height: 400px;
  }

  #pixi-container {
    width: 100%;
    min-height: 400px;
  }

  #pixi-container canvas {
    max-width: 100%;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
  }

  #log-panel {
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
  }

  /* Modals mobile */
  .modal-panel {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    overflow-y: auto;
  }

  #combat-modal {
    width: 95vw !important;
    max-width: 95vw !important;
    flex-direction: column !important;
  }

  #combat-modal .combat-sides {
    flex-direction: column !important;
    gap: 12px !important;
  }

  #combat-modal .combat-side {
    flex: 1 !important;
    max-height: none !important;
  }
}

/* Petits écrans (smartphones en portrait) */
@media (max-width: 640px) {
  main#game-layout {
    padding: 8px;
    gap: 8px;
  }

  #hud {
    padding: 6px;
    gap: 6px;
  }

  .info-card {
    padding: 6px 8px;
    font-size: 0.75rem;
  }

  .action-button {
    padding: 6px;
    font-size: 0.8rem;
  }

  #branding h1 {
    font-size: 1rem;
  }

  #branding p {
    font-size: 0.65rem;
  }

  #helper-text {
    font-size: 0.8rem;
    padding: 8px;
  }

  /* Rendre les boutons des modals plus grands pour le tactile */
  button {
    min-height: 44px;
    touch-action: manipulation;
  }

  .modal-panel button {
    padding: 12px 16px;
    font-size: 1rem;
  }
}

/* Orientation paysage sur mobile */
@media (max-width: 1024px) and (orientation: landscape) {
  #board-wrapper {
    flex-direction: row;
  }

  #board-container {
    flex: 1;
  }

  #log-panel {
    width: 250px;
    max-height: none;
  }
}

/* Support des gestes tactiles */
@media (hover: none) and (pointer: coarse) {
  /* Augmenter les zones tactiles */
  .action-button,
  button,
  .modal-panel button {
    min-height: 48px;
    padding: 12px 16px;
  }

  /* Désactiver les effets hover sur tactile */
  .action-button:hover,
  button:hover {
    transform: none;
  }

  /* Effet de feedback tactile */
  .action-button:active,
  button:active {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

/* ===== RESPONSIVE LAYOUT SYSTEM ===== */

/* Board rotation for portrait mode */
#board-container.rotated-90 {
  transform-origin: center center;
  transition: transform 0.3s ease;
}

/* History panel hidden state */
#board-wrapper.history-hidden #log-panel {
  display: none !important;
}

/* Compact HUD for smaller screens */
#hud.hud-compact {
  grid-template-rows: repeat(2, 90px);
  padding: 8px;
  gap: 6px;
}

#hud.hud-compact .action-button {
  padding: 8px;
  font-size: 0.85rem;
}

#hud.hud-compact .info-card {
  padding: 4px 6px;
  font-size: 0.75rem;
}

/* Layout modes */
main#game-layout.layout-compact {
  padding: 12px;
  gap: 12px;
}

main#game-layout.layout-portrait-rotated {
  padding: 8px;
  gap: 8px;
  flex-direction: row;
  align-items: center;
}

/* Very wide landscape: 3 columns (HUD | Board | History) */
main#game-layout.layout-landscape-3col {
  padding: 16px;
  gap: 12px;
  flex-direction: row;
  align-items: stretch;
}

main#game-layout.layout-landscape-3col #hud {
  flex: 0 0 240px;
  max-width: 260px;
  display: flex !important; /* Force flex instead of grid */
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

/* Force all HUD children to stack vertically */
main#game-layout.layout-landscape-3col #hud > * {
  width: 100%;
  grid-column: unset !important;
  grid-row: unset !important;
}

/* In 3-column layout, stack action buttons vertically */
main#game-layout.layout-landscape-3col #actions {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
}

main#game-layout.layout-landscape-3col #primary-actions {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
}

/* Reset grid positioning for action buttons in 3-column layout */
main#game-layout.layout-landscape-3col #primary-actions .action-button {
  grid-column: unset !important;
  grid-row: unset !important;
  width: 100%;
}

main#game-layout.layout-landscape-3col #board-wrapper {
  flex: 1;
  min-width: 0;
}

main#game-layout.layout-landscape-3col #log-panel {
  flex: 0 0 320px;
  width: 320px;
  max-width: 360px;
}

/* Left column: HUD (compact fixed width) */
main#game-layout.layout-portrait-rotated #hud {
  flex: 0 0 240px;
  max-width: 260px;
}

main#game-layout.layout-portrait-rotated #hud {
  writing-mode: horizontal-tb;
  max-width: 100%;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
}

main#game-layout.layout-portrait-rotated #board-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Right column: history/info (narrow fixed width) */
main#game-layout.layout-portrait-rotated #log-panel {
  flex: 0 0 260px;
  width: 260px;
  max-width: 320px;
}

/* History toggle button (appears when history can be hidden) */
#history-toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 140px; /* leave space for global menu */
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 16px;
  border: 2px solid rgba(59, 130, 246, 0.6);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  z-index: 1000;
  display: none; /* Hidden by default, shown by JS when needed */
}

#history-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.6);
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

#history-toggle-btn.visible {
  display: block;
}

/* Persistent global menu button */
#global-menu-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 16px;
  border: 2px solid rgba(100, 116, 139, 0.6);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.4);
  z-index: 1000;
  display: none; /* Hidden by default, shown by JS */
}

#global-menu-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(100, 116, 139, 0.6);
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

#global-menu-btn.visible {
  display: block;
}

/* Overlay prompting landscape/fullscreen on mobile portrait */
#landscape-prompt {
  position: fixed;
  inset: 0;
  background: rgba(5, 11, 18, 0.92);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  z-index: 2000;
}

#landscape-prompt.visible {
  display: flex;
}

#landscape-prompt .prompt-box {
  max-width: 520px;
  width: 100%;
  background: #0b1622;
  border: 1px solid #1f2a37;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}

#landscape-prompt h3 { margin: 0 0 8px 0; }
#landscape-prompt p { margin: 0 0 14px 0; color: rgba(255,255,255,0.85); }

#landscape-prompt .actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

#landscape-prompt button {
  padding: 10px 14px;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
}

#landscape-prompt .primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
}

#landscape-prompt .secondary {
  background: #1f2a37;
  color: #fff;
}

/* Log panel h2 styling */
#log-panel h2 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  color: var(--accent-color);
}

#board-wrapper {
  display: flex;
  gap: 16px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

/* Board area contains helper text + board container */
#board-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

/* Helper text positioned above the grid */
#helper-text {
  padding: 12px 16px;
  background: rgba(58, 141, 255, 0.1);
  border-left: 4px solid var(--accent-color);
  font-size: 0.9rem;
  color: #c5d7f1;
  line-height: 1.5;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Board container takes remaining space */
#board-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
  background: #050b12;
  border-radius: 8px;
}

#pixi-container {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
}

/* Log panel optimized for grid height */
#log-panel {
  background: rgba(12, 18, 25, 0.85);
  border: 1px solid rgba(102, 178, 255, 0.25);
  border-radius: 12px;
  padding: 12px;
  width: 320px;
  min-width: 280px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#log-header {
  flex-shrink: 0;
}

#log {
  flex: 1;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #c5d7f1;
}

/* ===== CUSTOM CURSORS ===== */

/* Cursor for buttons and interactive elements - detailed gauntlet hand */
button, a, .clickable {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><defs><linearGradient id="blade" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:%23e0e0e0"/><stop offset="50%25" style="stop-color:%23ffffff"/><stop offset="100%25" style="stop-color:%23b0b0b0"/></linearGradient><linearGradient id="hilt" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:%23d4af37"/><stop offset="50%25" style="stop-color:%23ffd700"/><stop offset="100%25" style="stop-color:%23b8860b"/></linearGradient></defs><g transform="rotate(-45 24 24)"><path d="M20 8 L28 8 L28 32 L26 34 L22 34 L20 32 Z" fill="url(%23blade)" stroke="%23666" stroke-width="1.5"/><path d="M23 30 L25 30 L25 10 L23 10 Z" fill="%23fff" opacity="0.4"/><rect x="19" y="32" width="10" height="4" rx="1" fill="url(%23hilt)" stroke="%23b8860b" stroke-width="1"/><rect x="17" y="36" width="14" height="3" rx="1.5" fill="url(%23hilt)" stroke="%23b8860b" stroke-width="1"/><circle cx="24" cy="37.5" r="1" fill="%23fff" opacity="0.6"/></g><circle cx="6" cy="6" r="3" fill="%23ff0000" stroke="%23fff" stroke-width="1.5"/></svg>') 6 6, pointer !important;
}

/* Movement cursor - detailed footsteps with arrow pointer */
.cursor-move {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><defs><linearGradient id="footGrad" x1="0%25" y1="0%25" x2="0%25" y2="100%25"><stop offset="0%25" style="stop-color:%2366b2ff"/><stop offset="100%25" style="stop-color:%234a90e2"/></linearGradient></defs><g><ellipse cx="22" cy="28" rx="8" ry="11" transform="rotate(-25 22 28)" fill="url(%23footGrad)" stroke="%23333" stroke-width="2"/><circle cx="18" cy="22" r="3" fill="url(%23footGrad)" stroke="%23333" stroke-width="1.5"/><circle cx="22" cy="20" r="3" fill="url(%23footGrad)" stroke="%23333" stroke-width="1.5"/><circle cx="26" cy="21" r="3" fill="url(%23footGrad)" stroke="%23333" stroke-width="1.5"/><ellipse cx="42" cy="44" rx="8" ry="11" transform="rotate(25 42 44)" fill="url(%23footGrad)" stroke="%23333" stroke-width="2"/><circle cx="38" cy="38" r="3" fill="url(%23footGrad)" stroke="%23333" stroke-width="1.5"/><circle cx="42" cy="36" r="3" fill="url(%23footGrad)" stroke="%23333" stroke-width="1.5"/><circle cx="46" cy="37" r="3" fill="url(%23footGrad)" stroke="%23333" stroke-width="1.5"/><path d="M8 4 L14 10 L11 10 L11 16 L5 16 L5 10 L2 10 Z" fill="%23ffed4e" stroke="%23333" stroke-width="2"/></g></svg>') 8 4, move;
}

/* Crosshair for targeting/selecting */
.cursor-crosshair {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><g><circle cx="32" cy="32" r="20" fill="none" stroke="%23ff6b6b" stroke-width="3" opacity="0.4"/><circle cx="32" cy="32" r="14" fill="none" stroke="%23ff6b6b" stroke-width="2" opacity="0.6"/><line x1="32" y1="4" x2="32" y2="20" stroke="%23ff6b6b" stroke-width="3"/><line x1="32" y1="44" x2="32" y2="60" stroke="%23ff6b6b" stroke-width="3"/><line x1="4" y1="32" x2="20" y2="32" stroke="%23ff6b6b" stroke-width="3"/><line x1="44" y1="32" x2="60" y2="32" stroke="%23ff6b6b" stroke-width="3"/><circle cx="32" cy="32" r="5" fill="%23ff6b6b" stroke="%238b0000" stroke-width="2"/><circle cx="32" cy="32" r="2" fill="%23fff"/></g></svg>') 32 32, crosshair;
}

/* Modal backdrop and content should also use sword cursor */
.modal-backdrop, .modal-backdrop * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><defs><linearGradient id="blade2" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:%23e0e0e0"/><stop offset="50%25" style="stop-color:%23ffffff"/><stop offset="100%25" style="stop-color:%23b0b0b0"/></linearGradient><linearGradient id="hilt2" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:%23d4af37"/><stop offset="50%25" style="stop-color:%23ffd700"/><stop offset="100%25" style="stop-color:%23b8860b"/></linearGradient></defs><g transform="rotate(-45 24 24)"><path d="M20 8 L28 8 L28 32 L26 34 L22 34 L20 32 Z" fill="url(%23blade2)" stroke="%23666" stroke-width="1.5"/><path d="M23 30 L25 30 L25 10 L23 10 Z" fill="%23fff" opacity="0.4"/><rect x="19" y="32" width="10" height="4" rx="1" fill="url(%23hilt2)" stroke="%23b8860b" stroke-width="1"/><rect x="17" y="36" width="14" height="3" rx="1.5" fill="url(%23hilt2)" stroke="%23b8860b" stroke-width="1"/><circle cx="24" cy="37.5" r="1" fill="%23fff" opacity="0.6"/></g><circle cx="6" cy="6" r="3" fill="%23ff0000" stroke="%23fff" stroke-width="1.5"/></svg>') 6 6, auto;
}

/* Specifically for modal buttons, keep the sword cursor */
.modal-backdrop button {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><defs><linearGradient id="blade3" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:%23e0e0e0"/><stop offset="50%25" style="stop-color:%23ffffff"/><stop offset="100%25" style="stop-color:%23b0b0b0"/></linearGradient><linearGradient id="hilt3" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:%23d4af37"/><stop offset="50%25" style="stop-color:%23ffd700"/><stop offset="100%25" style="stop-color:%23b8860b"/></linearGradient></defs><g transform="rotate(-45 24 24)"><path d="M20 8 L28 8 L28 32 L26 34 L22 34 L20 32 Z" fill="url(%23blade3)" stroke="%23666" stroke-width="1.5"/><path d="M23 30 L25 30 L25 10 L23 10 Z" fill="%23fff" opacity="0.4"/><rect x="19" y="32" width="10" height="4" rx="1" fill="url(%23hilt3)" stroke="%23b8860b" stroke-width="1"/><rect x="17" y="36" width="14" height="3" rx="1.5" fill="url(%23hilt3)" stroke="%23b8860b" stroke-width="1"/><circle cx="24" cy="37.5" r="1" fill="%23fff" opacity="0.6"/></g><circle cx="6" cy="6" r="3" fill="%23ff0000" stroke="%23fff" stroke-width="1.5"/></svg>') 6 6, pointer !important;
}