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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: 'Luckiest Guy', cursive;
}

/* --- FUNDO ANIMADO --- */
#bg-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 1;
}

.bg-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: fill;
}

@keyframes floatMonsters {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-40px); }
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(30px); }
}

.anim-monsters { animation: floatMonsters 6s ease-in-out infinite; }
.anim-logo { animation: floatLogo 6s ease-in-out infinite; }

/* --- TELA DE INÍCIO --- */
#start-screen {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
}

#btn-start {
    font-size: 32px;
    color: #fff;
    cursor: pointer;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 3px 3px 0px #32CD32;
    letter-spacing: 3px;
    animation: pulse 2s infinite ease-in-out;
}

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

/* --- VÍDEO E SKIP --- */
#intro-video {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    object-fit: cover;
    z-index: 50;
    display: none;
}

#skip-hint {
    position: fixed;
    bottom: 30px; right: 30px;
    z-index: 60;
    color: #fff;
    background: rgba(0,0,0,0.6);
    padding: 10px 20px;
    border-radius: 30px;
}

#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: radial-gradient(circle at center, rgba(9, 23, 18, 0.92) 0%, rgba(0, 0, 0, 0.97) 70%);
    color: #d6ffe3;
    text-align: center;
}

.loading-title {
    font-size: 46px;
    letter-spacing: 2px;
    text-shadow: 0 0 24px rgba(50, 205, 50, 0.5);
}

.loading-subtitle {
    font-size: 18px;
    opacity: 0.85;
}

/* --- LOGIN / REGISTRO (LOGOTIPO CORRIGIDO) --- */
#auth-modal {
    position: absolute;
    width: 100%; height: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-box {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    border: 2px solid #32CD32;
    border-radius: 20px;
    padding: 30px;
    width: 340px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#login-logo {
    width: 150px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 5px #32CD32);
}

.glass-box input {
    width: 100%;
    padding: 12px;
    margin: 6px 0;
    border: 1px solid rgba(50, 205, 50, 0.5);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    outline: none;
}

.auth-row {
    display: flex;
    width: 100%;
    gap: 10px;
    margin-top: 15px;
}

.login-disclaimer {
    margin-top: 14px;
    font-size: 11px;
    color: #cfe9d1;
    line-height: 1.4;
    text-align: center;
    opacity: 0.85;
}

/* --- BOTÕES PADRÃO VERDE LIMÃO --- */
.btn-main {
    flex: 1;
    padding: 12px;
    background: #32CD32 !important;
    color: #fff;
    border: none;
    border-bottom: 4px solid #28a428;
    border-radius: 8px;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
    font-size: 16px;
}

.btn-main:hover {
    background: #3fff3f !important;
    transform: translateY(-2px);
}

.btn-sub {
    flex: 1;
    padding: 12px;
    background: #3498db !important;
    color: #fff;
    border: none;
    border-bottom: 4px solid #2980b9;
    border-radius: 8px;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.title-lime { color: #32CD32; margin-bottom: 15px; }

/* --- TELA DE SELEÇÃO DE PERSONAGEM --- */
#char-selection-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: url('/assets/Interface/fundo1.png') no-repeat center center;
    background-size: cover;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-title {
    font-size: 50px;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 
        0 1px 0 #28a428, 0 2px 0 #28a428, 0 3px 0 #218c21,
        0 4px 0 #1a6e1a, 0 5px 0 #135213, 0 6px 1px rgba(0,0,0,.1),
        0 0 20px rgba(50, 205, 50, 0.6);
    margin-bottom: 60px;
    animation: floatLogo 4s infinite ease-in-out;
}

#char-slots-container {
    display: flex;
    gap: 60px;
    align-items: flex-end;
}

.char-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 200px;
    height: 350px;
    justify-content: flex-end;
}

.char-name-tag {
    font-size: 22px;
    color: #fff;
    text-shadow: 2px 2px 0px #000, 0 0 10px #32CD32;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 15;
}

/* PEDESTAIS 3D (TOP-DOWN) */
.platform-3d {
    position: relative;
    width: 200px;
    height: 100px;
    perspective: 1000px;
}

.platform-top {
    position: absolute;
    width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(50,205,50,0.5) 0%, rgba(0,0,0,0.8) 90%);
    border: 3px solid #32CD32;
    border-radius: 50%;
    transform: rotateX(60deg);
    z-index: 2;
    box-shadow: 0 0 25px rgba(50, 205, 50, 0.4);
}

.platform-base {
    position: absolute;
    width: 100%; height: 100%;
    background: #1a5c1a;
    border-radius: 50%;
    transform: rotateX(60deg) translateZ(-15px);
    z-index: 1;
    border-bottom: 4px solid #0d3d0d;
}

.add-char-btn {
    position: absolute;
    width: 150px;
    height: 250px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #32CD32;
    font-size: 60px;
    transition: transform 0.2s;
}

.add-char-btn:hover {
    transform: scale(1.05);
}

.add-char-btn:hover ~ .char-preview {
    filter: brightness(1.2) drop-shadow(0 0 15px #32CD32);
}

/* --- NOTIFICAÇÕES (TOASTS) --- */
#game-notifications {
    position: fixed;
    top: 80px; right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#digipix-hud {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(88vw, 1200px);
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 215, 0, 0.9);
    border-radius: 8px;
    color: #FFD700;
    font-family: "Luckiest Guy", sans-serif;
    z-index: 1800;
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.digipix-icon {
    font-size: 18px;
}

.digipix-label {
    font-size: 12px;
    letter-spacing: 1px;
    color: #ffe28a;
}

.digipix-value {
    font-size: 16px;
}

.diamonds-value {
    font-size: 16px;
    color: #8fd8ff;
}

.npc-coins-value {
    font-size: 16px;
    color: #ffd58a;
}

.dg-coins-value {
    font-size: 16px;
    color: #b9ff8f;
}

.pvp-coins-value {
    font-size: 16px;
    color: #ffb3b3;
}

.digipix-sep {
    color: rgba(255, 255, 255, 0.45);
}

#player-coords-hud {
    position: fixed;
    top: 128px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(50, 205, 50, 0.9);
    border-radius: 8px;
    color: #EFFFF0;
    font-family: "Luckiest Guy", sans-serif;
    font-size: 12px;
    letter-spacing: 0.6px;
    z-index: 1800;
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
    text-transform: uppercase;
}

#vip-status-banner {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1400;
    min-width: 250px;
    padding: 8px 12px;
    border-radius: 14px;
    border: 2px solid rgba(80, 165, 255, 0.9);
    background: linear-gradient(90deg, rgba(8, 16, 42, 0.92), rgba(18, 34, 78, 0.92));
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45), 0 0 18px rgba(80, 165, 255, 0.28);
    color: #dce9ff;
    display: flex;
    align-items: center;
    gap: 10px;
}

#vip-status-banner.hidden {
    display: none;
}

.vip-status-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(123, 196, 255, 0.8);
    background: radial-gradient(circle at 30% 30%, #a6d8ff 0%, #3d84ff 70%);
    color: #ffffff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.vip-status-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vip-status-title {
    font-size: 13px;
    color: #9fd0ff;
    letter-spacing: 1px;
}

.vip-status-timer {
    font-size: 15px;
    color: #ffffff;
    letter-spacing: 0.5px;
}

#vip-status-banner.vip-status-inactive {
    border-color: rgba(120, 120, 120, 0.7);
    background: linear-gradient(90deg, rgba(24, 24, 24, 0.92), rgba(38, 38, 38, 0.92));
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

#npc-dialog {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%);
    min-width: 280px;
    max-width: 520px;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(50, 205, 50, 0.9);
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6);
    z-index: 1900;
    color: #EFFFF0;
    text-align: left;
    font-family: "Luckiest Guy", sans-serif;
    letter-spacing: 0.4px;
}

.npc-dialog-name {
    font-size: 14px;
    color: #7CFF8A;
    margin-bottom: 6px;
    text-shadow: 1px 1px 0 #000;
}

.npc-dialog-text {
    font-size: 16px;
    line-height: 1.3;
    color: #FFFFFF;
    text-shadow: 1px 1px 0 #000;
    word-wrap: break-word;
}

#npc-creator,
#npc-panel {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2500;
}

.monster-scale-box {
    width: min(520px, 92vw);
    background: rgba(10, 12, 16, 0.95);
    border: 2px solid rgba(0, 229, 255, 0.7);
    border-radius: 12px;
    box-shadow: 0 16px 30px rgba(0,0,0,0.6);
    color: #EFFFF0;
    font-family: "Luckiest Guy", sans-serif;
}

.monster-scale-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.3);
}

.monster-scale-title {
    font-size: 18px;
    letter-spacing: 0.6px;
}

.monster-scale-close {
    background: transparent;
    border: none;
    color: #EFFFF0;
    font-size: 18px;
    cursor: pointer;
}

.monster-scale-body {
    padding: 16px;
}

#monster-scale-panel {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2600;
}

.npc-creator-panel,
.npc-panel-box {
    width: min(520px, 92vw);
    background: rgba(10, 12, 16, 0.95);
    border: 2px solid rgba(50, 205, 50, 0.8);
    border-radius: 12px;
    box-shadow: 0 16px 30px rgba(0,0,0,0.6);
    color: #EFFFF0;
    font-family: "Luckiest Guy", sans-serif;
}

.npc-creator-header,
.npc-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(50, 205, 50, 0.3);
}

.npc-creator-title,
.npc-panel-title {
    font-size: 18px;
    letter-spacing: 0.6px;
}

.npc-creator-close,
.npc-panel-close {
    background: transparent;
    border: none;
    color: #EFFFF0;
    font-size: 18px;
    cursor: pointer;
}

.npc-creator-body,
.npc-panel-body {
    padding: 16px;
}

.npc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 14px;
}

.npc-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.npc-teleport-options {
    padding: 10px;
    border: 1px solid rgba(50, 205, 50, 0.3);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
}

#npc-battle-options {
    max-height: 52vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
}

.npc-field input,
.npc-field select,
.npc-field textarea {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(50, 205, 50, 0.5);
    background: rgba(0, 0, 0, 0.6);
    color: #EFFFF0;
    font-family: "Luckiest Guy", sans-serif;
    font-size: 14px;
}

.npc-creator-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

.npc-panel-body .npc-section-title {
    font-size: 15px;
    margin-bottom: 8px;
    color: #7CFF8A;
}

.npc-shop-list,
.npc-hospital-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.npc-shop-item,
.npc-hospital-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(50, 205, 50, 0.3);
}

.npc-shop-item .item-meta,
.npc-hospital-item .item-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #eaf5ff;
}

.npc-shop-item .item-meta strong,
.npc-hospital-item .item-meta strong {
    color: #ffffff;
    text-shadow: none;
}

.npc-shop-item .item-meta span,
.npc-hospital-item .item-meta span {
    color: #d4e5ff;
    text-shadow: none;
}

