/* ═══════════════════════════════════════════════════
   🌲 FOREST KINGDOM MODULE v1.0
   3rd Map — Enchanted Forest Theme
   ═══════════════════════════════════════════════════ */

#forest-kingdom-container {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #0a1a0a;
    overflow: hidden;
    font-family: 'Nunito', 'Segoe UI', sans-serif;
}
#forest-kingdom-container.active {
    display: block;
}
/* Override global img reset */
#forest-kingdom-container img {
    max-width: none;
    height: auto;
}

/* ── Header ── */
.fk-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: linear-gradient(135deg, rgba(15,40,15,0.97), rgba(30,60,20,0.97));
    border-bottom: 2px solid rgba(100,200,50,0.4);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 10;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.fk-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.fk-header-title span:first-child { font-size: 28px; }
.fk-header-title h2 {
    font-size: 20px;
    font-weight: 800;
    color: #7cfc00;
    text-shadow: 0 0 12px rgba(124,252,0,0.4);
    letter-spacing: 1px;
    margin: 0;
}
.fk-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(124,252,0,0.15);
    border: 2px solid rgba(124,252,0,0.4);
    color: #7cfc00;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}
.fk-back-btn:hover {
    background: rgba(124,252,0,0.25);
    transform: translateX(-3px);
    box-shadow: 0 4px 16px rgba(124,252,0,0.3);
}
.fk-stats-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}
.fk-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(124,252,0,0.2);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 700;
    color: #7cfc00;
}

