/* 
* This WebGL template is licensed to the purchaser only.
* Unauthorized copying, redistribution, modification, or use of this template or any of its components � in whole or in part � 
* without a valid license is strictly prohibited and constitutes a violation of international copyright laws and licensing terms.
* This notice must remain intact in this file as a condition of use.
* Copyright � Devon Lively, 2025. All rights reserved. 
*/

:root {
    /* Pulse Animation Colors - These are set through the index.html */
    --pulse-start: #4caf50;
    --pulse-mid: #66bb6a;

    /* Page Setup */
    --PageSetup_PageBackgroundColor: #FFFFFF;

    /* Metrics Overlay Settings */
    --MetricsSettings_MetricsTextColor : #1EAED3;
    --metricsOverlaybox-shadow : 0 0 10px ##1EAED355;
    --metrics-headerborder-bottom : 1px solid #1EAED3;

    /* Minigames Settings */
    --LoadingScreen_SpaceAboveButton : 5px;
    --LoadingScreen_MinigameButtonFontSize : 16px;
    --LoadingScreen_MinigameButtonColor : #1EAED3;
    --LoadingScreen_MinigameButtonRadius : 5px;
    --LoadingScreen_MinigameFrame_Radius : 5px;
    --iframe-containerborder : 1px Solid #1EAED3;

    /* Loading Bar Settings */
    --LoadingScreen_Frame_Padding : 2px;
    --LoadingScreen_Frame_BGColor : #D6C3E7;
    --LoadingScreen_Frame_Radius : 3px;
    --LoadingScreen_PercentValueFontSize : 10px;
    --LoadingScreen_Frame_Width : 20%;
    --LoadingScreen_Frame_Height : 15px;
    --LoadingScreen_Frame_LogoYOffset : 10px 20px 0px 20px;
    --unity-progress-bar-emptyborder : 1px Hidden #FFFFFF;
    
    --unity-progress-bar-fulltransition :  width 0.3s;
    --unity-progress-bar-fullborder-radius : 3px;

    /* TapToStart Screen Settings */
    --TapToStartScreen_TextFontSize : 36px;

    /* Shared Tap + Loading Settings */
    --SharedTapAndLoadingSettings_PlaysTextColor : #BFBFBF;
    --SharedTapAndLoadingSettings_PlaysTextFontSize : 22px;
    --SharedTapAndLoadingSettings_QuoteTextYOffset : 28px;
    --SharedTapAndLoadingSettings_QuoteTextColor : #BFBFBF;
    --SharedTapAndLoadingSettings_QuoteTextFontSize : 12px;
    --SharedTapAndLoadingSettings_VersionTextColor : #E6E6E6;
    --SharedTapAndLoadingSettings_VersionTextFontSize : 12px;

    /* Background Images */
    --backgroundURLPortrait : url('../loadingScreens/backgroundPortrait.png') no-repeat center center fixed;
    --backgroundURLLandscape : url('../loadingScreens/backgroundLandscape.png');

    /* Corner Button Menu Icons */
    --unity-menu-button : url('../cornerMenu/icons/menu-button.png?') no-repeat center;
    --unity-fullscreen-button : url('../cornerMenu/icons/fullscreen-button.png') no-repeat center;
    --close-menu-button : url('../cornerMenu/icons/close-button.png') no-repeat center;
    --rating-buttonsmall-button : url('../cornerMenu/icons/rate-button.png?') no-repeat center;
    --menu-metrics-buttonsmall-button : url('../cornerMenu/icons/metrics-button.png') no-repeat center;
    --menu-fs-buttonsmall-button : url('../cornerMenu/icons/fullscreen-button.png') no-repeat center;
    --menu-fs-ios-buttonsmall-button : url('../cornerMenu/icons/fullscreen-button.png') no-repeat center;
}

*, *:before, *:after { box-sizing: inherit; }

html { box-sizing: border-box; }

html, body {
    height: 100%;
    overscroll-behavior: none;
}

body {
    margin: 0;
    background-color: var(--PageSetup_PageBackgroundColor);
}

canvas { display: block; }

#unity-canvas {
    width: 100%;
    height: 100%;
    background: var(--PageSetup_PageBackgroundColor);
}