.npc-shop-item button,
.npc-hospital-item button {
    background: #32CD32;
    border: none;
    color: #0b140f;
    font-family: "Luckiest Guy", sans-serif;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.npc-shop-item .npc-shop-qty {
    width: 68px;
    min-width: 68px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(124, 255, 138, 0.4);
    background: rgba(10, 23, 15, 0.9);
    color: #eaf5ff;
    font-family: "Luckiest Guy", sans-serif;
    font-size: 12px;
    text-align: center;
}

.npc-shop-item button:disabled,
.npc-hospital-item button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.title-hover-tooltip {
    position: fixed;
    z-index: 6000;
    max-width: 360px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(124, 255, 138, 0.5);
    background: rgba(5, 16, 11, 0.95);
    color: #d8ffe0;
    font-size: 12px;
    line-height: 1.35;
    font-family: "Luckiest Guy", sans-serif;
    pointer-events: none;
    white-space: pre-line;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.passive-hover-tooltip {
    position: fixed;
    z-index: 6000;
    max-width: 360px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.5);
    background: rgba(8, 14, 24, 0.95);
    color: #dff7ff;
    font-size: 12px;
    line-height: 1.35;
    font-family: "Luckiest Guy", sans-serif;
    pointer-events: none;
    white-space: pre-line;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.monster-skill-hover-tooltip {
    border-color: rgba(255, 92, 92, 0.6);
    background: rgba(28, 8, 8, 0.96);
    color: #ffe9e9;
}

.battle-entity-status-tooltip {
    border-color: rgba(255, 145, 77, 0.6);
    background: rgba(32, 10, 10, 0.96);
    color: #ffeede;
}

.digimon-hover-tooltip {
    border-color: rgba(124, 255, 138, 0.55);
    background: rgba(8, 20, 14, 0.74);
    color: #e6ffe8;
}

.npc-skill-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.npc-relearner-list {
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.npc-ability-list {
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.npc-ability-passive-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: #000;
    border-color: rgba(255, 255, 255, 0.2);
    color: #f2f2f2;
}

.npc-ability-passive-row span {
    font-size: 12px;
    color: #dddddd;
}

.npc-ability-passive-row small {
    font-size: 10px;
    color: #bdbdbd;
}

.npc-ability-passive-row.current {
    background: #0f3d19;
    border-color: rgba(50, 205, 50, 0.8);
    color: #d8ffe0;
}

.npc-ability-passive-row.current span,
.npc-ability-passive-row.current small {
    color: #d8ffe0;
}

.npc-skill-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(50, 205, 50, 0.3);
    font-size: 13px;
}

.npc-skill-count {
    margin-bottom: 8px;
    font-size: 12px;
    color: #c9ffd0;
}

.npc-action-btn {
    background: #32CD32;
    border: none;
    color: #0b140f;
    font-family: "Luckiest Guy", sans-serif;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.npc-evolution-select {
    width: 100%;
    margin: 8px 0;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid rgba(77, 195, 255, 0.55);
    background: linear-gradient(180deg, rgba(7, 19, 34, 0.94), rgba(7, 16, 26, 0.94));
    color: #dff6ff;
    font-family: "Luckiest Guy", sans-serif;
    letter-spacing: 0.3px;
}

.npc-evolution-select:focus {
    outline: 2px solid rgba(77, 195, 255, 0.6);
    outline-offset: 1px;
}

.npc-evolution-select option {
    background: #000;
    color: #dff6ff;
}

.npc-evolution-select option:checked {
    background: #000;
    color: #dff6ff;
}

.npc-evolution-apply {
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(62, 173, 255, 0.8);
    background: linear-gradient(180deg, #39b8ff, #1686cc);
    color: #041221;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.npc-evolution-apply:hover {
    filter: brightness(1.08);
}

.toast {
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 15px 25px;
    border-left: 6px solid #32CD32;
    border-radius: 5px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    animation: slideIn 0.4s ease-out forwards;
}

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.hidden { display: none !important; }

#install-game-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    padding: 24px;
}

#install-game-modal .install-game-card {
    width: min(460px, 100%);
    border: 2px solid rgba(50, 205, 50, 0.9);
    border-radius: 16px;
    background: rgba(6, 16, 9, 0.95);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
    padding: 22px;
    text-align: center;
    color: #f1fff1;
}

#install-game-modal .install-game-title {
    font-size: 30px;
    letter-spacing: 1px;
    color: #8fff8f;
    margin-bottom: 10px;
}

#install-game-modal .install-game-text {
    font-size: 15px;
    line-height: 1.45;
    opacity: 0.95;
    margin-bottom: 16px;
}

#install-game-modal .install-game-actions {
    display: flex;
    gap: 10px;
}

#install-game-modal .install-game-actions button {
    flex: 1;
}

#pet-hud {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    z-index: 2600;
    pointer-events: none;
    color: #E8F8FF;
    text-shadow: 1px 1px 0 #000;
    font-family: "Luckiest Guy", sans-serif;
}

.pet-hud-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pet-hud-core {
    position: relative;
    width: 84px;
    height: 84px;
}

.pet-hud-quick {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 290px;
}

.pet-hud-toggle {
    pointer-events: auto;
    width: 34px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.55);
    background: rgba(6, 16, 26, 0.84);
    color: #9adfff;
    font-family: "Luckiest Guy", sans-serif;
    cursor: pointer;
    line-height: 1;
}

.pet-hud-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 290px;
    pointer-events: auto;
    max-height: 260px;
    overflow-y: auto;
}

.pet-hud-list.collapsed {
    display: none;
}

.pet-hud-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    padding: 5px 7px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(0, 229, 255, 0.32);
    min-width: 200px;
}

.pet-hud-entry.active {
    border-color: rgba(0, 229, 255, 0.95);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
}

.pet-hud-photo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    border: 2px solid rgba(0, 229, 255, 0.35);
    background: rgba(0, 0, 0, 0.55);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pet-hud-photo:hover {
    border-color: rgba(0, 229, 255, 0.95);
}

.pet-hud-meta {
    min-width: 0;
    pointer-events: auto;
}

.pet-hud-meta-name {
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pet-hud-meta-name span {
    color: #9adfff;
    font-size: 10px;
}

.pet-hud-meta-line {
    color: #9adfff;
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pet-hud-mini {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pet-hud-ring {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, rgba(0, 0, 0, 0.1) 45%, rgba(0, 0, 0, 0.9) 70%),
        conic-gradient(from 0deg, rgba(0, 229, 255, 0.9), rgba(0, 90, 140, 0.4), rgba(0, 229, 255, 0.9));
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.6), inset 0 0 12px rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(0, 229, 255, 0.6);
    animation: techSpin 6s linear infinite;
}

#pet-hud-img {
    position: absolute;
    inset: 10px;
    width: 64px;
    height: 64px;
    object-fit: contain;
    pointer-events: auto;
    cursor: pointer;
    filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.5));
}

.pet-hud-bars {
    min-width: 180px;
}

.pet-hud-name {
    font-size: 16px;
    margin-bottom: 6px;
    color: #B6F7FF;
}

.pet-hud-bar {
    width: 180px;
    height: 12px;
    background: rgba(10, 10, 10, 0.7);
    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}

.pet-hud-bar.xp {
    height: 6px;
    margin-bottom: 0;
    border-radius: 6px;
}

.pet-hud-fill {
    height: 100%;
    width: 0%;
    transition: width 0.2s ease;
}

.pet-hud-hp {
    background: linear-gradient(to right, #3FFF6E 0%, #159E3D 100%);
}

.pet-hud-mp {
    background: linear-gradient(to right, #49A6FF 0%, #1456C3 100%);
}

.pet-hud-xp {
    background: linear-gradient(to right, #FFD54F 0%, #F57C00 100%);
}

.right-menu-toggle {
    position: fixed;
    top: 18px;
    right: 78px;
    z-index: 1310;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 2px solid rgba(110, 220, 255, 0.7);
    background: rgba(4, 10, 18, 0.82);
    color: #d6f6ff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
}

.right-menu-popout {
    position: fixed;
    top: 68px;
    right: 18px;
    z-index: 1309;
    min-width: 130px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(110, 220, 255, 0.45);
    background: rgba(4, 10, 18, 0.84);
    color: #c6f0ff;
    pointer-events: none;
}

.right-menu-popout-title {
    font-size: 12px;
}

.right-menu-popout-sub {
    font-size: 10px;
    opacity: 0.8;
}

.right-menu-button.hidden-by-menu {
    display: none !important;
}

@keyframes techSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#daily-roulette-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
}

#skill-target-prompt {
    position: fixed;
    inset: 0;
    z-index: 6500;
    background: rgba(0, 0, 0, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
}

#skill-target-prompt.hidden {
    display: none;
}

.skill-target-prompt-card {
    width: min(460px, 92vw);
    border-radius: 12px;
    border: 2px solid rgba(0, 229, 255, 0.5);
    background: rgba(8, 14, 24, 0.98);
    padding: 14px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
    color: #dff7ff;
    font-family: 'Luckiest Guy', cursive;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-target-prompt-title {
    font-size: 16px;
    color: #8ee9ff;
}

.skill-target-prompt-subtitle {
    font-size: 12px;
    color: #c7f1ff;
}

.skill-target-prompt-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.skill-target-btn {
    border: 1px solid rgba(50, 205, 50, 0.6);
    background: rgba(50, 205, 50, 0.18);
    color: #e8ffe9;
    border-radius: 10px;
    padding: 9px 10px;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.skill-target-btn-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    image-rendering: pixelated;
    flex: 0 0 48px;
}

.skill-target-btn.cancel {
    border-color: rgba(255, 90, 90, 0.65);
    background: rgba(255, 90, 90, 0.18);
    color: #ffe7e7;
}

.daily-roulette-card {
    width: min(460px, 92vw);
    background: rgba(6, 10, 22, 0.95);
    border: 2px solid rgba(255, 215, 0, 0.9);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.daily-roulette-title {
    color: #ffe28a;
    font-size: 20px;
    margin-bottom: 10px;
}

.daily-roulette-wheel {
    width: 170px;
    height: 170px;
    margin: 0 auto 10px;
    border-radius: 50%;
    border: 4px solid rgba(255, 215, 0, 0.95);
    background:
        radial-gradient(circle at center, rgba(255,255,255,0.18), rgba(0,0,0,0.45)),
        conic-gradient(#f6c646, #f09f24, #f6c646);
    display: flex;
    align-items: center;
    justify-content: center;
}

.daily-roulette-wheel.spinning {
    animation: techSpin 0.4s linear infinite;
}

.daily-roulette-wheel-label {
    color: #fff;
    font-size: 13px;
    width: 78%;
    text-shadow: 1px 1px 0 #000;
}

.daily-roulette-result {
    color: #e8f8ff;
    font-size: 14px;
    min-height: 18px;
}

#gameCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #0a2b0a;
    z-index: 100;
}

#virtual-joystick {
    position: fixed;
    left: max(18px, env(safe-area-inset-left));
    bottom: max(18px, env(safe-area-inset-bottom));
    width: 140px;
    height: 140px;
    z-index: 1250;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#virtual-joystick-base {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.55);
    background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.22), rgba(0, 0, 0, 0.4) 64%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 0 16px rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#virtual-joystick-knob {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.72);
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.45), rgba(0, 0, 0, 0.55) 74%);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.42);
    transform: translate(0, 0);
    transition: transform 70ms linear;
    pointer-events: none;
}

#mobile-interact-btn {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(22px, env(safe-area-inset-bottom));
    min-width: 124px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.75);
    background: linear-gradient(180deg, rgba(55, 220, 120, 0.96), rgba(25, 150, 75, 0.96));
    color: #fff;
    font-family: 'Luckiest Guy', cursive;
    font-size: 18px;
    letter-spacing: 0.8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
    z-index: 1250;
    touch-action: manipulation;
}

#mobile-interact-btn:active {
    transform: translateY(1px) scale(0.99);
}

@media (hover: hover) and (pointer: fine) {
    #mobile-interact-btn {
        display: none !important;
    }
}

.btn-delete-char {
    position: absolute;
    top: 40px;
    right: 10px;
    background: #ff4444;
    color: white;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 30px; height: 30px;
    cursor: pointer;
    font-family: 'Luckiest Guy', cursive;
    z-index: 30;
    box-shadow: 0 4px 0 #990000;
}

.btn-delete-char:hover {
    background: #ff0000;
    transform: scale(1.1);
}

#char-name-modal {
    position: fixed;
    top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.8);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
}

.char-preview {
    width: 64px;
    height: 128px;
    background-image: url('/assets/personagem/1-personagem.png');
    background-repeat: no-repeat;
    background-size: 192px 512px;
    background-position: -64px 0px;
    image-rendering: pixelated;
    z-index: 10;
    margin-bottom: -25px;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5));
    animation: idleFloat 3s ease-in-out infinite;
}

