
/* css clean up */

*{
    font-family: Arial, Helvetica, sans-serif;

	box-sizing: border-box;
	margin: 0;
	padding: 0;
    text-decoration: none;

    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;

    -webkit-user-drag: none;

    word-wrap: break-word;

    /*border: 1px solid red;*/

    overscroll-behavior-y: none;
}

html, body {
    touch-action: pan-x pan-y;
  }

:root {
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6, p {
    cursor: default;
    opacity: .9;
}

h2 {
    margin-bottom: .3rem;
}

.selectable, .selectable * {
    user-select: text;
    -webkit-user-select: text;
    -ms-user-select: text;

    cursor: text;
}

.inpextra {
    position: fixed;
    left: -500vw; right: -500vw;
    opacity: 0;
    pointer-events: none;
}

span {
    all: inherit;
    display: inline;
}

textarea{
    min-height: 68px;
    max-height: 300px;
    field-sizing: content;
    resize: vertical;
}

body {
    margin: 0;
    padding: 20px;
    background-color: #184E52;
    color: #EDE8DD;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    min-height: calc(100svh + env(safe-area-inset-top));
    background-image: url(/images/background.webp);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    padding: env(safe-area-inset-top) 20px 20px 20px;
  }

.no-phone {
    display: block;
}
.no-desk {
    display: none;
}

a {
    outline: none;
    cursor: pointer !important;
    color: #910100;
}
a:visited {
    outline: none;
    color: #916100;
}

/* components */

.hidden {
  display: none;
}
.container {
  backdrop-filter: blur(50px);
  max-width: 500px;
  width: 100%;
  /* padding: 1rem; */
  box-shadow: 0 0 12px -3px #000;
  border-radius: 3rem;
  border: 1px solid #c3c3cf4a;
  text-align: center;
}
#startScreen {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  justify-content: center;
  align-items: center;
}
input, button {
    font-size: 1rem;
    line-height: 1.1rem;
  padding: 10px;
  min-width: 1rem;
  width: 100%;
  max-width: 15rem;
  font-size: 16px;
  border: none;
  border-radius: .5rem;
}
input {
    border: 1px solid #ffffff57;
  background-color: #33333346;
  color: #EDE8DD;
  text-align: center;
}
input:focus {
    outline: none;
    background-color: #b1b1b168;
}
input:user-invalid {
    border: 1px solid #ff131357;
    color: #ff1313;
    background-color: #60191946;
}
input:user-valid, input.valid {
    border: 1px solid #13ff3a57;
    color: #13ff27;
    background-color: #19602e46;
}

button {
  background-color: #008080;
  background-color: #036b6b;
  border: 1px solid #c3c3cf4a;
  color: #EDE8DD;
  cursor: pointer;
  transition: scale .2s ease, filter .2s ease;
  
}
#session-toggle.end {
    background-color: #9c1e1e;
    background-color: #721616;
}

#revealBox {
    border: 2px solid #ffffff57;
    background-color: #33333346;
  padding: 21px 20px 20px 20px;
  min-height: 4.3rem;
  max-width: 300px;
  font-size: 20px;
  border-radius: 1rem;
  color: #e0e0e0;
  transition: background-color 0.3s, border 0.3s;
}
/* Visuelle Änderung, wenn "Aufdecken" geklickt wurde */
#revealBox.revealed {
  border: 2px dashed #009688;
  background-color: #263238;
}
#normalStartButton {
  background-color: #16841a;
}


#logo {
  left: 50%; top: -11rem;
  transform: translateX(-50%);
  position: absolute;
  width: 7.5rem; aspect-ratio: 1;
  background-image: url(/images/logo.svg);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 9px #ede8dd7d);
}

body #changeLanguage {
    background: none !important;
    position: fixed;
    color: #ffffff;
    font-size: 1rem;
    z-index: 100;
    display: flex;
    border: none;
    width: auto; 
    top: 2rem; right: 1.7rem;
}
body #changeLanguage span {
    top: 0; left: 0;
    margin: none;
    padding: none;
    opacity: .6;
    position: relative;
}

    
#pipe {
    margin-top: -.2rem;
}

