﻿

/* =========================
   BASE
========================= */

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    background: #000;
}

#game {
    height: 100%;
    width: 100%;
    position: relative;

    border: 1px solid #ccc;

    overflow: hidden;

    max-width: 100vw;
    max-height: 100vh;
}

/* =========================
   CAMERA WRAPPER
========================= */

#gameView {
    position: absolute;

    left: 0;
    bottom: 0;

    width: 100vw;
    height: 100vh;

    overflow: hidden;

    z-index: 0;

    transform-origin: bottom left;
}

#world {
    margin: 0;
    padding: 0;

    width: 100%;
    height: 100%;

    position: absolute;

    left: 0;
    bottom: 0;

    z-index: 0;

    transform: none;
}

/* =========================
   HUD
========================= */

.gauge {
    margin: 0;
    padding: 0;

    height: 50px;
    width: 70px;

    text-align: right;

    font-size: 2em;
    font-weight: bold;

    position: absolute;

    top: 17px;
    right: 52px;

    z-index: 1000;

font-family: 'Rye', serif;
}

.gaugeSprite {
    margin: 0;
    padding: 0;

    z-index: 1000;

    position: absolute;
}

#coinNumber {
    left: 0;
}

#liveNumber {
    right: 52px;
}

#coin {
    height: 32px;
    width: 32px;

    background-image: url(mario-objects.png);
    background-position: 0 0;

    top: 15px;
    left: 70px;
}

#live {
    height: 40px;
    width: 40px;

    background-image: url(mario-sprites.png);
    background-position: 0 -430px;

    top: 12px;
    right: 8px;
}

/* =========================
   GAME OBJECTS
========================= */

.figure {
    margin: 0;
    padding: 0;

    z-index: 99;

    position: absolute;
}

.matter {
    margin: 0;
    padding: 0;

    z-index: 95;

    position: absolute;

    width: 32px;
    height: 32px;
}

/* =========================
   LOGO
========================= */

#inkmanLogo {
    position: absolute;

    top: 110px;
    left: 50px;

    z-index: 9999;

    width: 250px;
}

/* =========================
   HOME BUTTON
========================= */

#homeButton {
    position: absolute;

    top: 110px;
    right: 50px;

    z-index: 9999;
}

#homeButtonImage {
    width: 150px;

    display: block;

    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.45));
}

/* =========================
   MOBILE CONTROLS
========================= */

#mobileControls {
    display: none;
}

/* =========================
   LEVEL COMPLETE
========================= */

#levelComplete {
    position: absolute;

    top: 40%;
    left: 50%;

    transform: translate(-50%, -50%);

    z-index: 999999;

font-family: 'Rye', serif;
    font-size: 64px;

    color: #ffd800;

    text-shadow:
        4px 4px 0 #000,
        8px 8px 12px rgba(0,0,0,0.5);

    animation: levelPulse 1s infinite;
}

@keyframes levelPulse {

    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.08);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* =========================
   GAME OVER
========================= */

#gameOver {
    position: absolute;

    top: 42%;
    left: 50%;

    transform: translate(-50%, -50%);

    z-index: 999999;

font-family: 'Rye', serif;
    font-size: 72px;

    color: #ff2a2a;

    text-shadow:
        4px 4px 0 #000,
        0 0 20px rgba(255, 0, 0, 0.5);

    pointer-events: none;

    white-space: nowrap;

    animation: gameOverPulse 0.8s infinite;
}

@keyframes gameOverPulse {

    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.06);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* =========================
   FOOTER
========================= */

.inkman-footer {

    position: fixed;

    bottom: 10px;
    left: 50%;

    transform: translateX(-50%);

    padding: 8px 18px;

    background: rgba(0,0,0,0.45);

    border-radius: 10px;

    color: rgba(255,255,255,0.78);

    font-family: 'Roboto', sans-serif;
    font-size: 8px;
    font-weight: 400;

    text-align: center;

    letter-spacing: 0.5px;

    text-shadow: 0 2px 4px rgba(0,0,0,0.7);

    backdrop-filter: blur(1px);

    white-space: nowrap;

    z-index: 9999;
}

