/* Global reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  height: 100%;
  width: 100%;
}
/*Color directory */
:root {
  --primary-color: #1a6bb0;
  --secondary-color: #2b2118;
  --accent-color: #ff9933;
  --text-color: #333;
  --play-table-color-1: #f4d1ae;
  --play-table-color-2: #604d53;
  --play-table-color-3: #c29979;
}
/* Custom fonts section */
@font-face {
  font-family: table;
  src: url("../assets/fonts/club-triton-fonts/ACME-Secret-Agent-Bold.ttf")
    format("truetype");
}
@font-face {
  font-family: "header-font";
  src: url("../assets/fonts/club-triton-fonts/Action-Man-Bold-Italic.ttf")
    format("truetype");
}
@font-face {
  font-family: "body-font";
  src: url("../assets/fonts/club-triton-fonts/Action-Man-Italic.ttf")
    format("truetype");
}
/* Basic body design */
body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #1a6bb0;
  padding: 20px 0; /* Top/bottom padding only */
}
/* Defines the game region */
.game-container {
  width: 95vw;
  /* width: 95%; */
  height: auto;
  aspect-ratio: 16/10;
  border: 1.25vw solid #2b2118;
  border-radius: 12px;
  margin: 20px auto; /* Fixed side margins by default */
  position: relative; /* For absolute-positioned children */
  display: grid;
  top: 12vh; /* Increased from 8vh to 12vh to account for 10vh navbar + spacing */
  gap: 1em; /* Consistent spacing */

  font-size: 1.5vw;
  /* font-size: clamp(12px, 1.5vw, 16px); Responsive base font size */
  box-shadow:
    0 0 15px rgba(0, 0, 0, 0.5),
    inset 0 0 15px rgba(0, 0, 0, 0.5);
}
/* Scaling game board */
.game-board {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
/* Scale all internal elements proportionally */
.timer,
.card-comparison,
.won-cards,
#rules-dropdown {
  width: 100%;
  font-size: 1em; /* Inherits from .game-container */
}
/* Timer design and formatting */
.timer {
  width: 8vw;
  height: 8vw;
  margin-left: 42vw;
  margin-top: 22.5%;
  position: absolute;
  align-self: center;
  background-color: green;
  border: 1.25vw solid #2b2118;
  border-radius: 50%;
  font-size: 1.5em;
  display: flex;
  justify-content: center;
  text-align: center;
  align-items: center;
  z-index: 1;
  box-shadow:
    0 0 15px rgba(0, 0, 0, 0.5),
    inset 0 0 15px rgba(0, 0, 0, 0.5);
  color: white;
  font-weight: bold;
}
/* Timer animation styling*/
.timer::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    red 0%,
    red var(--percentage, 0%),
    green var(--percentage, 0%),
    green 100%
  );
  z-index: -1;
}
/* Game board background and formatting */
.game-board {
  background-image: url("../assets/imgs/backgrounds/lecture-hall-1.png");
  background-size: 100% 80%;
  /* background-size: cover; */
  background-repeat: no-repeat; /* Prevents tiling */
}
/* Basic play-table formatting */
.play-table {
  display: flex; /* new */
  justify-content: space-between; /* push decks to sides */
  align-items: center; /* vertically center them */
  padding: 0 1%; /* a little side-padding */
  box-sizing: border-box;
}
/* restart button formatting*/
#restart-btn {
  z-index: 1001; /* ensures restart button is on top and not covered */
  display: flex; /* allows centering of restart symbol */
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  font-size: 2em;
  float: right;
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  width: 1em;
  height: 1em;
  background: #ffe375;
  border: none;
  border-radius: 50%;
}

/* Won cards section */
.prof-won-cards,
.student-won-cards {
  display: flex;
  justify-content: space-around;
  position: absolute;
  gap: 10%;
  /* gap: 10px; */
}

.prof-won-cards > div,
.student-won-cards > div {
  width: 3vw;
  height: 4vw;
  background: white;
  border: 0.25vw solid #333;
  border-radius: 0.5vw;
  margin-top: 30%;
  align-content: center;
  text-align: center;
}
.prof-won-cards {
  margin-left: 5%;
}
.student-won-cards {
  margin-left: 85%;
}
#prof-structure-card,
#student-structure-card {
  background: #b1bac6;
}
#prof-dining-hall-card,
#student-dining-hall-card {
  background: #71edd2;
}
#prof-living-card,
#student-living-card {
  background: #72e083;
}
/* Character Design Section */
.game-characters {
  display: flex;
  justify-content: space-around;
  position: absolute;
}
.professor-character img,
.student-character img {
  width: 20vw;
  margin-top: 92%;
}
.professor-character img {
  margin-left: 40%;
}
.student-character img {
  margin-left: 220%;
}
.card-comparison {
  position: absolute;
  display: flex;
}
.chosen-prof-card,
.chosen-student-card {
  width: 20%;
  aspect-ratio: 3/4;
  margin-top: 15%;
  justify-content: center;
  align-items: center;
}
.chosen-prof-card {
  margin-left: 35%;
}

/*Rules Dropdown Section*/

.projector-slot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40%;
  overflow: visible;
  z-index: 10;
  pointer-events: none;
}

#projector-screen {
  position: absolute;
  top: -145%;
  top: -145%;
  left: 10%;
  width: 80%;
  height: 150%;
  background-color: #f1bb87;
  border: 1.25vw solid black;
  z-index: 9;
  transition: top 0.7s ease-in-out;
  border-radius: 0.5em;
}

#projector-screen.show {
  top: 0;
}

/* Projector Screen Styles */