@keyframes idleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* --- EDITOR DE MAPAS --- */
#map-editor-ui {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    border-left: 3px solid #32CD32;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow-y: auto;
}

.layer-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 15px;
}

.layer-btn {
    padding: 8px;
    background: #444;
    color: white;
    border: 1px solid #666;
    cursor: pointer;
    font-family: 'Luckiest Guy';
}

.layer-btn.active {
    background: #32CD32;
    border-color: #fff;
}

.tileset-container {
    height: 400px;
    overflow-y: scroll;
    overflow-x: hidden;
    background: #111;
    border: 2px solid #32CD32;
    margin-bottom: 10px;
    position: relative;
}

.editor-section {
    margin-top: 12px;
    padding: 10px;
    background: rgba(50, 205, 50, 0.08);
    border: 1px solid rgba(50, 205, 50, 0.4);
    border-radius: 8px;
}

.editor-section-title {
    font-size: 13px;
    color: #32CD32;
    text-align: center;
    margin-bottom: 8px;
    font-family: 'Luckiest Guy';
}

.editor-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.editor-field label {
    font-size: 11px;
    color: #ccc;
}

.editor-field input[type="text"],
.editor-field input[type="number"] {
    padding: 6px;
    background: #111;
    border: 1px solid #555;
    color: #fff;
    border-radius: 6px;
    font-family: 'Luckiest Guy';
}

.editor-field.checkbox-field {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.editor-list {
    margin-top: 8px;
    font-size: 11px;
    color: #ddd;
    display: grid;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.editor-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(50, 205, 50, 0.2);
}

.editor-list-item button {
    border: none;
    background: #ff4d4d;
    color: #fff;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 10px;
    cursor: pointer;
    font-family: 'Luckiest Guy';
}

#tileset-selection-canvas {
    cursor: crosshair;
    image-rendering: pixelated;
}

.editor-hint {
    font-size: 12px;
    color: #aaa;
    text-align: center;
}

.commands-list {
    margin-top: 15px;
    padding: 10px;
    background: rgba(50, 205, 50, 0.1);
    border: 1px solid #32CD32;
    border-radius: 8px;
}

.cmd-hint {
    color: #FFD700 !important;
    font-size: 11px !important;
    margin: 5px 0;
}

.tileset-container::-webkit-scrollbar {
    width: 10px;
}

.tileset-container::-webkit-scrollbar-track {
    background: #000;
}

.tileset-container::-webkit-scrollbar-thumb {
    background: #32CD32;
    border-radius: 5px;
    border: 2px solid #000;
}

.tileset-container::-webkit-scrollbar-thumb:hover {
    background: #3fff3f;
}

/* ========================================
   SISTEMA DE BATALHA - HUD
   ======================================== */

#battle-hud {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1200;
    display: none;
    pointer-events: none;
}

.battle-hud-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: transparent;
    pointer-events: auto;
}

.battle-status {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 520px;
}

.battle-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 200px;
}

.combatant {
    flex: 1;
    max-width: 200px;
    width: 100%;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 10px;
    padding: 6px 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.combatant-name {
    font-size: 12px;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 4px;
    text-align: left;
}

.combatant-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}

.combatant-name-row .combatant-name {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.combatant-status-icons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.combatant-passive-chips {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    flex-wrap: wrap;
    min-height: 18px;
    margin-bottom: 4px;
}

.combatant-passive-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid rgba(173, 216, 255, 0.7);
    background: rgba(10, 30, 52, 0.82);
    color: #dbefff;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
}

.combatant-effect-tags {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    flex-wrap: wrap;
    min-height: 18px;
    margin-bottom: 4px;
}

.combatant-effect-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
}

.combatant-effect-tag.buff {
    border-color: rgba(98, 255, 163, 0.75);
    background: rgba(6, 48, 26, 0.82);
    color: #b7ffd2;
}

.combatant-effect-tag.debuff {
    border-color: rgba(255, 118, 118, 0.75);
    background: rgba(58, 14, 14, 0.82);
    color: #ffd0d0;
}

.battle-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.55);
    font-size: 12px;
    line-height: 1;
    cursor: help;
}

.battle-status-icon.badly {
    border-color: rgba(255, 122, 69, 0.7);
    background: rgba(70, 13, 13, 0.72);
}

.battle-status-icon.debuff {
    border-color: rgba(255, 70, 120, 0.7);
    background: rgba(62, 8, 34, 0.72);
}

.pet-status .combatant-name {
    color: #FFD700;
}

.pet-status.active {
    outline: 2px solid rgba(50, 205, 50, 0.7);
    border-radius: 12px;
    padding: 6px;
}

.pet-status.ally-target {
    outline: 2px solid rgba(124, 255, 138, 0.8);
    border-radius: 12px;
    padding: 6px;
}

.monster-status .combatant-name {
    color: #FF4444;
}

.monster-status.targeted {
    outline: 2px solid rgba(0, 229, 255, 0.7);
    border-radius: 12px;
    padding: 6px;
}

.monster-skills {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.battle-monster-skill-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 92, 92, 0.65);
    background: rgba(32, 6, 6, 0.8);
    color: #ffd6d6;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}

.vs-text {
    font-size: 18px;
    color: #32CD32;
    text-shadow: 0 0 10px #32CD32, 2px 2px 0 #000;
    animation: pulse 1.5s infinite;
}

.hp-bar {
    width: 100%;
    height: 10px;
    background: #333;
    border: 2px solid #555;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 3px;
}

.hp-fill {
    height: 100%;
    background: linear-gradient(to bottom, #4CAF50 0%, #2E7D32 100%);
    transition: width 0.3s ease;
    width: 100%;
}

.mp-bar {
    width: 100%;
    height: 6px;
    background: #222;
    border: 2px solid #444;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 3px;
}

.mp-fill {
    height: 100%;
    background: linear-gradient(to bottom, #4FC3F7 0%, #1565C0 100%);
    transition: width 0.2s ease;
    width: 0%;
}

.stamina-bar {
    width: 100%;
    height: 6px;
    background: #222;
    border: 2px solid #444;
    border-radius: 5px;
    overflow: hidden;
}

.evolution-bar {
    width: 100%;
    height: 5px;
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 4px;
}

.evolution-fill {
    height: 100%;
    background: linear-gradient(to bottom, #00E5FF 0%, #0097A7 100%);
    transition: width 0.2s ease;
    width: 0%;
}

.stamina-fill {
    height: 100%;
    background: linear-gradient(to bottom, #2196F3 0%, #1565C0 100%);
    transition: width 0.1s linear;
    width: 0%;
}

.pet-stamina {
    background: linear-gradient(to bottom, #FFD700 0%, #FFA000 100%);
}

.monster-stamina {
    background: linear-gradient(to bottom, #9C27B0 0%, #6A1B9A 100%);
}

.battle-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    max-width: 700px;
}

.battle-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    max-width: 700px;
    max-height: 230px;
    overflow-y: auto;
    padding-right: 6px;
}

.battle-items::-webkit-scrollbar {
    width: 8px;
}

.battle-items::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.55);
    border-radius: 10px;
}

.battle-items::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #34d399 0%, #059669 100%);
    border-radius: 10px;
}

.battle-swap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    max-width: 700px;
}

.battle-skill-btn {
    padding: 10px 16px;
    font-family: 'Luckiest Guy', cursive;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(to bottom, #7E57C2 0%, #4527A0 100%);
    border-bottom: 3px solid #311B92;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.battle-skill-title {
    display: block;
    font-size: 14px;
    line-height: 1.1;
    margin-bottom: 6px;
}

.battle-skill-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.battle-skill-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.28);
    font-size: 11px;
    line-height: 1.1;
}

.battle-skill-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.battle-skill-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.battle-skill-empty {
    width: 100%;
    text-align: center;
    color: #bbb;
    font-size: 13px;
    text-shadow: 1px 1px 0 #000;
}

