:root {
    --grid-size: 8;
    --cell-size: 65px;
    --gap: 0px;
    --bg-color: #fce4ec;
    --board-bg: #f06292;
    --cell-bg: transparent;
    --text-color: #880e4f;
    --accent-color: #c2185b;
}

body {
    margin: 0;
    padding: 0;
    background: url('assets/bg_1.webp') center center / cover no-repeat fixed !important;
    font-family: 'Pacifico', cursive, sans-serif !important;
    color: var(--text-color) !important;
    overflow-x: hidden;
}

.kendy-app-container {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

/* Screen Management */
.map-screen, .game-screen {
    display: none;
    width: 100%;
    min-height: 100vh;
}

.map-screen.active, .game-screen.active {
    display: flex;
}

.game-screen.active {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    z-index: 1;
}

/* Level Map Screen Styles */
.map-screen {
    flex-direction: row;
    justify-content: space-between;
    padding: 20px;
    background: url('assets/bakcground-level-select.webp') center center / cover no-repeat !important;
}

.map-side-panel {
    width: 270px;
    display: flex;
    flex-direction: column;
    padding: 22px 20px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 24px;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 18px 40px rgba(136, 14, 79, 0.18), inset 0 1px 0 rgba(255,255,255,0.9);
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.map-side-panel.left-panel {
    gap: 22px;
}

.map-side-panel.right-panel {
    justify-content: flex-start;
    align-items: stretch;
    gap: 10px;
}

.panel-section {
    width: 100%;
}

.stat-item {
    background: linear-gradient(135deg, #ffffff 0%, #fff5fa 100%);
    padding: 10px 14px;
    border-radius: 16px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(194, 24, 91, 0.12);
    border: 1px solid rgba(194, 24, 91, 0.12);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--board-bg);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.1;
}

.section-title {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(194, 24, 91, 0.18);
    letter-spacing: 0.02em;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #fff5fa 100%);
    padding: 8px 12px;
    border-radius: 14px;
    margin-bottom: 6px;
    font-size: 0.92rem;
    border: 1px solid rgba(194, 24, 91, 0.1);
    box-shadow: 0 2px 6px rgba(194, 24, 91, 0.08);
}

.friend-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.friend-name {
    flex: 1;
    color: var(--text-color);
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-score {
    color: var(--accent-color);
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
}

.friends-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 12px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px dashed rgba(194, 24, 91, 0.3);
    border-radius: 14px;
    color: rgba(136, 14, 79, 0.75);
    font-size: 0.88rem;
    text-align: center;
}

.friends-empty .bi {
    font-size: 1.6rem;
    color: var(--board-bg);
}

.friends-login-link {
    margin-top: 4px;
    background: var(--accent-color);
    color: #fff;
    text-decoration: none;
    font-family: 'Pacifico', cursive;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    box-shadow: 0 3px 0 #880e4f;
    transition: transform 0.15s, box-shadow 0.15s;
}

.friends-login-link:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 0 #880e4f;
}

.map-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 30px;
    min-width: 0;
}

