@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&display=swap');
@import url('./community-theme.css');
@import url('./echoes-brand.css');

:root {
    --lol-bg: #005064;
    --lol-ink: #f1e9c8;
    --lol-muted: #ddd6b6;
    --lol-gold: #c9a23f;
    --lol-gold-soft: rgba(218, 198, 129, 0.25);
    --lol-gold-bright: rgba(255, 230, 160, 0.5);
    --lol-panel: rgba(15, 18, 28, 0.75);
    --lol-panel-deep: rgba(8, 15, 30, 0.65);
    --lol-card: rgba(20, 20, 30, 0.5);
    --lol-border: rgba(192, 192, 192, 0.6);
    --lol-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
    --lol-inset-shadow: inset 0 0 40px rgba(255, 255, 255, 0.05);
}

body {
    margin: 0;
    font-family: "Cinzel", serif;
    background: var(--lol-bg);
    color: var(--lol-ink);
    overflow-x: hidden;
}

.chat-bg,
.player-card-container {
    background: var(--lol-panel);
    box-shadow: var(--lol-shadow), var(--lol-inset-shadow);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(192, 192, 192, 0.34) rgba(192, 192, 192, 0.08);
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(192, 192, 192, 0.08);
}

*::-webkit-scrollbar-thumb {
    background: rgba(192, 192, 192, 0.34);
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(220, 230, 235, 0.5);
    background-clip: content-box;
}

.chat-msg,
.stat {
    background: var(--lol-card);
    border: 1px solid var(--lol-gold-soft);
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
}

.scheda-frame-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: auto;
}

.scheda-frame-shell {
    position: fixed;
    left: 50%;
    top: 52%;
    width: min(1480px, calc(100vw - 56px));
    height: min(860px, calc(100vh - 72px));
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(218, 198, 129, 0.42);
    border-radius: 10px;
    background: rgba(5, 10, 16, 0.96);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.68);
}

.scheda-frame-shell.is-dragging {
    cursor: grabbing;
}

.scheda-frame-handle {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 8px 0 14px;
    border-bottom: 1px solid rgba(218, 198, 129, 0.22);
    background: rgba(7, 20, 27, 0.92);
    color: #f1e9c8;
    cursor: grab;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    user-select: none;
}

.scheda-frame-shell.is-dragging .scheda-frame-handle {
    cursor: grabbing;
}

.scheda-frame-shell.is-dragging .scheda-frame {
    pointer-events: none;
}

.scheda-frame-close {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(218, 198, 129, 0.26);
    border-radius: 5px;
    background: rgba(12, 16, 24, 0.86);
    color: #f1e9c8;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.scheda-frame-close:hover {
    border-color: rgba(255, 230, 160, 0.62);
    color: #fffbe8;
}

.scheda-frame {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: 0;
    background: transparent;
}

.stat:hover,
.slot:hover {
    background: rgba(35, 35, 50, 0.6);
    border-color: var(--lol-gold-bright);
    box-shadow: 0 0 8px rgba(255, 230, 160, 0.2);
}

/* ---------------- HEADER ---------------- */
.site-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    min-height: 68px;
    padding: 10px 18px;
    background:
        linear-gradient(90deg, rgba(201, 162, 63, 0.1), transparent 42%, rgba(97, 218, 251, 0.07)),
        rgba(5, 15, 22, 0.78);
    border-bottom: 1px solid rgba(218, 198, 129, 0.28);
    box-shadow: 0 10px 28px rgba(0,0,0,0.38);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    z-index: 20;
}

.header-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    color: #fff7d8;
    text-decoration: none;
}

.header-brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(218, 198, 129, 0.36);
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(241, 210, 122, 0.18), transparent 60%),
        rgba(7, 20, 28, 0.86);
    color: #f1d27a;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.header-brand-text {
    color: #fff7d8;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.mobile-brand {
    display: none;
    color: #f4e7b3;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-decoration: none;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(201, 162, 63, 0.55);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 34px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid rgba(201, 162, 63, 0.75);
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(18, 34, 42, 0.92), rgba(6, 14, 20, 0.92));
    box-shadow: inset 0 0 8px rgba(255, 230, 160, 0.08), 0 0 10px rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 19px;
    height: 2px;
    background: linear-gradient(90deg, #f6e6ad, #b78932);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.site-header.is-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-header.is-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}

.site-header.is-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-left {
    flex: 1 1 auto;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.nav-right {
    gap: 10px;
}

.nav-left a, .nav-right a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 5px;
    color: rgba(224, 214, 181, 0.86);
    text-decoration: none;
    font-weight: bold;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    position: relative;
    transition: color 0.25s, border-color 0.25s, background 0.25s, text-shadow 0.25s;
}

/* Striscia dorata animata */
.nav-left a::after, .nav-right a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 4px;
    width: 0%;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,220,120,0.8), rgba(255,230,180,0.5));
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-left a:hover, .nav-right a:hover {
    border-color: rgba(218, 198, 129, 0.22);
    background: rgba(7, 20, 28, 0.62);
    color: #fff7d8;
    text-shadow: 0 0 6px #c9a23f;
}

