@font-face {
    font-family: "Volter";
    src: url("assets/volter-font.ttf") format("truetype");
}

/* Base */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: #8fb6d9;
    font-family: "Volter", Arial, sans-serif;
    font-size: 18px;
    font-smooth: never;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
}

.seo-content {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Main Page */

.habbo-page {
    text-align: center;
    position: relative;
    width: min(100%, 720px);
    min-height: 650px;
    padding: 30px 16px 86px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.speech-area {
    width: 100%;
    min-height: 190px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.speech-bubble {
    position: relative;
    display: inline-block;
    width: fit-content;
    max-width: min(620px, calc(100vw - 32px));
    min-width: 0;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 6px;
    padding: 12px 16px;
    color: #000000;
    font-size: 18px;
    line-height: 22px;
    text-align: center;
    overflow-wrap: break-word;
    box-shadow:
        inset 0 1px 0 #ffffff,
        inset 0 -2px 0 #c7c7c7,
        2px 2px 0 rgba(0, 0, 0, 0.35);
}

.speech-bubble::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    background: inherit;
    border-left: 2px solid #000000;
    border-bottom: 2px solid #000000;
    transform: rotate(-45deg);
}

.bubble-whisper {
    background: #e8e8e8;
    color: #222222;
    font-style: italic;
}

.bubble-cursed {
    background: #111111;
    color: #ffffff;
    border-color: #000000;
    text-shadow: 1px 1px 0 #550000;
    box-shadow:
        inset 0 1px 0 #333333,
        inset 0 -2px 0 #000000,
        0 0 14px rgba(0, 0, 0, 0.75),
        2px 2px 0 rgba(0, 0, 0, 0.35);
}

.pressure {
    display: block;
    width: 192px;
    height: auto;
    margin: 0 auto;
    cursor: pointer;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
    transition: transform 0.08s ease, filter 0.08s ease;
    transform-origin: center bottom;
    flex-shrink: 0;
}

.pressure.clicked {
    transform: translateY(6px) scale(0.94);
    filter: brightness(0.92);
}

.click-hint {
    margin-top: 16px;
    color: #1f3d5a;
    font-size: 14px;
    line-height: 16px;
    text-shadow: 1px 1px 0 #ffffff;
}

/* Floating Buttons */

.floating-control-bar {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 900;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

.habbo-button {
    font-family: "Volter", Arial, sans-serif;
    font-size: 14px;
    line-height: 16px;
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 #ffffff,
        inset 0 -2px 0 #c7c7c7,
        2px 2px 0 rgba(0, 0, 0, 0.35);
}

.habbo-button:hover {
    background: #f2f2f2;
}

.habbo-button:active {
    transform: translateY(2px);
}

/* Overlays / Windows */

.about-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.25);
    align-items: center;
    justify-content: center;
}

.about-overlay.open {
    display: flex;
}

.about-window {
    width: min(720px, 92vw);
    max-height: 80vh;
    overflow-y: auto;
    background: #f5deb3;
    border: 2px solid #000;
    box-shadow: 4px 4px 0 #000;
}

.about-header {
    background: #2d8ca3;
    color: #fff;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.about-header button {
    cursor: pointer;
}

.about-content h1 {
    margin-top: 0;
}

.about-content p {
    line-height: 1.5;
}

.achievements-overlay,
.stats-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 10px;
    background: rgba(0, 0, 0, 0.42);
    display: none;
    align-items: center;
    justify-content: center;
}

.achievements-overlay.open,
.stats-overlay.open {
    display: flex;
}

.achievements-window,
.stats-window {
    width: min(515px, calc(100vw - 20px));
    max-height: 86vh;
    background: #e6e6dc;
    border: 2px solid #000000;
    border-radius: 7px;
    overflow: hidden;
    box-shadow:
        inset 1px 1px 0 #ffffff,
        inset -1px -1px 0 #b5b5aa,
        4px 4px 0 rgba(0, 0, 0, 0.45);
}