/* Indicador de Defesa */
.defend-indicator {
    margin-top: 8px;
    padding: 5px 10px;
    background: linear-gradient(to bottom, #00BFFF 0%, #0080FF 100%);
    border-radius: 5px;
    font-size: 12px;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    text-align: center;
    animation: defendPulse 1s infinite;
}

@keyframes defendPulse {
    0%, 100% { box-shadow: 0 0 5px #00BFFF; }
    50% { box-shadow: 0 0 15px #00BFFF, 0 0 25px #00BFFF; }
}

/* Botões de Ação */
.battle-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 80%, transparent 100%);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
}

.battle-pet-select {
    display: flex;
    gap: 8px;
    align-items: center;
}

.battle-pet-btn {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(50, 205, 50, 0.5);
    background: rgba(0, 0, 0, 0.6);
    color: #dfffe0;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.battle-pet-btn.active {
    background: rgba(50, 205, 50, 0.25);
    color: #fff;
    box-shadow: 0 0 10px rgba(50, 205, 50, 0.4);
}

.battle-btn {
    padding: 15px 30px;
    font-family: 'Luckiest Guy', cursive;
    font-size: 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.battle-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.battle-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

.battle-btn:not(:disabled):active {
    transform: translateY(0);
}

/* Botão de Ataque */
.btn-attack {
    background: linear-gradient(to bottom, #666 0%, #444 100%);
    color: #999;
    border-bottom: 4px solid #333;
}

.btn-attack.ready {
    background: linear-gradient(to bottom, #FF5722 0%, #D84315 100%);
    color: #fff;
    border-bottom: 4px solid #BF360C;
    animation: attackReady 0.5s infinite alternate;
}

@keyframes attackReady {
    from { box-shadow: 0 0 10px #FF5722; }
    to { box-shadow: 0 0 25px #FF5722, 0 0 40px #FF5722; }
}

/* Botão de Defender */
.btn-defend {
    background: linear-gradient(to bottom, #666 0%, #444 100%);
    color: #999;
    border-bottom: 4px solid #333;
}

.btn-defend.ready {
    background: linear-gradient(to bottom, #00BFFF 0%, #0080FF 100%);
    color: #fff;
    border-bottom: 4px solid #0066CC;
    animation: defendReady 0.5s infinite alternate;
}

@keyframes defendReady {
    from { box-shadow: 0 0 10px #00BFFF; }
    to { box-shadow: 0 0 25px #00BFFF, 0 0 40px #00BFFF; }
}

/* Botão de Habilidades */
.btn-skills {
    background: linear-gradient(to bottom, #9C27B0 0%, #7B1FA2 100%);
    color: #fff;
    border-bottom: 4px solid #4A148C;
}

/* Botão de Itens */
.btn-items {
    background: linear-gradient(to bottom, #2196F3 0%, #1976D2 100%);
    color: #fff;
    border-bottom: 4px solid #0D47A1;
}

/* Botão de Troca */
.btn-swap {
    background: linear-gradient(to bottom, #9C27B0 0%, #6A1B9A 100%);
    color: #fff;
    border-bottom: 4px solid #4A148C;
}

/* Botão de Fugir */
.btn-flee {
    background: linear-gradient(to bottom, #607D8B 0%, #455A64 100%);
    color: #fff;
    border-bottom: 4px solid #263238;
}

/* Efeito de brilho nos botões */
.battle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.battle-btn:not(:disabled):hover::before {
    left: 100%;
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

@media (max-width: 768px) {
    #pet-hud {
        transform: scale(0.9);
        transform-origin: top left;
    }
    .pet-hud-entry {
        min-width: 170px;
    }
    .battle-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .battle-status {
        flex-direction: column;
        gap: 15px;
    }
    
    .combatant {
        max-width: 100%;
        width: 80%;
    }
    
    .vs-text {
        font-size: 20px;
    }
    
    #map-editor-ui {
        width: 250px;
    }
    
    .commands-list {
        padding: 5px;
    }
    
    .cmd-hint {
        font-size: 10px !important;
    }
}

/* ========================================
   MENU ESC / HUB DE PETS
   ======================================== */

#esc-menu-icon {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1300;
    padding: 10px 14px;
    border-radius: 14px;
    border: 2px solid rgba(50, 205, 50, 0.8);
    background: rgba(0, 0, 0, 0.7);
    color: #32CD32;
    font-family: 'Luckiest Guy', cursive;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(50, 205, 50, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#esc-menu-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 18px rgba(50, 205, 50, 0.7);
}

#esc-menu-icon.active {
    background: rgba(50, 205, 50, 0.2);
    color: #fff;
}

#digimon-analysis-icon {
    position: fixed;
    top: 70px;
    right: 18px;
    z-index: 1300;
    padding: 8px 12px;
    border-radius: 12px;
    border: 2px solid rgba(0, 229, 255, 0.7);
    background: rgba(0, 0, 0, 0.7);
    color: #8ee9ff;
    font-family: 'Luckiest Guy', cursive;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#digimon-analysis-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.6);
}

#digimon-analysis-icon.active {
    background: rgba(0, 229, 255, 0.18);
    color: #fff;
}

#pvp-open-btn,
#pvp-close-btn {
    position: fixed;
    top: 122px;
    right: 18px;
    z-index: 1300;
    padding: 8px 12px;
    border-radius: 12px;
    border: 2px solid rgba(255, 99, 71, 0.7);
    background: rgba(0, 0, 0, 0.7);
    color: #ff9a8a;
    font-family: 'Luckiest Guy', cursive;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 99, 71, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#pvp-open-btn:hover,
#pvp-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 16px rgba(255, 99, 71, 0.6);
}

#pvp-close-btn {
    border-color: rgba(50, 205, 50, 0.8);
    color: #c9ffd0;
    box-shadow: 0 0 10px rgba(50, 205, 50, 0.35);
}

#pvp-close-btn:hover {
    box-shadow: 0 0 16px rgba(50, 205, 50, 0.6);
}

#championship-panel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1600;
}

#championship-panel.hidden {
    display: none;
}

.championship-card {
    width: min(920px, 94vw);
    max-height: 90vh;
    overflow: auto;
    background: rgba(10, 16, 26, 0.96);
    border: 2px solid rgba(255, 215, 0, 0.35);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
    color: #ffe8a3;
    font-family: 'Luckiest Guy', cursive;
}

.championship-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.championship-title {
    font-size: 20px;
    letter-spacing: 1px;
}

.championship-close {
    border: 1px solid rgba(255, 99, 71, 0.7);
    background: rgba(0, 0, 0, 0.7);
    color: #ff9a8a;
    border-radius: 10px;
    padding: 4px 10px;
    cursor: pointer;
}

.championship-subtitle,
.championship-rewards,
.championship-my-stats {
    font-size: 12px;
    color: #cdbb86;
    margin-bottom: 8px;
}

.championship-last-box {
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    background: rgba(6, 12, 22, 0.85);
    padding: 8px;
    margin-bottom: 8px;
}

.championship-last-title {
    font-size: 12px;
    color: #ffe8a3;
    margin-bottom: 6px;
}

.championship-last-list {
    display: grid;
    gap: 6px;
}

.championship-last-row {
    font-size: 12px;
    color: #cdbb86;
}

.championship-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.championship-controls button {
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid rgba(50, 205, 50, 0.6);
    background: rgba(0, 0, 0, 0.7);
    color: #c9ffd0;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.championship-controls button.active {
    border-color: rgba(50, 205, 50, 0.85);
    color: #c9ffd0;
    box-shadow: 0 0 10px rgba(50, 205, 50, 0.3);
}

.championship-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#championship-queue-status {
    font-size: 12px;
    color: #9fb6d1;
}

#card-deck-panel,
#card-battle-panel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1550;
}

#card-deck-panel.hidden,
#card-battle-panel.hidden {
    display: none;
}

.card-deck-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.card-deck-title {
    font-size: 12px;
    color: #ffe8a3;
    margin-bottom: 6px;
}

.card-deck-list,
.card-available-list {
    max-height: 360px;
    overflow: auto;
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    background: rgba(6, 12, 22, 0.85);
    padding: 8px;
    display: grid;
    gap: 6px;
}

.card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 12px;
    color: #cdbb86;
}

.card-row button {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(50, 205, 50, 0.5);
    background: rgba(0, 0, 0, 0.7);
    color: #c9ffd0;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.card-row button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.card-field-title {
    font-size: 12px;
    color: #ffe8a3;
    margin: 8px 0 4px;
}

.card-field-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
}

.card-slot {
    min-height: 52px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    background: rgba(6, 12, 22, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 6px;
}

.card-slot strong {
    font-size: 11px;
    color: #ffe8a3;
}

.card-slot span {
    font-size: 11px;
    color: #9fb6d1;
}

.card-hand-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.card-hand-btn {
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.35);
    background: rgba(6, 12, 22, 0.85);
    color: #cdbb86;
    font-size: 12px;
    cursor: pointer;
}

.card-hand-btn.active {
    border-color: rgba(50, 205, 50, 0.9);
    color: #c9ffd0;
    box-shadow: 0 0 10px rgba(50, 205, 50, 0.3);
}

#card-evo-slot {
    margin-left: 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.35);
    background: rgba(0, 0, 0, 0.7);
    color: #ffe8a3;
    font-family: 'Luckiest Guy', cursive;
}

#minigame-panel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1510;
}

#minigame-panel.hidden {
    display: none;
}

#minigame-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1700;
}

#minigame-overlay.hidden {
    display: none;
}

.minigame-card {
    width: min(760px, 96vw);
    background: rgba(10, 16, 26, 0.96);
    border: 2px solid rgba(0, 229, 255, 0.35);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
    color: #e6fbff;
    font-family: 'Luckiest Guy', cursive;
}

.minigame-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.minigame-title {
    font-size: 20px;
    letter-spacing: 1px;
}

.minigame-close {
    border: 1px solid rgba(255, 99, 71, 0.7);
    background: rgba(0, 0, 0, 0.6);
    color: #ff9a8a;
    border-radius: 10px;
    padding: 4px 10px;
    cursor: pointer;
}

.minigame-subtitle {
    font-size: 12px;
    color: #9fb6d1;
    margin-bottom: 8px;
}

#minigame-canvas {
    width: 100%;
    max-width: 640px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
    border: 1px solid rgba(0, 229, 255, 0.3);
    background: #000;
}

.minigame-footer {
    margin-top: 8px;
    text-align: center;
    font-size: 12px;
    color: #c9ffd0;
}

.championship-list {
    display: grid;
    gap: 8px;
    max-height: 420px;
    overflow: auto;
    margin-bottom: 10px;
}

.championship-row {
    display: grid;
    grid-template-columns: 65px 1fr 120px 120px;
    gap: 8px;
    align-items: center;
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    padding: 8px;
    background: rgba(6, 12, 22, 0.85);
    font-size: 12px;
}

.championship-empty {
    text-align: center;
    padding: 20px 10px;
    color: #cdbb86;
}

.championship-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.championship-pagination button {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.45);
    background: rgba(0, 0, 0, 0.7);
    color: #ffe8a3;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

@media (max-width: 760px) {
    .championship-row {
        grid-template-columns: 55px 1fr;
    }

    .card-deck-grid {
        grid-template-columns: 1fr;
    }

    .card-field-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .card-hand-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

#map-name-overlay {
    position: fixed;
    left: 50%;
    top: 30%;
    transform: translate(-50%, -50%);
    z-index: 1400;
    pointer-events: none;
    padding: 14px 28px;
    border-radius: 16px;
    border: 2px solid rgba(138, 255, 248, 0.6);
    background: radial-gradient(circle at top, rgba(10, 24, 36, 0.85), rgba(5, 10, 18, 0.85));
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.25), 0 0 60px rgba(0, 229, 255, 0.15);
    opacity: 0;
}

#map-name-overlay.show {
    animation: mapNameReveal 3s ease forwards;
}

#map-name-overlay .map-name-text {
    font-family: 'Luckiest Guy', cursive;
    font-size: 42px;
    letter-spacing: 3px;
    color: #c7faff;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
    white-space: nowrap;
}

/* Alerta visual de respawn de boss */
#boss-spawn-alert-overlay {
    position: fixed;
    left: 50%;
    top: 26%;
    transform: translate(-50%, -50%);
    z-index: 1550;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: min(92vw, 840px);
    padding: 12px 18px;
    border-radius: 18px;
    border: 2px solid rgba(255, 64, 64, 0.7);
    background: linear-gradient(180deg, rgba(80, 0, 0, 0.34), rgba(30, 0, 0, 0.22));
    box-shadow: 0 0 24px rgba(255, 50, 50, 0.35), 0 0 66px rgba(255, 30, 30, 0.2);
    opacity: 0;
}

#boss-spawn-alert-overlay.show {
    animation: bossSpawnAlertReveal 3.2s ease forwards;
}

#boss-spawn-alert-overlay .boss-spawn-alert-title {
    font-family: 'Luckiest Guy', cursive;
    font-size: clamp(54px, 11vw, 126px);
    line-height: 0.92;
    letter-spacing: 6px;
    color: rgba(255, 72, 72, 0.74);
    text-shadow: 0 0 16px rgba(255, 22, 22, 0.7), 0 0 54px rgba(255, 0, 0, 0.46);
}

#boss-spawn-alert-overlay .boss-spawn-alert-name {
    font-family: 'Luckiest Guy', cursive;
    font-size: clamp(24px, 4.4vw, 44px);
    line-height: 1;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 236, 236, 0.92);
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.38);
    text-align: center;
}

#boss-spawn-alert-overlay .boss-spawn-alert-meta {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: clamp(15px, 2.2vw, 24px);
    letter-spacing: 1px;
    color: rgba(255, 220, 220, 0.9);
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.32);
    text-align: center;
}

@keyframes bossSpawnAlertReveal {
    0% {
        opacity: 0;
        transform: translate(-50%, -58%) scale(0.9);
        filter: blur(5px);
    }
    12% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.02);
        filter: blur(0);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -42%) scale(0.98);
        filter: blur(2px);
    }
}

@keyframes mapNameReveal {
    0% {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.9);
        filter: blur(4px);
    }
    12% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
        filter: blur(0);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -40%) scale(0.98);
        filter: blur(2px);
    }
}

@keyframes anomalousBadgePulse {
    0%, 100% {
        transform: translateY(0) scale(1);
        box-shadow:
            0 0 0 1px rgba(20, 12, 30, 0.8),
            0 0 12px rgba(194, 154, 255, 0.8),
            0 0 24px rgba(20, 20, 30, 0.95);
    }
    50% {
        transform: translateY(-1px) scale(1.08);
        box-shadow:
            0 0 0 1px rgba(20, 12, 30, 0.85),
            0 0 18px rgba(227, 206, 255, 0.95),
            0 0 30px rgba(40, 20, 56, 0.98);
    }
}

#trade-panel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

#trade-panel.hidden {
    display: none;
}

.trade-card {
    width: min(720px, 92vw);
    background: rgba(10, 16, 26, 0.95);
    border: 2px solid rgba(0, 229, 255, 0.35);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
    color: #e6fbff;
    font-family: 'Luckiest Guy', cursive;
}

.trade-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.trade-title {
    font-size: 20px;
    letter-spacing: 2px;
}

.trade-close {
    border: 1px solid rgba(255, 99, 71, 0.7);
    background: rgba(0, 0, 0, 0.7);
    color: #ff9a8a;
    border-radius: 10px;
    padding: 4px 10px;
    cursor: pointer;
}

.trade-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.trade-col {
    background: rgba(4, 10, 18, 0.8);
    border: 1px solid rgba(50, 205, 50, 0.2);
    border-radius: 12px;
    padding: 12px;
}

