html, body {
    margin: 0%;
    padding: 0%;
    height: 100%;
    overflow: hidden;
    user-select: none;
    width: 100%;
    font-family: Inter,X-LocaleSpecific,sans-serif;
    font-weight: 300;
}

.chapter-block figure img {
    object-fit: contain;
    width: auto;
    height: 10em;
}

@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    .chapter-block figure img {
        height: 5em;
    }
}

@media (min-width: 480px) {
    html {
        font-size: 16px;
    }

    .chapter-block figure img {
        height: 5em;
    }
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }

    .chapter-block figure img {
        height: 6em;
    }
}

@media (min-width: 992px) {
    html {
        font-size: 17px;
    }

    .chapter-block figure img {
        height: 7em;
    }
}

@media (min-width: 1200px) {
    html {
        font-size: 18px;
    }

    .chapter-block figure img {
        height: 8em;
    }
}


#background {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -5;
}

@media (min-aspect-ratio: 3/4) {   
    #trigger-warning-box {
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        max-width: 32em;
    }
    
    #dialogue-box.single {
        right: auto;
        width: 35em;
        left: 10% !important;
    }

    #reference-flow {
        max-width: 32em;
    }

    #reflection-box {
        font-size: 1.2rem !important;
        top: 15%;
        max-width: 25em;
        max-height: 70%;
    }

    #reflection-box.story1 {
        left: 0;
        right: 55%;
    }

    #reflection-box.editor-letter {
        left: 45%;
        right: 0;
    }

    .word-panel {
        font-size: 2rem !important;
    }
}

.bg {
    position: fixed;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    opacity: 1;
    z-index: -1;
    /*mix-blend-mode: exclusion;*/
    transition: opacity 1s linear;
}

.fade.out {
    opacity: 0;
}

#logo-container {
    position: absolute;
    display: block;
    width: 16em;
    height: 16em;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

#logo {
    display: block;
    max-height: 16em;
    /*animation: glitch 3s linear infinite;*/
    width: 100%;
    opacity: 1;
    transition: opacity 300ms linear;
    filter: invert(20%);

    user-drag: none;
    -webkit-user-drag: none;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

@keyframes glitch{
  3%,63%{
    transform: translate(3px,0) skew(0deg);
  }
  4%,61%{
    transform: translate(-3px,0) skew(0deg);
  }
  62%{
    transform: translate(0,3px) skew(5deg); 
  }
}

.chapter-block {
    margin-left: auto;
    margin-right: auto;
    margin-top: 2em;
    display: flex;
    justify-content: center;
    flex-direction: row;
    overflow-x: hidden;
    overflow-y: hidden;
}

.chapter-block figure {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-left: 1em;
    margin-right: 1em;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0.5em;
    text-align: center;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.35);
    /*border: solid 0.15em #333333;*/
    border-radius: 0.3em;
    font-size: 1rem;
    width: auto !important;
}

.chapter-block figure.selected {
    background-color: rgb(255, 228, 109);
    border: solid 0.2em #333333;
}

.chapter-block h4 {
    margin-top: 0.25em;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    font-weight: 500;
}

.button-block {
    position: absolute;
    left: 50%;
    bottom: 0%;
    transform: translate(-50%, -50%);
    min-width: 25vh;
    margin-top: 2em;
    display: flex;
    flex-direction: column;
}

.button-block.hidden {
    display: none;
}

.button-block > button {
    cursor: pointer;
    height: 3em;
    margin-bottom: 1em;
    background-color: rgba(255, 255, 255, 0.35);
    border: solid 0.15em #333333;
    border-radius: 0.3em;
    font-size: 1rem;
}

.button-block > button:hover {
    background-color: rgba(var(--selected-color), 0.5);
}

#assembly-list {
    display: none;
}