#session-settings {
    position: relative;
    display: flex;
    padding: calc(1.5rem - 9px) 1.5rem;
    /* border-radius: 2rem;
    border: 1px solid #EDE8DD; */
    border: none;
    flex-wrap: wrap;
    gap: .85rem;
    margin-bottom: -1.3rem !important;
}
#session-settings .border {
    position: absolute;
    pointer-events: none;
    top: -.6rem; left: 0;
    border-radius: 2rem;
    width: 100%; height: calc(100% - .85rem);
}
#session-settings .border.top {
    border-top: 1px solid #EDE8DD;
    mask-image: linear-gradient(90deg, #000 calc(50% - 5.5rem), #00000000 calc(50% - 5.5rem), #00000000 calc(50% + 5.5rem), #000 calc(50% + 5.5rem));
    border-left: 1px solid #EDE8DD;
    border-right: 1px solid #EDE8DD;
}
body:has(#en.active) #session-settings .border.top {
    mask-image: linear-gradient(90deg, #000 calc(50% - 4.4rem), #00000000 calc(50% - 4.4rem), #00000000 calc(50% + 4.4rem), #000 calc(50% + 4.4rem));
}

#session-settings .border.bottom {
    border-bottom: 1px solid #EDE8DD;
    border-left: 1px solid #EDE8DD;
    border-right: 1px solid #EDE8DD;
    mask-image: linear-gradient(90deg, #000 calc(50% - 5.6rem), #00000000 calc(50% - 5.6rem), #00000000 calc(50% + 5.8rem), #000 calc(50% + 5.8rem));
}
body:has(#en.active) #session-settings .border.bottom {
    mask-image: linear-gradient(90deg, #000 calc(50% - 5.3rem), #00000000 calc(50% - 5.3rem), #00000000 calc(50% + 5.5rem), #000 calc(50% + 5.5rem));
}

#session-settings legend {
    margin: 0 auto;
    padding: 0 .5rem;
}

#session-settings button {
    flex: 1 1 0;
    width: none;
    min-width: 8rem;
    font-size: 1rem;
    height: 3rem;
    max-width: none;
    padding: 10px;
}
body #session-settings button:disabled {
    pointer-events: none;
    cursor: default;
    opacity: .6;
    background-color: #6a6a6a !important;
    scale: 1 !important;
    filter: none !important;
}

#startScreen p {
    display: flex;
    width: max-content;
    align-items: center;
    gap: .2rem;
  }
#indicator-dot {
    display: block;
    position: relative;
    width: .5rem; aspect-ratio: 1;
    border-radius: 1rem;
    margin-left: .3rem;
    background-color: white;
    transition: box-shadow .8s ease, background-color .8s ease;
}
#indicator-dot.on {
    box-shadow: 0 0 10px 2px #00e000;
    background-color: #00e000;
    animation-name: light-animation;
    animation-duration: 10s;
    animation-iteration-count: infinite;
}
#indicator-dot.on::after {
    position: absolute;
    content: "";
    display: block;
    top: .15rem; left: .15rem;
    width: .2rem; aspect-ratio: 1;
    background-color: white;
    filter: blur(2px);
}

@keyframes light-animation {
    0% {
        box-shadow: 0 0 5px -2px #00e000;
    }
    10%{
        box-shadow: 0 0 10px 2px #00e000;
    }
    12%{
        box-shadow: 0 0 13px 5px #00e000;
    }
    15%{
        box-shadow: 0 0 10px 1px #00e000;
    }
    30%{
        box-shadow: 0 0 4px 1px #00e000;
    }
    30%{
        box-shadow: 0 0 4px 1px #00e000;
    }
    55%{
        box-shadow: 0 0 11px 3px #00e000;
    }
    70%{
        box-shadow: 0 0 2px 0px #00e000;
    }
    90%{
        box-shadow: 0 0 8px 1px #00e000;
    }
    100%{
        box-shadow: 0 0 5px -2px #00e000;
    }
}

#readme-link {
    position: absolute;
    top: 1.3rem; right: 1.3rem;
    width: 1.7rem; aspect-ratio: 1;
    background-image: url(/images/info.svg);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;

    transition: scale .2s ease, filter .2s ease;
}