.stats-window {
    width: min(420px, calc(100vw - 20px));
}

.achievements-header,
.stats-header {
    position: relative;
    height: 38px;
    background: #2f84a0;
    border-bottom: 2px solid #1a5367;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 16px;
    text-shadow: 1px 1px 0 #000000;
}

.achievements-header button,
.stats-header button {
    position: absolute;
    right: 7px;
    top: 7px;
    width: 19px;
    height: 19px;
    padding: 0;
    border: 0;
    background: url("assets/close.png") center / contain no-repeat;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    image-rendering: pixelated;
}

.achievements-header button:hover,
.stats-header button:hover {
    background-image: url("assets/close_hover.png");
}

.achievements-header button:active,
.stats-header button:active {
    top: 8px;
}

/* Scrollable Lists */

.achievements-list,
.stats-list {
    background: #e6e6dc;
    padding: 9px;
    max-height: 68vh;
    overflow-y: auto;
    scrollbar-color: #cfcfcf #efefef;
    scrollbar-width: auto;
}

.achievements-list::-webkit-scrollbar,
.stats-list::-webkit-scrollbar {
    width: 14px;
}

.achievements-list::-webkit-scrollbar-track,
.stats-list::-webkit-scrollbar-track {
    background: #efefef;
    border-left: 1px solid #000000;
}

.achievements-list::-webkit-scrollbar-thumb,
.stats-list::-webkit-scrollbar-thumb {
    background: #cfcfcf;
    border: 1px solid #000000;
    box-shadow:
        inset 1px 1px 0 #ffffff,
        inset -1px -1px 0 #8a8a8a;
}

/* Achievement Rows */

.achievement-item {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 7px;
    margin-bottom: 8px;
    min-height: 112px;
}

.achievement-side {
    position: relative;
    background: #c8c8c8;
    border: 2px solid #747474;
    padding: 7px 5px;
    text-align: center;
    box-shadow:
        inset 1px 1px 0 #eeeeee,
        inset -1px -1px 0 #9a9a9a;
}

.achievement-side::after {
    content: "";
    position: absolute;
    top: 41px;
    right: -10px;
    width: 17px;
    height: 17px;
    background: #c8c8c8;
    border-top: 2px solid #747474;
    border-right: 2px solid #747474;
    transform: rotate(45deg);
    z-index: 2;
}

.achievement-name {
    color: #111111;
    font-size: 14px;
    line-height: 14px;
    min-height: 30px;
}

.achievement-icon {
    display: block;
    width: 50px;
    height: 50px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    margin: 4px auto 5px;
}

.achievement-progress {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 20px;
    padding: 0 6px;
    background: #000000;
    color: #ffffff;
    border: 0;
    border-radius: 5px;
    font-size: 12px;
    line-height: 14px;
    text-shadow: 1px 1px 0 #000000;
    overflow: hidden;
    z-index: 1;
}

.achievement-progress::before {
    content: "";
    position: absolute;
    inset: 2px;
    background: #e00000;
    border-radius: 3px;
    box-shadow:
        inset 1px 1px 0 #ff6b6b,
        inset -1px -1px 0 #7f0000;
    z-index: -1;
}

.achievement-info {
    position: relative;
    background: #c8c8c8;
    border: 2px solid #747474;
    border-radius: 7px;
    padding: 8px 10px 48px;
    text-align: left;
    box-shadow:
        inset 1px 1px 0 #eeeeee,
        inset -1px -1px 0 #9a9a9a;
}

.achievement-info-title {
    background: #8f8f8f;
    color: #333333;
    border: 1px solid #5f5f5f;
    border-radius: 6px;
    padding: 5px 10px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 15px;
    box-shadow:
        inset 1px 1px 0 #bdbdbd,
        inset -1px -1px 0 #777777;
}

.achievement-info-desc {
    color: #000000;
    font-size: 14px;
    line-height: 15px;
    padding-left: 4px;
    padding-right: 6px;
}