#reflection-box {
    font-size: 120%;
    height: 100%;
    font-style: italic;
    position: absolute;
    margin: 0 auto;
    background-color: rgba(var(--base-color), 0.5);
    border-radius: 0.5rem;
    padding: 0.1em 1em;
    overflow: auto;
}

.reflection {
    display: none;
}

.reflection.visible {
    display: inline-block;
}

.goto-next {
	text-align: center;
}

.goto-next svg {
    cursor: pointer;
	transition: transform 200ms ease-out;
}

.goto-next.turning svg:hover {
    animation: jumping 1s linear infinite;
    transform: rotate(90deg);
}

@keyframes jumping {
	33% {
		transform: rotate(90deg) translateX(-0.5em);
	}

	66% {
		transform: rotate(90deg) translateX(0.5em);
	}
}


.bubble img {
    width: 100%;
}

#dialogue > * {
    display: none;
}

#dialogue-box {
    left: 0.5rem;
    right: 0.5rem;
    margin: 0 auto;
    z-index: 0;
    position: absolute;
    max-width: 28em;
    background-color: rgba(170,208,228, 0.5);
    top: 0.5rem;
    bottom: 0.5rem;
    border: 0.5rem solid transparent;
    border-radius: 0.5rem;
}

#dialogue-box.single {
    max-width: 28em;
    background: none;
    top: 0;
    bottom: 0;
}

#dialogue-box.single > #bubble-box {
    overflow-y: hidden;
}

@import url('https://fonts.googleapis.com/css2?family=Exo:wght@700&display=swap');

#dialogue-box.single .bubble {
    font-family: 'Exo', sans-serif;
    font-weight: 500;
    font-size: 1.25em;
    border-radius: 0.7em;
    margin-top: 0.3em;
    color: #AD3255;
}

#dialogue-box.single #highlight-box {
    display: none;
}

#highlight-box {
    display: inline-block;
    text-align: center;
    position: absolute;
    font-weight: 300;
    font-size: 100%;
    bottom: 0;
    height: 3.2em;
    width: calc(min(100%, 28em));
    border-radius: 3.2em;
    background-color: rgba(var(--base-color), 0.65);
    border-top: solid 3px rgba(var(--base-color), 0);
    border-bottom: solid 3px rgba(var(--base-color), 0);
    transition: all 100ms linear;
    left: 50%;
    margin-left: -50%;
}

#highlight-box p {
    display: inline-block;
    vertical-align: middle;
    line-height: 1em;
    margin-left: 0.5em;
    margin-right: 0.5em;
}

#highlight-box .option, #highlight-box .bookmark, #highlight-box .concept {
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    flex-basis: 50%;
    justify-content: center; /* align horizontal */
    align-items: center;
    height: 3.2em;
    transform: translateY(-3px);
    border: solid 3px rgba(var(--base-color), 0);
}

#highlight-box .option.selected {
    border-color: rgba(var(--selected-color), 0.7);
    animation: none !important;
    background-color: rgba(var(--selected-color), 0.1);
}

#highlight-box :not(.options) .option,  #highlight-box .bookmark, #highlight-box .concept {
    border-radius: 3.2em;
    width: calc(100% - 6px);
}

@keyframes lure {
    20% {border-color: rgba(var(--base-color), 0)}
    35% {border-color: rgba(var(--selected-color), 0.45)}
    50% {border-color: rgba(var(--base-color), 0)}
}

#highlight-box > :not(.options) .option {
    animation: lure 3.5s infinite;
}

#highlight-box .options {
    display: flex;
}

#highlight-box .options > .option {
    width: calc(50% - 4px);
}

#highlight-box .option.left {
    border-radius: 3.2em 0 0 3.2em;
    border-right: solid 1px rgba(var(--base-color), 0.7);
    /*box-shadow: inset -5px 0 6px -9px black;*/
}

#highlight-box .option.right {
    border-radius: 0 3.2em 3.2em 0;
    border-left: solid 1px rgba(var(--base-color), 0.7);
    /*box-shadow: inset 5px 0 6px -9px black;*/
}


