:root {
    --primary: #2a2a2a;
    --secondary: #4e0000;
    --accent: #ff1a1a;
    --background: #0d0d0d;
    --text: #f5f5f5;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 300vh;

    --ellipse-width: 0px;
    --ellipse-height: 0px;
    --ellipse-x: 50%;
    --ellipse-y: 50%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -khtml-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    scrollbar-width: none;
}

body {
    font-family: "Orbitron", sans-serif;
    line-height: 1.6;
    min-width: 320px;
    background: var(--background);
    color: var(--text);
    overflow-x: hidden;
    align-items: center;
}

.page-container {
    position: relative;
    padding: 20px;
    padding-top: 60px;
    min-height: 100vh;
    overflow-x: hidden;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--primary);
    color: var(--accent);
    padding: 5px 20px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
    z-index: 5;
}

.header__back {
    margin-right: 15px;
    cursor: pointer;
    display: none;
    transition: var(--transition);
}

.header__title {
    flex: 1;
    font-size: 1.2em;
    text-shadow: 0 0 5px var(--accent);
}

.header__coins {
    position: absolute;
    display: none;
    right: 3%;
    flex: 1;
    font-size: 1.2em;
    text-shadow: 0 0 5px var(--accent);
}

.profile-card {
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 90vw;
    max-width: 400px;
    margin: auto;
}

.avatar {
    position: relative;
    width: 60%;
    padding-top: 60%;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    cursor: pointer;
    border: 3px solid var(--accent);
}

.avatar-item {
    position: absolute;
    width: 30%;
    height: 30%;
    right: 5%;
    bottom: 5%;
    border-radius: var(--border-radius);
}

.stats {
    width: 100%;
}

.stat-item {
    margin: 10px 0;
    text-shadow: 0 0 3px var(--accent);
}

.progress-bar {
    width: 100%;
    background: #444;
    border-radius: 5px;
    height: 8px;
    margin: 5px 0;
}

.progress {
    background: var(--accent);
    height: 100%;
    border-radius: 5px;
}
.xp-flex {
    display: flex;
    align-items: left;
    gap: 10px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 90vw;
    max-width: 400px;
    margin: 0 auto;
}

.divider {
    border-right: 1px solid #ddd;
    margin: 0 10px;
}

.content-block {
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.missions-grid {
    display: grid;
    grid-template-columns: repeat(1, 3fr);
    gap: 10px;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.item-placeholder {
    position: relative;
    padding-top: 100%;
    background: #f0f0f0;
    border-radius: var(--border-radius);
}

.mission-item {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.2%;
    background: var(--primary);
    border-radius: 6px;
    border: 1px solid var(--accent);
    text-shadow: 0 0 3px var(--accent);
    overflow: hidden;
}

.mission-item.completed::after {
    content: '';
    position: absolute;
    left: 2%;
    top: 45%;
    width: 98%;
    height: 1px;
    background: var(--accent);
    border: 2px solid var(--secondary);
    animation: strike 0.3s forwards;
    opacity: 80%;
}

@keyframes strike {
    from { width: 0; }
    to { width: 96%; }
}

.mission-item.completed input {
    opacity: 0.5;
    pointer-events: none;
}

.mission-item input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
    cursor: pointer;
    filter: drop-shadow(0 0 2px var(--accent));
}

.mission-item input:checked {
    animation: pulse 0.5s;
}

.missions-section {
    width: 90vw;
    max-width: 400px;
    margin: 0 auto 12px auto;
}
.shop-section {
    width: 90vw;
    max-width: 400px;
    margin: 0 auto;
}

.avatar-large {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    margin-bottom: 20px;
    border: 3px solid var(--accent);
}


.avatar, .avatar-large, .avatar-item {
    background-repeat: no-repeat;
    border-radius: var(--border-radius);
    background-size: cover;
    background-position: center;
}

.profile-stats {
    background: var(--primary);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    width: 90vw;
    max-width: 400px;
    margin: 0 auto;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    opacity: 0;
    visibility: hidden;
    transform: translateX(30%);
    transition: var(--transition);
    padding-top: 60px;
    z-index: 1;
}

.page.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    z-index: 2;
}

.content-grid {
    display: grid;
    padding-top: 20px;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 90vw;
    max-width: 400px;
    margin: 0 auto;
}

@media (max-width: 480px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    .divider {
        display: none;
    }
    .header__back {
        opacity: 1;
    }
}

