/* 🏠 IT Games Core - Shared Base Styles */
:root {
    --text-s: clamp(0.4689rem, 0.371rem + 0.4893vw, 0.7502rem);
    --text-m: clamp(0.625rem, 0.4946rem + 0.6522vw, 1rem);
    --text-l: clamp(0.8331rem, 0.6593rem + 0.8693vw, 1.333rem);
    --text-xl: clamp(1.1106rem, 0.8788rem + 1.1588vw, 1.7769rem);
    --text-xxl: clamp(1.4804rem, 1.1714rem + 1.5447vw, 2.3686rem);
    --muted: #969696;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body,
html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Comfortaa', sans-serif;
    font-size: var(--text-m);
    background-color: var(--bg-color);
}

h1 {
    font-size: var(--text-xxl);
}

h2 {
    font-size: var(--text-xl);
}

h3 {
    font-size: var(--text-l);
}

h4 {
    font-size: var(--text-m);
}

h5 {
    font-size: var(--text-s);
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

canvas {
    width: 100%;
    flex: 1;
    display: block;
    cursor: grab;
}

canvas:active {
    cursor: grabbing;
}

/* Game preview bar */
#game-preview {
    position: relative;
    background: rgba(255, 128, 8, 0.95);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    gap: 10px;
    padding: 10px 20px;
}

.preview-banner-text {
    text-align: center;
    line-height: 1.5;
}

.preview-banner-text>strong {
    font-size: var(--text-l);
}

.preview-stats-container .stats-section {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    background-color: #fff;
    color: rgba(255, 128, 8, 0.95);
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 12px;
    white-space: nowrap;
}

@media (max-width: 400px) {
    .stats-section {
        gap: 8px;
    }
}

/* Game actions bar */
#game-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    color: var(--primary);
}

#game-actions .game-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-grow: 1;
    font-weight: bold;
    font-size: var(--text-m);
    color: var(--muted);
}

#game-actions .game-stat>span {
    min-width: 100px;
    font-size: var(--text-xl);
    color: var(--primary);
}

#game-reset-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 10px;
    transition: all 0.2s ease;
    width: 50px;
    height: 50px;
}

#game-reset-btn:hover {
    transform: rotate(45deg);
}

#game-reset-btn svg {
    display: block;
}

@media (max-width: 480px) {
    #game-reset-btn {
        width: 35px;
        height: 35px;
    }
}

/* 🔄 Game Loader Core Styles */
#game-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.5s ease;
}

.loader-content {
    text-align: center;
    color: var(--primary);
    font-family: 'Comfortaa', sans-serif;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(71, 28, 168, 0.1);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#game-loader p {
    font-weight: 700;
    letter-spacing: -0.5px;
}

#game-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 🏆 Contest Form Overlay */
#contest-form-overlay {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 20px;
    box-sizing: border-box;
    z-index: 100;
}

#contest-form-overlay h2 {
    margin: 0 0 10px 0;
    text-align: center;
}

#contest-form-overlay h3 {
    font-weight: normal;
    text-align: center;
}

#contest-form-overlay .contest-form-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    max-width: 600px;
}


#contest-form-overlay .contest-form-wrapper h3 span {
    color: var(--accent);
    font-size: var(--text-xl);
    font-weight: bold;
}


#contest-entry-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 24px;
}

#contest-email {
    padding: 12px;
    width: 100%;
    border-radius: 8px;
    border: none;
    text-align: center;
    box-sizing: border-box;
    outline: none;
    color: #333;
}

#contest-form-overlay .terms-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

#contest-form-overlay .terms-container label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

#contest-form-overlay .terms-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

#contest-form-overlay .terms-container a {
    color: var(--accent);
    text-decoration: underline;
}

#contest-form-overlay button[type="submit"],
#contest-form-overlay button[type="button"] {
    padding: 12px 30px;
    background-color: var(--accent);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

#contest-form-overlay button[type="submit"]:hover {
    opacity: 0.9;
}


#contest-form-overlay .contest-success-leaderboard {
    margin-top: 15px;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
}

#contest-form-overlay .contest-success-leaderboard h4 {
    margin: 0 0 10px 0;
    color: var(--accent);
    text-align: center;
}

#contest-form-overlay .contest-success-leaderboard ol {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    color: white;
    font-family: Comfortaa, sans-serif;
}