.trade-col-title {
    font-size: 14px;
    margin-bottom: 8px;
    color: #c9ffd0;
}

.trade-col select,
.trade-col input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    background: rgba(0, 0, 0, 0.7);
    color: #e6fbff;
    font-family: 'Luckiest Guy', cursive;
    margin-bottom: 8px;
}

.trade-col button {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(50, 205, 50, 0.6);
    background: rgba(0, 0, 0, 0.7);
    color: #c9ffd0;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
    margin-bottom: 8px;
}

#trade-cancel-btn {
    border-color: rgba(255, 99, 71, 0.6);
    color: #ff9a8a;
}

.trade-offer {
    margin-top: 6px;
    padding: 8px;
    border-radius: 10px;
    border: 1px dashed rgba(0, 229, 255, 0.35);
    color: #e6fbff;
    min-height: 44px;
}

#trade-offer-value,
#trade-partner-offer {
    white-space: pre-line;
    line-height: 1.35;
}

.trade-offer-label {
    font-size: 11px;
    color: #9fb6d1;
    margin-bottom: 4px;
}

.trade-actions {
    display: grid;
    gap: 6px;
}

.trade-ready-status {
    margin-top: 6px;
    font-size: 12px;
    color: #9fb6d1;
    text-align: center;
}

@media (max-width: 720px) {
    .trade-body {
        grid-template-columns: 1fr;
    }
}

#auction-btn {
    position: fixed;
    top: 174px;
    right: 18px;
    z-index: 1300;
    padding: 8px 12px;
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.7);
    background: rgba(0, 0, 0, 0.7);
    color: #ffe8a3;
    font-family: 'Luckiest Guy', cursive;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#auction-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.6);
}

#vip-shop-btn {
    position: fixed;
    top: 226px;
    right: 18px;
    z-index: 1300;
    padding: 8px 12px;
    border-radius: 12px;
    border: 2px solid rgba(255, 105, 180, 0.7);
    background: rgba(0, 0, 0, 0.7);
    color: #ffd1ea;
    font-family: 'Luckiest Guy', cursive;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#vip-shop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 16px rgba(255, 105, 180, 0.6);
}

#daily-roulette-btn {
    position: fixed;
    top: 278px;
    right: 18px;
    z-index: 1300;
    padding: 8px 12px;
    border-radius: 12px;
    border: 2px solid rgba(80, 180, 255, 0.75);
    background: rgba(0, 0, 0, 0.7);
    color: #d7efff;
    font-family: 'Luckiest Guy', cursive;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(80, 180, 255, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#daily-roulette-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 16px rgba(80, 180, 255, 0.6);
}

#quest-btn,
#friend-btn,
#guild-btn,
#chat-toggle-btn,
#desbug-toggle-btn {
    position: fixed;
    right: 18px;
    z-index: 1300;
    padding: 8px 12px;
    border-radius: 12px;
    border: 2px solid rgba(60, 220, 180, 0.75);
    background: rgba(0, 0, 0, 0.7);
    color: #d5fff1;
    font-family: 'Luckiest Guy', cursive;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(60, 220, 180, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#quest-btn {
    top: 330px;
}

#friend-btn {
    top: 382px;
}

#guild-btn {
    top: 434px;
}

#chat-toggle-btn {
    top: 486px;
}

#desbug-toggle-btn {
    top: 538px;
}

#quest-btn:hover,
#friend-btn:hover,
#guild-btn:hover,
#chat-toggle-btn:hover,
#desbug-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 16px rgba(60, 220, 180, 0.6);
}

#chat-toggle-btn.active,
#desbug-toggle-btn.active {
    background: rgba(60, 220, 180, 0.2);
    color: #fff;
}

#vip-shop-panel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

#vip-shop-panel.hidden {
    display: none;
}

#quest-panel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

#quest-panel.hidden {
    display: none;
}

#friend-panel,
#guild-panel,
#guild-emblem-editor,
#skins-panel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

#friend-panel.hidden,
#guild-panel.hidden,
#guild-emblem-editor.hidden,
#skins-panel.hidden {
    display: none;
}

#party-panel {
    position: fixed;
    top: 118px;
    right: 14px;
    z-index: 1200;
    width: min(320px, 88vw);
    max-height: 72vh;
    overflow-y: auto;
    background: rgba(7, 13, 24, 0.92);
    border: 1px solid rgba(139, 233, 253, 0.35);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}

#party-panel.hidden {
    display: none;
}

.party-panel-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.party-member-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.party-member-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
}

.party-member-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.party-member-placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Luckiest Guy', cursive;
}

.party-member-meta {
    min-width: 0;
    flex: 1;
}

.party-member-name {
    color: #e6f6ff;
    font-family: 'Luckiest Guy', cursive;
    font-size: 14px;
    letter-spacing: 0.6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.party-member-sub {
    margin-top: 2px;
    font-size: 11px;
    color: #9fd5eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.party-bar {
    margin-top: 4px;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.party-bar > div {
    height: 100%;
    transition: width 0.2s ease;
}

.party-bar.hp > div {
    background: linear-gradient(90deg, #ff5f6d, #ffc371);
}

.party-bar.mp > div {
    background: linear-gradient(90deg, #00c6ff, #0072ff);
}

.friend-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.friend-tab {
    flex: 1;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 105, 180, 0.4);
    background: rgba(10, 10, 10, 0.7);
    color: #ffd1ea;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.friend-tab.active {
    border-color: rgba(255, 105, 180, 0.95);
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.35);
}

.vip-shop-card {
    width: min(420px, 90vw);
    max-height: 72vh;
    background: rgba(10, 16, 26, 0.96);
    border: 2px solid rgba(255, 105, 180, 0.35);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
    color: #ffd1ea;
    font-family: 'Luckiest Guy', cursive;
    display: flex;
    flex-direction: column;
}

.vip-shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.vip-shop-title {
    font-size: 18px;
    letter-spacing: 2px;
}

.vip-shop-close {
    border: 1px solid rgba(255, 99, 71, 0.7);
    background: rgba(0, 0, 0, 0.7);
    color: #ff9a8a;
    border-radius: 10px;
    padding: 4px 10px;
    cursor: pointer;
}

.vip-shop-wallet {
    font-size: 12px;
    color: #ffc0e0;
    margin-bottom: 10px;
}

.vip-shop-list {
    display: grid;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.quest-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.quest-tabs button {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    background: rgba(0, 0, 0, 0.55);
    color: #dff7ff;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.quest-tabs button.active {
    border-color: rgba(80, 227, 194, 0.8);
    background: rgba(80, 227, 194, 0.2);
    color: #f0fff8;
}

#npc-quest-list {
    max-height: 260px;
    overflow-y: auto !important;
    padding-right: 4px;
}

.npc-quest-scroll {
    max-height: 360px;
    overflow-y: auto;
}

.vip-shop-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 105, 180, 0.25);
    background: rgba(6, 12, 22, 0.85);
}

.vip-shop-item .item-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.vip-shop-item button {
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(50, 205, 50, 0.6);
    background: rgba(0, 0, 0, 0.7);
    color: #c9ffd0;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.vip-shop-item button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#auction-panel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

#auction-panel.hidden {
    display: none;
}

.auction-card {
    width: min(760px, 92vw);
    background: rgba(10, 16, 26, 0.96);
    border: 2px solid rgba(255, 215, 0, 0.35);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
    color: #ffe8a3;
    font-family: 'Luckiest Guy', cursive;
}

.auction-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.auction-title {
    font-size: 20px;
    letter-spacing: 2px;
}

.auction-close {
    border: 1px solid rgba(255, 99, 71, 0.7);
    background: rgba(0, 0, 0, 0.7);
    color: #ff9a8a;
    border-radius: 10px;
    padding: 4px 10px;
    cursor: pointer;
}

.auction-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
}

.auction-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.auction-tab {
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    background: rgba(0, 0, 0, 0.6);
    color: #ffe8a3;
    cursor: pointer;
}

.auction-tab.active {
    background: rgba(255, 215, 0, 0.2);
}

.auction-create {
    background: rgba(6, 12, 22, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 12px;
}

.auction-create-title {
    margin-bottom: 8px;
    font-size: 14px;
}

.auction-create select,
.auction-create input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.35);
    background: rgba(0, 0, 0, 0.7);
    color: #ffe8a3;
    font-family: 'Luckiest Guy', cursive;
    margin-bottom: 8px;
}

#auction-post-btn {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(50, 205, 50, 0.6);
    background: rgba(0, 0, 0, 0.7);
    color: #c9ffd0;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.auction-hint {
    font-size: 11px;
    color: #b9a46b;
    margin-top: 6px;
}

.auction-list {
    background: rgba(6, 12, 22, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 10px;
    max-height: 360px;
    overflow: auto;
}

.auction-row {
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    color: #ffe8a3;
}

.auction-row-title {
    font-size: 14px;
}

.auction-row-meta {
    font-size: 11px;
    color: #b9a46b;
    margin-top: 4px;
}

.auction-row-actions {
    margin-top: 8px;
    display: flex;
    gap: 6px;
}

.auction-row-actions button {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(50, 205, 50, 0.6);
    background: rgba(0, 0, 0, 0.7);
    color: #c9ffd0;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.auction-empty {
    color: #b9a46b;
    font-size: 12px;
    text-align: center;
    padding: 20px 10px;
}

@media (max-width: 820px) {
    .auction-body {
        grid-template-columns: 1fr;
    }
}

.equip-panel {
    display: grid;
    gap: 10px;
}

.equip-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr 90px 90px;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(50, 205, 50, 0.2);
    background: rgba(6, 12, 20, 0.75);
}

.equip-label {
    font-size: 12px;
    color: #c9ffd0;
}

.equip-current {
    font-size: 12px;
    color: #e6fbff;
}

.equip-select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    background: rgba(0, 0, 0, 0.7);
    color: #e6fbff;
    font-family: 'Luckiest Guy', cursive;
}

.equip-btn {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(50, 205, 50, 0.6);
    background: rgba(0, 0, 0, 0.7);
    color: #c9ffd0;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.equip-btn.danger {
    border-color: rgba(255, 99, 71, 0.6);
    color: #ff9a8a;
}

.equip-orb-title {
    margin-top: 8px;
    font-size: 13px;
    color: #9fb6d1;
}

.card-select-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.card-select-label {
    font-size: 12px;
    color: #c9ffd0;
}

.card-select {
    flex: 1;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    background: rgba(0, 0, 0, 0.7);
    color: #e6fbff;
    font-family: 'Luckiest Guy', cursive;
}

.card-active-box {
    border-radius: 10px;
    border: 1px solid rgba(0, 229, 255, 0.3);
    background: rgba(6, 12, 20, 0.75);
    padding: 10px;
    color: #e6fbff;
    font-size: 12px;
    margin-bottom: 10px;
}

.esc-item-search {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.esc-item-search-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-family: 'Luckiest Guy', cursive;
    letter-spacing: 0.4px;
    outline: none;
}

.esc-item-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.esc-item-section-title {
    margin: 12px 2px 8px;
    color: #a7f3d0;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.card-active-title {
    font-size: 13px;
    color: #c9ffd0;
    margin-bottom: 4px;
}

.card-active-meta {
    font-size: 12px;
    color: #bcd7ff;
}

.card-remove-btn {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 99, 71, 0.6);
    background: rgba(0, 0, 0, 0.7);
    color: #ff9a8a;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
    margin-bottom: 12px;
}

.card-remove-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 229, 255, 0.25);
    background: rgba(6, 12, 20, 0.75);
    color: #e6fbff;
    font-size: 12px;
    margin-bottom: 8px;
}

.profile-label {
    color: #c9ffd0;
}

.profile-value {
    color: #e6fbff;
}

#minimap {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 200px;
    height: 200px;
    border-radius: 12px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45);
    background: rgba(6, 10, 18, 0.8);
    z-index: 1200;
    image-rendering: pixelated;
    pointer-events: none;
}