.screen-handle {
  position: absolute;
  bottom: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 10%;
  height: 10%;
  background: black;
  border-radius: 0 0 10px 10px;
  color: white;
  text-align: center;
  align-content: center;
  cursor: pointer;
  z-index: 101;
}

.slide {
  display: none;
  padding: 20px;
  height: calc(100% - 60px);
}

.slide.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Ensure controls are visible and properly positioned */
.screen-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10%;
  z-index: 1000;
  margin: 0 auto;
  width: fit-content;
}

/* Button styling */
.nav-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 40%;
  height: 8vw;
  transition: transform 0.2s;
}

.nav-btn:hover:not(:disabled) {
  transform: scale(1.1);
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Slide counter styling */
.slide-counter {
  font-weight: bold;
  font-size: 1.2em;
  color: #333;
  min-width: 40px;
  text-align: center;
}

/* Projector content styling */
.slide.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}

.slide h1,
.slide h2 {
  font-family: header-font, sans-serif;
  margin-bottom: 1em;
  text-align: center;
  text-decoration: underline;
}

.slide ul {
  font-family: body-font, sans-serif;
  display: inline-block;
  text-align: left;
  margin: 0 auto;
  padding-left: 20px;
  list-style-position: inside;
}

.slide li {
  margin-bottom: 0.5em;
}
.slide.last > img {
  width: 90%;
  height: 100%;
  align-content: center;
  object-fit: contain;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* Makes the screen intercept clicks */
#projector-screen {
  pointer-events: auto;
}

/* Makes sure content doesn't block clicks */
.screen-content {
  pointer-events: auto;
}

/* Projector should only be clickable when screen is hidden */
#projector {
  pointer-events: auto;
}
#projector-screen.show ~ #projector {
  pointer-events: none;
}
/* Additional play-table design and formatting*/
.play-table {
  font-size: 1em;
  display: flex;
  flex-direction: row; /* row overrides column */
  align-items: stretch;
  justify-content: space-between;
  gap: 2em;
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 30%; /* Relative to container */
  background-color: var(--play-table-color-3);
  border-top: 1.25vw solid #2b2118;
  border-bottom: none;
  box-sizing: border-box;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
  padding: 0 2vw;
}
/* Professors Deck Section*/
.prof-deck {
  flex-direction: column;
  margin-left: 1vw;
  align-items: flex-start;
  flex: 1;
}
#prof-name {
  text-align: left;
}
.prof-cards {
  display: flex;
  width: 35vw;
  height: 8vw;
  border-collapse: separate;
  border-spacing: 7.5px 2px;
  background-color: transparent;
}
/* Students Deck Section*/
.student-deck {
  flex-direction: column;
  align-items: flex-end;
  flex: 1;
}

.card:hover {
  border-color: #ffe100;
  border-width: 0.5vw;
  transform: translateY(-4vh);
}
#student-name {
  text-align: right;
}
.student-cards {
  display: flex;
  width: 35vw;
  height: 8vw;
  border-collapse: separate;
  border-spacing: 7.5px 2px;
  background-color: transparent;
  position: relative;
  overflow: visible;
  z-index: 0;
}
/* Altering both the professors and student name fonts */
#prof-name,
#student-name {
  font-family: table, sans-serif;
  font-size: 100%;
  color: var(--text-color);
  font-weight: bold;
}

/* Card design and formatting */
td {
  width: 20%;
  aspect-ratio: 3/4;
  border: 2px solid #333;
  text-align: center;
  background-color: transparent;
  position: relative;
}
table {
  width: 100%;
  border-collapse: collapse;
}
.prof-cards,
.student-cards {
  margin-top: 1%;
}
/* Card Animations Section*/
.card {
  transition: all 0.5s ease;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
}

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

.card-front {
  background: white;
}

/* triton-card specific styles for game */
triton-card {
  display: block;
  transition: all 0.4s ease-out;
  position: relative;
  background-color: transparent !important;
}

triton-card[style*="visibility: hidden"] {
  opacity: 0 !important;
  pointer-events: none;
}

/* Ensure card slots maintain their shape when empty */
td:empty {
  border: 2px dashed rgba(51, 51, 51, 0.3);
  background-color: rgba(255, 255, 255, 0.1);
  min-height: 60px;
}

/* Fix for card animation states - add a specific class for empty states */
td.card-moving {
  border: 2px dashed rgba(51, 51, 51, 0.3);
  background-color: rgba(255, 255, 255, 0.1);
}

/* Copyright Section */
.copyright-info {
  font-size: 0.8em;
  text-align: center;
}

triton-card {
  position: relative;
  --card-width: 8vw;
  --card-height: 18vh;
  --card-font-size: 1rem;
}
triton-card:hover {
  z-index: 10;
}

.popup {
  display: none;
  position: absolute;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.popup.show {
  display: flex;
}

.popup-content {
  position: absolute;
  background-color: #f09d4a;
  border: 1.25vw solid #2b2118;
  padding: 5%;
  border-radius: 20px;
  text-align: center;
  box-shadow:
    0 0 20px rgba(0, 0, 0, 0.6),
    inset 0 0 10px rgba(0, 0, 0, 0.4);
  margin: auto;
  width: 60%;
  height: 60%;
}
#modalTitle {
  font-family: "header-font", sans-serif;
  color: #2b2118;
  margin: auto;
}
#play,
#home {
  position: static;
  margin: 10px;
  font-size: 100%;
  text-align: center;
  background-color: #2b2118;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px #111;
  transition: background-color 0.2s;
}
#play,
#home {
  height: 35%;
  width: 50%;
}
#play:hover,
#home:hover {
  background-color: #3a2a20;
}
#play {
  margin-bottom: 5%;
}
#home {
  margin-bottom: 20%;
}