/* Achievement Progress Bars */

.achievement-progress-bar {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: 22px;
    background: #5b5650;
    border: 2px solid #000000;
    border-radius: 5px;
    overflow: hidden;
    box-shadow:
        inset 1px 1px 0 #8d8882,
        inset -1px -1px 0 #2f2c28;
}

.achievement-progress-fill-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.achievement-progress-fill {
    height: 100%;
    min-width: 0;
    background: #00b7bd;
    box-shadow:
        inset 1px 1px 0 #75ffff,
        inset -1px -1px 0 #00777c;
}

.achievement-progress-text {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 12px;
    line-height: 14px;
    text-shadow: 1px 1px 0 #000000;
}

/* Achievement Unlocked State */

.achievement-item:not(.locked) .achievement-side {
    background: #ffdd86;
    border-color: #b88c22;
}

.achievement-item:not(.locked) .achievement-side::after {
    background: #ffdd86;
    border-top-color: #b88c22;
    border-right-color: #b88c22;
}

.achievement-item:not(.locked) .achievement-info {
    background: #f2deb2;
    border-color: #9c7c3a;
}

.achievement-item:not(.locked) .achievement-info-title {
    background: #f2b83d;
    color: #ffffff;
    border-color: #a66d00;
    text-shadow: 1px 1px 0 #7a4b00;
}

.achievement-item:not(.locked) .achievement-progress::before {
    background: #12c900;
    box-shadow:
        inset 1px 1px 0 #8dff7a,
        inset -1px -1px 0 #087000;
}

.achievement-item.locked .achievement-icon {
    filter: grayscale(100%);
    opacity: 0.75;
}

.achievement-item.locked .achievement-side::after {
    background: #c8c8c8;
    border-top-color: #747474;
    border-right-color: #747474;
}

/* Special Visitors Achievement */

.special-visitors-row {
    min-height: 164px;
}

.special-visitors-row .achievement-info {
    padding-bottom: 10px;
}

.special-visitor-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, 54px);
    justify-content: center;
    align-items: start;
    gap: 7px;
    margin: 10px auto 0;
    width: 100%;
}

.special-visitor-badge {
    position: relative;
    width: 54px;
    min-height: 67px;
    background: #c8c8c8;
    border: 2px solid #747474;
    padding: 4px 3px;
    text-align: center;
    box-shadow:
        inset 1px 1px 0 #eeeeee,
        inset -1px -1px 0 #9a9a9a;
}

.special-visitor-badge img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.special-visitor-badge span {
    display: block;
    margin-top: 3px;
    color: #000000;
    font-size: 10px;
    line-height: 12px;
}

.special-visitor-badge.unlocked {
    background: #ffdd86;
    border-color: #b88c22;
}

.special-visitor-badge.locked {
    filter: grayscale(100%);
    opacity: 0.55;
}

/* Stats */

.stat-item {
    background: #c8c8c8;
    border: 2px solid #747474;
    border-radius: 7px;
    padding: 10px;
    margin-bottom: 8px;
    text-align: left;
    box-shadow:
        inset 1px 1px 0 #eeeeee,
        inset -1px -1px 0 #9a9a9a;
}

.stat-label {
    background: #8f8f8f;
    color: #333333;
    border: 1px solid #5f5f5f;
    border-radius: 6px;
    padding: 5px 10px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 14px;
}

.stat-value {
    color: #000000;
    font-size: 18px;
    line-height: 22px;
}

/* Achievement Toast */

.achievement-toast {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1100;
    background: #f2f2f2;
    border: 2px solid #7f7f7f;
    padding: 10px 14px;
    font-family: "Volter", Arial, sans-serif;
    font-size: 14px;
    line-height: 18px;
    box-shadow:
        inset 1px 1px 0 #ffffff,
        inset -1px -1px 0 #9a9a9a,
        4px 4px 0 rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    gap: 10px;
}