.nav-left a:hover::after, .nav-right a:hover::after {
    width: 100%;
}

/* Wrapper numeri in colonna */
.resource-column {
    display: flex;
    gap: 6px;
    position: relative;
}

/* Singola risorsa */
.resource {
    min-width: 62px;
    display: grid;
    gap: 1px;
    padding: 5px 9px;
    font-size: 11px;
    background: rgba(2, 12, 19, 0.68);
    border: 1px solid rgba(218, 198, 129, 0.22);
    border-radius: 5px;
    text-align: center;
}

.resource span {
    color: rgba(220, 230, 235, 0.58);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.resource strong {
    color: #f1d27a;
    font-size: 12px;
}

/* Striscia verticale a sinistra dei numeri */
.resources-left-border {
    display: none;
}

/* ---------------- PROFILO ---------------- */
.profile {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 0;
    padding: 5px 9px 5px 5px;
    border: 1px solid rgba(218, 198, 129, 0.18);
    border-radius: 999px;
    background: rgba(2, 12, 19, 0.54);
    cursor: pointer;
    transition: transform 0.25s ease;
}

.profile img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    margin-right: 0;
    border: 2px solid rgba(218,198,129,0.5);
    background: rgba(8, 15, 30, 0.65);
    box-shadow: 0 0 12px rgba(0,0,0,0.7);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.profile:hover img {
    border-color: rgba(255,230,160,0.75);
    box-shadow: 0 0 14px rgba(255,230,160,0.22), 0 0 12px rgba(0,0,0,0.7);
    transform: scale(1.06);
}
/* Wrapper nome + status */
.profile-info {
    display: flex;
    flex-direction: column;
}

/* Nome personaggio */
.profile-name {
    font-weight: bold;
    font-size: 12px;
    color: #eef3f5;
    text-shadow: none;
    transition: text-shadow 0.3s ease, color 0.3s ease;
}

/* Hover sul nome */
.profile:hover .profile-name {
    color: #f0f0f0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5), 0 -2px 4px rgba(255,255,255,0.4);
}

/* Status online */
.profile-status {
    display: flex;
    align-items: center;
    margin-top: 2px;
}

.nav-right .profile-link::after,
.nav-right .profile-link:hover::after {
    content: none;
    display: none;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00ff00;
    margin-right: 6px;
    box-shadow: inset -2px -2px 4px #00ff00aa, inset 2px 2px 4px #00880055,
                0 0 6px #00ff00bb;
    animation: pulse 1.5s infinite ease-in-out;
}

.status-text {
    font-size: 10px;
    color: #7fff7f;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.header-icon-link {
    width: 34px;
    padding: 0;
    font-size: 14px;
}

.logout-link {
    border-color: rgba(223, 93, 93, 0.28) !important;
    color: #ffb8b8 !important;
}

.logout-link:hover {
    border-color: rgba(223, 93, 93, 0.54) !important;
    background: rgba(80, 24, 24, 0.5) !important;
    color: #ffd0d0 !important;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}

/* ---------------- MAPPA ---------------- */
.map-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 45%, rgba(0, 80, 100, 0.18), transparent 42%),
        #02070b;
}

.map {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 1600 / 1200;
    cursor: grab;
    transform-origin: top left;
    will-change: transform;
}

.map::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('../../IMG/map.png');
    background-size: cover;
    background-position: top left;
    filter: contrast(1.2) brightness(1.05) saturate(1.2);
    pointer-events: none;
}

.map.dragging {
    cursor: grabbing;
}

/* Hotspots */
.map svg.hotspots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

.map svg.hotspots circle {
    pointer-events: all;
    cursor: pointer;
}