#session-indicator {
    width: 100%;
    display: flex;
    justify-content: center;
}

footer {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    color: #aac5c9;
    font-size: .7rem;
    text-align: center;
    padding: .7rem 1rem;
    gap: .5rem;
    /* background-color: #031113; */
}
footer a {
    color: #e5eced;
    transition: opacity .2s ease;
}
footer a:visited {
    color: #e5eced;
}
footer a:hover {
    opacity: .6;
}

body.web-app footer {
    padding: .7rem 1rem 1.3rem 1rem;
    bottom: calc(0% - env(safe-area-inset-top));
}
body.web-app .container {
    margin-bottom: 4rem;
}

body.web-app #changeLanguage {
    top: calc(2rem + env(safe-area-inset-top));
}

body.web-app #exit-selection {
    top: calc(2rem + env(safe-area-inset-top));
}

#alert-dialog, #dialogWebApp {
    all: unset;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    max-width: 30rem;
    width: 90%;
    backdrop-filter: blur(50px);
    background: none;
    box-shadow: 0 0 12px -3px #000;
    border-radius: 3rem;
    border: 1px solid #c3c3cf4a;
    text-align: center;
    overflow: hidden;
    flex-direction: column;
    z-index: 200;
    display: none;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .1s ease-out, visibility 0s linear .1s;
}
#alert-dialog[open]::backdrop {
    width: 100vw; height: 100dvh;
    background-color: #00000040;
    backdrop-filter: blur(10px);
}
#alert-dialog[open] {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition: opacity .2s ease-in;
}
#alert-dialog p, #dialogWebApp p {
    color: #EDE8DD;
    padding: 1rem 2rem;
}
#alert-dialog button, #gameScreen button, #dialogWebApp button {
    all: unset;
    padding: .7rem 1rem;
    border-top: 1px solid #c3c3cf4a;
    color: #EDE8DD;
    cursor: pointer;
    border-radius: 0 0 3rem 3rem;
    transition: background-color .2s ease, color .2s ease;
}

body.web-app #alert-dialog {
    top: calc(50% - 1rem);
}

#dialogWebApp {
    top: unset;
    height: auto;
    bottom: 4rem;
    transform: translateX(-50%);
}
#dialogWebApp.show {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


#topicDisplay {
    padding: 1rem 2rem 0 2rem;
}
#playerTurn {
    padding: .3rem 1rem 0 1rem;
}
#revealBox {
    margin: 25px 1rem 30px 1rem;
    width: calc(100% - 2rem);
}

#gameScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}
#gameScreen button, #dialogWebApp button {
    padding: .7rem 0;
    width: 100%;
}
#gameScreen button, #dialogWebApp button:last-child {
    border-radius: 0 0 3rem 3rem;
}




#topic-selection-wrapper {
    display: none;
    position: fixed;
    z-index: 100;
    top: 0; left: 0;
    width: 100vw; height: 100dvh;
    backdrop-filter: blur(80px);
    background-color: #00000026;
}
#topic-selection-wrapper.shown {
    display: block;
}
#topic-selection-scroll {
    max-height: 100%; width: 100%;
    max-width: 50rem;
    overflow: scroll;
    gap: 1rem;
    overscroll-behavior-y: contain;
    margin: 0 auto;
    padding: 9rem 2rem;
    display: flex;
    flex-wrap: wrap;
    mask-image: linear-gradient(#00000000 0%, #000 5rem, #000 calc(100% - 5rem), #00000000 100%);
}
.topic {
    min-width: 6rem; height: auto;
    flex-grow: 1;
    box-shadow: 0 0 12px -3px #000;
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    gap: .5rem;
    flex-direction: column;
    align-items: center;
    border: 1px solid #c3c3cf4a;
    cursor: pointer;
    transition: box-shadow .1s ease-out, left .1s ease-out, background-color .1s ease-out, scale .1s ease-out,  color .1s ease-out, filter .1s ease-out;
}
.topic:hover {
    box-shadow: 0 0 16px -1px #000;
    filter: brightness(.6);
}
.topic:has(input[type=checkbox]:checked) {
    background-color: #17953463;
}
.topic:has(input[type=checkbox]:checked) .topic-title {
    color: #6eff90;
}

