/* ============================================================
   miris.dev :: MiRiS Game Works
   late-night attic-studio aesthetic
   ============================================================ */

:root {
    --bg-deep: #1a1423;
    --bg-surface: #2d2235;
    --wood: #3e2f1c;
    --amber: #f4a261;
    --terracotta: #e76f51;
    --sage: #2a9d8f;
    --gold: #e9c46a;
    --parchment: #fef3e2;
    --ink-faded: #b8a99a;
    --post-yellow: #ffd166;
    --post-pink: #f4845f;
    --neon: #00e5cc;
    --deep-teal: #264653;

    --font-display: "Bungee Shade", "Fredoka", system-ui, sans-serif;
    --font-section: "Fredoka", system-ui, sans-serif;
    --font-body: "Nunito", system-ui, sans-serif;
    --font-hand: "Caveat", "Comic Sans MS", cursive;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-deep);
    color: var(--parchment);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100%;
}

body {
    position: relative;
    background:
        radial-gradient(ellipse at 18% 12%, rgba(244,162,97,0.10) 0%, transparent 45%),
        radial-gradient(ellipse at 82% 70%, rgba(42,157,143,0.08) 0%, transparent 45%),
        var(--bg-deep);
}

/* ============================================================
   Boot screen
   ============================================================ */
.boot-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-deep);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 600ms ease 200ms;
    overflow: hidden;
}
.boot-screen.is-done {
    opacity: 0;
    pointer-events: none;
}

.boot-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 7vw, 5rem);
    color: var(--amber);
    letter-spacing: 0.06em;
    text-align: center;
    min-height: 1.4em;
    line-height: 1.1;
}

.boot-subtitle {
    font-family: var(--font-section);
    font-size: 0.9rem;
    letter-spacing: 0.4em;
    color: var(--gold);
    margin-top: 1.6rem;
    opacity: 0;
    animation: bootBlink 1s steps(2) infinite 1.5s;
}

.boot-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,0) 0px,
        rgba(255,255,255,0) 2px,
        rgba(244,162,97,0.07) 3px
    );
    mix-blend-mode: overlay;
}

@keyframes bootBlink {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.power-flash {
    position: fixed;
    inset: 0;
    background: var(--parchment);
    opacity: 0;
    pointer-events: none;
    z-index: 9998;
}
.power-flash.is-firing {
    animation: flashOnce 320ms ease-out forwards;
}
@keyframes flashOnce {
    0%   { opacity: 0; }
    20%  { opacity: 0.6; }
    100% { opacity: 0; }
}

/* ============================================================
   Global scanlines + parallax
   ============================================================ */
.scanlines-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,0) 0px,
        rgba(255,255,255,0) 2px,
        rgba(255,255,255,0.03) 3px
    );
}

.parallax-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    perspective: 1px;
    transform-style: preserve-3d;
}

.bg-wood, .bg-grid, .bg-shavings {
    position: absolute;
    inset: -10vh -10vw;
    will-change: transform;
}

.bg-wood {
    background:
        repeating-linear-gradient(
            92deg,
            rgba(62,47,28,0.06) 0px,
            rgba(62,47,28,0.06) 1px,
            transparent 1px,
            transparent 7px
        ),
        repeating-linear-gradient(
            88deg,
            rgba(62,47,28,0.04) 0px,
            rgba(62,47,28,0.04) 2px,
            transparent 2px,
            transparent 24px
        );
    opacity: 0.9;
}