/* =========================
   TABLET + MOBILE
========================= */

@media (max-width: 768px) {

    #gameView {

        width: calc(100vw / 0.76);
        height: calc(100vh / 0.76);

        transform: scale(0.76);

        transform-origin: bottom left;

        left: 0;
        bottom: 0;
    }

    #world {
        width: 100%;
        height: 100%;
        transform: none;
    }

    #inkmanLogo {

        width: 120px;

        top: 58px;
        left: 15px;
    }

    #homeButton {

        top: 58px;
        right: 15px;
    }

    #homeButtonImage {

        width: 48px;
    }

    #mobileControls {

        display: block;

        position: fixed;

        left: 0;
        bottom: 12px;

        width: 100%;

        z-index: 99999;

        pointer-events: none;
    }

    #mobileControls button {

        pointer-events: auto;

        position: absolute;

        width: 52px;
        height: 52px;

        border-radius: 50%;

        border: 2px solid rgba(255,255,255,0.75);

        background: rgba(0,0,0,0.55);

        color: #ffffff;

        font-size: 18px;
        font-weight: bold;

        backdrop-filter: blur(4px);

        box-shadow:
            0 4px 10px rgba(0,0,0,0.35);
    }

    #btnLeft {
        left: 18px;
        bottom: 0;
    }

    #btnRight {
        left: 82px;
        bottom: 0;
    }

#btnJump {

    pointer-events: auto !important;

    position: absolute !important;

    right: 10px !important;
    bottom: 0 !important;

    width: 58px !important;
    height: 145px !important;

    border-radius: 999px !important;

    border: 2px solid rgba(255,255,255,0.75) !important;

    background: rgba(0,0,0,0.55) !important;

    color: #ffffff !important;

    backdrop-filter: blur(4px);

    box-shadow:
        0 4px 10px rgba(0,0,0,0.35);

    z-index: 99999 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    touch-action: manipulation;
    user-select: none;
}
}
/* =========================
   SMALL MOBILE
========================= */

@media (max-width: 480px) {

    #gameView {

        width: calc(100vw / 0.70);
        height: calc(100vh / 0.70);

        transform: scale(0.70);

        transform-origin: bottom left;

        left: 0;
        bottom: 0;
    }

    #world {
        width: 100%;
        height: 100%;
        transform: none;
    }

    #inkmanLogo {
    top: 55px;
        width: 95px;
    }

    #homeButtonImage {
    top: 55px;
        width: 38px;
    }

    #mobileControls button {

        width: 44px;
        height: 44px;

        font-size: 15px;
    }

    #btnRight {

        left: 70px;
    }

#btnJump {

    pointer-events: auto !important;

    position: absolute !important;

    right: 8px !important;
    bottom: 0 !important;

    width: 52px !important;
    height: 135px !important;

    border-radius: 999px !important;

    border: 2px solid rgba(255,255,255,0.75) !important;

    background: rgba(0,0,0,0.55) !important;

    color: #ffffff !important;

    backdrop-filter: blur(4px);

    box-shadow:
        0 4px 10px rgba(0,0,0,0.35);

    z-index: 99999 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    touch-action: manipulation;
    user-select: none;
}
}

/* =========================
   FLAG POLE
========================= */

#flagPole {

    position: absolute;

    bottom: 96px;

    width: 8px;
    height: 260px;

    background: #d9d9d9;

    border-radius: 10px;

    z-index: 50;

    box-shadow:
        inset -2px 0 0 rgba(0,0,0,0.2),
        0 0 8px rgba(255,255,255,0.15);
}

#flagPole::after {

    content: "";

    position: absolute;

    bottom: -12px;
    left: -8px;

    width: 24px;
    height: 12px;

    background: #777;

    border-radius: 4px;
}

