/* 
   YAMIKAWA/GOTH/VAMPIRE THEME
   Colors: Soft Pastel Pink, Blood Red, Deep Purple/Black, White 
*/

body {
    background-color: transparent;
    background-image: none;
    color: #ffccdd;
    font-family: 'VT323', monospace;
    font-size: 18px;
    /* Slightly smaller for denser text */
    margin: 0;
    padding: 20px 0;

    /* Custom pixel-art bat cursor */
    cursor: url('assets/icons/cursor_bat.png') 16 16, crosshair;
}

/* CRT Scanline overlay to make it feel like an old comfy monitor */
body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    /* Weakened the opacity of both the scanlines and the RGB phosphor glow for better readability */
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.04) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.01), rgba(0, 255, 0, 0.005), rgba(0, 0, 255, 0.01));
    z-index: 999;
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
}

/* Background canvas for cat paws */
#bg-paws {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    /* Behind container (10) but above background texture */
    pointer-events: none;
    image-rendering: pixelated;
}

/* Custom Icons */
.icon {
    height: 1.1em;
    width: auto;
    margin: 0 2px;
    vertical-align: -0.1em;
    object-fit: contain;
    display: inline-block;
    image-rendering: auto;
}

/* ══════════════════════════════════════════
   CUSTOM THEMED SCROLLBARS
   ══════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 10px;
    background-color: #0b0508;
}

::-webkit-scrollbar-track {
    background-color: #0b0508;
    border-left: 1px solid #1a0a13;
}

::-webkit-scrollbar-corner {
    background-color: #0b0508;
}

::-webkit-scrollbar-thumb {
    background-color: #1a0a13;
    border: 2px solid #331122;
    outline: 1px solid #ff99bb;
    transition: all 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #331122;
    outline: 1px solid #ff99bb;
}

/* ══════════════════════════════════════════
   GLOBAL CLASSES
   ══════════════════════════════════════════ */
.pixelated {
    image-rendering: pixelated;
}

/* Custom Text Selection */
::selection {
    background: #8b0021;
    /* Blood red */
    color: #ffd1dc;
}

::-moz-selection {
    background: #8b0021;
    color: #ffd1dc;
}

/* Headings */
h1,
h2,
h3 {
    font-family: 'VT323', monospace;
    font-weight: normal;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 0px #000000;
}

h1 {
    font-size: 42px;
    color: #ff6699;
    /* Hot sickly pink */
    text-shadow: 2px 2px 0px #8b0021, -1px -1px 0px #000;
}

h2 {
    font-size: 28px;
    color: #ff99bb;
    border-bottom: 2px dashed #8b0021;
    /* Dashed stitched border look */
    padding-bottom: 5px;
}

h3 {
    font-size: 24px;
    color: #ff6699;
    background-color: #1a0a13;
    padding: 5px 10px;
    /* Removing side padding since flex gap handles spacing now */
    border: 1px dotted #ff6699;
    border-radius: 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* Keeps text and icons perfectly separated on one line */
}

/* Links */
a {
    color: #ff6699;
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    color: #ffffff;
    background-color: #8b0021;
    text-decoration: none;
    cursor: url('assets/icons/cursor_bat.png') 16 16, crosshair;
}

/* Main Container Wrapper */
#container {
    width: 980px;
    /* Widened for 3-column layout */
    margin: 0 auto;

    /* Subtly transparent so the background pattern bleeds through slightly */
    background-color: rgba(18, 8, 13, 0.95);

    border: 4px double #8b0021;
    border-radius: 30px;
    box-shadow: 0px 0px 25px rgba(139, 0, 33, 0.3);
    padding: 15px;
    /* Tighter padding */

    position: relative;
    /* ensure it sits above the background properly */
    z-index: 10;
}

/* Header Container */
#header {
    background-color: #0b0508;
    border: 2px solid #331122;
    border-radius: 20px;
    padding: 10px 20px;
    /* Tighter padding */
    text-align: center;
    margin-bottom: 10px;
    position: relative;
    /* Anchor for particle canvas */
    overflow: hidden;
    /* Keep particles clipped inside */
}

/* Particle canvas sits behind header content */
#header-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Never blocks clicks */
    z-index: 0;
}

/* Push header children above the canvas */
#header>*:not(#header-particles) {
    position: relative;
    z-index: 1;
}

marquee {
    color: #ff99bb;
    font-size: 16px;
    border-top: 1px dashed #ff6699;
    border-bottom: 1px dashed #ff6699;
    padding: 5px 0;
    margin-top: 10px;
    background: #1a0a13;
}

/* Layout Using Flexbox */
#layout {
    display: flex;
    gap: 10px;
    /* Tighter gap between columns */
    align-items: flex-start;
    /* Ensure columns don't stretch vertically unless needed */
}

