﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

:root {
    --loader-width: calc(100vw / 3);
}

html {
    height: 100%;
}

canvas {
    outline: none;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* --- Mobile touch/pointer hardening for Unity WebGL --- */
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

#unity-container, #unity-canvas {
    touch-action: none;
}

#unity-canvas {
    display: block;
    -webkit-tap-highlight-color: transparent;
}

body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: radial-gradient(ellipse farthest-corner at center, #2D3248, #1D2130) no-repeat fixed;
}

@font-face {
    font-family: Neuron;
    src: url('fonts/Neuron.ttf') format('truetype');
}

/* === Unity fullscreen container/canvas === */
#unity-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
}

#unity-container.unity-desktop {
    transform: none;
}

#unity-container.unity-mobile {
    position: fixed;
    width: 100%;
    height: 100%;
}

#unity-canvas {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    background-size: cover;
    background: url('background_pattern.png') no-repeat center;
}

.unity-mobile #unity-canvas {
    width: 100%;
    height: 100%;
}

/* === Loading UI === */
#unity-loading-bar {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    padding: env(safe-area-inset-top) 32px env(safe-area-inset-bottom) 32px;
    z-index: 10;
    pointer-events: none;
}

.loading-content {
    width: min(85vw, 700px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5vh;
}

#unity-logo {
    width: min(40vw, 360px);
    max-width: 360px;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

#unity-progress-bar-empty {
    width: var(--loader-width);
    height: 14px;
    margin: 2vh auto 0;
    display: block;
    background: linear-gradient(to right, #3a3f4b, #1e2430);
    border-radius: 10px;
    box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

#unity-progress-bar-full {
    width: 0%;
    height: 100%;
    display: block;
    background-size: cover;
    background: linear-gradient(to right, #52A0FD, #A066FE);
    border-radius: inherit;
}

#progress-label {
    font-family: 'Inter', sans-serif;
    width: var(--loader-width);
    height: 32px;
    font-size: 14px;
    margin: 0 auto;
    color: white;
    text-align: center;
    vertical-align: middle;
    display: flex;
    justify-content: center;
    align-items: center;
}

#progress-text {
    font-family: 'Inter', sans-serif;
    width: var(--loader-width);
    height: 14px;
    font-size: 14px;
    margin: 0 auto;
    color: white;
    text-align: center;
    vertical-align: middle;
    display: flex;
    justify-content: center;
    align-items: center;
}

#version-text {
    font-family: Arial, sans-serif;
    width: var(--loader-width);
    height: 14px;
    font-size: 12px;
    margin: 0 auto;
    text-align: center;
    vertical-align: middle;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #6c757d;
}

#main-header {
    position: absolute;
    top: 24%;
    font-family: 'Inter', sans-serif;
    width: 100%;
    height: 22px;
    font-size: 2.2vh;
    margin: auto;
    transform: translate(0, 48%);
    color: white;
    text-align: center;
    vertical-align: middle;
    display: flex;
}

#unity-footer {
    position: relative;
}

.unity-mobile #unity-footer {
    display: none;
}

#unity-logo-title-footer {
    float: left;
    width: 102px;
    height: 38px;
    background: url('unity-logo-title-footer.png') no-repeat center;
}

#unity-build-title {
    float: right;
    margin-right: 10px;
    line-height: 38px;
    font-family: arial;
    font-size: 18px;
}

#unity-fullscreen-button {
    cursor: pointer;
    float: right;
    width: 38px;
    height: 38px;
    background: url('fullscreen-button.png') no-repeat center;
}

#unity-warning {
    position: absolute;
    left: 50%;
    top: 5%;
    transform: translate(-50%);
    background: white;
    padding: 10px;
    display: none;
}

@media (max-height: 560px) {
    #unity-logo {
        width: min(52vw, 280px);
    }
}