.bg-grid {
    background-image:
        linear-gradient(rgba(184,169,154,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(184,169,154,0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.6;
}

.bg-shavings {
    background-image:
        radial-gradient(circle at 12% 20%, rgba(244,162,97,0.18) 0px, transparent 3px),
        radial-gradient(circle at 78% 8%, rgba(233,196,106,0.15) 0px, transparent 2px),
        radial-gradient(circle at 30% 70%, rgba(231,111,81,0.12) 0px, transparent 2px),
        radial-gradient(circle at 88% 86%, rgba(0,229,204,0.18) 0px, transparent 2px),
        radial-gradient(circle at 50% 40%, rgba(244,162,97,0.10) 0px, transparent 2px),
        radial-gradient(circle at 62% 92%, rgba(233,196,106,0.10) 0px, transparent 2px);
    opacity: 0.8;
}

/* ============================================================
   Toolbox navigation
   ============================================================ */
.toolbox {
    position: fixed;
    top: 50%;
    left: 18px;
    transform: translateY(-50%);
    z-index: 200;
    background: linear-gradient(160deg, #3e2f1c 0%, #2d2235 100%);
    border: 2px solid #1a1423;
    border-radius: 8px;
    padding: 14px 10px;
    box-shadow:
        0 6px 18px rgba(0,0,0,0.55),
        inset 0 1px 0 rgba(244,162,97,0.15);
    filter: url(#wobble);
}

.toolbox-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.toolbox-toggle {
    display: none;
    background: var(--amber);
    border: 2px solid var(--bg-deep);
    width: 38px;
    height: 38px;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
}

.pixel-burger,
.pixel-burger::before,
.pixel-burger::after {
    display: block;
    width: 20px;
    height: 3px;
    background: var(--bg-deep);
    position: relative;
}
.pixel-burger::before,
.pixel-burger::after {
    content: "";
    position: absolute;
    left: 0;
}
.pixel-burger::before { top: -7px; }
.pixel-burger::after  { top: 7px; }

.tool-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--parchment);
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 220ms, transform 220ms, box-shadow 220ms;
    font-family: var(--font-section);
    font-weight: 600;
    font-size: 0.9rem;
}

.pixel-svg {
    width: 30px;
    height: 30px;
    image-rendering: pixelated;
    flex-shrink: 0;
    transition: transform 200ms;
}

.tool-label {
    color: var(--parchment);
    transition: color 200ms;
}

.tool-icon:hover {
    background: rgba(244,162,97,0.10);
    box-shadow:
        0 0 8px rgba(0,229,204,0.4),
        0 0 24px rgba(0,229,204,0.15);
    animation: neonPulse 2s ease-in-out infinite;
}
.tool-icon:hover .tool-label { color: var(--neon); }
.tool-icon:hover .pixel-svg { animation: wiggleSprite 220ms steps(2) infinite; }

@keyframes wiggleSprite {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(1px, -1px) scale(1.05); }
    100% { transform: translate(-1px, 0) scale(1); }
}

@keyframes neonPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(0,229,204,0.4), 0 0 24px rgba(0,229,204,0.15); }
    50%      { box-shadow: 0 0 8px rgba(0,229,204,0.5), 0 0 28px rgba(0,229,204,0.25); }
}

/* ============================================================
   Main content
   ============================================================ */
.workshop {
    position: relative;
    z-index: 2;
    padding-left: 160px;
    padding-right: 60px;
    max-width: 1500px;
    margin: 0 auto;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
    position: relative;
    min-height: 92vh;
    padding: 8vh 4vw 4vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.hero-inner {
    position: relative;
    text-align: center;
    z-index: 4;
    transform: rotate(-1.4deg);
    padding: 2.4rem 3rem;
    background: rgba(45,34,53,0.55);
    border: 2px dashed rgba(244,162,97,0.35);
    border-radius: 12px;
    backdrop-filter: blur(2px);
    filter: url(#wobble);
}

.display-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 5.4rem);
    margin: 0;
    line-height: 0.95;
    color: var(--amber);
    letter-spacing: 0.02em;
}
.display-title.alt-color { color: var(--terracotta); }

.hero-tag {
    font-family: var(--font-section);
    font-weight: 600;
    color: var(--gold);
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    margin: 1.6rem auto 0.4rem;
    max-width: 38ch;
}

.hero-handwritten {
    font-family: var(--font-hand);
    font-size: 1.4rem;
    color: var(--gold);
    margin: 0.4rem 0 1.6rem;
    transform: rotate(-2deg);
}

