html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: sans-serif;
  background: #f2f2f2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  box-sizing: border-box;
}

h1 {
  margin: 20px;
  font-size: 2vw;
  text-align: center;
}

#gameTitle {
  font-size: 3rem; /* Increase size */
  font-weight: 800; /* Make it bold */
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4); /* Add a shadow for contrast */
  letter-spacing: 2px; /* More space between letters */
  margin-bottom: 20px;
  text-align: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.main {
  display: flex;
  flex: 1;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  height: calc(100%);
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  height: 60px; /* or whatever your top bar is */
  flex-shrink: 0;
}

.main {
  flex: 1;
  display: flex;
  overflow: hidden;
}


.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 1vw;
  flex: 1;
  max-width: 75%;
  height: 100%;
  box-sizing: border-box;
}

/* Card base styling */
.card {
  background-color: white;
  border: 2px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s;
  overflow: hidden;
  aspect-ratio: 1.075 / 1.625;
  width: 100%;
  height: 100%;
  perspective: 800px;
  animation: fadeIn 0.3s ease;
}

/* Card flipping animation */
.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s;
}

.card.covered .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.card-front img,
.card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-back {
  transform: rotateY(180deg);
}

/* Tooltip on hover */
.card:hover::after {
  content: attr(data-description);
  position: absolute;
  bottom: -1.5em;
  left: 50%;
  transform: translateX(-50%);
  background: black;
  color: white;
  padding: 4px 6px;
  font-size: 1.5vw;
  white-space: nowrap;
  border-radius: 4px;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.card::after {
  opacity: 0;
}

/* Sidebar layout */
.sidebar {
  width: 25%;
  padding: 10px;
  box-sizing: border-box;
  background: #ddd;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.description-box {
  background: white;
  padding: 10px;
  border: 1px solid #aaa;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start; /* changed from center to left-align */
  text-align: left;        /* text itself left-aligned */
  font-weight: 2vw;
}

.description-box .name {
  font-size: 2vw;          /* bigger name font */
  font-weight: bold;
  margin-bottom: 0.5em;
}

.description-box .description {
  font-size: 1.1vw;
  line-height: 1.4;
  color: #333;
}


/* Form layout */
.form {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form input {
  padding: 5px;
  font-size: 1vw;
}

/* Turn indicator styling */
.turn-indicator {
  font-size: 1.5vw;
  font-weight: bold;
  text-align: center;
  padding: 10px;
  background-color: #ccc;
  margin: 0 20px 10px 20px;
  border-radius: 4px;
}

/* Button styling */
button {
  padding: 10px;
  font-size: 1vw;
  border: none;
  background: #bbb;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s;
}

button:hover {
  background: #999;
}

button:active {
  transform: scale(0.98);
}

/* Fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Tooltip styling for buttons */
button[data-tooltip] {
  position: relative;
}

button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #222;
  color: #fff;
  padding: 4px 8px;
  font-size: 0.75em;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease-in-out;
  white-space: nowrap;
  z-index: 1000;
}

button[data-tooltip]:hover::after {
  opacity: 1;
}

/* Dark mode styles */
body.dark-mode {
  background-color: #181818;
  color: #eee;
}

body.dark-mode .sidebar {
  background: #2e2e2e;
}

body.dark-mode .card {
  border-color: #444;
}

body.dark-mode .description-box {
  background: #222;
  color: #ddd;
  border-color: #444;
}

body.dark-mode button {
  background: #333;
  color: #fff;
  border: 1px solid #555;
}

body.dark-mode button:hover {
  background: #444;
}

.settings-wrapper {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 100;
}

.settings-icon {
  font-size: 1.2em;
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  background: #ccc;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
  user-select: none;
}

.settings-menu {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 42px;
  right: 0;
  background: white;
  border: 1px solid #aaa;
  border-radius: 6px;
  padding: 8px 12px;
  gap: 8px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 101;
  min-width: 160px;
  font-size: 1.5em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.settings-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.setting-button {
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  text-align: center;
  transition: background 0.2s;
}

.setting-button:hover {
  background: #ddd;
}

body.dark-mode .settings-menu {
  background: #2e2e2e;
  border-color: #444;
  color: #ddd;
}

body.dark-mode .settings-icon {
  background: #444;
  color: #eee;
}

body.dark-mode .setting-button:hover {
  background: #444;
}



/* Dark mode styles */
body.dark-mode {
  background-color: #181818;
  color: #eee;
}

body.dark-mode .sidebar {
  background: #2e2e2e;
}

body.dark-mode .card {
  border-color: #444;
}

body.dark-mode .description-box {
  background: #222;
  color: #ddd;
  border-color: #444;
}

body.dark-mode button {
  background: #333;
  color: #fff;
  border: 1px solid #555;
}

body.dark-mode button:hover {
  background: #444;
}

body.dark-mode .settings-menu {
  background: #2e2e2e;
  border-color: #444;
  color: #ddd;
}

body.dark-mode .settings-icon {
  background: #444;
  color: #eee;
}


#toggles button {
  font-size: 1.5rem;
  padding: 0.6rem 1rem;
  background-color: #eee;
  color: #000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s, color 0.3s, transform 0.2s;
}

#toggles button:hover {
  background-color: #ddd;
  transform: scale(1.05);
}

/* DARK MODE STYLES */
.dark-mode #toggles button {
  background-color: #222;
  color: #fff;
}

.dark-mode #toggles button:hover {
  background-color: #333;
}

/* Position the toggles in the bottom-right corner */
.corner-buttons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.corner-buttons button {
  padding: 10px 15px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  background-color: #444;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.corner-buttons button:hover {
  background-color: #666;
}

.card.highlighted {
  outline: 3px solid gold;
  box-shadow: 0 0 10px 2px gold;
}