#unity-container {
    position: relative; 
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: var(--PageSetup_PageBackgroundColor);
}

/*//////////////////////////////////////////*/
/* Version Number Text */
/*//////////////////////////////////////////*/
#version-number-text {
    position: fixed;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--SharedTapAndLoadingSettings_VersionTextColor);
    text-align: center;
    font-size: var(--SharedTapAndLoadingSettings_VersionTextFontSize);
    z-index: 9993;
}

/*//////////////////////////////////////////*/
/* Loading Screen Cover */
/*//////////////////////////////////////////*/
#background-cover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--backgroundURLPortrait);
    background-size: cover;
    z-index: 9990;
}

/*//////////////////////////////////////////*/
/* Landscape override */
/*//////////////////////////////////////////*/
@media (orientation: landscape) {
    #background-cover {
        background-image: var(--backgroundURLLandscape);
    }
}

#loading-cover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9993;
}

#unity-logo { text-align: center; }

#unity-logo img { max-width: 80%; }

/*//////////////////////////////////////////*/
/* Loading Bar */
/*//////////////////////////////////////////*/
#unity-loading-bar {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#unity-progress-bar-empty {
    width: var(--LoadingScreen_Frame_Width);
    height: var(--LoadingScreen_Frame_Height);
    margin: var(--LoadingScreen_Frame_LogoYOffset);
    border: var(--unity-progress-bar-emptyborder);
    padding: var(--LoadingScreen_Frame_Padding);
    position: relative;
    background-color: var(--LoadingScreen_Frame_BGColor);
    border-radius: var(--LoadingScreen_Frame_Radius);
    overflow: hidden;
}

@keyframes pulseColor {
    0%, 100% {
        background-color: var(--pulse-start);
    }

    50% {
        background-color: var(--pulse-mid);
    }
}

.pulsing {
    animation: pulseColor 1.5s infinite ease-in-out;
}

#unity-progress-bar-full {
    height: 100%;
    width: 0%;
    background-color: #4caf50;
    transition: var(--unity-progress-bar-fulltransition);
    border-radius: var(--unity-progress-bar-fullborder-radius);
}

#progress-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: black;
    z-index: 2;
    pointer-events: none;
    font-size: var(--LoadingScreen_PercentValueFontSize);
}

/*//////////////////////////////////////////*/
/* Play Count */
/*//////////////////////////////////////////*/
#play-count{
    position: fixed;
    top: 10px;
    right: 15px;
    color: var(--SharedTapAndLoadingSettings_PlaysTextColor);
    font-size: (var--SharedTapAndLoadingSettings_PlaysTextFontSize);
    z-index: 9999;
}

/*//////////////////////////////////////////*/
/*minigames*/
/*//////////////////////////////////////////*/
#game-ready {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 4px;
    justify-content: center;
    font-size: 1rem;
    z-index: 9999;
}

#minigame-button {
    pointer-events: auto;
	margin-top: var(--LoadingScreen_SpaceAboveButton);
    padding: 4px 8px;
    font-size: var(--LoadingScreen_MinigameButtonFontSize);
    background-color: var(--LoadingScreen_MinigameButtonColor);
    color: white;
    border: none;
    border-radius: var(--LoadingScreen_MinigameButtonRadius);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: background-color 0.3s;
}

    #minigame-button:hover {
        background-color: #1565c0;
    }

 .iframe-container {
    position: relative;
    background: black;
    border: var(--iframe-containerborder);
    border-radius: var(--LoadingScreen_MinigameFrame_Radius);
    overflow: hidden;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    margin: 3% auto;

    width: 90vw;
    height: calc(90vw * 7 / 8); /* 8:7 ratio */
    max-height: 90vh;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
}

.close-iframe-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    background: rgba(0,0,0,0.9);
    color: white;
    border: none;
    font-size: 20px;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10000;
}