.btn-pixel {
    display: inline-block;
    position: relative;
    overflow: hidden;
    padding: 0.9rem 1.6rem;
    background: var(--terracotta);
    color: var(--parchment);
    font-family: var(--font-section);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
    border: 3px solid var(--bg-deep);
    box-shadow:
        4px 4px 0 var(--bg-deep),
        inset 0 -3px 0 rgba(0,0,0,0.25);
    transition: transform 200ms, box-shadow 220ms;
    cursor: pointer;
}
.btn-pixel:hover {
    transform: translate(-2px, -2px) scale(1.03);
    box-shadow:
        6px 6px 0 var(--bg-deep),
        0 0 8px rgba(0,229,204,0.4),
        0 0 24px rgba(0,229,204,0.15),
        inset 0 -3px 0 rgba(0,0,0,0.25);
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(0,229,204,0.2);
    pointer-events: none;
    transform: scale(0);
    animation: rippleOut 400ms ease-out forwards;
}
@keyframes rippleOut {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.hero-decor {
    position: absolute;
    opacity: 0.55;
    z-index: 2;
    animation: floatBob 3s ease-in-out infinite, slowRotate 60s linear infinite;
}
.hero-decor svg { width: 100%; height: 100%; display: block; }

.decor-d20      { top: 8%;  left: 6%;  width: 70px; height: 70px; }
.decor-heart    { top: 14%; right: 10%; width: 36px; height: 36px; image-rendering: pixelated; animation-duration: 4s, 50s; }
.decor-controller { bottom: 16%; left: 12%; width: 110px; height: 70px; animation-duration: 5s, 70s; }
.decor-compass  { bottom: 8%;  right: 8%;  width: 80px; height: 80px; animation-duration: 4.5s, 80s; }
.decor-potion   { top: 40%;  right: 4%;  width: 50px; height: 70px; animation-duration: 3.5s, 65s; }

@keyframes floatBob {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-6px) rotate(0deg); }
}
@keyframes slowRotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ============================================================
   Paper-tear divider
   ============================================================ */
.paper-tear {
    height: 28px;
    margin: 4rem -10vw 4rem;
    background: var(--bg-surface);
    box-shadow: 0 4px 6px rgba(0,0,0,0.45);
    position: relative;
    z-index: 3;
}
.paper-tear.tear-1 {
    clip-path: polygon(0 0, 4% 60%, 8% 30%, 14% 80%, 20% 40%, 26% 70%, 32% 20%, 38% 80%, 44% 30%, 50% 70%, 56% 40%, 62% 80%, 68% 30%, 74% 70%, 80% 40%, 86% 80%, 92% 30%, 96% 60%, 100% 0, 100% 100%, 0 100%);
}
.paper-tear.tear-2 {
    clip-path: polygon(0 0, 6% 70%, 12% 30%, 18% 60%, 24% 20%, 30% 80%, 36% 40%, 42% 70%, 48% 30%, 54% 80%, 60% 40%, 66% 70%, 72% 20%, 78% 60%, 84% 30%, 90% 80%, 96% 50%, 100% 20%, 100% 100%, 0 100%);
}
.paper-tear.tear-3 {
    clip-path: polygon(0 20%, 4% 70%, 10% 30%, 16% 80%, 22% 40%, 28% 70%, 34% 20%, 40% 80%, 46% 30%, 52% 60%, 58% 30%, 64% 80%, 70% 40%, 76% 70%, 82% 20%, 88% 80%, 94% 30%, 100% 50%, 100% 100%, 0 100%);
}
.paper-tear.tear-4 {
    clip-path: polygon(0 40%, 6% 20%, 12% 70%, 18% 40%, 24% 80%, 30% 30%, 36% 70%, 42% 20%, 48% 60%, 54% 30%, 60% 80%, 66% 40%, 72% 70%, 78% 30%, 84% 80%, 90% 40%, 96% 70%, 100% 30%, 100% 100%, 0 100%);
}
.paper-tear.tear-5 {
    clip-path: polygon(0 30%, 5% 80%, 10% 40%, 17% 70%, 24% 20%, 31% 80%, 38% 40%, 45% 60%, 52% 30%, 59% 80%, 66% 30%, 73% 70%, 80% 30%, 87% 80%, 94% 40%, 100% 60%, 100% 100%, 0 100%);
}

/* ============================================================
   Sketchbook section
   ============================================================ */