/* ── Map ── */
.fk-map {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}
.fk-map-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-image: url('https://ingilizcemaarif.com/Treasureisland/forest/forest.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.fk-map-bg img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

/* ── Fog ── */
.fk-fog {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0.3;
    background:
        radial-gradient(ellipse 60% 40% at 20% 80%, rgba(0,60,0,0.25) 0%, transparent 70%),
        radial-gradient(ellipse 50% 50% at 80% 20%, rgba(0,80,20,0.15) 0%, transparent 70%);
    animation: fkFogDrift 20s ease-in-out infinite alternate;
}
@keyframes fkFogDrift {
    0%   { opacity: 0.6; transform: translateX(0); }
    100% { opacity: 0.9; transform: translateX(-30px); }
}

/* ── Fireflies ── */
.fk-firefly {
    position: absolute;
    width: 4px; height: 4px;
    background: #7cfc00;
    border-radius: 50%;
    box-shadow: 0 0 8px 3px rgba(124,252,0,0.6), 0 0 20px 6px rgba(124,252,0,0.3);
    z-index: 3;
    pointer-events: none;
    animation: fkFirefly 6s ease-in-out infinite;
}
@keyframes fkFirefly {
    0%   { opacity: 0; transform: translate(0,0) scale(0.5); }
    25%  { opacity: 1; transform: translate(15px,-20px) scale(1); }
    50%  { opacity: 0.6; transform: translate(-10px,-40px) scale(0.8); }
    75%  { opacity: 1; transform: translate(20px,-25px) scale(1.1); }
    100% { opacity: 0; transform: translate(5px,-50px) scale(0.5); }
}

/* ── Islands ── */
.fk-islands-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}
.fk-island {
    position: absolute;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: fkIslandAppear 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.fk-island:nth-child(1)  { animation-delay: 0.1s; }
.fk-island:nth-child(2)  { animation-delay: 0.2s; }
.fk-island:nth-child(3)  { animation-delay: 0.3s; }
.fk-island:nth-child(4)  { animation-delay: 0.4s; }
.fk-island:nth-child(5)  { animation-delay: 0.5s; }
.fk-island:nth-child(6)  { animation-delay: 0.6s; }
.fk-island:nth-child(7)  { animation-delay: 0.7s; }
.fk-island:nth-child(8)  { animation-delay: 0.8s; }
.fk-island:nth-child(9)  { animation-delay: 0.9s; }
.fk-island:nth-child(10) { animation-delay: 1.0s; }
@keyframes fkIslandAppear {
    0%   { opacity: 0; transform: scale(0.4) translateY(30px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.fk-island:hover {
    transform: scale(1.12) translateY(-8px);
    z-index: 20;
    filter: drop-shadow(0 12px 24px rgba(124,252,0,0.4));
}
.fk-island:active { transform: scale(0.95); }
.fk-island.fk-locked {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(80%) brightness(0.7);
}
.fk-island.fk-locked:hover {
    transform: scale(1.02);
    filter: grayscale(80%) brightness(0.7);
}
.fk-island-img {
    width: 130px;
    height: auto !important;
    max-width: none !important;
    display: block !important;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.5));
    transition: all 0.3s ease;
}
.fk-island-label {
    margin-top: 6px;
    background: rgba(10,30,10,0.88);
    color: #7cfc00;
    border: 1.5px solid rgba(124,252,0,0.45);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    text-shadow: 0 0 6px rgba(124,252,0,0.3);
}
.fk-island-progress {
    margin-top: 4px;
    width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.fk-island-progress-track {
    width: 100%;
    height: 5px;
    background: rgba(0,0,0,0.4);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(124,252,0,0.2);
}
.fk-island-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4caf50, #7cfc00);
    border-radius: 10px;
    transition: width 0.7s ease;
}
.fk-island-progress-fill.fk-complete {
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    box-shadow: 0 0 6px rgba(255,215,0,0.6);
}
.fk-island-progress-label {
    font-size: 9px;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.fk-island-lock {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    font-size: 42px;
    z-index: 15;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.8));
    animation: fkLockPulse 2s ease-in-out infinite;
}
@keyframes fkLockPulse {
    0%,100% { transform: translate(-50%,-50%) scale(1); }
    50%     { transform: translate(-50%,-50%) scale(1.1); }
}

/* ── Preview Modal ── */
.fk-preview-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
}
.fk-preview-overlay.active { display: flex; }
.fk-preview-card {
    background: linear-gradient(160deg, #0a2a0a, #1a4a1a 50%, #0d3d0d);
    border: 3px solid rgba(124,252,0,0.4);
    border-radius: 28px;
    padding: 40px 36px;
    max-width: 460px;
    width: 92%;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 60px rgba(124,252,0,0.1);
    animation: fkCardIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes fkCardIn {
    0%   { opacity: 0; transform: scale(0.7) translateY(30px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.fk-preview-icon {
    font-size: 72px;
    margin-bottom: 16px;
    animation: fkIconFloat 3s ease-in-out infinite;
}
@keyframes fkIconFloat {
    0%,100% { transform: translateY(0) rotate(-2deg); }
    50%     { transform: translateY(-10px) rotate(2deg); }
}
.fk-preview-title {
    font-size: 28px;
    font-weight: 900;
    color: #7cfc00;
    text-shadow: 0 0 20px rgba(124,252,0,0.4);
    margin-bottom: 8px;
}
.fk-preview-desc {
    font-size: 15px;
    color: rgba(255,255,255,0.75);
    line-height: 1.6;
    margin-bottom: 24px;
}
.fk-preview-req {
    background: rgba(124,252,0,0.1);
    border: 1px solid rgba(124,252,0,0.3);
    border-radius: 16px;
    padding: 14px 20px;
    margin-bottom: 24px;
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    font-weight: 600;
}
.fk-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #4caf50, #7cfc00);
    color: #0a1a0a;
    border: none;
    border-radius: 50px;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 0 #2e7d32, 0 8px 24px rgba(76,175,80,0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.fk-preview-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #2e7d32, 0 12px 28px rgba(76,175,80,0.45);
}
.fk-preview-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
.fk-preview-close {
    margin-top: 16px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
}
.fk-preview-close:hover { color: rgba(255,255,255,0.9); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .fk-header { height: 52px; padding: 0 12px; }
    .fk-header-title h2 { font-size: 16px; }
    .fk-back-btn { padding: 6px 14px; font-size: 12px; }
    .fk-stats-bar { display: none; }
    .fk-map { top: 52px; }
    .fk-island-img { width: 75px !important; }
    .fk-island-label { font-size: 9px; padding: 3px 8px; }
    .fk-island-progress { width: 65px; }
}
@media (max-width: 480px) {
    .fk-header { height: 48px; padding: 0 8px; }
    .fk-header-title span:first-child { font-size: 22px; }
    .fk-header-title h2 { font-size: 14px; }
    .fk-back-btn { padding: 5px 10px; font-size: 11px; gap: 4px; }
    .fk-map { top: 48px; }
    .fk-island-img { width: 65px !important; }
    .fk-island-label { font-size: 8px; padding: 2px 6px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
    .fk-island-progress { display: none; }
}