#game-clock {
    position: fixed;
    top: 62px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 198px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    background: rgba(6, 10, 18, 0.85);
    color: #e6fbff;
    font-family: 'Luckiest Guy', cursive;
    text-align: left;
    z-index: 1201;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.game-clock-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 2px;
}

.game-clock-time {
    font-size: 14px;
    letter-spacing: 1px;
}

.game-clock-vip {
    font-size: 12px;
    color: #8fd0ff;
    white-space: nowrap;
}

.game-clock-digitv {
    font-size: 11px;
    color: #ffdb7f;
    white-space: nowrap;
}

.game-clock-autobattle {
    font-size: 11px;
    color: #bdfad0;
    white-space: nowrap;
}

.game-clock-autobattle-toggle {
    border: 1px solid rgba(120, 255, 170, 0.35);
    background: rgba(10, 34, 20, 0.82);
    color: #d8ffe7;
    border-radius: 999px;
    padding: 3px 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
}

.game-clock-digitv-close {
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(120, 18, 18, 0.45);
    color: #fff;
    border-radius: 999px;
    width: 22px;
    height: 22px;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
}

.game-clock-vip-remaining {
    font-size: 11px;
    color: #b8f7ff;
    white-space: nowrap;
}

.game-clock-period {
    font-size: 12px;
    color: #ffd88a;
    text-align: center;
}

.game-clock-global-buffs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 2px;
}

.game-clock-party-buffs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.global-buff-pill {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    line-height: 1.2;
    white-space: nowrap;
}

.global-buff-pill.xp {
    color: #d7ffe0;
    background: rgba(46, 160, 67, 0.24);
    border-color: rgba(46, 160, 67, 0.55);
}

.global-buff-pill.bits {
    color: #fff2c9;
    background: rgba(214, 153, 0, 0.24);
    border-color: rgba(214, 153, 0, 0.55);
}

.party-buff-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(183, 230, 255, 0.28);
    background: rgba(12, 18, 28, 0.92);
    color: #f3fbff;
    font-size: 11px;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.party-buff-icon {
    font-size: 14px;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(255, 240, 180, 0.28));
}

.party-buff-timer {
    color: #9ee8ff;
    font-size: 10px;
    letter-spacing: 0.4px;
}

.game-clock-icon {
    width: 22px;
    height: 22px;
    margin: 0;
    display: inline-block;
}

#area-enemies-panel {
    position: fixed;
    top: auto;
    bottom: 244px;
    left: 12px;
    width: 252px;
    max-height: min(62vh, 560px);
    border-radius: 10px;
    border: 1px solid rgba(95, 184, 255, 0.42);
    background: rgba(5, 12, 20, 0.9);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    z-index: 1300;
    overflow: hidden;
}

#area-enemies-toggle {
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(95, 184, 255, 0.28);
    background: rgba(24, 62, 102, 0.62);
    color: #d9eeff;
    font-family: 'Luckiest Guy', cursive;
    font-size: 12px;
    letter-spacing: 0.8px;
    padding: 8px 10px;
    cursor: pointer;
    text-align: left;
}

#area-enemies-panel.collapsed .area-enemies-body {
    display: none;
}

.area-enemies-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
}

.area-enemies-map {
    font-family: 'Luckiest Guy', cursive;
    font-size: 11px;
    color: #8dc7ff;
    letter-spacing: 0.4px;
}

.area-enemies-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: min(50vh, 430px);
    padding-right: 2px;
}

.area-enemies-item {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(120, 194, 255, 0.24);
    border-radius: 8px;
    background: rgba(20, 36, 52, 0.7);
    padding: 6px;
}

.area-enemies-photo {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid rgba(135, 209, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 20, 30, 0.7);
    overflow: hidden;
    flex: 0 0 auto;
}

.area-enemies-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.area-enemies-photo-fallback {
    color: #93bfe6;
    font-family: 'Luckiest Guy', cursive;
    font-size: 16px;
}

.area-enemies-name {
    color: #f5fbff;
    font-family: 'Luckiest Guy', cursive;
    font-size: 12px;
    letter-spacing: 0.4px;
    line-height: 1.2;
}

.area-enemies-empty {
    border: 1px dashed rgba(120, 194, 255, 0.32);
    border-radius: 8px;
    color: #b8d8f7;
    font-family: 'Luckiest Guy', cursive;
    font-size: 11px;
    padding: 8px;
    text-align: center;
}

@media (max-width: 900px) {
    .equip-row {
        grid-template-columns: 1fr 1fr;
    }
    .equip-row .equip-select {
        grid-column: span 2;
    }
    .chest-dual {
        grid-template-columns: 1fr;
    }
    .spawn-drop-form {
        grid-template-columns: 1fr;
    }
}

#spawn-panel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

#spawn-panel.hidden {
    display: none;
}

#edit-spawn-panel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

#edit-spawn-panel.hidden {
    display: none;
}

.spawn-card {
    width: min(520px, 92vw);
    background: rgba(10, 16, 26, 0.96);
    border: 2px solid rgba(0, 229, 255, 0.35);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
    color: #e6fbff;
    font-family: 'Luckiest Guy', cursive;
}

.edit-spawn-card {
    width: min(1080px, 96vw);
    max-height: 88vh;
    background: rgba(10, 16, 26, 0.96);
    border: 2px solid rgba(0, 229, 255, 0.35);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
    color: #e6fbff;
    font-family: 'Luckiest Guy', cursive;
    overflow: hidden;
}

.spawn-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.spawn-title {
    font-size: 18px;
    letter-spacing: 2px;
}

.spawn-close {
    border: 1px solid rgba(255, 99, 71, 0.7);
    background: rgba(0, 0, 0, 0.7);
    color: #ff9a8a;
    border-radius: 10px;
    padding: 4px 10px;
    cursor: pointer;
}

.spawn-body {
    display: grid;
    gap: 10px;
}

.edit-spawn-body {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 14px;
    max-height: calc(88vh - 70px);
}

.edit-spawn-sidebar,
.edit-spawn-editor {
    min-height: 0;
}

.edit-spawn-list {
    margin-top: 8px;
    max-height: calc(88vh - 130px);
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    background: rgba(6, 12, 22, 0.75);
    padding: 8px;
}

.edit-spawn-entry {
    width: 100%;
    display: grid;
    gap: 4px;
    text-align: left;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 10px;
    border: 1px solid rgba(0, 229, 255, 0.18);
    background: rgba(0, 0, 0, 0.55);
    color: #e6fbff;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.edit-spawn-entry.active {
    border-color: rgba(50, 205, 50, 0.7);
    box-shadow: inset 0 0 0 1px rgba(50, 205, 50, 0.3);
}

.edit-spawn-entry span,
.edit-spawn-hint,
.edit-spawn-summary {
    font-size: 12px;
    color: #9fb6d1;
}

.edit-spawn-editor {
    overflow-y: auto;
    padding-right: 4px;
}

@media (max-width: 900px) {
    .edit-spawn-card {
        width: min(96vw, 96vw);
        max-height: 92vh;
    }

    .edit-spawn-body {
        grid-template-columns: 1fr;
        max-height: calc(92vh - 70px);
    }

    .edit-spawn-list {
        max-height: 220px;
    }
}

.spawn-row {
    display: grid;
    gap: 6px;
}

.spawn-row label {
    font-size: 12px;
    color: #9fb6d1;
}

.spawn-row input,
.spawn-row select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    background: rgba(0, 0, 0, 0.7);
    color: #e6fbff;
    font-family: 'Luckiest Guy', cursive;
}

.spawn-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 6px;
}

.spawn-actions button {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(50, 205, 50, 0.6);
    background: rgba(0, 0, 0, 0.7);
    color: #c9ffd0;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.spawn-actions #spawn-cancel {
    border-color: rgba(255, 99, 71, 0.6);
    color: #ff9a8a;
}

.spawn-hint {
    font-size: 11px;
    color: #9fb6d1;
    text-align: center;
}

.spawn-drop-form {
    display: grid;
    grid-template-columns: 1fr 110px auto;
    gap: 8px;
}

.spawn-drop-form button {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(50, 205, 50, 0.6);
    background: rgba(0, 0, 0, 0.7);
    color: #c9ffd0;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.spawn-drop-list {
    margin-top: 6px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    background: rgba(6, 12, 22, 0.7);
    max-height: 180px;
    overflow-y: auto;
}

.chest-list {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    background: rgba(6, 12, 22, 0.75);
    max-height: 320px;
    overflow-y: auto;
}

.chest-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.chest-title {
    font-size: 12px;
    color: #9fb6d1;
    margin-bottom: 6px;
}

.chest-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0, 229, 255, 0.15);
}

.chest-row:last-child {
    border-bottom: none;
}

.chest-row.draggable {
    cursor: grab;
}

.chest-row.draggable:active {
    cursor: grabbing;
}

.chest-list.drop-target {
    outline: 2px dashed rgba(50, 205, 50, 0.65);
    outline-offset: 2px;
}

.chest-row button {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(50, 205, 50, 0.6);
    background: rgba(0, 0, 0, 0.7);
    color: #c9ffd0;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.chest-empty {
    font-size: 12px;
    color: #9fb6d1;
    padding: 6px 0;
}

.chest-status {
    font-size: 12px;
    color: #c9ffd0;
    margin-bottom: 8px;
}

@media (max-width: 900px) {
    .chest-dual {
        grid-template-columns: 1fr;
    }
}

#chat-panel {
    position: fixed;
    left: 18px;
    bottom: 18px;
    width: min(360px, 90vw);
    background: rgba(10, 16, 26, 0.9);
    border: 2px solid rgba(0, 229, 255, 0.35);
    border-radius: 14px;
    padding: 10px;
    z-index: 1200;
    font-family: 'Luckiest Guy', cursive;
    color: #e6fbff;
}

#chat-panel.hidden {
    display: none;
}

.chat-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.chat-tab {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    background: rgba(0, 0, 0, 0.6);
    color: #8ee9ff;
    cursor: pointer;
    font-size: 12px;
}

.chat-tab.active {
    background: rgba(0, 229, 255, 0.2);
    color: #fff;
}

.chat-messages {
    height: 160px;
    overflow-y: auto;
    padding: 6px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 10px;
    margin-bottom: 6px;
    font-size: 12px;
}

.chat-msg {
    margin-bottom: 4px;
}

.chat-name {
    color: #ffd36a;
}

.chat-text {
    color: #e6fbff;
}

.chat-input-row {
    display: grid;
    grid-template-columns: 1fr 80px;
    gap: 6px;
}

#chat-text-input {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    background: rgba(0, 0, 0, 0.7);
    color: #e6fbff;
    font-family: 'Luckiest Guy', cursive;
}

#chat-send-btn {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(50, 205, 50, 0.6);
    background: rgba(0, 0, 0, 0.7);
    color: #c9ffd0;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

#private-chat-dock {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1250;
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-end;
    gap: 10px;
    max-width: calc(100vw - 24px);
    pointer-events: none;
}

.private-chat-window {
    width: min(320px, 84vw);
    background: rgba(8, 14, 24, 0.95);
    border: 2px solid rgba(0, 229, 255, 0.42);
    border-radius: 12px;
    overflow: hidden;
    pointer-events: auto;
}

.private-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.28);
    background: rgba(0, 0, 0, 0.35);
    color: #9beeff;
    font-size: 12px;
}

.private-chat-close {
    border: none;
    background: transparent;
    color: #dff8ff;
    cursor: pointer;
    font-size: 14px;
}

.private-chat-messages {
    height: 180px;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.private-chat-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
}

.private-chat-row .name {
    color: #ffd36a;
}

.private-chat-row .text {
    color: #e6fbff;
    line-height: 1.25;
    word-break: break-word;
}

.private-chat-row.outgoing .name {
    color: #8ff5a5;
}