#highlight-box .option.middle {
    border-radius: 0;
    border-left: solid 1px rgba(var(--base-color), 0.7);
    border-right: solid 1px rgba(var(--base-color), 0.7);
    /*box-shadow: inset 5px 0 6px -9px black;*/
}

#highlight-box .bookmark p::before {
    content: "🔎";
    margin-right: 1rem;
}

#highlight-box .bookmark {
    background-color: rgba(var(--bookmark-color), 0.65);
}

#highlight-box .bookmark:hover {
    animation: none;
    border-color: rgba(var(--acquire-color), 0.5);
}

#highlight-box .bookmark p {
    font-size: 1.2rem;
    font-family: 'Courier New', Courier, monospace;
}

#highlight-box .concept p::before {
    content: "✏️";
    margin-right: 1rem;
}

#highlight-box .concept {
    background-color: rgba(var(--concept-color), 0.65);
}

#highlight-box .concept:hover {
    animation: none;
    border-color: rgba(var(--acquire-color), 0.5);
}

#highlight-box .concept p {
    font-size: 1.2rem;
    font-family: 'Courier New', Courier, monospace;
}

#bubble-box {
    width: 100%;
    position: absolute;
    bottom: 4em;
    display: inline-flex;
    align-items: flex-end;
    align-content: flex-end;
    flex-direction: column-reverse;

    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    height: 80vh;

    padding-right: 0.3rem;

    scrollbar-color: #475c63 transparent;
    scrollbar-width: thin;
}

#bubble-box::-webkit-scrollbar {
    width: 5px;
}

#bubble-box::-webkit-scrollbar-thumb {
    /*background-image: linear-gradient(180deg, #c8315d 0%, #7090e9 99%);*/
    background-color: #475c63;
    /*box-shadow: inset 0 0 0px 1px #f2f2f2;*/
    border-radius: 8px;
}

.line {
    display: none;
    width: 100%;
    transition: all 500ms linear, opacity 100ms linear;
}

.line .wave {
    display: none;
}

.line.texthide p {
    display: none;
}

.line.typing .wave {
    display: block;
}

.line.appeared {
    display: inline;
    margin-top: 0.2em;
    opacity: 0;
}

.line.positioned {
    margin-top: 0.2em;
}

.line.shown {
    opacity: 1;
}

.line.left {
    text-align: left;
}

.line.right {
    text-align: right;
}

linemeta {
    display: none;
}

:root {
    --left-bubble-color: white;
    --right-bubble-color: white;
    --left-text-color: black;
    --right-text-color: black;

    --base-color: 255, 255, 255;
    --text-color: 0, 0, 0;
    --selected-color: 203, 252, 69;

    /* concept and bookmark colors */
    --concept-color: 150, 248, 218; 
    --bookmark-color: 255, 228, 109;
    --alpha: 0.9;

    /* border on hover etc */
    --acquire-color: 255, 11, 243;

    --click-block: rgba(223, 68, 240, 0.5);
    --border-hover-bkmrk: rgba(255, 11, 243, 0.363);
    --bookmark-chat: rgba(255, 228, 109, 0.65);
}

@media (prefers-color-scheme: dark) {
    /* will be later */
}

.bubble {
    color: black;
    display: inline-block;
    padding: 0.75em 0.75em;
    max-width: 16em;
    text-align: left;
    overflow: hidden;
    transition: all 150ms linear;
    background-color: white;
}

.widebubble .bubble {
    font-size: 1.1rem !important;
    max-width: 24em !important;
}

.bubble p {
    /* user-select: all; */
    overflow-wrap: break-word;
    margin-top: 0;
    margin-bottom: 0;
}

.bubble figure {
    overflow-wrap: break-word;
    margin: 0;
}

.bubble figcaption {
    font-size: 0.75em;
}

.bubble a {
    color: rgb(0, 145, 145);
}