.sketchbook {
    position: relative;
    margin: 0 0 4rem;
    padding: 3rem 4rem 3rem 6rem;
    background:
        repeating-linear-gradient(
            transparent 0px,
            transparent 23px,
            rgba(184,169,154,0.10) 24px
        ),
        linear-gradient(180deg, #2a2030 0%, #221a2a 100%);
    border: 2px solid rgba(244,162,97,0.18);
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    transform: rotate(-0.4deg);
    filter: url(#wobble);
}
.sketchbook-2 { transform: rotate(0.6deg); }

.spiral-binding {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 14px;
    width: 26px;
    background-image:
        radial-gradient(circle at 50% 16px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 50px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 84px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 118px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 152px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 186px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 220px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 254px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 288px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 322px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 356px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 390px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 424px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 458px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 492px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 526px, var(--bg-deep) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 560px, var(--bg-deep) 0 5px, transparent 6px);
    background-repeat: no-repeat;
}

.section-header {
    font-family: var(--font-section);
    font-weight: 700;
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    color: var(--amber);
    margin: 0 0 1.6rem;
    letter-spacing: 0.02em;
}

.sketchbook .section-header {
    color: var(--terracotta);
}

.body-text {
    font-family: var(--font-body);
    color: var(--parchment);
    font-size: 1.05rem;
    line-height: 1.75;
    margin: 0 0 1.2rem;
    max-width: 64ch;
}
.body-text em {
    color: var(--gold);
    font-style: italic;
}

.margin-note {
    display: inline-block;
    font-family: var(--font-hand);
    font-size: 1.4rem;
    color: var(--gold);
    background: rgba(244,162,97,0.06);
    border-left: 3px solid var(--amber);
    padding: 0.4rem 1rem;
    margin: 1rem 0 1.4rem 1.5rem;
    max-width: 38ch;
}
.note-tilt-left  { transform: rotate(-1.5deg); }
.note-tilt-right { transform: rotate(1.5deg); margin-left: 4rem; }

.devlog-entry .entry-title {
    font-family: var(--font-section);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--gold);
    margin: 0 0 0.3rem;
}
.entry-meta {
    font-family: var(--font-hand);
    color: var(--ink-faded);
    font-size: 1.1rem;
    margin: 0 0 1.2rem;
}

.hint-text {
    font-family: var(--font-hand);
    color: var(--gold);
    font-size: 1.2rem;
    margin: -0.4rem 0 1.6rem;
    transform: rotate(-0.5deg);
    display: inline-block;
}

/* ============================================================
   Card fan / Projects
   ============================================================ */
.projects {
    position: relative;
    padding: 3rem 0 5rem;
    margin-bottom: 2rem;
}

.card-fan {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0;
    padding: 4rem 1rem 5rem;
    perspective: 1200px;
    min-height: 460px;
}

.game-card {
    position: relative;
    width: 280px;
    height: 380px;
    margin-left: -40px;
    transform: rotate(var(--rot, 0deg));
    transition: transform 420ms cubic-bezier(0.34, 1.56, 0.64, 1),
                margin 420ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 320ms;
    cursor: pointer;
    z-index: calc(10 + var(--i, 0));
    filter: drop-shadow(4px 6px 8px rgba(0,0,0,0.4));
}
.game-card:first-child { margin-left: 0; }

.card-fan:hover .game-card {
    margin-left: 18px;
    transform: rotate(calc(var(--rot, 0deg) * 0.35));
}
.card-fan:hover .game-card:first-child { margin-left: 0; }

.game-card:hover {
    transform: rotate(0deg) translateY(-12px) scale(1.05) !important;
    z-index: 50 !important;
    filter:
        drop-shadow(0 8px 14px rgba(0,0,0,0.55))
        drop-shadow(0 0 8px rgba(0,229,204,0.45))
        drop-shadow(0 0 24px rgba(0,229,204,0.2));
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 500ms cubic-bezier(0.65, 0, 0.35, 1);
}

.game-card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: var(--bg);
    border: 2px solid var(--bg-deep);
    padding: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* torn edge along right side */
    clip-path: polygon(
        0 0,
        100% 0,
        96% 6%, 98% 12%, 94% 18%, 99% 26%, 95% 32%, 100% 40%,
        94% 48%, 99% 55%, 95% 64%, 100% 72%, 95% 80%, 99% 88%, 95% 96%,
        100% 100%,
        0 100%
    );
}

.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(160deg, #2d2235 0%, #1a1423 100%);
    color: var(--parchment);
    justify-content: space-between;
    padding: 26px 22px;
}

.card-screenshot {
    width: 100%;
    height: 140px;
    border: 2px solid var(--bg-deep);
    margin-bottom: 14px;
    overflow: hidden;
    image-rendering: pixelated;
    box-shadow: inset 0 -4px 0 rgba(0,0,0,0.3);
}
.card-art { width: 100%; height: 100%; display: block; }

.card-title {
    font-family: var(--font-display);
    font-size: 1.45rem;
    line-height: 1;
    color: var(--amber);
    margin: 0 0 0.4rem;
}
.game-card:nth-child(2n) .card-title { color: var(--terracotta); }
.game-card:nth-child(3n) .card-title { color: var(--gold); }

