:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --canvas-bg: transparent;
    --canvas-stroke: #ffffff;
}

@font-face {
    font-family: 'Evogria';
    src: url('./Evogria.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Evogria';
    src: url('./Evogria Italic.otf') format('opentype');
    font-weight: normal;
    font-style: italic;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body,
html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Evogria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    touch-action: none;
    /* Prevent browser gestures */
}

.hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* --- Orientation Warning --- */
#orientation-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#orientation-warning .message {
    text-align: center;
    padding: 2rem;
}

#orientation-warning .rotate-icon {
    width: 75%;
    height: auto;
    margin-bottom: 2rem;
    animation: rotatePhone 2s infinite ease-in-out;
}

#orientation-warning p {
    font-size: 1.2rem;
    line-height: 1.5;
}

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

    50% {
        transform: rotate(-90deg);
    }

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

@media screen and (orientation: portrait) {

    #welcome-ui,
    #signing-ui,
    #thank-you-ui {
        display: none !important;
    }

    #orientation-warning {
        display: flex !important;
    }
}

@media screen and (orientation: landscape) {
    #orientation-warning {
        display: none !important;
    }
}

/* --- Shared Components --- */
.logo-homecoming {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 20vw;
    height: auto;
    z-index: 200;
}

.logo-sheepdog {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 15vw;
    height: auto;
    z-index: 200;
}

button {
    font-family: 'Evogria';
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

button:active {
    transform: scale(0.95);
}

.button-rounded {
    padding: 0.8rem 2.5rem;
    border-radius: 30px;
    background: var(--text-color);
    color: var(--bg-color);
}

.button-pill {
    padding: 0.6rem 2.5rem;
    border-radius: 30px;
}

/* --- Welcome UI --- */
#welcome-ui {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
    z-index: 100;
}

#welcome-ui .content {
    text-align: center;
}

#welcome-ui h1 {
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 2rem;
    letter-spacing: 1px;
}

/* --- Signing UI --- */
#signing-ui {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
    background-color: var(--canvas-bg);
    transition: opacity 0.5s ease;
    z-index: 90;
}

canvas {
    flex: 1;
    width: 100%;
    background: var(--canvas-bg);
    cursor: crosshair;
}

.controls {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background: var(--bg-color);
    /* Dark bar at bottom per mockup */
    border-top: 1px solid #222;
}

.secondary {
    background: transparent;
    color: #fff;
    border: 1px solid #555;
}

.primary {
    background: #b18445;
    /* Eyedropped from reference */
    color: #ffffff;
}

/* --- Thank You UI --- */
#thank-you-ui {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000000 !important;
    background-image: url('./background.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 500;
}

#thank-you-ui .message {
    text-align: center;
    animation: fadein 1s ease;
    max-width: 600px;
    padding: 2rem;
}

#thank-you-ui h1 {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

#thank-you-ui p {
    color: #ccc;
    font-size: 1.2rem;
    line-height: 1.6;
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Toast Validation --- */
#toast-container {
    position: fixed;
    top: 2rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 2000;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast {
    background: rgba(40, 40, 40, 0.95);
    color: white;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
}

#toast-container.hidden {
    transform: translateY(-20px);
}