.left .bubble {
    border-radius: 0.7em 0.7em 0.7em 0;
    background-color: var(--left-bubble-color);
    color: var(--left-text-color);
}

.right .bubble {
    border-radius: 0.7em 0.7em 0 0.7em;
    background-color: var(--right-bubble-color);
    color: var(--right-text-color);
}

#highlight-box .bubble {
    background: none;
}

components {
    display: none;
}

components * {
    display: none;
}

.wave {
	position: relative;
    width: 3em;
	margin-left: 0.15em;
    margin-right: 0;
}

.wave .dot {
		display:inline-block;
		width:0.3em;
		height:0.3em;
		border-radius:50%;
		margin-right: 0.3em;
		background:#303131;
		animation: wave 1.3s linear infinite;
}

.left .wave .dot {
    background: var(--left-text-color);
}

.right .wave .dot {
    background: var(--right-text-color);
}

.wave .dot:nth-child(2) { animation-delay: -1.1s;}
.wave .dot:nth-child(3) { animation-delay: -0.9s;}

@keyframes wave {
	0%, 60%, 100% {
		width: 0.35em;
        height: 0.35em;
        margin-right: 0.3em;
        opacity: 1;
	}

    75% {
        opacity: 0;
    }

    85% {
        opacity: 0;
    }

	30% {
        width: 0.55em;
        height: 0.55em;
        margin-right: 0.1em;
        opacity: 1;
	}
}

canvas.scene {
    position:absolute;
    top:0;
    left:0;
    z-index:-5;
    transition: filter 300ms linear, transform 900ms linear;
}

canvas.scene.blured {
    transform: scale(1.1);
    filter: blur(25px);
}

#trigger-warning-box {
    left: 1em;
    right: 1em;
    top: 50%;
    transform: translateY(-50%);
    position: absolute;
    background-color: rgba(var(--base-color), 0.35);
    padding: 0 1em;
    border-radius: 0.3em;
}

#trigger-warning-box.color-invert {
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
}

#trigger-warning-box .button {
    margin: 0.5em 0;
    font-weight: 500;
    border: 0.15em solid black;
    padding: 0.25em;
}

#trigger-warning-box.hidden {
    display: none;
}

.next.hidden {
    opacity: 0;
    visibility: hidden;
}

.next {
    margin-top: 1em;
    opacity: 1;
    transition: opacity 150ms ease-in-out;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.button-next {
    cursor: pointer;
    margin: 0.1em 0;
    font-weight: 500;
    padding: 0.25em;
    line-height: 0;
    display: inline-block;
    transition: all 150ms ease-in-out;
    height: 2rem;
    background-color: black;
    border-radius: 0.15rem;
    border: 0.15em double black;
    color: white;
    animation: pointout 3.5s ease-in-out infinite;
}

.button-next.idle {
    animation: none;
}

.button-next:hover {
    animation: none !important;
}

.color-invert .button-next {
    background-color: rgba(0, 0, 0, 0.5);
    border: none !important;
    border-radius: 0.3rem;
}

.button-next.white {
    border: 0.15em double white;
}

@keyframes pointout {
    0%,90% {
        transform: translateX(0);
    }

	95% {
		transform: translateX(-0.5rem);
	}

	97% {
		transform: translateX(0.5rem);
	}
}

.button-next p {
    font-size: 2rem;
    transform: translateY(-1rem);
    line-height: 0;
}

#highlight-box .button-next {
    height: 2rem;
    background-color: transparent;
    color: black;
}

#highlight-box .button-next p {
    font-size: 2rem;
    transform: translateY(-1.9rem);
}


#trigger-warning-box .button #checkbox {
    cursor: pointer;
    display: block;
    width: 1em;
    height: 1em;
    border: 0.15em solid black;
    float: left;
    margin-top: 0.3em;
    margin-left: 0.5em;
    margin-right: 0.75em;
    transition: background 150ms ease-in-out;
}