.topic-title {
    pointer-events: none;
    font-weight: 100;
    text-align: center;
    font-size: 1rem;
}
.topic input[type=checkbox] {
    width: 3rem;
    all: unset;
    display: block;
    position: relative;
    background-color: #ffffff77;
    width: 3rem; height: 1.5rem;
    border-radius: .75rem;
    box-shadow: 0 0 3px 0 #1f1f1f;
    cursor: pointer;
    transition: left .1s ease-out, background-color .1s ease-out, scale .1s ease-out,  color .1s ease-out;
}


.topic input[type=checkbox]::after {
    top: .2rem; left: calc(0% + .2rem);
    position: absolute;
    display: block;
    content: "";
    box-shadow: 0 0 3px 0 #1f1f1f;
    background-color: #536366;
    height: 1.1rem; aspect-ratio: 1;
    border-radius: .75rem;
    pointer-events: none;
    transition: left .1s ease-out, background-color .1s ease-out, scale .1s ease-out,  color .1s ease-out;
}
  
.topic input[type=checkbox]:checked {
    background-color: #daffcac4;
    box-shadow: 0 0 3px 0 #134217;
  }
.topic:hover .topic-checkbox::after {
    scale: 1.2;
  }
  .topic input[type=checkbox]:active::after {
    scale: .8 !important;
  }

  .topic input[type=checkbox]:checked::after {
    left: calc(100% - 1.1rem - .2rem);
    background-color: #179534;
  }

#select-all-topics, #exit-selection {
    all: unset;
    background-color: #122a2e;
    position: fixed;
    bottom: 38px; left: 50%;
    z-index: 10;
    padding: 1rem 1.5rem;
    box-shadow: 0 0 10px -2px #000;
    border-radius: 1rem;
    cursor: pointer;

    transform: translateX(-50%);
    border: 1px solid #c3c3cf4a;
    transition: box-shadow .2s ease, filter .2s ease;
}
#exit-selection {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transform: none;
    top: 2rem; right: 2rem;
    bottom: unset; left: unset;
    width: 2.5rem; height: 2.5rem;
    padding: 2px 0 0 0 2px;
}
#select-all-topics:hover, #exit-selection:hover {
    box-shadow: 0 0 5px -5px #000;
    filter: brightness(.8);
}

#start-buttons {
    width: 100%;
    /* max-width: 26.1rem; */
    display: flex;
    flex-wrap: wrap;
    flex-wrap: wrap-reverse;
    gap: 1rem;
    padding: 0 1.5rem;
}
#start-buttons button {
    flex: 1 0 0;
    height: 3rem;
    min-width: 10rem;
    max-width: 100%;
}

/* overwrites */


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


@media screen and (max-height: 800px) {
    #logo {
        top: -9.5rem;
    }
  }
@media screen and (max-height: 740px) {
    #logo {
        display: none;
    }
  }


@media screen and (min-width: 650px) {
    #readme-link:hover {
        scale: 1.1;
        filter: brightness(.6);
    }
    body button:hover {
        scale: 1.05;
        filter: brightness(.6);
      }
      #gameScreen button:hover {
        scale: 1;
        filter: none;
        background-color: #00000034;
        color: #ede8dd97;
    }
  }
  

@media screen and (max-width: 400px) {
    #logo {
        display: none;
    } 
}

body #changeLanguage:hover {
    filter: none;
}
    

body button:active {
    scale: .8;
    filter: brightness(.3);
}


body #changeLanguage span.active {
    opacity: 1;
}
body #changeLanguage:active {
    filter: brightness(.5);
}

#readme-link:active {
    scale: .8;
    filter: brightness(.3);
}

#alert-dialog button:hover, #dialogWebApp button:hover {
    scale: 1;
    filter: none;
    background-color: #00000034;
    color: #ede8dd97;
}
#alert-dialog button:active, #gameScreen button:active, #dialogWebApp button:active {
    scale: 1;
    filter: none;
    background-color: #0000006e;
    color: #ede8dd3b;
}

@media screen and (max-width: 457px) {
    #start-buttons {
        padding: 0;
        max-width: 15rem;
    }
}