.card-meta {
    font-family: var(--font-hand);
    color: var(--ink-faded);
    font-size: 1.05rem;
    margin: 0 0 0.6rem;
}

.card-tag {
    align-self: flex-start;
    margin-top: auto;
    font-family: var(--font-section);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: var(--terracotta);
    color: var(--parchment);
    padding: 4px 10px;
    border: 2px solid var(--bg-deep);
    box-shadow: 2px 2px 0 var(--bg-deep);
}
.card-tag.tag-cyan   { background: var(--neon); color: var(--bg-deep); }
.card-tag.tag-yellow { background: var(--gold); color: var(--bg-deep); }
.card-tag.tag-green  { background: var(--sage); color: var(--parchment); }

.card-desc {
    font-family: var(--font-body);
    font-size: 0.96rem;
    line-height: 1.6;
    margin: 0 0 1rem;
    color: var(--parchment);
}

.card-link {
    font-family: var(--font-section);
    font-weight: 700;
    color: var(--neon);
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    transition: border-color 300ms;
    align-self: flex-start;
}
.game-card.is-flipped .card-link {
    border-color: var(--neon);
}

/* ============================================================
   Corkboard
   ============================================================ */
.corkboard {
    position: relative;
    padding: 2rem 0 5rem;
    margin: 0 0 2rem;
}

.corkboard-area {
    position: relative;
    margin-top: 1.5rem;
    background:
        repeating-linear-gradient(
            45deg,
            rgba(62,47,28,0.18) 0 2px,
            transparent 2px 6px
        ),
        radial-gradient(ellipse at 30% 20%, rgba(244,162,97,0.05), transparent 50%),
        linear-gradient(180deg, #3a2c20 0%, #2a1f17 100%);
    border: 4px solid #1a1423;
    border-radius: 8px;
    min-height: 620px;
    overflow: hidden;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.5);
}

.sticky-note {
    position: absolute;
    top: var(--top);
    left: var(--left);
    width: 180px;
    height: 180px;
    padding: 18px 16px;
    transform: rotate(var(--rot, 0deg));
    color: var(--bg-deep);
    font-family: var(--font-hand);
    font-size: 1.2rem;
    line-height: 1.35;
    box-shadow:
        0 6px 12px rgba(0,0,0,0.4),
        inset -8px -8px 12px rgba(0,0,0,0.07);
    cursor: grab;
    user-select: none;
    transition: transform 220ms ease, box-shadow 220ms;
    z-index: 5;
    /* curl bottom-right corner */
    background-image: linear-gradient(135deg, transparent 88%, rgba(0,0,0,0.18) 90%);
}

.sticky-note p {
    margin: 0;
}

.sticky-note.is-dragging {
    transition: none !important;
    box-shadow: 0 14px 28px rgba(0,0,0,0.55);
    cursor: grabbing;
    z-index: 60;
}

.sticky-note:hover {
    box-shadow:
        0 8px 18px rgba(0,0,0,0.55),
        0 0 8px rgba(0,229,204,0.3),
        0 0 24px rgba(0,229,204,0.12);
}