.private-chat-input-row {
    display: grid;
    grid-template-columns: 1fr 70px;
    gap: 6px;
    padding: 8px;
    border-top: 1px solid rgba(0, 229, 255, 0.24);
}

.private-chat-input {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    background: rgba(0, 0, 0, 0.7);
    color: #e6fbff;
    font-family: 'Luckiest Guy', cursive;
}

.private-chat-send {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(50, 205, 50, 0.6);
    background: rgba(0, 0, 0, 0.7);
    color: #c9ffd0;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

#battle-log-panel {
    position: fixed;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: min(340px, 86vw);
    max-height: 60vh;
    overflow: hidden;
    background: rgba(10, 16, 26, 0.92);
    border: 2px solid rgba(255, 122, 122, 0.35);
    border-radius: 14px;
    padding: 10px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    font-family: 'Luckiest Guy', cursive;
    color: #ffe8e8;
}

#battle-log-panel.hidden {
    display: none;
}

.battle-log-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    letter-spacing: 0.6px;
    color: #ffb0b0;
    margin-bottom: 6px;
}

.battle-log-toggle {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 176, 176, 0.45);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
    color: #ffd5d5;
    font-family: 'Luckiest Guy', cursive;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.battle-log-messages {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px;
    background: rgba(0, 0, 0, 0.48);
    border-radius: 10px;
    font-size: 12px;
}

.battle-log-row {
    margin-bottom: 4px;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#battle-log-panel.collapsed {
    width: auto;
    max-height: none;
    padding: 8px 10px;
}

#battle-log-panel.collapsed .battle-log-title {
    margin-bottom: 0;
}

#battle-log-panel.collapsed .battle-log-messages {
    display: none;
}

@media (max-width: 768px) {
    #game-notifications {
        display: none !important;
    }

    #battle-log-panel {
        left: 8px;
        top: auto;
        bottom: calc(150px + env(safe-area-inset-bottom));
        transform: none;
        width: min(220px, 58vw);
        max-height: 36vh;
        padding: 8px;
        border-radius: 12px;
        overflow: hidden;
    }

    .battle-log-title {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .battle-log-toggle {
        width: 24px;
        height: 24px;
    }

    .battle-log-messages {
        max-height: none;
        font-size: 11px;
        padding: 5px;
    }

    #battle-log-panel.collapsed {
        width: auto;
        max-width: 44vw;
        bottom: calc(140px + env(safe-area-inset-bottom));
    }

    .battle-actions,
    .battle-btn,
    .battle-pet-btn,
    .combatant {
        touch-action: manipulation;
    }
}

#digimon-analysis {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(0, 0, 0, 0.68);
    display: flex;
    align-items: center;
    justify-content: center;
}

.digimon-analysis-panel {
    width: min(920px, 92vw);
    max-height: 90vh;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.95), rgba(10, 20, 30, 0.92));
    border: 2px solid rgba(0, 229, 255, 0.5);
    border-radius: 24px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.digimon-analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.15), rgba(0, 0, 0, 0.6));
    border-bottom: 1px solid rgba(0, 229, 255, 0.25);
}

.digimon-analysis-title {
    font-size: 22px;
    color: #e6fbff;
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.55);
}

.digimon-analysis-bits {
    padding: 0 22px 12px;
    font-size: 12px;
    color: #ffe28a;
}

.digimon-analysis-close {
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 18px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.digimon-analysis-body {
    padding: 16px;
    display: grid;
    gap: 14px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.digimon-analysis-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(0, 229, 255, 0.3);
    background: rgba(0, 0, 0, 0.5);
}

.digimon-analysis-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: #eaffff;
    font-family: 'Luckiest Guy', cursive;
    font-size: 13px;
    outline: none;
}

.digimon-analysis-lupe {
    font-size: 16px;
}

.digimon-analysis-content {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    align-items: stretch;
}

.digimon-analysis-list {
    display: grid;
    gap: 10px;
    max-height: 52vh;
    overflow-y: auto;
    padding-right: 6px;
}

.digimon-analysis-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 229, 255, 0.25);
    background: rgba(0, 0, 0, 0.55);
    color: #e6faff;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
    text-align: left;
}

.digimon-analysis-item.active {
    border-color: rgba(50, 205, 50, 0.7);
    box-shadow: 0 0 10px rgba(50, 205, 50, 0.4);
}

.digimon-analysis-item-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(0, 229, 255, 0.25);
    background: rgba(0, 229, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9adfff;
    font-size: 12px;
    overflow: hidden;
}

.digimon-analysis-item-img img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.digimon-analysis-item-name {
    font-size: 13px;
}

.digimon-analysis-detail {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: #eaffff;
    min-height: 320px;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-x: hidden;
}

.digimon-detail-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.digimon-detail-title {
    font-size: 20px;
    color: #e6fbff;
}

.anomalous-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 8px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 30%, rgba(255,255,255,0.95), rgba(255,255,255,0.15) 28%, rgba(124, 76, 172, 0.7) 30%, rgba(8, 8, 14, 0.96) 72%);
    color: #fff6c9;
    font-size: 14px;
    line-height: 1;
    border: 1px solid rgba(220, 194, 255, 0.9);
    box-shadow:
        0 0 0 1px rgba(20, 12, 30, 0.8),
        0 0 12px rgba(194, 154, 255, 0.8),
        0 0 24px rgba(20, 20, 30, 0.95);
    animation: anomalousBadgePulse 1.8s ease-in-out infinite;
    vertical-align: middle;
}

.digimon-detail-id {
    font-size: 12px;
    color: #9adfff;
}

.digimon-detail-visual {
    background: rgba(0, 0, 0, 0.55);
    border-radius: 14px;
    border: 1px dashed rgba(0, 229, 255, 0.3);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.digimon-detail-visual img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.5));
}

.digimon-detail-placeholder {
    font-size: 12px;
    color: #9adfff;
}

.digimon-detail-section {
    margin-bottom: 12px;
}

.digimon-detail-section-title {
    font-size: 13px;
    color: #bffbff;
    margin-bottom: 6px;
}

.digimon-detail-text {
    font-size: 12px;
    line-height: 1.4;
    color: #e5faff;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    white-space: pre-wrap;
}

.digimon-detail-empty {
    color: #cbdfe6;
    text-align: center;
    padding: 40px 10px;
}

#esc-menu {
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
}

.esc-menu-panel {
    width: min(720px, 88vw);
    max-height: 80vh;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.95), rgba(10, 20, 10, 0.9));
    border: 2px solid rgba(50, 205, 50, 0.7);
    border-radius: 24px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.esc-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: linear-gradient(90deg, rgba(50, 205, 50, 0.2), rgba(0, 0, 0, 0.5));
    border-bottom: 1px solid rgba(50, 205, 50, 0.3);
}

.esc-menu-title {
    font-size: 22px;
    color: #E6FFE6;
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(50, 205, 50, 0.6);
}

.esc-menu-bits {
    margin-left: auto;
    margin-right: 10px;
    font-size: 12px;
    color: #ffe28a;
}

.esc-close {
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 18px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.esc-menu-body {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.4);
}

.esc-tabs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.esc-tab {
    border: 1px solid transparent;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #d8ffd8;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.esc-tab.active {
    background: rgba(50, 205, 50, 0.25);
    border-color: rgba(50, 205, 50, 0.7);
    color: #fff;
    box-shadow: 0 0 15px rgba(50, 205, 50, 0.4);
}

.esc-content {
    padding: 6px;
    max-height: 52vh;
    overflow-y: auto;
    border: 1px solid rgba(50, 205, 50, 0.15);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.35);
}

.esc-empty {
    color: #ccc;
    text-align: center;
    padding: 30px 10px;
    text-shadow: 1px 1px 0 #000;
}

.esc-item-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.item-card {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(50, 205, 50, 0.35);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 16px;
}

.item-count {
    color: #32CD32;
    font-size: 14px;
}

.item-desc {
    color: #c6c6c6;
    font-size: 13px;
    line-height: 1.4;
}

.item-use-btn {
    margin-top: auto;
    padding: 8px 12px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(to bottom, #32CD32 0%, #1f7f1f 100%);
    color: #fff;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
}

.item-use-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pet-db-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.pet-card {
    border: 1px solid rgba(0, 229, 255, 0.4);
    background: rgba(0, 0, 0, 0.55);
    border-radius: 16px;
    padding: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: #fff;
    cursor: pointer;
    text-align: left;
}

.pet-card.active {
    border-color: rgba(50, 205, 50, 0.8);
    box-shadow: 0 0 12px rgba(50, 205, 50, 0.4);
}

.pet-card.dragging {
    opacity: 0.55;
}

.pet-card.drop-target {
    border-color: rgba(255, 215, 0, 0.9);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.pet-card-img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(0, 229, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 229, 255, 0.35);
}

.pet-card-img img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.pet-card-info {
    flex: 1;
    min-width: 0;
}

.pet-card-name {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pet-card-meta {
    font-size: 11px;
    color: #9adfff;
}

.pet-card-action {
    margin-left: auto;
    font-size: 11px;
    color: #32CD32;
    white-space: nowrap;
}

#pet-hub {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pet-hub-panel {
    width: min(720px, 90vw);
    max-height: 78vh;
    overflow: auto;
    background: radial-gradient(circle at top, rgba(20, 40, 20, 0.95), rgba(0, 0, 0, 0.95));
    border-radius: 26px;
    border: 2px solid rgba(0, 229, 255, 0.4);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    padding: 16px;
}

.pet-hub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.pet-hub-actions {
    display: flex;
    justify-content: flex-end;
    margin: -8px 0 12px;
}

.pet-hub-danger {
    border: 1px solid rgba(255, 110, 110, 0.65);
    background: rgba(88, 16, 16, 0.72);
    color: #ffd5d5;
    font-family: 'Luckiest Guy', cursive;
    letter-spacing: 0.5px;
    border-radius: 10px;
    padding: 7px 12px;
    cursor: pointer;
}

.pet-hub-danger:hover {
    background: rgba(130, 24, 24, 0.82);
}

.pet-hub-title {
    font-size: 22px;
    color: #E6FFFF;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}

.pet-hub-anomalous-ribbon {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(214, 183, 255, 0.8);
    background: linear-gradient(135deg, rgba(8, 8, 14, 0.95), rgba(72, 32, 102, 0.88));
    color: #fff3cc;
    font-family: 'Luckiest Guy', cursive;
    font-size: 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 0 0 18px rgba(73, 38, 104, 0.85);
}

.pet-hub-subtitle {
    color: #a0ffd8;
    font-size: 12px;
    margin-top: 4px;
}

.pet-hub-close {
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 18px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.pet-hub-body {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    align-items: start;
}

.pet-hub-visual {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(0, 229, 255, 0.3);
    text-align: center;
}

.pet-hub-visual img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.5));
}

.pet-hub-quick {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    font-size: 12px;
    color: #d9faff;
}

.pet-hub-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.pet-stat {
    background: rgba(0, 0, 0, 0.55);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(50, 205, 50, 0.25);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.pet-hub-attrs {
    margin-top: 14px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(50, 205, 50, 0.2);
    background: rgba(0, 0, 0, 0.45);
}

.pet-attr-title {
    font-size: 14px;
    color: #bfffbf;
    margin-bottom: 10px;
}

.pet-attr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    color: #e5ffe5;
    font-size: 12px;
}

.pet-attr-grid div {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 8px;
    border-radius: 10px;
}

.pet-hub-evo {
    margin-top: 20px;
}

.pet-evo-title {
    font-size: 14px;
    color: #9adfff;
    margin-bottom: 8px;
}

.pet-evo-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}

.pet-evo-card {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: #e7faff;
    font-size: 12px;
}

.pet-evo-card.active {
    border-color: rgba(50, 205, 50, 0.8);
    box-shadow: 0 0 12px rgba(50, 205, 50, 0.5);
}