.map-title {
    font-size: 5rem;
    background: linear-gradient(180deg, #ff4fa3 0%, #c2185b 60%, #880e4f 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent-color);
    text-shadow: 0 4px 0 rgba(255, 255, 255, 0.85), 0 8px 18px rgba(136, 14, 79, 0.3);
    filter: drop-shadow(0 6px 0 rgba(255,255,255,0.6));
    margin: 10px 0 40px;
    letter-spacing: 0.01em;
}

.level-map {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 600px;
    position: relative;
}

.level-node {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, #fff 0%, #ffe1ef 60%, #ffc4dc 100%);
    border: 4px solid var(--board-bg);
    color: var(--accent-color);
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 6px 0px var(--board-bg), inset 0 -6px 12px rgba(194, 24, 91, 0.15), inset 0 4px 6px rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}

.level-node:hover {
    transform: translateY(-5px);
    box-shadow: 0 11px 0px var(--board-bg), inset 0 -6px 12px rgba(194, 24, 91, 0.15), inset 0 4px 6px rgba(255, 255, 255, 0.9);
}

.level-node.active {
    background: radial-gradient(circle at 30% 25%, #fff5fa 0%, #ff4fa3 70%, #c2185b 100%);
    border-color: #fff;
    color: #fff;
    box-shadow: 0 7px 0 #880e4f, 0 0 0 4px rgba(194, 24, 91, 0.35), 0 0 30px rgba(255, 79, 163, 0.6), inset 0 -6px 12px rgba(136, 14, 79, 0.4), inset 0 4px 6px rgba(255, 255, 255, 0.5);
    text-shadow: 0 2px 0 rgba(0,0,0,0.2);
    animation: level-active-pulse 1.6s ease-in-out infinite;
}

@keyframes level-active-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.level-node.active:hover {
    transform: translateY(-4px) scale(1.06);
}

.level-node.locked {
    background: radial-gradient(circle at 30% 25%, #ece8f5 0%, #c8bed8 68%, #9385aa 100%);
    border-color: #6d5d82;
    color: #2f2340;
    cursor: not-allowed;
    box-shadow: 0 4px 0px #5b4d6e, inset 0 -6px 10px rgba(0,0,0,0.14), inset 0 3px 5px rgba(255,255,255,0.65);
    text-shadow: 0 1px 0 rgba(255,255,255,0.55);
}

.level-node.locked:hover {
    transform: none;
    box-shadow: 0 4px 0px #5b4d6e, inset 0 -6px 10px rgba(0,0,0,0.14), inset 0 3px 5px rgba(255,255,255,0.65);
}

.level-node.completed {
    background: radial-gradient(circle at 30% 25%, #fff8e0 0%, #ffe066 70%, #ffb300 100%);
    border-color: #fff;
    color: #b87800;
    box-shadow: 0 6px 0px #b87800, inset 0 -6px 12px rgba(184, 120, 0, 0.3), inset 0 4px 6px rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}

.level-node.completed:hover {
    box-shadow: 0 11px 0px #b87800, inset 0 -6px 12px rgba(184, 120, 0, 0.3), inset 0 4px 6px rgba(255, 255, 255, 0.8);
}

/* Moves Panel */
.moves-panel {
    width: 100%;
    margin-bottom: 0;
}

.moves-box {
    background: linear-gradient(135deg, #d81b60 0%, #c2185b 50%, #880e4f 100%);
    padding: 12px 20px;
    border-radius: 20px;
    border: 3px solid #fff;
    box-shadow: 0 6px 14px rgba(194, 24, 91, 0.35), inset 0 -3px 8px rgba(136,14,79,0.4), inset 0 2px 4px rgba(255,255,255,0.3);
    text-align: center;
}

.moves-label {
    display: block;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
}

.moves-value {
    font-size: 2.4rem;
    font-weight: bold;
    color: #fff;
    line-height: 1.05;
    text-shadow: 0 2px 0 rgba(0,0,0,0.15);
}

/* Objective Display */
.objective-display {
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 40px;
    border: 3px solid var(--board-bg);
    margin-left: auto;
}

.objective-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
}

.objective-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.objective-count.completed {
    color: #4caf50;
    text-decoration: line-through;
}

/* New Mechanic Layers */
.cell .jelly-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 105, 180, 0.4);
    border-radius: 10px;
    z-index: 1;
    pointer-events: none;
}

.cell .double-jelly-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 20, 147, 0.6);
    border-radius: 10px;
    z-index: 1;
    pointer-events: none;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.5);
}

.cell .candy-img {
    z-index: 5;
    transition: transform 0.2s;
}

.cell .overlay-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cell .honey-layer {
    background: radial-gradient(circle, rgba(255, 193, 7, 0.6) 0%, rgba(255, 152, 0, 0.4) 100%);
    border-radius: 10px;
}

.cell .cage-layer {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect x="10" y="10" width="80" height="80" fill="none" stroke="gray" stroke-width="8"/><line x1="30" y1="10" x2="30" y2="90" stroke="gray" stroke-width="8"/><line x1="50" y1="10" x2="50" y2="90" stroke="gray" stroke-width="8"/><line x1="70" y1="10" x2="70" y2="90" stroke="gray" stroke-width="8"/><line x1="10" y1="30" x2="90" y2="30" stroke="gray" stroke-width="8"/><line x1="10" y1="50" x2="90" y2="50" stroke="gray" stroke-width="8"/><line x1="10" y1="70" x2="90" y2="70" stroke="gray" stroke-width="8"/></svg>');
    background-size: cover;
}

.cell .frozen-layer {
    background: rgba(173, 216, 230, 0.5);
    backdrop-filter: blur(2px);
    border-radius: 10px;
    border: 2px solid #fff;
}

/* Modals */
.kendy-modal {
    border-radius: 30px;
    border: 8px solid var(--board-bg);
    background: #fff url('assets/kendy/bg_pattern.png'); /* Pattern fallback */
    box-shadow: 0 20px 0px rgba(0,0,0,0.1);
}

.candy-font {
    font-family: 'Pacifico', cursive;
    color: var(--accent-color);
}

.candy-btn {
    font-family: 'Pacifico', cursive;
    background: var(--accent-color);
    border: none;
    border-radius: 30px;
    padding: 10px 40px;
    box-shadow: 0 6px 0px #880e4f;
    transition: all 0.2s;
}

.candy-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 0px #880e4f;
    background: var(--accent-color);
}

.modal-header .modal-title {
    font-size: 2.5rem;
}

/* Background Blur */
#game-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(6px);
    background-size: cover;
    background-position: center;
}