/*//////////////////////////////////////////*/
/* Quote Table */
/*//////////////////////////////////////////*/
#quote-table {
    position: fixed;
    bottom: var(--SharedTapAndLoadingSettings_QuoteTextYOffset);
    width: 85%;
    left: 50%;      
    transform: translateX(-50%);
    color: var(--SharedTapAndLoadingSettings_QuoteTextColor);
    text-align: center;
    z-index: 9993;
    font-size: var(--SharedTapAndLoadingSettings_QuoteTextFontSize);
}

#quote-table a {
    text-decoration: none;  
    color: var(--SharedTapAndLoadingSettings_QuoteTextColor);
}

#quote-table a:hover {
    text-decoration: underline; 
    color: var(--SharedTapAndLoadingSettings_QuoteTextColor);
}

/*//////////////////////////////////////////*/
/* Tap to Start Button */
/*//////////////////////////////////////////*/
#tap-to-start-button-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-scale 2s ease-in-out infinite;
}

@keyframes pulse-scale {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

#tap-to-start-button {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: none;
    color: white;
    font-size: var(--TapToStartScreen_TextFontSize);
    border: none;
    z-index: 9992;
    display: block;
    cursor: pointer;
}

/*//////////////////////////////////////////*/
/* Hamburger Menu */
/*//////////////////////////////////////////*/
#menu-options {
    flex-direction: column;
    gap: 5px;
    margin-top: 5px;
}

/* Hamburger Menu Buttons */
.menu-button {
    position: fixed;
    right: 10px;
    bottom: 10px;
    width: 38px;
    height: 38px;
    background-size: contain;
    z-index: 9989;
}

#unity-menu-button {
    bottom: 10px;
    background: var(--unity-menu-button);
}

#unity-fullscreen-button {
    bottom: 10px;
    background: var(--unity-fullscreen-button);
}

#close-menu-button {
    bottom: 10px;
    background: var(--close-menu-button);
}

.menu-button.small-button {
    width: 28px;
    height: 28px;
    right: 10px;
    margin-bottom: 1px;
    border: none;
}

/* Hamburger Menu Inner Buttons */
#rating-button.small-button {
    background: var(--rating-buttonsmall-button);
    border: none;
}

.menu-button.small-button.custom-button {
    background: url('') no-repeat center;
    border: none;
}

#menu-metrics-button.small-button {
    background: var(--menu-metrics-buttonsmall-button);
    border: none;
}

#menu-fs-button.small-button {
    background: var(--menu-fs-buttonsmall-button);
    border: none;
}

#menu-fs-ios-button.small-button {
    background: var(--menu-fs-ios-buttonsmall-button);
    border: none;
}

/*//////////////////////////////////////////*/
/* Rating Screen */
/*//////////////////////////////////////////*/
#ratingModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#rateTitleText {
    background-color: rgba(0,0,0,0.35);
    border-radius: 5px;
}

.rating-selection-button {
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-radius: 5px;
    margin-left: 5px;
    margin-right: 5px;
    color: black;
    transition: color 0.2s;
}

.rating-selection-button.selected { color: grey; }

#averageRating { padding-top: 5px; }

#ratingWindow {
    background: #1eaed3;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.star {
    font-size: 40px;
    color: rgba(0,0,0,0.35);
    cursor: pointer;
    transition: color 0.2s;
}

.star.hover,
.star.selected { color: gold; }

/*//////////////////////////////////////////*/
/* Metrics Overlay */
/*//////////////////////////////////////////*/
#metricsOverlayWrapper {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 9999;
    cursor: grab;
}

#metricsOverlayWrapper.dragging {
    cursor: grabbing;
}

#metricsOverlay {
    background: rgba(0, 0, 0, 0.85);
    color: var(--MetricsSettings_MetricsTextColor);
    font-family: monospace;
    font-size: 13px;
    padding: 0;
    border-radius: 8px;
    width: 250px;
    box-shadow: var(--metricsOverlaybox-shadow);
    overflow: hidden;
}

.metrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    padding: 8px 10px;
    border-bottom: var(--metrics-headerborder-bottom);
    font-weight: bold;
    font-size: 14px;
    user-select: none;
}

#metricsCloseBtn {
    background: none;
    border: none;
    color: #ff5c5c;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

#metricsCloseBtn:hover {
    color: #ff1f1f;
}

.metrics-body {
    padding: 10px;
}