.pet-evo-card img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    margin-bottom: 6px;
}

.esc-content::-webkit-scrollbar,
.pet-hub-panel::-webkit-scrollbar {
    width: 8px;
}

.esc-content::-webkit-scrollbar-track,
.pet-hub-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
}

.esc-content::-webkit-scrollbar-thumb,
.pet-hub-panel::-webkit-scrollbar-thumb {
    background: rgba(50, 205, 50, 0.6);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.4);
}

.esc-content,
.pet-hub-panel {
    scrollbar-width: thin;
    scrollbar-color: rgba(50, 205, 50, 0.6) rgba(0, 0, 0, 0.4);
}

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

*::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(50, 205, 50, 0.6);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.4);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(50, 205, 50, 0.6) rgba(0, 0, 0, 0.4);
}

@media (max-width: 700px) {
    .esc-menu-body {
        grid-template-columns: 1fr;
    }
    .pet-hub-body {
        grid-template-columns: 1fr;
    }
    .digimon-analysis-content {
        grid-template-columns: 1fr;
    }
    #digimon-analysis-icon {
        top: 62px;
        right: 12px;
    }
}

/* ========================================
   MOBILE PACK (UI COMPLETA)
   ======================================== */
@media (max-width: 900px) {
    html,
    body {
        overscroll-behavior: none;
        -webkit-tap-highlight-color: transparent;
    }

    #start-screen {
        padding: 18px;
    }

    #btn-start {
        font-size: clamp(24px, 7vw, 34px);
        text-align: center;
        line-height: 1.15;
        letter-spacing: 2px;
    }

    #skip-hint {
        bottom: max(14px, env(safe-area-inset-bottom));
        right: 10px;
        font-size: 11px;
        padding: 8px 12px;
    }

    .loading-title {
        font-size: clamp(30px, 8vw, 42px);
        letter-spacing: 1px;
    }

    .loading-subtitle {
        font-size: 14px;
    }

    #auth-modal {
        align-items: flex-start;
        justify-content: center;
        padding:
            max(16px, env(safe-area-inset-top))
            10px
            max(16px, env(safe-area-inset-bottom));
        overflow-y: auto;
    }

    .glass-box {
        width: min(94vw, 420px);
        padding: 18px 14px;
        border-radius: 16px;
    }

    #login-logo {
        width: min(44vw, 150px);
        margin-bottom: 12px;
    }

    .glass-box input {
        padding: 12px;
        font-size: 16px;
    }

    .auth-row {
        flex-direction: column;
        gap: 8px;
    }

    .btn-main,
    .btn-sub {
        min-height: 46px;
        font-size: 15px;
        padding: 12px 14px;
    }

    #char-selection-screen {
        justify-content: flex-start;
        padding:
            max(16px, env(safe-area-inset-top))
            10px
            max(16px, env(safe-area-inset-bottom));
        overflow-y: auto;
    }

    .hero-title {
        font-size: clamp(28px, 9vw, 40px);
        margin-bottom: 18px;
        line-height: 1.1;
        text-align: center;
    }

    #char-slots-container {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        align-items: center;
        justify-items: center;
        gap: 20px;
        padding-bottom: 14px;
    }

    .char-slot {
        width: min(220px, 72vw);
        height: 250px;
    }

    .char-name-tag {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .platform-3d {
        width: 150px;
        height: 78px;
    }

    .add-char-btn {
        width: 112px;
        height: 170px;
        font-size: 44px;
    }

    .char-preview {
        margin-bottom: -16px;
    }

    #digipix-hud {
        top: max(8px, env(safe-area-inset-top));
        left: 8px;
        transform: none;
        gap: 5px;
        padding: 7px 9px;
        z-index: 1805;
    }

    .digipix-label {
        font-size: 10px;
    }

    .digipix-value,
    .diamonds-value,
    .npc-coins-value,
    .dg-coins-value,
    .pvp-coins-value {
        font-size: 14px;
    }

    #game-clock {
        top: calc(max(8px, env(safe-area-inset-top)) + 92px);
        left: 8px;
        right: auto;
        transform: none;
        min-width: 172px;
        padding: 6px 8px;
    }

    .game-clock-time {
        font-size: 12px;
    }

    .game-clock-period {
        font-size: 10px;
    }

    .game-clock-vip {
        font-size: 10px;
    }

    .game-clock-vip-remaining {
        font-size: 9px;
    }

    .game-clock-icon {
        width: 18px;
        height: 18px;
    }

    #area-enemies-panel {
        top: auto;
        bottom: calc(96px + env(safe-area-inset-bottom) + 132px);
        left: 8px;
        width: 220px;
        max-height: min(58vh, 460px);
    }

    #area-enemies-toggle {
        font-size: 11px;
        padding: 7px 8px;
    }

    .area-enemies-name {
        font-size: 11px;
    }

    #player-coords-hud {
        top: calc(max(8px, env(safe-area-inset-top)) + 132px);
        left: 8px;
        transform: none;
        padding: 4px 8px;
        font-size: 10px;
        max-width: 58vw;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #vip-status-banner {
        top: calc(max(8px, env(safe-area-inset-top)) + 46px);
        min-width: 0;
        width: min(94vw, 420px);
        padding: 6px 8px;
        gap: 8px;
    }

    .vip-status-icon {
        width: 34px;
        height: 34px;
        font-size: 10px;
    }

    .vip-status-title {
        font-size: 11px;
    }

    .vip-status-timer {
        font-size: 12px;
    }

    #pet-hud {
        top: calc(max(8px, env(safe-area-inset-top)) + 92px);
        left: 8px;
        transform: scale(0.84);
        transform-origin: top left;
        max-width: 62vw;
    }

    .pet-hud-core {
        width: 72px;
        height: 72px;
    }

    #pet-hud-img {
        inset: 9px;
        width: 54px;
        height: 54px;
    }

    .pet-hud-bars {
        min-width: 138px;
    }

    .pet-hud-name {
        font-size: 13px;
    }

    .pet-hud-bar {
        width: 138px;
        height: 10px;
    }

    .pet-hud-bar.xp {
        height: 5px;
    }

    .pet-hud-quick,
    .pet-hud-list {
        max-width: 230px;
    }

    .pet-hud-entry {
        min-width: 170px;
    }

    #right-menu-toggle {
        top: calc(max(8px, env(safe-area-inset-top)) + 94px);
        right: 8px;
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .right-menu-popout {
        top: calc(max(8px, env(safe-area-inset-top)) + 138px);
        right: 8px;
        min-width: 112px;
        padding: 6px 8px;
    }

    .right-menu-popout-sub {
        display: none;
    }

    #esc-menu-icon,
    #digimon-analysis-icon,
    #pvp-open-btn,
    #pvp-close-btn,
    #auction-btn,
    #vip-shop-btn,
    #daily-roulette-btn,
    #quest-btn,
    #friend-btn,
    #guild-btn,
    #chat-toggle-btn,
    #desbug-toggle-btn {
        right: 8px;
        padding: 6px 8px;
        border-radius: 10px;
        font-size: 11px;
        letter-spacing: 0.4px;
        max-width: 112px;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    #esc-menu-icon {
        top: calc(max(8px, env(safe-area-inset-top)) + 138px);
    }

    #digimon-analysis-icon {
        top: calc(max(8px, env(safe-area-inset-top)) + 178px);
    }

    #pvp-open-btn,
    #pvp-close-btn {
        top: calc(max(8px, env(safe-area-inset-top)) + 218px);
    }

    #auction-btn {
        top: calc(max(8px, env(safe-area-inset-top)) + 258px);
    }

    #vip-shop-btn {
        top: calc(max(8px, env(safe-area-inset-top)) + 298px);
    }

    #daily-roulette-btn {
        top: calc(max(8px, env(safe-area-inset-top)) + 338px);
    }

    #quest-btn {
        top: calc(max(8px, env(safe-area-inset-top)) + 378px);
    }

    #friend-btn {
        top: calc(max(8px, env(safe-area-inset-top)) + 418px);
    }

    #guild-btn {
        top: calc(max(8px, env(safe-area-inset-top)) + 458px);
    }

    #chat-toggle-btn {
        top: calc(max(8px, env(safe-area-inset-top)) + 498px);
    }

    #desbug-toggle-btn {
        top: calc(max(8px, env(safe-area-inset-top)) + 538px);
    }

    #npc-dialog {
        left: 50%;
        transform: translateX(-50%);
        width: min(94vw, 460px);
        min-width: 0;
        bottom: calc(100px + env(safe-area-inset-bottom));
        padding: 10px 12px;
    }

    .npc-dialog-name {
        font-size: 12px;
    }

    .npc-dialog-text {
        font-size: 14px;
        line-height: 1.25;
    }

    #virtual-joystick {
        left: max(10px, env(safe-area-inset-left));
        bottom: max(10px, env(safe-area-inset-bottom));
    }

    #mobile-interact-btn {
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
        min-width: 116px;
        padding: 12px 14px;
        font-size: 16px;
    }

    #chat-panel {
        left: 8px;
        right: 8px;
        width: auto;
        bottom: calc(96px + env(safe-area-inset-bottom));
        max-height: 38vh;
        padding: 8px;
    }

    .chat-messages {
        height: 120px;
    }

    #party-panel {
        right: 8px;
        top: calc(max(8px, env(safe-area-inset-top)) + 548px);
        width: min(300px, 90vw);
        max-height: 30vh;
    }

    #minimap {
        width: 124px;
        height: 124px;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
    }

    .esc-menu-panel,
    .pet-hub-panel,
    .digimon-analysis-panel,
    .trade-card,
    .vip-shop-card,
    .auction-card,
    .championship-card,
    .minigame-card,
    .spawn-card,
    .npc-creator-panel,
    .npc-panel-box,
    .monster-scale-box {
        width: min(96vw, 880px);
        max-height: 86vh;
        border-radius: 16px;
        padding: 12px;
    }

    .esc-menu-header,
    .npc-creator-header,
    .npc-panel-header,
    .digimon-analysis-header {
        padding: 10px 12px;
    }

    .esc-menu-title,
    .npc-creator-title,
    .npc-panel-title,
    .digimon-analysis-title {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .esc-menu-body {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }

    .esc-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .esc-tab {
        padding: 8px 6px;
        font-size: 11px;
        text-align: center;
    }

    .esc-content {
        max-height: 62vh;
    }

    .digimon-analysis-body {
        padding: 10px;
    }

    .digimon-analysis-content {
        grid-template-columns: 1fr;
        min-height: 0;
        gap: 10px;
    }

    .digimon-analysis-list {
        max-height: 28vh;
    }

    .npc-creator-body,
    .npc-panel-body {
        max-height: 70vh;
        overflow-y: auto;
        padding: 10px;
    }

    .npc-field-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .npc-shop-item,
    .npc-hospital-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .npc-shop-item button,
    .npc-hospital-item button,
    .npc-action-btn,
    .npc-evolution-apply {
        width: 100%;
    }

    .trade-body,
    .auction-body,
    .card-deck-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 600px) {
    #btn-start {
        font-size: 24px;
    }

    .hero-title {
        font-size: 28px;
    }

    #pet-hud {
        transform: scale(0.78);
    }

    #esc-menu-icon,
    #digimon-analysis-icon,
    #pvp-open-btn,
    #pvp-close-btn,
    #auction-btn,
    #vip-shop-btn,
    #daily-roulette-btn,
    #quest-btn,
    #friend-btn,
    #guild-btn,
    #chat-toggle-btn,
    #desbug-toggle-btn {
        max-width: 98px;
        font-size: 10px;
    }

    #chat-panel {
        bottom: calc(88px + env(safe-area-inset-bottom));
    }

    #area-enemies-panel {
        top: auto;
        bottom: calc(88px + env(safe-area-inset-bottom) + 132px);
    }
}