.back-home-map-btn {
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #ff4fa3 0%, #c2185b 100%);
    padding: 12px 20px;
    border-radius: 16px;
    font-family: 'Pacifico', cursive;
    font-size: 1rem;
    text-align: center;
    box-shadow: 0 4px 0px #880e4f;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}

.back-home-map-btn .bi {
    font-size: 1.2rem;
    width: 22px;
    text-align: center;
}

.back-home-map-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0px #880e4f;
    color: #fff;
}

/* In-Game Screen Styles */
.game-screen {
    flex-direction: column;
    align-items: center;
    background:
        radial-gradient(ellipse at top left, rgba(255, 192, 222, 0.55) 0%, transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(187, 222, 251, 0.45) 0%, transparent 55%),
        linear-gradient(180deg, #fff5fa 0%, #ffe9f3 100%);
    position: relative;
}

.game-top-bar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 18px 36px;
    gap: 20px;
}

.game-top-bar .level-info {
    font-size: 1.6rem;
    color: var(--accent-color);
    text-shadow: 0 2px 0 rgba(255,255,255,0.85);
    letter-spacing: 0.01em;
}

.game-top-bar .objective-display {
    margin-left: 0;
    justify-self: end;
}

.game-title-mini {
    display: none;
}

.game-layout {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1;
    gap: 36px;
    padding-bottom: 30px;
}

.game-sidebar-left {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    width: 240px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 22px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 32px rgba(136, 14, 79, 0.15), inset 0 1px 0 rgba(255,255,255,0.9);
}

.game-controls-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-items: center;
    gap: 6px;
    width: 100%;
    padding: 4px 0 0;
}

.score-panel-vertical {
    width: 100%;
}

.icon-btn-game {
    background: linear-gradient(135deg, #ffffff 0%, #fff5fa 100%);
    border: 2px solid var(--board-bg);
    color: var(--accent-color);
    width: min(52px, 100%);
    aspect-ratio: 1;
    height: auto;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--board-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.icon-btn-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--board-bg);
    background: var(--accent-color);
    color: #fff;
}

.icon-btn-game:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 var(--board-bg);
}

.game-sidebar-right {
    width: 200px; /* Balance the layout */
}

.game-header {
    display: none;
}

.score-panel {
    display: none;
}

.controls-hint {
    display: none;
}

@media (max-width: 900px) {
    .map-screen {
        flex-direction: column;
        align-items: stretch;
        overflow-y: auto;
        padding: 12px;
    }
    .map-side-panel {
        width: 100%;
        margin-bottom: 16px;
        max-height: none;
    }
    .map-title {
        font-size: 3.2rem;
        margin: 6px 0 24px;
    }
    .game-layout {
        flex-direction: column;
        gap: 16px;
        padding-bottom: 20px;
    }
    .game-sidebar-left {
        width: min(420px, 96%);
        flex-direction: column;
        gap: 10px;
        padding: 14px;
    }
    .game-top-bar {
        padding: 14px 16px;
        grid-template-columns: 1fr auto;
    }
    .game-top-bar .level-info { font-size: 1.3rem; }
    .game-sidebar-right {
        display: none;
    }
}

.score-box {
    background: linear-gradient(135deg, #ffffff 0%, #fff5fa 100%);
    padding: 12px 20px;
    border-radius: 20px;
    border: 3px solid var(--accent-color);
    box-shadow: 0 6px 14px rgba(194, 24, 91, 0.18), inset 0 -3px 8px rgba(194,24,91,0.06);
    text-align: center;
}

.score-label {
    display: block;
    font-size: 0.72rem;
    color: var(--board-bg);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
}

.score-value {
    font-size: 2.4rem;
    font-weight: bold;
    color: var(--accent-color);
    line-height: 1.05;
}

.board-wrapper {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 15px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2), inset 0 0 20px rgba(255, 255, 255, 0.2);
}

.game-board {
    position: relative;
    width: calc(var(--grid-size) * (var(--cell-size) + var(--gap)));
    height: calc(var(--grid-size) * (var(--cell-size) + var(--gap)));
    background-color: rgba(0, 0, 0, 0.25);
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.2) 1px, transparent 1px);
    background-size: calc(var(--cell-size) + var(--gap)) calc(var(--cell-size) + var(--gap));
    background-position: -1px -1px;
    padding: 0;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.cell {
    position: absolute;
    width: var(--cell-size);
    height: var(--cell-size);
    top: calc(var(--row) * (var(--cell-size) + var(--gap)));
    left: calc(var(--col) * (var(--cell-size) + var(--gap)));
    background: var(--cell-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cell img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 6px 6px rgba(0,0,0,0.4)) drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}

.cell:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cell.selected {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 15px rgba(255,255,255,0.4);
    z-index: 10;
}

.cell.swapping {
    z-index: 20;
    transition: all 0.2s ease-in-out;
}

.cell.falling {
    transition: all 0.3s cubic-bezier(0.5, 0, 0.75, 0);
}

