html, body {
    overflow-x: hidden;
}

body {
    background-color: #1f1f1f;
    color: #cccccc;
    font-family: sans-serif;
    user-select: none; /* To prevent highlighting text while shuffling */
    max-width: 1200px;
}

/* Typography */
h1 {
    text-align: center;
}

h2 {
    font-size: x-large;
    color: #f7f7f7;
    text-align: center;
    margin: 5px;
    user-select: none;
}

p {
    margin: 5px;
    line-height: 1.5;
}

h3,
#card_link_text a {
    font-size: larger;
    color: #f7f7f7;
    text-align: center;
    position: relative;
    margin: 0.5vw;
}

.nav-button {
  background-color: transparent;
  border: 2px solid #f7f7f7;
  color: #f7f7f7;
  width: 220px;
  height: 80px;
  margin: 10px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  cursor: pointer;
  vertical-align: middle;
}

button:hover {
    background-color: #f7f7f7;
    color: #1f1f1f;
}

#nav-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

#github-link {
    text-align: center;
    margin: 20px 0;
}

#briefing {
    user-select: none;
}

/* Shuffle / card display areas */
#reversed {
    display: none;
    text-align: center;
}

#pulled,
#shuffled {
    display: none;
    flex-wrap: wrap;
}

.pulled, #shuffled {
    align-content: flex-end;
}

#pulled {
    margin-top: 10px;
    min-height: 165px;
}

/* This additional styling is for the one-card, three-card, and celtic-cross layouts */
.pulled, .pulled-celtic-cross {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: nowrap;
}

.pulled-celtic-cross {
    width: 100%;
    height: min(100vh - 250px, 655px);
    position: relative;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

#shuffled {
    width: calc(100% - 85px); /* Compensate for card overlap */
    margin-top: 20px;
    row-gap: 20px;
}

/* Tarot card styling */
.card, .card-pulled {
    cursor: pointer;
    background-size: contain;
    background-color: firebrick;
    vertical-align: text-top;
    height: 145px;
    width: 85px;
    border: 2px solid black;
    border-radius: 5px;
    font-size: 12px;
    position: relative;
    transition: transform 0.2s ease;
}

.card {
    display: inline-block;
    margin: 5px -80px 5px 5px; /* negative margin to stack the cards */
}

.card-pulled {
    visibility: hidden;
    margin: 5px;
}

/* Modal / overlay styling */
#overlay {
    width: 100%;
    height: 100%;
    background-color: #000000bb;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1500;
    display: none;
}

#container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    cursor: default;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 350px;
    width: 95dvw;
    height: 95dvh;
    max-height: 600px;
}

#picked,
#card_link {
    position: relative;
    z-index: 2000;
}

#picked {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    flex-shrink: 1;
    min-height: 0;
    margin: 10px auto;
    border-radius: 7px;
}

#card_name {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin-bottom: 10px;
}

#card_name_text {
    cursor: text;
}

#card_link {
    height: auto;
    margin-top: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

#close_button_row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}

#close_button_container {
    display: flex;
    align-items: center;
    width: fit-content;
    cursor: pointer;
    padding: 0 5px;
}

#close_button_text {
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    color: #f7f7f7;
    padding: 4px 8px 0 0;
}

#close_button {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #f7f7f7;
    padding: 0;
    cursor: pointer;
}

#icon {
    width: 50vw;
    max-width: max-content;
    max-height: max-content;
    display: block;
    margin: 25px auto;
    pointer-events: none;
}