.map svg.hotspots path {
    fill: rgba(255, 255, 255, 0.015);
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1.2;
    transition: fill 180ms ease, stroke 180ms ease, filter 180ms ease;
    pointer-events: all;
    cursor: pointer;
}

.map svg.hotspots path:hover,
.map svg.hotspots path.hover {
    fill: rgba(255, 230, 150, 0.18);
    stroke: rgba(255, 220, 120, 0.95);
    filter: drop-shadow(0 0 6px #c9a23f);
}

.map svg.hotspots path.active {
    fill: rgba(255, 220, 120, 0.25);
    stroke: rgba(255, 200, 50, 1);
    filter: drop-shadow(0 0 8px #c9a23f);
}

.map svg.hotspots path.draft-area {
    fill: rgba(97, 218, 251, 0.14);
    stroke: rgba(97, 218, 251, 0.9);
    stroke-dasharray: 8 6;
    pointer-events: all;
    cursor: copy;
}

.map svg.hotspots path.draft-area.is-selected {
    fill: rgba(255, 230, 160, 0.16);
    stroke: rgba(255, 230, 160, 0.95);
    filter: drop-shadow(0 0 8px rgba(255, 230, 160, 0.48));
}

.map svg.hotspots path.draft-segment {
    fill: none;
    stroke: rgba(255, 245, 198, 0.98);
    stroke-width: 3;
    stroke-linecap: round;
    pointer-events: none;
    filter: drop-shadow(0 0 7px rgba(255, 230, 160, 0.68));
}

.map svg.hotspots circle.draft-point {
    fill: #bcefff;
    stroke: rgba(1, 8, 14, 0.9);
    stroke-width: 1.6;
    pointer-events: all;
    cursor: grab;
    filter: drop-shadow(0 0 5px rgba(97, 218, 251, 0.74));
}

.map svg.hotspots circle.draft-point:hover {
    fill: #fff7d8;
    stroke: rgba(255, 230, 160, 0.95);
    cursor: grabbing;
}

.map svg.hotspots circle.draft-point.is-selected {
    fill: #f1d27a;
    stroke: rgba(255, 255, 255, 0.92);
    filter: drop-shadow(0 0 8px rgba(255, 230, 160, 0.9));
}

.map-markers {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
}

.map-marker {
    position: absolute;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transform: translate(-50%, -50%);
    border: 0;
    background: transparent;
    color: #fff7d8;
    cursor: pointer;
    pointer-events: auto;
    font-family: "Cinzel", serif;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.map-marker span {
    width: 18px;
    height: 18px;
    display: inline-block;
    border: 2px solid rgba(255, 230, 160, 0.92);
    border-radius: 50%;
    background: rgba(1, 8, 14, 0.86);
    box-shadow: 0 0 0 5px rgba(201, 162, 63, 0.16), 0 0 16px rgba(255, 230, 160, 0.48);
}

.map-marker strong {
    opacity: 0;
    transform: translateX(-4px);
    color: #fff7d8;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: opacity 160ms ease, transform 160ms ease;
    white-space: nowrap;
}

.map-marker:hover strong,
.map-marker.hover strong,
.map-marker.active strong {
    opacity: 1;
    transform: translateX(0);
}

.map-marker.hover span,
.map-marker.active span {
    background: #f1d27a;
    box-shadow: 0 0 0 7px rgba(201, 162, 63, 0.22), 0 0 24px rgba(255, 230, 160, 0.76);
}

.map-container.is-editing .map-marker {
    cursor: grab;
}

.map-container.is-editing .map-marker:hover span,
.map-marker.is-draft-marker span {
    background: #bcefff;
    border-color: rgba(188, 239, 255, 0.95);
    box-shadow: 0 0 0 6px rgba(97, 218, 251, 0.18), 0 0 18px rgba(97, 218, 251, 0.66);
}

.map-chat-marker {
    position: absolute;
    z-index: 8;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transform: translate(-50%, -50%);
    color: rgba(255, 247, 216, 0.92);
    font-family: "Cinzel", serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: uppercase;
    pointer-events: auto;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.86);
}

.map-chat-marker span {
    width: 9px;
    height: 9px;
    border: 1px solid rgba(241, 210, 122, 0.58);
    border-radius: 50%;
    background: rgba(4, 13, 20, 0.88);
    box-shadow: 0 0 8px rgba(241, 210, 122, 0.18);
}

.map-chat-marker strong {
    max-width: 108px;
    padding: 3px 6px;
    overflow: hidden;
    border: 1px solid rgba(218, 198, 129, 0.16);
    border-radius: 4px;
    background: rgba(1, 8, 14, 0.78);
    opacity: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-chat-marker:hover {
    color: #fff7d8;
}

.map-chat-marker:hover span {
    border-color: rgba(255, 230, 160, 0.9);
    box-shadow: 0 0 12px rgba(241, 210, 122, 0.36);
}

/* Map controls */
.map-controls {
    position: absolute;
    top: 86px;
    right: 14px;
    display: grid;
    gap: 7px;
    z-index: 18;
}

.map-controls button {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: rgba(7, 20, 28, 0.78);
    color: #fff7d8;
    border: 1px solid rgba(218, 198, 129, 0.36);
    padding: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 800;
}

.map-controls .map-editor-toggle {
    width: auto;
    min-width: 132px;
    padding: 0 12px;
    justify-content: center;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.map-controls button:hover,
.map-controls button.is-active {
    background: rgba(60,60,60,0.85);
    transform: scale(1.1);
}

.map-region-panel,
.map-editor-panel {
    position: absolute;
    z-index: 18;
    width: min(340px, calc(100vw - 28px));
    border: 1px solid rgba(218, 198, 129, 0.3);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 30%),
        rgba(5, 14, 22, 0.9);
    box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.58), 0 18px 38px rgba(0, 0, 0, 0.42);
    color: #eef3f5;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.map-region-panel {
    position: fixed;
    top: 96px;
    right: 18px;
    left: auto;
    bottom: auto;
    z-index: 35;
    width: min(380px, calc(100vw - 36px));
    max-height: calc(100vh - 122px);
    overflow-y: auto;
    padding: 18px;
    opacity: 0;
    transform: translateX(18px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.map-region-panel.is-open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.map-region-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(135deg, rgba(255, 230, 160, 0.14), transparent 34%),
        radial-gradient(circle at 88% 12%, rgba(97, 218, 251, 0.14), transparent 28%);
    pointer-events: none;
}

.map-region-panel > * {
    position: relative;
    z-index: 1;
}

.map-panel-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(218, 198, 129, 0.24);
    border-radius: 5px;
    background: rgba(1, 8, 14, 0.72);
    color: #fff7d8;
    cursor: pointer;
    font-size: 18px;
}

.map-panel-kicker {
    margin: 0 0 6px;
    color: rgba(220, 230, 235, 0.7);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.map-region-panel h2,
.map-editor-panel h2 {
    margin: 0 34px 8px 0;
    color: #fff7d8;
    font-size: 20px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.map-region-panel h2 {
    font-size: 24px;
}

.map-region-panel p,
.map-editor-help {
    color: rgba(238, 243, 245, 0.76);
    font-size: 12px;
    line-height: 1.6;
}

.map-chat-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.map-chat-list a {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid rgba(218, 198, 129, 0.18);
    border-radius: 5px;
    background:
        linear-gradient(90deg, rgba(201, 162, 63, 0.12), transparent),
        rgba(2, 12, 19, 0.76);
    color: #fff7d8;
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.map-chat-list a:hover {
    border-color: rgba(255, 230, 160, 0.52);
    background:
        linear-gradient(90deg, rgba(201, 162, 63, 0.22), rgba(97, 218, 251, 0.08)),
        rgba(4, 16, 24, 0.88);
    transform: translateX(3px);
}

.map-chat-index {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(218, 198, 129, 0.32);
    border-radius: 50%;
    color: #f1d27a;
    font-size: 10px;
    font-weight: 800;
}

.map-chat-name {
    min-width: 0;
    overflow: hidden;
    color: #fff7d8;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.map-chat-list small {
    color: rgba(220, 230, 235, 0.58);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.map-chat-list p {
    grid-column: 2 / -1;
    margin: -2px 0 0;
    color: rgba(238, 243, 245, 0.62);
    font-size: 11px;
    line-height: 1.45;
}

.map-editor-panel {
    top: 86px;
    left: 14px;
    display: none;
    gap: 10px;
    padding: 14px;
}

.map-editor-panel.is-open {
    display: grid;
}

.map-editor-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.map-editor-head span {
    padding: 5px 8px;
    border: 1px solid rgba(97, 218, 251, 0.3);
    border-radius: 999px;
    color: #bcefff;
    font-size: 10px;
    font-weight: 800;
}

.map-editor-panel label {
    display: grid;
    gap: 5px;
    color: rgba(220, 230, 235, 0.65);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.map-editor-panel input,
.map-editor-panel select {
    min-height: 34px;
    border: 1px solid rgba(192, 192, 192, 0.16);
    border-radius: 5px;
    outline: 0;
    padding: 0 9px;
    background: rgba(1, 8, 14, 0.82);
    color: #eef3f5;
    font-family: "Segoe UI", sans-serif;
}

.map-editor-panel select option {
    background: #061018;
    color: #eef3f5;
}

.map-editor-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.map-editor-actions button {
    min-height: 34px;
    border: 1px solid rgba(218, 198, 129, 0.24);
    border-radius: 5px;
    background: rgba(7, 20, 28, 0.72);
    color: #fff7d8;
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.map-container.is-editing .map {
    cursor: crosshair;
}

/* ---------------- SIDEBAR ---------------- */
.sidebar {
    position: fixed;
    top: 50%;
    right: 0.1px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    z-index: 10;
    background: rgba(8, 15, 30, 0.65);
    

    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    border-left: 1px solid rgba(192,192,192,0.6);
    

    box-shadow: -4px 0 12px rgba(0,0,0,0.6); /* ombra solo a sinistra */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    padding: 10px;
    transition: right 0.4s ease;
}
.sidebar button {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(192,192,192,0.6);
    background: rgba(8, 15, 30, 0.65);
    color: #fff;
    cursor: pointer;
    border-radius: 6px;
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    box-shadow: -4px 0 12px rgba(0,0,0,0.6);
    transition: background 0.3s, transform 0.3s;
}
.sidebar button:hover {
    background: rgba(8, 15, 30, 0.85);
    transform: scale(1.1);
}
.sidebar.shifted {
    right: 380px;
}

#effects-panel {
    position: fixed;
    top: 120px;
    left: 14px;
    width: 280px;
    padding: 16px;
    background: rgba(7, 18, 28, 0.94);
    border: 1px solid rgba(255, 230, 160, 0.12);
    border-radius: 22px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    color: #f4e3ba;
    z-index: 12;
}

.effects-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff5c1;
}

.effects-count {
    background: rgba(255, 230, 140, 0.18);
    color: #fff8d9;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.effects-list {
    display: grid;
    gap: 10px;
}

.effect-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 230, 160, 0.1);
    background: rgba(18, 24, 38, 0.96);
}

.effect-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 230, 140, 0.16);
}

.effect-data strong {
    display: block;
    font-size: 13px;
    color: #f7eabf;
}

.effect-data small {
    display: block;
    color: rgba(247, 225, 179, 0.78);
    font-size: 11px;
}

.effect-item.negative .effect-icon {
    background: rgba(255, 120, 110, 0.18);
}

.effect-item.positive .effect-icon {
    background: rgba(102, 196, 131, 0.18);
}

@media (max-width: 1200px) {
    #effects-panel {
        display: none;
    }
}

/* ---------------- PANNELLO MESSAGGI ---------------- */
#messages-panel {
    position: fixed;
    top: 68px;
    right: 0;
    width: 340px;
    height: calc(100vh - 68px);
    background: rgba(7, 20, 27);
    border-left: 1px solid rgba(192, 192, 192, 0.5);
    box-shadow: -4px 0 12px rgba(0,0,0,0.7);
    backdrop-filter: blur(10px) saturate(140%);
    padding: 20px;
    color: #e0d6b5;
    transform: translateX(100%);
    transition: transform 0.4s ease;
    overflow: visible;
    z-index: 25;
}

