@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Economica:ital,wght@0,400;0,700;1,400;1,700&family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Lexend:wght@100..900&family=Oswald:wght@200..700&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Spectral:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,200;1,300;1,400;1,500;1,600;1,700;1,800&family=Taviraj:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

html, body {
  background-color: #030303;
  color: white;
  font-family: "Fira Sans",Verdana, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  align-content: center;
  flex-direction: column;
}

main {
  align-self: center;
}

main, article {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

q {
  quotes: "“" "”" "‘" "’";
}

/* In case we need to specify */
:lang(en) {
  quotes: "“" "”" "‘" "’";
}

/* Mongolian, Gun's language */
:lang(mn) {
  font-style: italic;
  quotes: "«" "»" "„" "“";
}

/* Romani, used for Tiyafi */
:lang(rmy) {
  font-style: italic;
}

/* Russian, used for Zyiakharian */
:lang(ru) {
  font-style: italic;
  color: #99aade;
  quotes: "«" "»" "„" "“";
}

em[data-def], span[data-def] {
  text-decoration: underline wavy #cb0;
  position: relative;     
  display: inline-block;
}

em[data-def]::after, span[data-def]::after {
  content: attr(data-def);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  
  /* Futuristic Styling */
  font-family: "Lexend", "Oswald", Verdana, sans-serif;
  background: #111a24;
  color: #cc0;
  border: 1px solid #cc0;
  padding: 0.4em 0.75em;
  font-size: 0.85rem;
  border-radius: 0.25em;
  box-shadow: 0px 0px 15px 13px rgba(204,204,0,0.5);
  
  /* Interactive States */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  z-index: 10;

  /* Desktop Width Rules */
  white-space: normal;           
  width: max-content;            
  min-width: 8em;     
  max-width: 15em;    
  line-height: 1.4;
}

em[data-def]:hover::after, span[data-def]:hover::after,
em[data-def]:focus::after, span[data-def]:focus::after {
  opacity: 1;
}

@media (max-width: 30em) {
  em[data-def]::after, span[data-def]::after {
    /* Anchors the tooltip to the device's viewport instead of the text */
    position: fixed; 
    
    /* Places the box comfortably at the bottom of the screen */
    bottom: 1.75rem;  
    left: 7vw;
    right: 7vw;
    
    /* Overrides the desktop centering math */
    width: 90vw;
    max-width: none;
    min-width: 0;
    transform: none; 
    
    /* Adds safety buffers for modern mobile browser navigation bars */
    box-sizing: border-box;
    padding: 0.75em 1em;
    font-size: 0.95rem;
  }
}


.chapter {
  border: thin solid #884;
  border-radius: 1em;
  margin: 0.5em;
  padding: 1em;
  max-width: 67em;
  min-width: 22.5em;
  width: 50vw;
}

.chead {
  font-weight: 700;
  font-size: 2.5em;
  color: #3f21a2;
  line-height:0.75;
  padding:3em 0 0 0;
  text-align: center;
}
h1, h2, h3, h4, h5, h6 {
  text-align: center;
}

h1, h6 {
  font-family: "Lexend","Oswald",Verdana,sans-serif;
}
h2 {
  font-family: "Economica","Fira Sans",Arial,sans-serif;
}
.ctitle {
  font-weight: 500;
  font-size: 2em;
  color: #999;
  line-height:0.75;
  margin: 0;
  padding: 0 0 1em 0;
}
.divider {
  font-family: "Lexend","Oswald",Verdana,sans-serif;
  font-size: 1.25em;
  margin: 0;
  padding: 6pt 0 4pt 0;
}
.body {
  font-family: "Taviraj","Spectral","Garamond","Times","Times New Roman",serif;
  font-weight: normal;
  font-size: 1.25em;
  color: #ccc;
}
.body p {
  margin: 0 0 3pt 0;
  padding: 0;
}
.body p em {
  font-style: italic;
}
.screen {
  font-family: "Fira Code","Courier Prime","Courier New",Courier,monospace;
  color: #afa;
}
