:root {
    --popup-bg: #f9f9f9;
    --popup-border: #7aac7b;
    --popup-text: #121212;

    --reset-bg: #46513e;
    --reset-border: #7aac7b;
    --reset-text: #f1f6ea;

    --final-bg: none;
    --final-border: none;
    --final-text: #121212;
    --final-accent: #569157;

    --shadow-reset: 2px 2px 5px rgba(0, 0, 0, 0.8);
    --shadow-final: none;
}

.game-wrapper {
    width: 1920px;
    height: 1080px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.hide {
    display: none;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
}

#game-bg {
    z-index: -1;
}

.changa-300 {
    font-family: 'Changa', sans-serif;
    font-weight: 300;
}

.changa-600 {
    font-family: 'Changa', sans-serif;
    font-weight: 600;
}
.changa-800 {
    font-family: 'Changa', sans-serif;
    font-weight: 800;
}

#game-hint {
    z-index: 0;
    pointer-events: none;
}

#game-area {
    z-index: 2;
}

.dragbox,
.dropbox {
    position: absolute;
}

#game-hint img {
    width: 100%;
    height: auto;
    display: block;
}

.dragbox img,
#game-bg img,
#game-end img {
    width: 100%;
    height: auto;
    display: block;
}

/* Draggable items in left panel  */
#drag-anterior-mandible,
#drop-anterior-mandible {
    width: 600.8px;
    height: 174.87px;
}

#drag-braincase,
#drop-braincase {
    width: 238.12px;
    height: 107.63px;
    z-index: 6;
}

#drag-circumorbital,
#drop-circumorbital {
    width: 493.57px;
    height: 151.93px;
    z-index: 5;
}
#drag-posterior-mandible,
#drop-posterior-mandible {
    width: 415.49px;
    height: 222.09px;
    z-index: 10;
}

#drag-pterygoid,
#drop-pterygoid {
    width: 400.36px;
    height: 55.34px;
    z-index: 7;
}

#drag-suspensorium,
#drop-suspensorium {
    width: 277.09px;
    height: 197.39px;
    z-index: 8;
}

#drag-anterior-mandible {
    left: 4.84%;
    top: 75.1%;
    z-index: 9;
}

#drag-braincase {
    left: 6.93%;
    top: 64.2%;
}

#drag-circumorbital {
    left: 4.69%;
    top: 8.52%;
}

#drag-posterior-mandible {
    left: 4.17%;
    top: 36.2%;
}

#drag-pterygoid {
    left: 14.1%;
    top: 26.85%;
}

#drag-suspensorium {
    left: 20.47%;
    top: 52.5%;
}

/* Drop zones on skeleton - matching the outline positions */
#drop-anterior-mandible {
    left: 45.9%;
    top: 54.8%;
}
#drop-braincase {
    left: 77.3%;
    top: 34.4%;
}
#drop-circumorbital {
    left: 59.7%;
    top: 30.4%;
}
#drop-posterior-mandible {
    left: 73.5%;
    top: 44.9%;
}
#drop-pterygoid {
    left: 67.8%;
    top: 43.1%;
}
#drop-suspensorium {
    left: 76.3%;
    top: 29%;
}

/* apply a red hue to indicate wrong placement */
.drop-wrong {
    filter: sepia(1) hue-rotate(0deg) saturate(30) brightness(0.8);
}

.popup {
    position: absolute;
    background: var(--popup-bg);
    color: #569157;
    border: solid 10px var(--popup-border);
    padding: 5px 30px;
    width: auto;
    height: 60px;
    line-height: 60px;
    border-radius: 80px;
    text-align: center;
    font-size: 30px;
    font-weight: bold;
    z-index: 150;
}

/* Position popups near their drop zones */
#popup-anterior-mandible {
    left: 50%;
    top: 75%;
}

#popup-braincase {
    left: 70%;
    top: 15%;
}

#popup-circumorbital {
    left: 59.7%;
    top: 15%;
}

#popup-posterior-mandible {
    left: 73.5%;
    top: 70%;
}

#popup-pterygoid {
    left: 67.8%;
    top: 15%;
}

#popup-suspensorium {
    left: 76.3%;
    top: 15%;
}

#game-reset {
    position: absolute;
    bottom: 5%;
    right: 5%;
    color: var(--reset-text);
    font-size: 32px;
    border: solid 5px var(--reset-border);
    background: var(--reset-bg);
    line-height: 1;
    width: auto;
    height: auto;
    text-align: center;
    border-radius: 15px;
    z-index: 200;
    box-shadow: var(--shadow-reset);
    padding: 12px 24px;
}

#game-reset:hover {
    cursor: pointer;
    /* lighten button */
    filter: brightness(1.1);
}

#game-tutorial {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#game-tutorial img {
    width: 100%;
    height: auto;
    display: block;
}

#tutorial-tooltip.popup {
    color: #121212;
    height: auto;
    font-size: 50px;
    min-height: 80px;
    line-height: 1.25;
    max-width: 800px;
    padding: 12px 36px;
    left: 50%;
    top: 60%;
}

/* toggle stuff - based on w3 schools toggle */
#hint-toggle {
    position: absolute;
    right: 4%;
    bottom: 4%;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 250;
}

#hint-toggle .hint-label {
    font-size: 30px;
    color: #46513e;
}

#hint-toggle.hide {
    display: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 78px;
    height: 44px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #b0b6ad;
    transition: 0.4s;
}

.slider:before {
    position: absolute;
    content: '';
    height: 34px;
    width: 34px;
    left: 5px;
    bottom: 5px;
    background-color: #fff;
    transition: 0.4s;
}

.switch input:checked + .slider {
    background-color: #46513e;
}

.switch input:focus + .slider {
    box-shadow: 0 0 1px #46513e;
}

.switch input:checked + .slider:before {
    transform: translateX(34px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

#game-end #game-final {
    /* transform: translate(-50%, -50%); */
    width: 100%;
    max-width: 507px;
    z-index: 200;
    border: none;
    background: transparent;
    box-shadow: none;
    text-align: center;
}

.game-final-stack {
    position: absolute;
    top: 144px;
    max-width: 507px;
    left: 134px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 89px;
    width: 100%;
}

.game-final-intro,
.game-final-reveal,
.game-final-scroll {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.game-final-title {
    color: var(--final-accent);
    font-size: 87px;
    line-height: 1;
    margin: 0 0 19px;
}

.game-final-subtitle {
    color: var(--final-text);
    font-size: 40px;
    line-height: 49px;
    margin: 0;
}

.game-final-reveal-line {
    color: var(--final-accent);
    font-size: 60px;
    line-height: 74px;
    margin: 0;
}

.game-final-reveal-line strong {
    color: var(--final-text);
    font-weight: inherit;
}

.game-final-scroll {
    gap: 19px;
}

.game-final-scroll-text {
    color: var(--final-text);
    font-size: 40px;
    line-height: 49px;
    margin: 0;
}

#game-final .game-final-arrow {
    width: 100px;
    height: 100px;
    max-width: 100px;
    flex-shrink: 0;
}