@keyframes candy-drop-in {
    0%   { transform: translateY(-90px) scale(0.4); opacity: 0; }
    55%  { transform: translateY(5px) scale(1.1);   opacity: 1; }
    75%  { transform: translateY(-3px) scale(0.95); opacity: 1; }
    100% { transform: translateY(0) scale(1);       opacity: 1; }
}

.cell.new-candy {
    animation: candy-drop-in 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    animation-delay: calc(var(--col, 0) * 0.03s);
}

.cell.matching-epic {
    animation: pop-out-epic 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    z-index: 5;
}

@keyframes pop-out-epic {
    0% { transform: scale(1) rotate(0); filter: brightness(1); }
    40% { transform: scale(1.5) rotate(15deg); filter: brightness(2) drop-shadow(0 0 10px #fff); }
    100% { transform: scale(0) rotate(-45deg); filter: brightness(3); opacity: 0; }
}

.laser-beam {
    position: absolute;
    background: #fff;
    box-shadow: 0 0 10px #fff, 0 0 20px #00ffff, 0 0 30px #00ffff, 0 0 40px #fff;
    z-index: 50;
    border-radius: 10px;
    opacity: 0;
    pointer-events: none;
}

.laser-horiz {
    height: 30px;
    animation: laser-shoot-h 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.laser-vert {
    width: 30px;
    animation: laser-shoot-v 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes laser-shoot-h {
    0% { transform: scaleX(0); opacity: 1; }
    50% { transform: scaleX(1); opacity: 1; height: 30px; }
    100% { transform: scaleX(1); opacity: 0; height: 0px; }
}

@keyframes laser-shoot-v {
    0% { transform: scaleY(0); opacity: 1; }
    50% { transform: scaleY(1); opacity: 1; width: 30px; }
    100% { transform: scaleY(1); opacity: 0; width: 0px; }
}

.shockwave {
    position: absolute;
    width: 10px;
    height: 10px;
    background: transparent;
    border: 5px solid #fff;
    box-shadow: 0 0 20px #ffff00, inset 0 0 20px #ffff00, 0 0 40px #ff00ff, inset 0 0 40px #ff00ff;
    border-radius: 50%;
    z-index: 40;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: shockwave-expand 0.5s ease-out forwards;
}

@keyframes shockwave-expand {
    0% { width: 10px; height: 10px; opacity: 1; border-width: 15px; }
    50% { opacity: 0.8; border-width: 5px; }
    100% { width: 800px; height: 800px; opacity: 0; border-width: 1px; }
}

.lightning {
    position: absolute;
    height: 4px;
    background: #fff;
    box-shadow: 0 0 5px #fff, 0 0 15px #00ffff, 0 0 25px #00ffff, 0 0 35px #00ffff;
    transform-origin: 0 50%;
    z-index: 45;
    pointer-events: none;
    border-radius: 2px;
    animation: flash-lightning 0.05s infinite alternate;
}

@keyframes flash-lightning {
    0% { opacity: 0.4; height: 2px; }
    100% { opacity: 1; height: 8px; }
}

.flash-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 70%);
    transform: translate(-50%, -50%) scale(0);
    z-index: 30;
    pointer-events: none;
    animation: flash-anim 0.5s ease-out forwards;
}

@keyframes flash-anim {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(2.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(4); opacity: 0; }
}

.cell.special-solid {
    cursor: not-allowed;
}

.cell.special-solid img {
    filter: drop-shadow(0 8px 8px rgba(0,0,0,0.6)) brightness(0.85);
}

.cell.special-horiz img {
    transform: rotate(90deg);
}

.cell.special-bomb img {
    filter: drop-shadow(0 0 10px #ff00ff) drop-shadow(0 0 20px #00ffff) drop-shadow(0 0 30px #ffff00) !important;
    animation: pulse-bomb 0.8s infinite alternate;
}

@keyframes pulse-bomb {
    0% { transform: scale(0.9) rotate(-5deg); }
    100% { transform: scale(1.1) rotate(5deg); }
}

.controls-hint {
    margin-top: 30px;
    background: #fff;
    padding: 12px 25px;
    border-radius: 30px;
    color: var(--accent-color);
    font-size: 1.1rem;
    box-shadow: 0 6px 15px rgba(0,0,0,0.05);
}

@media (max-width: 600px) {
    :root {
        --cell-size: 36px;
        --gap: 0px;
    }
    .game-title {
        font-size: 2.2rem;
    }
    .score-value {
        font-size: 2rem;
    }
    .score-box {
        padding: 5px 20px;
    }
    .board-wrapper {
        padding: 8px;
        border-radius: 14px;
    }
}

@media (max-width: 340px) {
    :root {
        --cell-size: 32px;
    }
}

/* ============================================================
   JUICE: Combo Counter, Hype Text, Score Popups
   ============================================================ */

.combo-counter {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-family: 'Pacifico', cursive;
    color: #fff;
    text-shadow: 0 0 10px #ff69b4, 0 0 20px #ff1493, 0 0 40px #ff69b4, 2px 2px 0 #880e4f;
    opacity: 0;
    transition: opacity 0.2s, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 1000;
}

.combo-counter.visible {
    opacity: 1;
}

.hype-text {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 4rem;
    font-family: 'Pacifico', cursive;
    color: #ffd93d;
    text-shadow: 0 0 15px #ff6b6b, 0 0 30px #ff1493, 3px 3px 0 #880e4f;
    opacity: 0;
    pointer-events: none;
    z-index: 1001;
    transition: none;
}

.hype-text.visible {
    animation: hype-pop 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes hype-pop {
    0% { transform: translate(-50%, -50%) scale(0) rotate(-10deg); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.3) rotate(5deg); opacity: 1; }
    40% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5) rotate(0); opacity: 0; }
}

.score-popup {
    position: fixed;
    font-size: 1.4rem;
    font-family: 'Pacifico', cursive;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 6px #ff69b4, 1px 1px 0 #880e4f;
    pointer-events: none;
    z-index: 1002;
    opacity: 0;
    transform: translateY(0);
    transition: none;
}

.score-popup.visible {
    animation: score-float 0.8s ease-out forwards;
}

@keyframes score-float {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    50% { opacity: 1; transform: translateY(-30px) scale(1.2); }
    100% { opacity: 0; transform: translateY(-60px) scale(0.8); }
}

/* Board shake transition override */
.board-wrapper {
    transition: transform 0s;
}

/* Große Bildschirme (Laptops/Desktops) */
@media (min-width: 1024px) {
    :root {
        --cell-size: 75px;
    }
}

/* Sehr große Bildschirme (3K / 4K) */
@media (min-width: 1600px) {
    :root {
        --cell-size: 90px;
    }
}

@media (max-width: 900px) {
    .combo-counter {
        top: 50%;
        bottom: auto;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 2rem;
    }
    .hype-text {
        font-size: 2.5rem;
    }
}

@media (max-width: 600px) {
    .combo-counter {
        font-size: 1.5rem;
        bottom: 10px;
        right: 10px;
    }
    .hype-text {
        font-size: 2rem;
    }
}

/* ============================================================
   PHASE 2A: STAR RATING SYSTEM
   ============================================================ */

.modal-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.modal-star {
    font-size: 3rem;
    display: inline-block;
    opacity: 0;
    transform: scale(0) rotate(-30deg);
    animation: star-pop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.modal-star.filled {
    color: #ffd700;
    text-shadow: 0 0 10px #ffc000, 0 0 20px #ff8c00;
}

.modal-star.empty {
    color: #ccc;
    text-shadow: none;
}

@keyframes star-pop-in {
    0% { opacity: 0; transform: scale(0) rotate(-30deg); }
    70% { transform: scale(1.3) rotate(5deg); opacity: 1; }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* Stars on level map nodes */
.level-node {
    flex-direction: column;
    gap: 2px;
    font-size: 1.4rem;
    width: 90px;
    height: 90px;
}

.node-stars {
    display: flex;
    gap: 1px;
    line-height: 1;
}

.node-star {
    font-size: 0.75rem;
}

.node-star.filled {
    color: #ffd700;
    text-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

.node-star.empty {
    color: rgba(194, 24, 91, 0.25);
}

.level-node.locked .node-star.empty {
    color: rgba(47,35,64,0.45);
}

.level-node.active .node-star.empty {
    color: rgba(255,255,255,0.45);
}

/* ============================================================
   PHASE 2B: BOOSTER SYSTEM
   ============================================================ */

#booster-bar {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: nowrap;
    width: 100%;
    padding-top: 4px;
}

.booster-btn {
    position: relative;
    flex: 1;
    aspect-ratio: 1;
    background: radial-gradient(circle at 30% 25%, #ffffff 0%, #fff0f6 60%, #ffd6e7 100%);
    border: 2.5px solid var(--accent-color);
    border-radius: 18px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 0 var(--accent-color), inset 0 -3px 6px rgba(194,24,91,0.12), inset 0 2px 4px rgba(255,255,255,0.7);
    transition: all 0.15s;
    color: var(--accent-color);
    min-width: 0;
}

.booster-icon {
    width: 60%;
    height: 60%;
    color: var(--accent-color);
    pointer-events: none;
}

.booster-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--accent-color), inset 0 -3px 6px rgba(194,24,91,0.12), inset 0 2px 4px rgba(255,255,255,0.7);
}

.booster-btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 1px 0 var(--accent-color), inset 0 -3px 6px rgba(194,24,91,0.12), inset 0 2px 4px rgba(255,255,255,0.7);
}

.booster-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: 0 2px 0 var(--accent-color);
}