.sticky-pin {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f4845f, #842c1f);
    transform: translateX(-50%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.polaroid {
    position: absolute;
    top: var(--top);
    left: var(--left);
    width: 240px;
    padding: 12px 12px 36px;
    background: #fef3e2;
    transform: rotate(var(--rot, 0deg));
    box-shadow:
        0 6px 16px rgba(0,0,0,0.5),
        inset 0 0 0 1px rgba(0,0,0,0.05);
    z-index: 4;
    transition: transform 280ms;
}
.polaroid:hover {
    transform: rotate(0deg) scale(1.05);
    z-index: 30;
    box-shadow:
        0 12px 26px rgba(0,0,0,0.6),
        0 0 8px rgba(0,229,204,0.4),
        0 0 24px rgba(0,229,204,0.18);
}
.polaroid-photo {
    width: 100%;
    aspect-ratio: 5 / 4;
    background: #1a1423;
    overflow: hidden;
    image-rendering: pixelated;
}
.polaroid-photo svg { width: 100%; height: 100%; display: block; }
.polaroid-caption {
    font-family: var(--font-hand);
    font-size: 1.15rem;
    color: var(--bg-deep);
    text-align: center;
    margin: 8px 0 0;
}

.decor-floater {
    position: absolute;
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    opacity: 0.7;
    animation: floatBob 4s ease-in-out infinite;
}
.decor-star-1 { top: 86%; left: 16%; }

/* ============================================================
   Contact
   ============================================================ */
.contact {
    position: relative;
    padding: 2rem 0 4rem;
}
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.6rem;
    margin-top: 1.6rem;
}
.contact-card {
    background: rgba(45,34,53,0.6);
    border: 2px solid rgba(244,162,97,0.25);
    padding: 1.4rem 1.4rem 1.6rem;
    transform: rotate(-0.6deg);
    transition: transform 220ms, box-shadow 220ms;
    filter: url(#wobble);
}
.contact-card:nth-child(2) { transform: rotate(0.8deg); }
.contact-card:nth-child(3) { transform: rotate(-1.2deg); }
.contact-card:hover {
    transform: rotate(0deg) scale(1.03);
    box-shadow:
        0 8px 18px rgba(0,0,0,0.5),
        0 0 8px rgba(0,229,204,0.4),
        0 0 24px rgba(0,229,204,0.15);
}
.contact-card-title {
    font-family: var(--font-display);
    color: var(--gold);
    font-size: 1.4rem;
    margin: 0 0 0.6rem;
    line-height: 1;
}
.contact-card p {
    font-family: var(--font-body);
    color: var(--parchment);
    font-size: 0.95rem;
    margin: 0 0 0.8rem;
}

.link-draw {
    display: inline-block;
    position: relative;
    color: var(--neon);
    font-family: var(--font-section);
    font-weight: 700;
    text-decoration: none;
    padding-bottom: 4px;
}
.link-draw::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    background: var(--neon);
    transition: width 300ms ease;
}
.link-draw:hover::after { width: 100%; }

.workshop-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px dashed rgba(184,169,154,0.25);
    text-align: center;
}
.footer-handwritten {
    font-family: var(--font-hand);
    font-size: 1.4rem;
    color: var(--gold);
    margin: 0 0 0.4rem;
    transform: rotate(-0.6deg);
    display: inline-block;
}
.footer-meta {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--ink-faded);
    margin: 0;
}

/* ============================================================
   Mascot
   ============================================================ */
.mascot-cradle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 64px;
    height: 64px;
    z-index: 100;
    pointer-events: auto;
}

#mascotCanvas {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    width: 64px;
    height: 64px;
    cursor: pointer;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.55));
}

.mascot-zzz {
    position: absolute;
    top: -12px;
    right: 38px;
    font-family: var(--font-hand);
    color: var(--gold);
    font-size: 1.2rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 400ms;
}
.mascot-zzz.is-on { opacity: 1; }

.mascot-zzz span {
    display: inline-block;
    animation: zzzFloat 2.4s ease-in-out infinite;
}
.mascot-zzz span:nth-child(2) { animation-delay: 0.6s; }
.mascot-zzz span:nth-child(3) { animation-delay: 1.2s; }

@keyframes zzzFloat {
    0%   { transform: translate(0, 0) scale(0.7); opacity: 0; }
    25%  { opacity: 1; }
    100% { transform: translate(-12px, -28px) scale(1.2); opacity: 0; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .toolbox {
        top: 14px;
        left: 14px;
        transform: none;
        padding: 10px;
    }
    .toolbox-toggle { display: inline-flex; }
    .toolbox-list {
        display: none;
        margin-top: 12px;
    }
    .toolbox.is-open .toolbox-list { display: flex; }
    .tool-label {
        display: inline;
    }
    .workshop {
        padding-left: 20px;
        padding-right: 20px;
    }
    .hero-inner { padding: 1.6rem 1.4rem; }
    .sketchbook {
        padding: 2rem 1.4rem 2rem 3.4rem;
    }
    .game-card { width: 240px; height: 360px; }
    .corkboard-area { min-height: 720px; }
    .sticky-note { width: 150px; height: 150px; font-size: 1.05rem; }
    .polaroid { width: 200px; }
    .decor-d20, .decor-controller, .decor-compass { display: none; }
}

@media (max-width: 560px) {
    .display-title { font-size: 2.2rem; }
    .game-card { width: 220px; height: 340px; margin-left: -20px; }
    .card-fan:hover .game-card { margin-left: 8px; }
    .corkboard-area { min-height: 820px; }
    .sticky-note { width: 130px; height: 130px; }
    .polaroid { width: 170px; }
}
