:root {
  --bg: #212121;
  --panel: #212121;
  --accent: lime;
  --text: deeppink;
  --muted: whitesmoke;
  --good: lime;
  --bad: #ef4444;
}

/* Globale reset */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100dvh;
  width: 100dvw;
  color: var(--text);
  font-family:monospace;
  overflow: hidden;
  letter-spacing: 0.2cap;
}

/* Body layout: horizontaal centreren, boven starten */
body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}



.footer-link {
  color: inherit;
  text-decoration: none;
  position: absolute;
  top: 45px;
  right: 5px;
  height: auto;
  box-shadow: none;
  z-index: 1000;
  border: 1px solid transparent;
  width: auto;
  text-align: center;
  font-size: 10px;
  background-color: transparent;
}

.footer-link:hover {
  border: 1px solid lime;
  background-color: transparent;
  color: lime;
}


#disclaimer {
  position:fixed;
  height: 80dvh;
  width: 100dvw;
  z-index: 1000;
  border: 3px solid darkred;
  border-radius: 20px;
  opacity: 0.8;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px;
  background-color: #212121;
  color: lime;
  text-align: center;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
}
#disclaimer button {
  margin-left: 12px;
  position: fixed;
  bottom: 30px;
  margin-left: auto;
  margin-right: auto;
  background-color: yellow;
  opacity: 1;
  color: darkred;
  font-size: 120%;

}
#disclaimer button:hover {
  background-color: darkred;
  color: yellow;
}

/* Achtergrondcontainer met foto */
.hero {
  position: relative;
  background-color: var(--bg);
  margin-inline: auto;
  height: 100dvh;
  width: 100dvw;
  overflow: hidden;
  --hero-image: url("img/vlinder.jpg");
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-image) center/cover no-repeat;
  opacity: 0.3;
}

/* Hoofdgame-panel */
.game {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  text-align: center;
  background: transparent;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* Titel bovenin */
#h1Tekst {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  margin: 0;
  padding-left: 10px;
  padding-top: 3px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: left;
  opacity: 0.4;
  border-bottom: 1px solid var(--muted);
}

/* Verhaalcontainer */
#story {
  display: block;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  line-height: 1.3;
  text-align: center;
  color: var(--accent);
  white-space: pre-wrap; /* \n vanuit JS */
  overflow: visible;
  position: relative;
  z-index: 100;
  
}



/* Kop in het verhaal */
#kop {
  display: block;
  flex: 0 0 10%; /*10% van de ruimte in story*/
  width: 100%;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0;
  padding: 0;
  padding-top: 10px;
  line-height: 1.1;
  font-size: 140% !important;
  font-weight: 700 !important;
  color: turquoise;
  
  text-shadow:
    0 0 #000,
    -2px 0 0 #000,
    0 2px 0 #000,
    0 -2px 0 #000,
    2px 2px 0 #000,
    -2px 2px 0 #000,
    2px -2px 0 #000,
    -2px -2px 0 #000;
}



/* Hoofdtekst */
#tekst {
  display: block;
  flex: 1 1 auto; /*vult de rest van de ruimte onder kop*/
  width: 90%;
  margin: 4px auto 0 auto;
  text-align: center;
  color: lime;
  font-size: 100% !important;
  text-shadow:
    0 0 #000,
    -1px 0 0 #000,
    0 1px 0 #000,
    0 -1px 0 #000,
    1px 1px 0 #000,
    -1px 1px 0 #000,
    1px -1px 0 #000,
    -1px -1px 0 #000;
  
}

/* Links in het verhaal */
#link a,
#link a:link,
#link a:visited,
#link a:hover,
#link a:active {
  color: yellow !important;
  font-weight: normal;
  text-shadow: none;
  text-decoration: none;
  font-size: 1.1rem;
  text-align: center;
}

/* Linkblok onder tekst */
#link {
  display: block;
  grid-template-columns: auto;
  grid-template-rows: auto auto;
  /*grid-template-areas: 
  "before link"
  "bron bron";*/
  width: 100%;
  padding-top: 0;
  padding-left: 12px;
  padding-right: 12px;
  padding-bottom: 7px;
  text-align: left;
  column-gap: 0px;
  row-gap: 7px;
  background-color: rgba(0, 0, 0, 0.35);
}

#link .link-container {
  display: grid;
  width: 100%;
  row-gap: 5px;
  margin-bottom: 5px;
}

#choices {
  position: relative;
  height: 40dvh;
  width: calc(100dvw - 40px);
  margin-left: 20px;
  margin-right: 20px;
  overflow: hidden;
  margin-top: 12px;
  padding-bottom: 20px;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  
  gap: 8px;
  margin-bottom: 16px;
}

#choices .choice {
  flex: 0 0 50px;
  width: 100%;
}