.booster-btn:disabled .booster-icon {
    filter: grayscale(0.4);
}

.booster-btn.booster-active {
    background: radial-gradient(circle at 30% 25%, #fff8e0 0%, #ffd633 60%, #ff8c00 100%);
    border-color: #ff8c00;
    color: #8a4500;
    box-shadow: 0 4px 0 #cc6600, 0 0 18px rgba(255, 200, 0, 0.7);
    transform: translateY(-2px);
    animation: booster-pulse 0.6s ease-in-out infinite alternate;
}

.booster-btn.booster-active .booster-icon {
    color: #8a4500;
}

@keyframes booster-pulse {
    0% { box-shadow: 0 4px 0 #cc6600, 0 0 10px rgba(255,200,0,0.4); }
    100% { box-shadow: 0 4px 0 #cc6600, 0 0 28px rgba(255,200,0,0.95); }
}

.booster-count {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 0.78rem;
    background: var(--accent-color);
    color: #fff;
    border-radius: 999px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

@media (max-width: 900px) {
    #booster-bar {
        flex-direction: row;
    }
}

/* ============================================================
   PHASE 2D: SWIPE UX
   ============================================================ */

.game-board {
    touch-action: none;
}

.cell.cell-drag-source {
    opacity: 0.7;
    transform: scale(0.92);
    z-index: 15;
}

.cell.cell-drag-target {
    box-shadow: inset 0 0 12px 3px rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.2);
    z-index: 14;
}

/* ============================================================
   MAP PANEL — Action Buttons & Leaderboard
   ============================================================ */
.map-action-btn {
    width: 100%;
    padding: 11px 16px;
    background: rgba(255,255,255,0.95);
    border: 2px solid var(--accent-color);
    border-radius: 16px;
    color: var(--accent-color);
    font-family: 'Pacifico', cursive;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    text-align: left;
    box-shadow: 0 3px 0 rgba(194, 24, 91, 0.4);
}
.map-action-btn .bi {
    font-size: 1.2rem;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}
.map-action-btn:hover {
    background: var(--accent-color);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 0 #880e4f;
}
.map-action-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(194, 24, 91, 0.4);
}

.lb-section { width: 100%; margin-top: 12px; }
.lb-section .section-title { font-size: 1.1rem; color: var(--accent-color); margin-bottom: 8px; }

.kendy-lb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.8);
    border-radius: 10px;
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 0.82rem;
    color: var(--text-color);
}
.kendy-lb-item.kendy-lb-me { background: rgba(194,24,91,0.15); border: 1px solid var(--accent-color); }
.kendy-lb-rank {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(194, 24, 91, 0.12);
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kendy-lb-rank-1 { background: linear-gradient(135deg, #ffe066 0%, #ffb300 100%); color: #fff; box-shadow: 0 2px 4px rgba(255,179,0,0.4); }
.kendy-lb-rank-2 { background: linear-gradient(135deg, #e8e8ef 0%, #a8a8b8 100%); color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }
.kendy-lb-rank-3 { background: linear-gradient(135deg, #f5b87f 0%, #c87f3a 100%); color: #fff; box-shadow: 0 2px 4px rgba(200,127,58,0.35); }
.kendy-lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kendy-lb-you { color: var(--accent-color); font-size: 0.75em; }
.kendy-lb-score { font-weight: bold; color: var(--accent-color); font-family: 'Inter', system-ui, sans-serif; font-size: 0.85rem; }
.kendy-lb-loading, .kendy-lb-empty { text-align: center; padding: 12px; color: rgba(136,14,79,0.6); font-size: 0.85rem; }

/* ============================================================
   STATS MODAL
   ============================================================ */
.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(194,24,91,0.12);
    font-size: 0.92rem;
}
.stats-row:last-child { border-bottom: none; }
.stats-label { color: var(--board-bg); }
.stats-val { font-weight: bold; color: var(--accent-color); }

/* ============================================================
   ACHIEVEMENT GALLERY
   ============================================================ */
.achievement-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    max-height: 65vh;
    overflow-y: auto;
    padding: 4px;
}
.ach-item {
    background: #fff;
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    border: 2px solid transparent;
    transition: transform 0.15s;
}
.ach-unlocked { border-color: var(--accent-color); box-shadow: 0 4px 14px rgba(194,24,91,0.18); }
.ach-locked { opacity: 0.45; filter: grayscale(1); }
.ach-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 8px; color: var(--accent-color); }
.ach-locked .ach-icon { color: rgba(136, 14, 79, 0.4); }
.ach-unlocked .ach-icon { color: var(--accent-color); filter: drop-shadow(0 2px 4px rgba(194,24,91,0.25)); }
.toast-icon { color: var(--accent-color); }
.ach-name { font-size: 0.78rem; font-weight: bold; color: var(--text-color); margin-bottom: 4px; line-height: 1.2; }
.ach-desc { font-size: 0.68rem; color: var(--board-bg); line-height: 1.3; font-family: sans-serif; }

/* ============================================================
   ACHIEVEMENT TOAST
   ============================================================ */
.achievement-toast {
    position: fixed;
    bottom: 30px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #fff0f6 0%, #fff 100%);
    border: 2px solid var(--accent-color);
    border-radius: 18px;
    padding: 12px 18px;
    box-shadow: 0 8px 28px rgba(194,24,91,0.25);
    z-index: 20000;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), opacity 0.35s;
    max-width: 280px;
    font-family: 'Pacifico', cursive;
}
.achievement-toast.toast-visible { transform: translateX(0); opacity: 1; }
.toast-icon { font-size: 2rem; flex-shrink: 0; }
.toast-body { font-size: 0.82rem; color: var(--text-color); line-height: 1.4; }
.toast-body strong { display: block; color: var(--accent-color); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }

/* ============================================================
   PHASE 4A: DAILY CHALLENGE BUTTON
   ============================================================ */
.map-action-daily {
    background: linear-gradient(135deg, #fff7e0 0%, #fff 100%);
    border-color: #e6a500;
    color: #b87800;
    box-shadow: 0 3px 0 rgba(184, 120, 0, 0.45);
}
.map-action-daily:hover { background: #ffc107; color: #fff; border-color: #e6a500; box-shadow: 0 4px 0 #b87800; }
.map-action-daily:disabled { opacity: 0.55; cursor: not-allowed; }

.map-action-endless {
    background: linear-gradient(135deg, #e8f5ff 0%, #fff 100%);
    border-color: #4fc3f7;
    color: #0277bd;
    box-shadow: 0 3px 0 rgba(2, 119, 189, 0.45);
}
.map-action-endless:hover { background: #4fc3f7; color: #fff; border-color: #0277bd; box-shadow: 0 4px 0 #0277bd; }

/* ============================================================
   PHASE 4B: ENDLESS MODE — infinity in moves box
   ============================================================ */
.moves-value.endless-inf {
    font-size: 2rem;
    letter-spacing: -2px;
}

/* ============================================================
   PHASE 4C: UI POLISH
   ============================================================ */

/* --- Idle candy bob --- */
@keyframes candy-bob {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.025); }
}

.cell:not(.selected):not(.swapping):not(.cell-drag-source):not(.matching-epic):not(.new-candy) .candy-img {
    animation: candy-bob 2.6s ease-in-out infinite;
    animation-delay: calc(var(--row, 0) * 0.15s + var(--col, 0) * 0.11s);
}

/* --- Modal bounce-in --- */
@keyframes modal-bounce-in {
    0%   { transform: scale(0.55) translateY(-30px); opacity: 0; }
    60%  { transform: scale(1.06); opacity: 1; }
    80%  { transform: scale(0.97); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal.show .modal-dialog {
    animation: modal-bounce-in 0.42s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* --- Level map path --- */
.map-path-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

.map-path-line {
    animation: path-appear 1.2s ease-out both;
}

@keyframes path-appear {
    from { opacity: 0; stroke-dashoffset: 1000; }
    to   { opacity: 1; stroke-dashoffset: 0; }
}

/* Level nodes above the SVG path */
.level-node {
    position: relative;
    z-index: 1;
}

/* --- Volume slider --- */
.volume-slider-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    color: var(--board-bg);
    font-size: 1rem;
    padding: 0 4px;
}

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--accent-color) 0%, var(--accent-color) 50%, rgba(194, 24, 91, 0.2) 50%);
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--accent-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--accent-color);
    cursor: pointer;
}

/* ============================================================
   DARK MODE
   ============================================================ */

body.dark-mode {
    --bg-color: #1a0824;
    --board-bg: #8a2252;
    --text-color: #f0d0e8;
    --accent-color: #f06292;
    background:
        linear-gradient(rgba(13, 2, 28, 0.72), rgba(13, 2, 28, 0.72)),
        url('assets/bg_1.webp') center center / cover no-repeat fixed !important;
}

body.dark-mode .map-screen {
    background:
        linear-gradient(rgba(13, 2, 28, 0.78), rgba(13, 2, 28, 0.78)),
        url('assets/bakcground-level-select.webp') center center / cover no-repeat !important;
}

body.dark-mode .map-side-panel {
    background: rgba(20, 5, 40, 0.88);
    border-color: rgba(192, 80, 140, 0.3);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.08);
}

body.dark-mode .stat-item {
    background: rgba(30, 8, 55, 0.9);
    border-color: rgba(192, 80, 140, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .friend-item {
    background: rgba(30, 8, 55, 0.9);
    border-color: rgba(192, 80, 140, 0.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

body.dark-mode .friends-empty {
    background: rgba(25, 5, 45, 0.7);
    border-color: rgba(240, 98, 146, 0.3);
    color: rgba(240, 180, 210, 0.7);
}

body.dark-mode .map-action-btn {
    background: rgba(30, 5, 55, 0.92);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 3px 0 rgba(140, 0, 80, 0.6);
}
body.dark-mode .map-action-btn:hover {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 0 #5a0030;
}

body.dark-mode .map-action-daily {
    background: rgba(35, 20, 5, 0.92);
    border-color: #e6a500;
    color: #ffc840;
    box-shadow: 0 3px 0 rgba(140, 90, 0, 0.5);
}
body.dark-mode .map-action-daily:hover {
    background: #c8860a;
    color: #fff;
    border-color: #e6a500;
    box-shadow: 0 4px 0 #7a5000;
}

body.dark-mode .map-action-endless {
    background: rgba(5, 20, 40, 0.92);
    border-color: #4fc3f7;
    color: #7dd8ff;
    box-shadow: 0 3px 0 rgba(0, 80, 140, 0.5);
}
body.dark-mode .map-action-endless:hover {
    background: #0277bd;
    color: #fff;
    border-color: #4fc3f7;
    box-shadow: 0 4px 0 #003d6e;
}

body.dark-mode .kendy-lb-item {
    background: rgba(30, 5, 55, 0.85);
    color: var(--text-color);
}
body.dark-mode .kendy-lb-item.kendy-lb-me {
    background: rgba(192, 24, 91, 0.22);
}
body.dark-mode .kendy-lb-loading,
body.dark-mode .kendy-lb-empty {
    color: rgba(240, 180, 210, 0.6);
}

body.dark-mode .game-screen {
    background:
        radial-gradient(ellipse at top left, rgba(120, 30, 90, 0.4) 0%, transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(30, 60, 100, 0.35) 0%, transparent 55%),
        linear-gradient(180deg, #120520 0%, #0d0318 100%);
}

body.dark-mode #game-bg-container {
    filter: blur(6px) brightness(0.28) saturate(0.6);
}

body.dark-mode .game-sidebar-left {
    background: rgba(20, 5, 40, 0.88);
    border-color: rgba(192, 80, 140, 0.3);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.06);
}

body.dark-mode .score-box {
    background: rgba(30, 8, 55, 0.9);
    border-color: var(--accent-color);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

body.dark-mode .icon-btn-game {
    background: rgba(30, 8, 55, 0.9);
    border-color: var(--board-bg);
    color: var(--accent-color);
    box-shadow: 0 3px 0 rgba(100, 0, 60, 0.7);
}
body.dark-mode .icon-btn-game:hover {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 5px 0 rgba(100, 0, 60, 0.7);
}

body.dark-mode .objective-display {
    background: rgba(20, 5, 40, 0.85);
    border-color: var(--board-bg);
}

body.dark-mode .kendy-modal {
    background: #1e0535 url('assets/kendy/bg_pattern.png');
    border-color: var(--board-bg);
}
body.dark-mode .kendy-modal .modal-title,
body.dark-mode .kendy-modal .modal-body,
body.dark-mode .kendy-modal p {
    color: var(--text-color);
}
body.dark-mode .kendy-modal .btn-close {
    filter: invert(1);
}

body.dark-mode .stats-row {
    border-bottom-color: rgba(192, 80, 140, 0.18);
}
body.dark-mode .stats-label {
    color: var(--accent-color);
}

body.dark-mode .ach-item {
    background: rgba(30, 8, 55, 0.9);
}
body.dark-mode .ach-name {
    color: var(--text-color);
}
body.dark-mode .ach-desc {
    color: rgba(240, 180, 210, 0.65);
}

body.dark-mode .achievement-toast {
    background: linear-gradient(135deg, #2a0545 0%, #1a0330 100%);
    border-color: var(--accent-color);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
}
body.dark-mode .toast-body {
    color: var(--text-color);
}

body.dark-mode .booster-btn {
    background: radial-gradient(circle at 30% 25%, #2a0545 0%, #1e0038 60%, #160028 100%);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 4px 0 rgba(100, 0, 60, 0.7), inset 0 -3px 6px rgba(0,0,0,0.3), inset 0 2px 4px rgba(255,255,255,0.06);
}
body.dark-mode .booster-btn:hover:not(:disabled) {
    box-shadow: 0 6px 0 rgba(100, 0, 60, 0.7), inset 0 -3px 6px rgba(0,0,0,0.3), inset 0 2px 4px rgba(255,255,255,0.06);
}

body.dark-mode .section-title {
    border-bottom-color: rgba(240, 98, 146, 0.25);
}

body.dark-mode .map-path-svg {
    filter: brightness(1.8) saturate(1.5);
}

body.dark-mode .level-node.locked {
    background: radial-gradient(circle at 30% 25%, #4a3b5b 0%, #2f2340 68%, #20162d 100%);
    border-color: #9f7fba;
    color: #f4e9ff;
    box-shadow: 0 4px 0 #160d22, inset 0 -6px 10px rgba(0,0,0,0.35), inset 0 3px 5px rgba(255,255,255,0.08);
    text-shadow: 0 2px 0 rgba(0,0,0,0.45);
}

body.dark-mode .level-node.locked .node-star.empty {
    color: rgba(244,233,255,0.42);
}