/* Sidebars (Left and Right) */
#sidebar,
#right-sidebar {
    width: 220px;
    /* Fixed width for standard dense widgets */
    flex-shrink: 0;
}

.side-box {
    background-color: #0b0508;
    border: 1px dashed #ff6699;
    /* Inner scrapbook stitch */
    box-shadow: 0 0 0 2px #1a0a13, 0 0 0 4px #331122;
    /* Outer heavy frame */
    border-radius: 18px;
    padding: 12px;
    margin-bottom: 15px;
}

/* Sidebar Navigation Layout */
.menu ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.menu li {
    margin-bottom: 5px;
}

.menu a {
    display: block;
    background-color: #1a0a13;
    border: 1px solid #331122;
    border-radius: 10px;
    padding: 8px 12px;
    text-align: left;
    color: #ffb3c6;
}

.menu a:hover {
    background-color: #ff6699;
    /* Bright pink on hover */
    color: #000;
    border-color: #ff6699;
}

/* Updates/Status boxes */
.updates .update-entry {
    font-size: 12px;
    border-bottom: 1px dotted #8b0021;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.updates .update-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Main Content Area */
#main-content {
    flex-grow: 1;
}

.content-box {
    background-color: #0b0508;
    border: 1px dashed #ff6699;
    /* Inner scrapbook stitch */
    box-shadow: 0 0 0 2px #1a0a13, 0 0 0 4px #331122;
    /* Outer heavy frame */
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 15px;
    line-height: 1.4;
    font-size: 16px;
    /* Crisper, smaller text for feed density */
}

.content-box ul {
    list-style-type: square;
    color: #ff6699;
    /* Pink bullets */
}

/* Footer Container */
#footer {
    background-color: #0b0508;
    border: 2px solid #331122;
    border-radius: 20px;
    padding: 15px;
    text-align: center;
    font-size: 12px;
    margin-top: 15px;
}

/* Fake Buttons Placeholder Area */
#buttons-area {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
}

.placeholder-button {
    width: 88px;
    height: 31px;
    border: 1px solid #ff6699;
    border-radius: 8px;
    background-color: #1a0a13;
    line-height: 31px;
    text-align: center;
    font-size: 10px;
    color: #ff6699;
}

/* --- EARLY 2000s GIMMICKS ANIMATIONS --- */

/* 1. Fake 3D Spinning Animation (Replaced fast spin with a slower, drifting rotate) */
.spin-3d {
    display: inline-block;
    animation: spinY 6s linear infinite;
    color: #ff99bb;
    text-shadow: 2px 2px 0px #8b0021;
}

@keyframes spinY {
    0% {
        transform: perspective(400px) rotateY(0deg);
    }

    100% {
        transform: perspective(400px) rotateY(360deg);
    }
}

/* 2. Pulsing Heartbeat Effect (slowed down for coziness) */
.pulse-heart {
    display: inline-block;
    animation: heartbeat 2.5s infinite;
}

@keyframes heartbeat {

    0%,
    100%,
    50% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.15);
    }

    30% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.15);
    }
}

/* 3. The Classic Web 1.0 Blink Tag - Softened into a cozy, slow glow/float */
.blink {
    display: inline-block;
    animation: cozy-glow 2s ease-in-out infinite alternate;
}

@keyframes cozy-glow {
    0% {
        opacity: 0.6;
        transform: translateY(0px);
        text-shadow: 0 0 2px #ff6699;
    }

    100% {
        opacity: 1;
        transform: translateY(-3px);
        text-shadow: 0 0 8px #ff99bb;
    }
}

/* 4. Text Glitch - Softened to static chromatic aberration to avoid aggressive jitter */
.glitch-text {
    position: relative;
    display: inline-block;
    color: #ffccdd;
    text-shadow: 1px 0 #ff6699, -1px 0 #8b0021;
}

.glitch-text::before,
.glitch-text::after {
    display: none;
    /* Removed the aggressive animation layers */
}

/* --- GUESTBOOK OVERRIDES --- */
#HCB_comment_box {
    color: #ffccdd;
    font-family: 'Courier Prime', monospace;
    font-size: 16px;
    margin-top: 20px;
}

#HCB_comment_box a {
    color: #ff6699;
    text-decoration: underline;
}

#HCB_comment_box a:hover {
    color: white;
    background-color: #8b0021;
}

#HCB_comment_box textarea,
#HCB_comment_box input[type="text"] {
    background-color: #0b0508;
    border: 1px dashed #8b0021;
    border-radius: 12px;
    color: #ff6699;
    font-family: 'Courier Prime', monospace;
    padding: 10px;
    width: 100%;
    margin-bottom: 10px;
}