#messages-panel.open {
    transform: translateX(0);
}
#messages-panel .message-conversations{max-height:calc(100vh - 210px);overflow-y:auto}
#messages-panel .message-thread{position:absolute;inset:auto;right:calc(100% + 14px);bottom:16px;width:360px;height:min(520px,calc(100vh - 100px));display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(192,192,192,.4);border-radius:12px;background:#07141b;box-shadow:0 18px 45px #000b;z-index:30}
#messages-panel .message-thread[hidden]{display:none}
.sidebar button{position:relative}.message-badge{position:absolute;top:-5px;right:-5px;display:grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border-radius:10px;background:#b83c45;color:#fff;font:700 10px/1 sans-serif}.messages-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.messages-head small{color:#82979a;font-size:9px;text-transform:uppercase;letter-spacing:.12em}.messages-head h3{margin:4px 0;color:#f1e7c9}.messages-head button,.message-thread>header button{border:0;background:transparent;color:#aab8b8;font-size:24px;cursor:pointer}.messages-search{position:relative}.messages-search>input{width:100%;padding:11px;border:1px solid rgba(150,175,177,.22);border-radius:7px;background:#0c1a22;color:#e2e9e5}.messages-search>[data-player-results]{position:absolute;z-index:2;top:45px;left:0;right:0;background:#10212a;border-radius:7px;box-shadow:0 12px 25px #0008}.messages-search>[data-player-results] button,.message-conversation{display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:10px;width:100%;padding:10px;border:0;border-bottom:1px solid rgba(150,175,177,.1);background:transparent;color:#dce4df;text-align:left;cursor:pointer}.messages-search img,.message-conversation img,.message-thread>header img{width:36px;height:36px;border-radius:50%;object-fit:cover}.message-conversations{margin-top:16px}.message-conversation:hover{background:#122730}.message-conversation span{display:grid;min-width:0}.message-conversation small{overflow:hidden;color:#809497;text-overflow:ellipsis;white-space:nowrap}.message-conversation time{color:#657b7e;font-size:9px}.message-conversation i{grid-column:3;display:grid;place-items:center;min-width:18px;height:18px;border-radius:9px;background:#b9983d;color:#09131a;font-size:10px}.messages-empty{padding:30px 10px;color:#73898c;text-align:center;font-size:12px}.message-thread{position:absolute;inset:65px 12px 12px;display:flex;flex-direction:column;background:#07141b}.message-thread[hidden]{display:none}.message-thread>header{display:grid;grid-template-columns:30px 38px 1fr;align-items:center;gap:8px;padding:10px;border-bottom:1px solid rgba(150,175,177,.15)}.message-thread>header div{display:grid}.message-thread>header small{color:#71878a;font-size:9px}.message-log{flex:1;display:flex;flex-direction:column;gap:8px;overflow-y:auto;padding:15px}.private-bubble{align-self:flex-start;max-width:86%;padding:9px 11px;border-radius:4px 12px 12px;background:#142832}.private-bubble.is-mine{align-self:flex-end;background:#50431f}.private-bubble p{margin:0;color:#e1e7e2;font:12px/1.5 Segoe UI,sans-serif}.private-bubble span{display:block;margin-top:4px;color:#829194;font-size:8px;text-align:right}.message-thread form{display:grid;grid-template-columns:1fr auto;gap:7px;padding:10px;border-top:1px solid rgba(150,175,177,.15)}.message-thread textarea{resize:none;padding:9px;border:1px solid #29424b;border-radius:6px;background:#0c1b23;color:#e1e7e2}.message-thread form button{padding:0 13px;border:1px solid #b49339;border-radius:6px;background:#806622;color:#fff;cursor:pointer}

/* ---------------- MEDIA QUERIES RESPONSIVE ---------------- */
@media (max-width: 1200px) {
    .site-header {
        position: fixed;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        min-height: 58px;
        padding: 10px 14px;
        background:
            linear-gradient(90deg, rgba(201, 162, 63, 0.1), transparent 48%),
            rgba(7, 20, 27, 0.76);
    }

    .site-header.is-open {
        max-height: 100vh;
        overflow-y: auto;
        background: rgba(7, 20, 27, 0.72);
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55), inset 0 -1px 0 rgba(201, 162, 63, 0.28);
    }

    .mobile-brand {
        display: block;
        grid-column: 1;
        justify-self: start;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-brand {
        display: none;
    }

    .site-header.is-open .mobile-brand {
        visibility: hidden;
    }

    .nav-toggle {
        display: flex;
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        margin: 0;
    }

    .nav-left,
    .nav-right {
        display: none;
        grid-column: 1 / -1;
        flex: 0 0 100%;
        width: 100%;
        max-width: none;
        margin-left: auto;
        margin-right: auto;
    }

    .site-header.is-open .nav-left,
    .site-header.is-open .nav-right {
        display: flex;
    }

    .nav-left {
        position: relative;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-top: 18px;
        padding: 18px 0 12px;
        border-top: 1px solid rgba(201, 162, 63, 0.55);
    }

    .nav-left::before {
        content: "";
        position: absolute;
        top: -2px;
        left: 50%;
        width: min(220px, 70%);
        height: 1px;
        transform: translateX(-50%);
        background: linear-gradient(90deg, transparent, rgba(255, 230, 160, 0.9), transparent);
    }

    .nav-right {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 0 0 8px;
    }

    .nav-left a,
    .nav-right > a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 42px;
        margin: 0;
        padding: 10px 14px;
        color: #f0e6c4;
        border: 1px solid rgba(201, 162, 63, 0.28);
        border-radius: 4px;
        background:
            linear-gradient(90deg, rgba(201, 162, 63, 0.12), rgba(255, 230, 160, 0.03), rgba(201, 162, 63, 0.12)),
            rgba(8, 15, 30, 0.72);
        box-shadow: inset 0 0 10px rgba(255, 230, 160, 0.04), 0 6px 14px rgba(0, 0, 0, 0.22);
        font-size: 13px;
        letter-spacing: 1.4px;
        text-transform: uppercase;
    }

    .nav-left a:hover,
    .nav-right > a:hover {
        color: #fff3b0;
        border-color: rgba(255, 230, 160, 0.58);
        background:
            linear-gradient(90deg, rgba(201, 162, 63, 0.22), rgba(255, 230, 160, 0.07), rgba(201, 162, 63, 0.22)),
            rgba(8, 15, 30, 0.9);
    }

    .nav-left a::after,
    .nav-right > a::after {
        display: none;
    }

    .resources-wrapper {
        display: flex;
        justify-content: center;
        padding: 12px;
        border: 1px solid rgba(192, 192, 192, 0.18);
        border-radius: 6px;
        background: rgba(4, 10, 16, 0.38);
    }

    .resources-left-border {
        display: none;
    }

    .resource-column {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .resource { padding: 6px; font-size: 12px; }
    .nav-right > a.profile-link {
        justify-content: center;
        border-color: rgba(192, 192, 192, 0.24);
        background: rgba(4, 10, 16, 0.38);
        border-radius: 4px;
    }

    .profile {
        justify-content: center;
        width: 100%;
        margin-right: 0;
        border: 0;
        background: transparent;
    }

    .profile img {
        width: 36px;
        height: 36px;
    }

    .sidebar.shifted { right: 300px; }
    #messages-panel { width: 280px; padding: 70px 15px 15px; }
}

@media (max-width: 960px) {
    .mobile-brand {
        display: block;
        max-width: 140px;
        font-size: 11px;
        letter-spacing: 1px;
    }

    .nav-left,
    .nav-right {
        max-width: none;
    }

    .nav-left a,
    .nav-right a {
        font-size: 11px;
    }

    .profile img {
        width: 32px;
        height: 32px;
    }

    .map-controls button { padding: 6px 10px; }
}

@media (max-width: 600px) {
    .resources-wrapper { flex-wrap: wrap; }
    .map-controls button { padding: 5px 8px; }
    .sidebar { padding: 8px; }
    .map-region-panel {
        top: auto;
        right: 10px;
        bottom: 12px;
        left: 10px;
        width: auto;
        max-height: 44vh;
        transform: translateY(18px);
    }

    .map-region-panel.is-open {
        transform: translateY(0);
    }
}

@media (max-width: 400px) {
    .map-controls { top: 5px; right: 5px; }
    .sidebar.shifted { right: 260px; }
    #messages-panel { width: 220px; padding: 60px 10px 10px; }
    .resources-left-border { right: 220px; }
}

/* ---------------- MODALE SCHEDA RESPONSIVE ---------------- */
@media (max-width: 1100px) {
    .scheda-frame-shell {
        left: 16px;
        right: 16px;
        top: 78px;
        width: auto;
        height: calc(100vh - 96px);
        transform: none;
    }
}

@media (max-width: 720px) {
    .scheda-frame-shell {
        left: 8px;
        right: 8px;
        top: 68px;
        height: calc(100vh - 78px);
        border-radius: 8px;
    }

    .scheda-frame-handle {
        min-height: 38px;
        padding-left: 10px;
        font-size: 10px;
        letter-spacing: 0.08em;
    }

    .scheda-frame-close {
        width: 30px;
        height: 30px;
    }
}