#trigger-warning-box .button #checkbox:hover {
    background-color: black;
}

#trigger-warning-box .button #checkbox.checked {
    background-color: black;
}

canvas.minigame {
    margin: 0;
}

#reference-flow {
    margin-top: 1em;
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
    height: calc(100vh - 2em);
    position: absolute;
    margin-left: auto;
    margin-right: auto;
    left: 1em;
    right: 1em;
    text-align: center;

    padding-right: 0.25em;

    -webkit-overflow-scrolling: touch;

    scrollbar-color: #555e70 transparent;
    scrollbar-width: thin;
}

#reference-flow::-webkit-scrollbar {
    width: 6px;
}

#reference-flow::-webkit-scrollbar-thumb {
    /*background-image: linear-gradient(180deg, #c8315d 0%, #7090e9 99%);*/
    background-color: #555e70;
    /*box-shadow: inset 0 0 0px 1px #f2f2f2;*/
    border-radius: 8px;
}

bookmark-reference {
    margin-top: 1em;
    border-radius: 1.2em;
    transition: box-shadow 300ms linear;
}

bookmark-reference.hidden {
    display: none;
}

bookmark-reference.willing {
    animation: pointout 3.5s ease-in-out infinite;
}


bookmark-reference span {
    display: inline;
}
  
bookmark-reference.click-block {
    box-shadow: inset 0px 0px 10px 2px rgba(var(--acquire-color), 0.5);;
}

#next {
    margin-top: 1em;
}

#to-next {
    margin-top: 1em;
    text-align: center;
}

/* soup game */

.word-panel {
    position: fixed;
    display: inline-block;
    z-index: 10;
    top: 2em;
    transform: translateX(calc(50vw - 50%));
    padding-left: 1em;
    padding-right: 1em;
    height: 2.5rem;
    background-color: rgba(var(--base-color), 0.5);
    border-radius: 4rem;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    pointer-events: none;
}

@keyframes win_glow {
    from {background-color: rgba(var(--base-color), 0.5);}
    to {background-color: rgba(200, 255, 200, 0.5);}
}

.word-panel.win {
    animation: win_glow 1s infinite;
    animation-direction: alternate;
}

.emoji-sparkle {
    pointer-events: none;
    position: absolute;
    z-index: 10;
    left: 0;
    top: 0;
}

.bubble img.type-emoji {
    width: 4em;
    float: left;
    margin-right: 1em;
}

.obfuscation {
    width: 100%;
    height: 100%;
    z-index: -1;
    position: absolute;
    pointer-events: none;
    left: 0;
    top: 0;
    background-color: black;
    opacity: 0;
    animation: obfuscate 3s linear infinite;
}

@keyframes obfuscate {
    0%,50%,100% {opacity: 0;}
    20%,30% {opacity: 0.5;}
}

.blur {
    width: 100%;
    height: 100%;
    z-index: -1;
    position: absolute;
    pointer-events: none;
    left: 0;
    top: 0;
    backdrop-filter: blur(10px);
}

.bookmark-reference {
    font-size: 1.2rem;
    font-family: 'Courier New', Courier, monospace;
    color: var(--text-color);
    display: inline-block;
    text-align: left;
    background-color: rgba(var(--bookmark-color), 0.8);
    padding: 0.6em;
    border-radius: 1.2em;
}

.bookmark-reference.concept {
    background-color: rgba(var(--concept-color), 0.9);
}

.bookmark-reference span {
  display: inline;
}

.bookmark-reference .description-container {
  display: none;
}

.bookmark-reference:not(.open) {
  cursor: pointer;
}

.bookmark-reference.open > .description-container {
  display: inline;
}

.bookmark-reference .term-container {
  display: table;
  background-color: white;
  padding-left: 0.5em;
  padding-right: 0.5em;
}

.bookmark-reference.open .term-container {
  margin-bottom: 0.5em;
}

.bookmark-reference .term-container::before {
  content: " ";
}