/* @brief   Digital Dice game for Let's Go
   @author  Sarah Rosanna Busch
   @client  Richard Watkins
   @date    19 Dec 2025
   @version 2.1
   */

@font-face {
  font-family: 'Nitti-Reg';
  src: url('./assets/NittiGroteskLG-Regular.otf') format('opentype');
}

@font-face {
  font-family: 'Nitti-Bold';
  src: url('./assets/NittiGroteskLG-Bold.otf') format('opentype');
}

:root {
    --button-color: #64C2C2;
    --button-active-color: #72dddd;
}

* {
    box-sizing: border-box;
    margin: 0px;    
    font-size: clamp(16pt, 3vw, 24pt);
    font-family: 'Nitti-Reg', Arial, sans-serif;
}

html, body {
	height: 100dvh; /* page sizing that behaves better on mobile */	
    overflow: hidden;
}

#letsGoApp {
    display: flex;
    flex-direction: column;
    margin: 0;
	width: 100dvw;
	height: calc(100dvh - env(safe-area-inset-bottom));
	padding-bottom: env(safe-area-inset-bottom);
    overflow-x: hidden;
}

main {
    display: flex;
    flex-direction: column;
    flex: 1;
    max-height: 90%; /* to ensure window resizing works */
    max-width: 100vw;
    position: relative;    
    align-items: center;
}

header {
    display: flex;
    height: 8rem;
    align-items: center;
    justify-content: center;
    color: black;
}

h1 {
    font-size: clamp(24pt, 5vw, 48pt);
    font-family: 'Nitti-Bold', Arial, sans-serif;
    margin: 0 5rem;
    text-align: center;
}

h2 {
    font-family: 'Nitti-Bold', Arial, sans-serif;
    padding: 2px 10px;
    margin-bottom: 5px;
}

.logo {
    max-width: min(60vw, 40dvh);
    height: auto;
}

.centerDiv {
    display: flex;
    flex: 1;
    position: relative;
    left: -1rem;
    align-items: start;
    justify-content: center;
}

footer {
    display: flex;
    height: 10dvh;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

footer .centerBtn {
	display: flex;
	justify-content: center;
}

footer .leftBtn {
	flex: 1;
	display: flex;
	justify-content: right;
}

footer .rightBtn {
	flex: 1;
	display: flex;
	justify-content: left;
}

.button { /* start/roll button */
    background-color: var(--button-color);
    color: white;
    padding: 0;
    width: 6rem;
    border: none;
    border-radius: 1rem;
    font-size: 24pt;
    cursor: pointer;
    font-family: 'Nitti-Bold', Arial, sans-serif;
    z-index: 101;
}

.button:hover {
    box-shadow: 0px 2px 2px 1px rgb(0 0 0 / 0.2);
}

.button:active {
    background-color: var(--button-active-color);
}

.button:disabled {            
	cursor: default;     
}

.triangleBtn {
    width: 0;
    height: 0;
    border-style: solid;
    cursor: pointer;
    background-color: white;
    z-index: 101;
}

/* Left-pointing blue triangle */
#prevBtn {
    border-width: 20px 30px 20px 0;   /* top, right, bottom, left */
    border-color: transparent var(--button-color) transparent transparent;
}

#prevBtn:disabled {
    cursor: default; 
}

/* Right-pointing blue triangle */
#nextBtn {
    border-width: 20px 0 20px 30px;   /* top, right, bottom, left */
    border-color: transparent transparent transparent var(--button-color);
}

#nextBtn:disabled {
    cursor: default; 
}

#prevBtn:hover {
    box-shadow: 1px 0px 0px 0px rgb(0 0 0 / 0.2);
}

#nextBtn:hover {
	box-shadow: -2px 0px 0px 0px rgb(0 0 0 / 0.2);
}

#prevBtn:active {
    border-color: transparent var(--button-active-color) transparent transparent;
}

#nextBtn:active {
    border-color: transparent transparent transparent var(--button-active-color);
}

/* Style the fullscreen button */
#fullscreen-btn {
    position: absolute;   /* absolutely positioned */
    top: 10px;            /* distance from top */
    right: 10px;          /* distance from right */
    padding: 8px 12px;
    font-size: 18px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    background-color: var(--button-color);
    color: #fff;
    transition: background-color 0.2s ease;
    z-index: 102;
}

#fullscreen-btn:hover {
    background-color: var(--button-active-color);
}

/* ************************** DICE BOX ***************************** */
.textPrompt {
    display: flex;
    padding: 0;
    align-items: start;
    justify-content: left;
    width: 12.5rem;
    height: 7.5rem;
    opacity: 0;
}

.textPrompt div {
    display: flex;
    flex-direction: column;
}

.centered {
    width: 15rem;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.fadeIn {
	opacity: 0; /* start invisible */
	animation: fadeInAnimation 0.5s ease-in forwards;
}

@keyframes fadeInAnimation {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.fadeOut {
	opacity: 1; /* start fully visible */
	animation: fadeOutAnimation 0.5s ease-out forwards;
}

@keyframes fadeOutAnimation {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
	}
}

.diceRollerUI {
    flex: 1;
    height: 100%;
    width: 100%;
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.diceRoller {
    position: relative;
    height: 100%;
    width: 100%;
    z-index:-1;
    overflow: hidden;
}

#canvas {
    width: 100%;
    height: 100%;
}

#swipe_div {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 100;
}

/* phone in horizontal orientation */
@media screen and (max-height: 400px) {
    main {
        position: relative;
        width: 100%;
        height: calc(100% - 50px);
    }
    header, .textPrompt {
        position: absolute;
        left: 0;
        top: 0;
        width: 50%;
    }
    header {
        margin-top: 1rem;
        align-items: start;    
        height: 50%;    
    }
    h1 {        
        font-size: clamp(2pt, 10vh, 24pt);
    }
    .textPrompt {
        align-items: end;
        padding: 0 1rem 1rem 1rem;
        height: 100%;
    }
    .textPrompt * {        
        font-size: clamp(2pt, 8vh, 14pt);
    }
    .centerDiv, .diceRollerUI {
        position: absolute;
        top: 0;
        left: 50vw;
        width: 50vw;
        height: 100dvh;
    }    
    .button {        
        font-size: clamp(16pt, 8vh, 24pt);
    }
    #prevBtn {
        border-width: clamp(14px, 5vh, 20px) clamp(16px, 10vh, 30px) clamp(14px, 5vh, 20px) 0;   /* top, right, bottom, left */
    }
    #nextBtn {
        border-width: clamp(14px, 5vh, 20px) 0 clamp(14px, 5vh, 20px) clamp(16px, 10vh, 30px);   /* top, right, bottom, left */
    }
    .logo {
        max-width: min(60vw, 55vh);
        height: auto;
    }
    footer {
        width: 50%;
        height: 20dvh;
    }
}