#inkBossFlag {

    position: absolute;

    top: 25px;
    left: 8px;

    width: 110px;
    height: 60px;

    background: #000;

    clip-path: polygon(
        0 0,
        100% 50%,
        0 100%
    );

    border: 2px solid #111;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}

#inkBossFlag span {

    position: absolute;

    left: 12px;
    top: 11px;

    color: #fff;

    font-family: 'Pixelify Sans', sans-serif;

    font-size: 14px;

    font-weight: 700;

    letter-spacing: 1px;

    text-shadow:
        1px 1px 0 #000;
}

/* =========================
   LEVEL SELECTOR
========================= */

#levelSelector {

    position: absolute;

    top: 20px;

    left: 50%;

    transform: translateX(-50%);

    z-index: 99999;

    font-family: 'Pixelify Sans', sans-serif;
}

/* MAIN BUTTON */

#levelToggle {

    background:
        linear-gradient(
            180deg,
            #dd3247 0%,
            #9c1c2d 100%
        );

    color: #fff;

    border: 3px solid #111;

    border-radius: 12px;

    padding: 12px 18px;

    font-family: 'Pixelify Sans', sans-serif;

    font-size: 18px;
    font-weight: 700;

    letter-spacing: 1px;

    cursor: pointer;

    text-shadow:
        2px 2px 0 #000;

    box-shadow:
        0 5px 0 #4b0c16,
        0 0 14px rgba(221,50,71,0.4);

    transition:
        transform 0.15s ease;
}

#levelToggle:hover {

    transform: translateY(-2px);
}

#levelToggle:active {

    transform: translateY(3px);

    box-shadow:
        0 2px 0 #4b0c16;
}

/* DROPDOWN */

#levelDropdown {

    display: none;

    margin-top: 10px;

    background:
        rgba(0,0,0,0.92);

    border: 3px solid #dd3247;

    border-radius: 12px;

    overflow: hidden;

    width: 190px;

    max-height: 300px;

    overflow-y: auto;

    box-shadow:
        0 0 20px rgba(0,0,0,0.55);
}

#levelDropdown button {

    width: 100%;

    border: none;

    background: transparent;

    color: #fff;

    text-align: left;

    padding: 12px 16px;

    cursor: pointer;

    font-family: 'Pixelify Sans', sans-serif;

    font-size: 16px;

    transition:
        background 0.15s ease;
}

#levelDropdown button:hover {

    background:
        rgba(221,50,71,0.25);
}

/* OPEN STATE */

#levelSelector.open #levelDropdown {

    display: block;
}

/* DESKTOP ONLY */

@media (max-width: 768px) {

    #levelSelector {
        top: 10px;
        left: 600px;
        z-index: 999999;
    }

    #levelToggle {
        padding: 7px 10px;
        font-size: 11px;
        border-radius: 8px;
    }

    #levelDropdown {
        width: 120px;
        max-height: 220px;
    }

    #levelDropdown button {
        padding: 8px 10px;
        font-size: 11px;
    }
}

/* =========================
   START SCREEN
========================= */

#startOverlay {

    position: fixed;

    inset: 0;

    background:
        rgba(0,0,0,0.82);

    z-index: 99999999;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 30px;
}

#startLogo {

    width: 340px;

    max-width: 80vw;

    filter:
        drop-shadow(
            0 10px 30px rgba(0,0,0,0.55)
        );
}

#startGameButton {

    background:
        linear-gradient(
            180deg,
            #dd3247 0%,
            #9c1c2d 100%
        );

    color: #fff;

    border: 4px solid #111;

    border-radius: 14px;

    padding: 18px 34px;

    font-family:
        'Pixelify Sans',
        sans-serif;

    font-size: 28px;

    font-weight: 700;

    cursor: pointer;

    text-shadow:
        2px 2px 0 #000;

    box-shadow:
        0 6px 0 #4b0c16,
        0 0 20px rgba(221,50,71,0.35);
}

#startGameButton:active {

    transform:
        translateY(4px);
}