.item-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    max-width: 400px;
    margin: 0 auto;
}

.item-image {
    width: 80%;
    padding-top: 80%;
    background-size: cover;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    background-size: cover;
    background-position: center;
}

.item-info {
    background: var(--primary);
    padding: 20px;
    border-radius: var(--border-radius);
    width: 100%;
    text-align: center;
}

.item-name {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.item-price {
    font-size: 1.2em;
    color: var(--accent);
    margin-bottom: 20px;
}

.buy-button {
    background: var(--accent);
    color: black;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1em;
    transition: var(--transition);
}

.buy-button:hover {
    transform: scale(1.05);
}

.item {
    background-size: cover;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.item:hover {
    transform: scale(1.05);
}

.price-tag {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(161, 161, 161, 0.8);
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 0.8em;
    font-weight: bold;
}

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    z-index: 999;
    opacity: 1;
    transition: opacity 0.5s;
}

.stopwatch-container {
    position: relative;
    width: 70vmin;
    height: 70vmin;
    animation: sway 5s infinite ease-in-out;
}

.clock-face {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #ffd700, #b8860b);
    border-radius: 50%;
    border: 1.5vmin solid #d4af37;
    box-shadow: inset 0 0 5vmin rgba(0, 0, 0, 0.3),
        0 0 3.5vmin rgba(255, 215, 0, 0.5);
}

.clock-face::before {
    content: "";
    position: absolute;
    top: -7vmin;
    left: 50%;
    width: 4.5vmin;
    height: 7.2vmin;
    background: #ffd700;
    border-radius: 0.7vmin;
    transform: translateX(-50%);
    box-shadow: 0 0 2vmin #ffd700;
}

.clock-face::after {
    content: "";
    position: absolute;
    top: -12.5vmin;
    left: 50%;
    width: 11.5vmin;
    height: 7vmin;
    background: #ffd700;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 2vmin #ffd700;
}

.hand {
    position: absolute;
    background: black;
    left: 50%;
    transform-origin: bottom center;
}
.hour-hand {
    width: 1.6vmin;
    height: 25%;
    top: 25%;
}

.minute-hand {
    width: 1vmin;
    height: 45%;
    top: 5%;
}
canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

@keyframes sway {
    0%,
    100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

.purchased-overlay {
    position: absolute;
    top: 65%;
    left: 40%;
    transform: translate(-50%, -50%);
    border: 5px solid gray;
    color: gray;
    background-color: rgba(200, 200, 200, 0.8);
    font-size: 1.2em;
    padding: 2% 3%;
    border-radius: 8%;
    rotate: 20deg;
}

.error {
    animation: shake 0.5s;
    background: #ff4444 !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.notification {
    position: fixed;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: black;
    padding: 2%;
    border-radius: 5px;
    box-shadow: var(--shadow);
    font-size: 1.2em;
    z-index: 1000;
    text-align: center;
    animation: notificationSlide 1.2s forwards;
}

@keyframes notificationSlide {
    0% { top: -8%; }
    20% { top: 2%; }
    90% { top: 2%; }
    100% { top: -8%; }
}

#guide-text {
    position: fixed;
    display: none;
    top: 10%;
    left: 10%;
    right: 10%;
    margin: 0 auto;
    color: white;
    font-size: 1.3em;
    max-width: 380px;
    text-align: center;
    opacity: 0;
    z-index: 9;
    transition: opacity 0.5s;
    font-family: 'Arial', sans-serif;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 10px;
    border-radius: 10px;
    border: 2px solid var(--secondary);
    pointer-events: none;
}

.demo-btn {
    position: absolute;
    display: none;
    right: 1.5%;
    top: 12%;
    background: var(--secondary);
    color: var(--text);
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: opacity 0.3s;
}

#close-guide {
    position: fixed;
    display: none;
    top: 0.5%;
    right: 3%;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.5em;
    z-index: 9;
    opacity: 1;
    transition: opacity 0.3s;
}
.overlay {
    position: fixed;
    display: none;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    mask: radial-gradient(
        ellipse calc(var(--ellipse-width) / 2) calc(var(--ellipse-height) / 2) at 
        var(--ellipse-x) var(--ellipse-y),
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0) calc(100% - 15px),
        rgba(0, 0, 0, 1) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease, mask 1.5s ease;
    z-index: 8;
}

.no-scroll {
    overflow: hidden;
    height: 100vh;
    width: 100%;
}