#HCB_comment_box textarea:focus,
#HCB_comment_box input[type="text"]:focus {
    outline: none;
    border-color: #ff99bb;
    box-shadow: 0 0 5px #8b0021;
}

#HCB_comment_box input[type="submit"],
#HCB_comment_box button {
    background-color: #1a0a13;
    color: #ff99bb;
    border: 1px solid #ff6699;
    border-radius: 12px;
    font-family: 'VT323', monospace;
    font-size: 18px;
    padding: 5px 15px;
    cursor: crosshair;
    transition: 0.2s all;
}

#HCB_comment_box input[type="submit"]:hover,
#HCB_comment_box button:hover {
    background-color: #8b0021;
    color: white;
}

.hcb-comment-tb {
    background-color: #1a0a13 !important;
    border: 1px dotted #8b0021 !important;
    border-radius: 12px !important;
    padding: 10px !important;
    margin-bottom: 10px !important;
}

.hcb-comment-tb .hcb-icon {
    display: none;
    /* Hide default icons */
}

/* Forcibly hide image uploads */
.hcb-wrapper .b-lb,
#hcb_file_label,
.hcb-door-in,
#HCB_comment_box img.hcb-icon {
    display: none !important;
}

/* Modern CSS Marquee — replaces buggy <marquee> tag */
.marquee-box {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    background: #1a0a13;
    border-top: 1px dashed #ff6699;
    border-bottom: 1px dashed #ff6699;
    padding: 5px 0;
    margin-top: 10px;
}

.marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee-roll 40s linear infinite;
    color: #ff99bb;
    font-size: 16px;
}

@keyframes marquee-roll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

/* Header-specific marquee adjustment */
#header .marquee-box {
    margin-top: 10px;
    border: none;
    background: transparent;
}

/* --- CUSTOM RETRO COUNTER STYLES --- */
.counter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.counter-item {
    text-align: center;
}

.counter-label {
    font-size: 11px;
    color: #ff99bb;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 5px;
    transition: all 0.2s;
}

.menu ul li a:hover {
    display: block;
    background-color: #1a0a13;
    color: #ffb3c6;
    text-shadow: 0 0 5px #ff6699;
}