.achievement-toast.show {
    display: flex;
    animation: achievementPop 2.5s ease forwards;
}

.achievement-toast-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    flex-shrink: 0;
}

.achievement-toast-title {
    color: #555555;
    font-size: 12px;
    line-height: 14px;
}

.achievement-toast-name {
    color: #000000;
    font-size: 14px;
    line-height: 18px;
}

.achievement-toast-level {
    color: #000000;
    font-size: 12px;
    line-height: 14px;
}

/* Animations */

.pop {
    animation: pop 0.18s ease;
}

.streak-glow {
    animation: streakGlow 1.2s ease forwards;
}

@keyframes pop {
    0% {
        transform: scale(0.96);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes achievementPop {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    15% {
        opacity: 1;
        transform: translateY(0);
    }

    85% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes streakGlow {
    0% {
        box-shadow:
            inset 0 1px 0 #ffffff,
            inset 0 -2px 0 #c7c7c7,
            2px 2px 0 rgba(0, 0, 0, 0.35);
    }

    35% {
        box-shadow:
            inset 0 1px 0 #ffffff,
            inset 0 -2px 0 #c7c7c7,
            0 0 12px rgba(255, 255, 255, 0.95),
            0 0 20px rgba(255, 230, 120, 0.9),
            2px 2px 0 rgba(0, 0, 0, 0.35);
    }

    100% {
        box-shadow:
            inset 0 1px 0 #ffffff,
            inset 0 -2px 0 #c7c7c7,
            2px 2px 0 rgba(0, 0, 0, 0.35);
    }
}

.habbo-tooltip {
    position: fixed;
    z-index: 999999;
    display: none;
    max-width: 220px;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 6px;
    padding: 7px 9px;
    color: #000000;
    font-family: "Volter", Arial, sans-serif;
    font-size: 14px;
    line-height: 13px;
    text-align: center;
    pointer-events: none;
    box-shadow:
        inset 0 1px 0 #ffffff,
        inset 0 -2px 0 #c7c7c7,
        2px 2px 0 rgba(0, 0, 0, 0.35);
}

.habbo-tooltip.show {
    display: block;
}

.completion-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.65);
}

.completion-overlay.open {
    display: flex;
}

.completion-window {
    width: min(420px, calc(100vw - 36px));
    background: #ffdd86;
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 18px;
    text-align: center;
    box-shadow:
        inset 1px 1px 0 #fff3c4,
        inset -2px -2px 0 #b88c22,
        5px 5px 0 rgba(0, 0, 0, 0.45);
}

.completion-window h2 {
    margin: 0 0 12px;
    background: #f2b83d;
    border: 1px solid #a66d00;
    border-radius: 6px;
    padding: 8px;
    color: #000000;
    font-size: 18px;
    line-height: 22px;
}

.completion-window img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    image-rendering: pixelated;
    margin: 8px auto;
}

.completion-window p {
    margin: 8px 0;
    color: #000000;
    font-size: 14px;
    line-height: 18px;
}

/* Mobile */

@media (max-width: 768px) {
    .habbo-page {
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 24px 12px 86px;
    }

    .speech-area {
        min-height: 170px;
    }

    .speech-bubble {
        max-width: calc(100vw - 28px);
        font-size: 18px;
        line-height: 22px;
    }

    .pressure {
        width: 192px;
    }

    .floating-control-bar {
        right: 12px;
        bottom: 45px;
        left: 12px;
        justify-content: center;
    }

    .habbo-button {
        flex: 1;
        max-width: 160px;
    }

    .achievement-item {
        grid-template-columns: 92px 1fr;
    }

    .achievement-name {
        font-size: 11px;
        line-height: 13px;
    }

    .special-visitor-badges {
        grid-template-columns: repeat(auto-fit, 50px);
        gap: 6px;
    }

    .special-visitor-badge {
        width: 50px;
        min-height: 64px;
    }

    .achievement-toast {
        top: 12px;
        right: 12px;
        left: 12px;
    }
}