:root {
    --bg-color: #f0f0f0;
    --manga-bg: #ffffff;
    --panel-border: #000000;
    --text-color: #000000;
    --static-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition-speed: 0.8s;
}

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

body {
    background-color: var(--bg-color);
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
}

.manga-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--manga-bg);
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 40px 0;
    border-bottom: 2px dashed #ccc;
    opacity: 0.3;
    filter: blur(5px);
    transition: opacity var(--transition-speed), filter var(--transition-speed);
    pointer-events: none;
}

.page.active {
    opacity: 1;
    filter: blur(0);
    pointer-events: auto;
}

.panel-layout {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 15px;
    width: 100%;
}

.panel {
    border: 4px solid var(--panel-border);
    position: relative;
    overflow: hidden;
    background: #fff;
    min-height: 300px;
    transition: transform 0.3s ease;
}

.panel:hover {
    transform: scale(1.01);
}

.panel-full {
    grid-column: span 12;
    min-height: 500px;
    height: 70vh;
}

.panel-half {
    grid-column: span 6;
    min-height: 350px;
    height: 50vh;
}

.panel-third {
    grid-column: span 4;
    min-height: 250px;
    height: 40vh;
}

@keyframes target-pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.5);
        opacity: 1;
        box-shadow: 0 0 15px white;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

.static-target-active {
    animation: target-pulse 2s infinite ease-in-out;
    background: #444 !important;
    border: 2px solid white !important;
    z-index: 20;
}

/* Halftone utility */
.halftone-bg {
    background-image: radial-gradient(circle, #000 20%, transparent 20%);
    background-size: 5px 5px;
    opacity: 0.1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.panel-content {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.dialogue {
    position: absolute;
    background: white;
    border: 3px solid black;
    padding: 15px 20px;
    border-radius: 40px;
    font-family: 'Special Elite', cursive;
    font-size: 1.1rem;
    z-index: 10;
    box-shadow: 5px 5px 0 black;
    pointer-events: auto;
    /* Enable for dragging if needed */
    max-width: 250px;
    text-align: center;
    transition: transform 0.2s ease, opacity 0.5s ease;
}

.dialogue::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 40px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 15px solid black;
}

/* Static Puzzle Style */
.static-bg {
    background: repeating-radial-gradient(circle at center,
            #fff,
            #fff 1px,
            #000 1px,
            #000 2px);
    background-size: 4px 4px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.puzzle-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.static-clutter {
    position: absolute;
    width: 40px;
    height: 40px;
    background: black;
    border-radius: 50%;
    filter: blur(8px);
    opacity: 0.8;
    transition: transform 0.2s ease, opacity 0.5s ease;
}

/* SFX Text */
.sfx {
    position: absolute;
    font-weight: 900;
    font-size: 3rem;
    color: black;
    text-transform: uppercase;
    font-style: italic;
    transform: rotate(-15deg);
    pointer-events: none;
    user-select: none;
}

#save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: black;
    color: white;
    padding: 5px 15px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s;
}

#save-indicator.show {
    opacity: 1;
}

/* Mobile Tweaks */
@media (max-width: 600px) {

    .panel-half,
    .panel-third {
        grid-column: span 12;
    }
}