/* Persistent Active State */
.menu ul li a.nav-active {
    color: #ffb3c6 !important;
    text-shadow: 0 0 10px #ff6699;
    padding-left: 15px;
    border-left: 3px solid #ff6699;
    background: linear-gradient(90deg, #331122 0%, transparent 100%);
}

.counter-value {
    display: inline-block;
    background-color: #000;
    color: #ff99bb;
    font-family: 'VT323', monospace;
    font-size: 24px;
    padding: 2px 0;
    border: 1px solid #331122;
    border-radius: 10px;
    box-shadow: inset 0 0 5px rgba(255, 153, 187, 0.2);
    text-shadow: 0 0 5px #ff6699;
    letter-spacing: 2px;
    min-width: 100px;
    text-align: center;
    image-rendering: pixelated;
}

.counter-value-img {
    display: flex;
    justify-content: center;
    background-color: #000;
    padding: 8px 4px;
    border: 1px solid #331122;
    border-radius: 10px;
    box-shadow: inset 0 0 5px rgba(255, 153, 187, 0.2);
    min-width: 120px;
}

.counter-img {
    height: 38px;
    /* Custom pink glow filter for the SVG */
    filter: invert(78%) sepia(21%) saturate(1454%) hue-rotate(296deg) brightness(101%) contrast(102%) drop-shadow(0 0 2px #ff6699);
}

/* ══════════════════════════════════════════
   GACHAPON MACHINE & WIDGET STYLES
   ══════════════════════════════════════════ */

.gacha-machine-container {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.gacha-machine-wrapper {
    position: relative;
    display: inline-block;
    margin: 20px auto;
}

.gacha-machine {
    max-width: 400px;
    width: 100%;
    cursor: pointer;
    image-rendering: auto;
    transition: transform 0.1s ease-out;
    -webkit-user-drag: none;
    user-select: none;
}

/* Sidebar specific scaling & compact widget */
.side-box .gacha-machine,
.compact-widget .gacha-machine {
    max-width: 140px;
    /* Increased from 120px — 15% bigger */
    filter: drop-shadow(0 0 5px rgba(255, 102, 153, 0.3));
}

.compact-widget {
    padding: 8px !important;
    border: 1px dotted #ff6699 !important;
    background: rgba(26, 10, 19, 0.82);
    margin: 0 auto 15px auto;
    max-width: 180px;
    overflow: visible !important;
    /* Allow capsule to escape */
    z-index: 5;
}

.compact-widget .gacha-machine-wrapper {
    margin: 5px auto;
    overflow: visible !important;
    /* Allow capsule to escape */
}

.compact-widget .widget-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 5px;
}

.compact-widget h3 {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font-size: 20px;
    text-shadow: none;
}

.compact-widget .ascii-deco {
    color: #ff99bb;
    font-size: 14px;
    opacity: 0.7;
}

.compact-widget .widget-footer {
    margin-top: 5px;
}

.compact-widget .insert-coin-btn {
    display: inline-block;
    font-size: 10px;
    color: #000;
    background: #ff6699;
    padding: 2px 6px;
    border: 1px solid #ff99bb;
    cursor: pointer;
    margin-bottom: 3px;
    text-transform: uppercase;
    font-weight: bold;
    box-shadow: 1px 1px 0px #8b0021;
}

.compact-widget .token-cost {
    font-size: 10px !important;
    margin: 0 !important;
    color: #886677;
    font-style: italic;
}

/* --- ANIMATIONS --- */

.gacha-shake {
    animation: gachaShake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

.gacha-deform {
    animation: gachaDeform 0.6s ease-in-out both;
}

@keyframes gachaShake {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    10% {
        transform: translate(-4px, -2px) rotate(-3deg);
    }

    20% {
        transform: translate(4px, 2px) rotate(3deg);
    }

    30% {
        transform: translate(-6px, 1px) rotate(-5deg);
    }

    40% {
        transform: translate(6px, -1px) rotate(5deg);
    }

    50% {
        transform: translate(-8px, -2px) rotate(-7deg);
    }

    60% {
        transform: translate(8px, 2px) rotate(7deg);
    }

    70% {
        transform: translate(-4px, 1px) rotate(-3deg);
    }

    80% {
        transform: translate(4px, -1px) rotate(3deg);
    }

    90% {
        transform: translate(-2px, 0) rotate(-1deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

@keyframes gachaDeform {
    0% {
        transform: scale(1, 1);
    }

    15% {
        transform: scale(1.25, 0.75);
    }

    30% {
        transform: scale(0.75, 1.25);
    }

    45% {
        transform: scale(1.15, 0.85);
    }

    60% {
        transform: scale(0.85, 1.15);
    }

    75% {
        transform: scale(1.05, 0.95);
    }

    100% {
        transform: scale(1, 1);
    }
}

/* --- SPARKLES --- */

#sparkle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.sparkle {
    position: absolute;
    color: #ff99bb;
    font-size: 20px;
    text-shadow: 0 0 10px #ff6699, 0 0 20px #ff6699;
    pointer-events: none;
    animation: sparklePop 0.8s ease-out forwards;
}

@keyframes sparklePop {
    0% {
        transform: translate(0, 0) scale(0) rotate(0deg);
        opacity: 0;
    }

    50% {
        opacity: 1;
        transform: translate(var(--tx), var(--ty)) scale(1.5) rotate(180deg);
    }

    100% {
        transform: translate(var(--tx2), var(--ty2)) scale(0) rotate(360deg);
        opacity: 0;
    }
}

/* --- CAPSULE (3D Pastel) --- */

#capsule-slot {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 9999;
    /* Stay on top of everything! */
}

.capsule {
    width: 45px;
    height: 45px;
    /* Soft pastel gradient with highlight overlay */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 50%),
        linear-gradient(180deg, var(--cap-color) 50%, #fdfdfd 50%);
    border-radius: 50%;
    border: 2.5px solid #331122;
    position: absolute;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.4), inset -2px -2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Glossy highlight for 3D effect */
.capsule::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 8px;
    width: 15px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transform: rotate(-20deg);
}

.capsule::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background: rgba(51, 17, 34, 0.8);
    top: 50%;
    transform: translateY(-50%);
}

.capsule-roll {
    animation: capsuleRoll 1.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes capsuleRoll {
    0% {
        transform: translate(0, -30px) rotate(0deg) scale(0);
        opacity: 0;
    }

    15% {
        opacity: 1;
        transform: translate(0, 0) rotate(90deg) scale(1);
    }

    100% {
        /* Escape the widget box downward and slightly offset */
        transform: translate(15px, 200px) rotate(1080deg) scale(1.1);
    }
}

/* --- PRIZE OVERLAY --- */

#prize-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 5, 8, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.prize-content {
    background: #1a0a13;
    border: 3px double #ff6699;
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 102, 153, 0.4);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

#prize-reveal {
    font-size: 80px;
    margin: 20px 0;
    filter: drop-shadow(0 0 10px #ff6699);
}

#close-prize {
    background: #1a0a13;
    color: #ff99bb;
    border: 2px solid #ff6699;
    padding: 10px 25px;
    border-radius: 12px;
    font-family: 'VT323', monospace;
    font-size: 20px;
    cursor: pointer;
    transition: 0.2s;
}

#close-prize:hover {
    background: #ff6699;
    color: #000;
}