.scrollbaar {
  position: relative;
  height: 57dvh;
  overflow-y: auto;
  margin-bottom: 0px;
  padding-bottom: 0px;
  border-bottom: 1px double yellow;
  display: flex;
  flex-direction: column; /*default maar via javascript bij geen scroll, naar beneden duwen*/
  justify-content: flex-start;
  align-items: flex-start;
  width: 100dvw;
  overflow-x: none;
  
}

.scrollbaar.bottom-first {
  flex-direction: column-reverse;
}

.link-container{
  display: grid;
  grid-template-columns: 1fr auto; /* before links, anchor rechts */
  grid-template-rows: auto auto;   /* rij1 en rij2 */
  grid-template-areas:
    "before link"
    "bron bron";
  width: 100%;
  column-gap: 10px;
  row-gap: 7px;
}

.link-before{
  grid-area: before;
  text-align: left;
  width: 100%;
  border-top: 1px dotted whitesmoke;
  padding-top: 7px;
  margin: 3px 0 0 0;
  margin-right: 0;
}

.link-anchor{
  grid-area: link;
  justify-self: end;
  align-self: center;
  width: 50px;
  margin-top: 5px;
}

.link-bron{
  grid-area: bron;
  text-align: left;
  font-size: 0.85em;
  color: #ccc;
  margin: 0;
  width: 85dvw;
}


/* before-tekst bij link */
.link-before {
  grid-area: before;
  width: 94%;
  color: yellow;
  font-size: 1rem;
  
  text-align: left;
  border-top: 1px dotted whitesmoke;
  padding-top: 7px;
  margin-bottom: 3px;
  margin-top: 3px;
  margin-right: 20px;
  
}

a {
  border: 1px solid yellow;
  padding: 6px 12px;
  border-radius: 4px;
  box-shadow: -1px 2px yellow;
  margin-top: 0px;
}
/* Hover voor links */
a:hover {
  background-color: darkred;
}

a:active {
  box-shadow: 0 0px black;
  transform: translateY(1px) translateX(-1px);
  
}



/* Basisknopstijl */
button {
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease,
    opacity 0.15s ease;
}

/* Keuzeknop */
.choice {
  text-align: center;
  background-color: rgba(255,255,0,0.6);
  color: darkred;
  font-weight: 900;
  font-size: 135%;
  
  text-shadow:
  
  
  -1px 2px 0px yellow;
  

  border: 2px solid transparent;
  transition: transform 1s ease;
  transition-delay: 2s;
  font-family: monospace;
  
  
}

.choice:hover {
  
  color: var(--bg);
  transform: translateY(0) translateX(0);
  font-weight: bold;
  background-color: rgba(255,255,0,1);
}

/* Hover blokkeren */
.choice.no-hover:hover {
  padding-left: 0 !important;
  color: var(--panel) !important;
  font-weight: normal !important;
  transform: none !important;
  background-color: whitesmoke !important;
  border: 2px solid transparent !important;
  pointer-events: none !important;
}

/* Restart-knop rechts onder */
#restart {
  position: absolute;
  left: 5px;
  bottom: 10px;
  font-size: 2rem;
  background-color: transparent;
  z-index: 1000;
}

#restart:hover {
  transform: translateY(5px) translateX(-2px);
  background-color: transparent;
}

/* Terug-knop linksonder */
.action1 {
  position: fixed;
  right: 20px;
  bottom: 15px;
  z-index: 1000;
  color: yellow;
  background-color: transparent;
  padding: 6px 12px;
  font-weight: bold;
  font-size: 125%;
  border: 1px solid transparent;
  border-radius: 2px;
}

.action1:hover {
  border: 1px solid yellow;
  
}

/* Hint-balk onderin */
.hint {
  position: fixed;
  bottom: 30px;
  left: 0;
  width: 70dvw;
  margin-left: 15dvw;
  height: 50px;
  margin-top: 0;
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.8;
  text-align: center;
  white-space: pre-wrap;
  padding: 12px;
}

/* Onbenutte .link class */
.link {
  width: 50px;
  height: 20px;
}

@media only screen and (max-width: 600px) {

  #disclaimer {
    opacity: 1;
  }

  #choices {
    
    padding-top: 20px;
    width: calc(100dvw - 20px);
  margin-left: 10px;
  margin-right: 10px;
  }

  

  .choice {
    padding: 10px;
    background-color: rgba(255,255,0,0.6);

    transition: background-color 0.2s ease; /*uitvinden hoe ik 1 tap bg color yellow en nogmaals tab klik kan maken.*/
    -webkit-tap-hightlight-color: yellow;
  }

  .choice.active {
        background-color: rgba(255,255,0,1);

  }

  #story {
    text-align: center;
    line-height: 1.1;
    font-size: 1rem;
    overflow: hidden;
    margin: 0;
  }

  #kop {
    width: 90dvw;
    letter-spacing: normal;
    text-align: center;
    margin-left: 5dvw;
    margin-right: 5dvw;
  }
}