/* ######################################## Variables ########################################*/


:root {
    /* Colors */
    --main-bg-color: rgb(229, 226, 226);
    --color1: #115740;
    --color2: #B9975B;

    /* Text Formatting */
    --font-family: "Century Gothic", sans-serif;
    --txt-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);

    /* Text Sizes, Line Height, Margin */
    --hello-font-size: 7vmax;
    --sub-hello-font-size: 2vmax;
    --about-me-font-size: 2vmax;
    --about-me-line-height: 7vh;
    --about-me-margin-top: 5vh;

    /* Translations */
    --center-x: translateX(-50%);
    --center-y: translateY(-50%);
    --center-both: translate(-50%, -50%);
}


/* ######################################## General ########################################*/


.layout {
    display: flex;
    min-height: 100svh;
}

/* Stage + canvas fill */
.stage {
    position: fixed;
    top: 10.5vh;                        /* directly under the 10vh topbar */
    left: calc(10vw + 10px);          /* aligned with the sidebar + border */
    width: calc(90vw - 10px);         /* same as topbar width */
    height: 80vh;                     /* between topbar (10vh) & bottombar (90vh) */
    display: flex;
    background: #edeaea;
}

#simCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Sim toggle buttons in topbar */
.sim-toggle-group {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: center;
    padding: 0.5rem 2rem;
}

.sim-toggle {
    font-family: "Century Gothic", sans-serif;
    font-size: 0.95rem;
    font-weight: bold;
    border-radius: 999px;
    padding: 0.35rem 1.6rem;
    border: 2px solid #115740;
    background: #f4f2f2;
    color: #115740;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sim-toggle:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sim-toggle.active {
    background: #B9975B;
    border-color: #B9975B;
    color: #ffffff;
}


.topbar {
    position: fixed;
    top: 0;
    left: calc(10vw + 10px);
    width: calc(90vw - 10px);
    height: 10vh;
    background-color: var(--main-bg-color);
    display: block;
    align-items: center;
    justify-content: center;
    box-shadow: var(--txt-shadow);
    border-bottom: var(--color1) solid 5px;
}

.sim-buttons {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: var(--font-family);
}

.sim-btn {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 2px solid var(--color1);
  background: white;
  color: var(--color1);
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sim-btn:hover {
  background: var(--color1);
  color: white;
}

.sim-btn.active {
  background: var(--color2);
  border-color: var(--color2);
  color: white;
}

.bottombar {
    position: fixed;
    top: 90vh;
    left: calc(10vw + 10px);
    width: calc(90vw - 10px);
    height: 10vh;
    background-color: var(--main-bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--txt-shadow);
    border-top: var(--color1) solid 5px;
    padding: 0 1.5rem;
    text-align: center;
    font-family: var(--font-family);
    font-size: 1.6rem;
}

.bottom-instructions {
    margin: 0;
    width: 100%;
    text-align: center;
}

.kbd {
    padding: 0.1em 0.35em;
    border-radius: 4px;
    border: 1px solid #999;
    background-color: #eee;
    font-size: 0.9em;
}

/* ######################################## Desktop ########################################*/


/* Initially hide desktop-specific elements */


/* ######################################## Mobile ########################################*/


/* Initially hide mobile-specific elements */


/* ######################################## Utility ########################################*/


@media (max-height: 768px) {
    /* Mobile Landscape */

    .topbar, .bottombar {
        height: 20vh;
    }
    .bottombar {
        top: 80vh;
    }

    .stage {
        top: calc(20vh + 5px);
        height: calc(60svh - 5px);
    }

}


@media (max-width: 768px) {
    /* Mobile Portrait */

    .layout { display: flex; flex-direction: column; min-height: 100svh; }

    .stage {
        position: fixed;
        top: 12vh;           /* just below mobile topbar */
        left: 0;
        width: 100vw;
        height: 58vh;        /* leaves room before bottombar at ~70vh */
        display: flex;
        background: #edeaea;
    }

    #simCanvas {
        width: 100%;
        height: 100%;
    }

    body {
        padding-bottom: calc(20svh + env(safe-area-inset-bottom, 0px));
    }

    .topbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 12vh;
        padding-top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
        box-sizing: border-box;
    }

    .bottombar {
        position: fixed;
        top: 70vh;
        left: 0;
        right: 0;
        width: 100%;

        display: flex;
        align-items: center;
        justify-content: center;

        padding: 0.5rem 0.75rem;
        box-sizing: border-box;

        font-family: var(--font-family);
        font-size: 1.2rem;
        text-align: center;
        overflow-x: hidden;
    }

    .bottom-instructions {
        margin: 0;
        max-width: 100%;
        text-align: center;
    }
    
}