body {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #121212; /* dark base background */
    font-family: 'Courier New', sans-serif;
    overflow: auto;
    color: #e0e0e0; /* default text color for readability */
}

h1 {
    text-align: center;
    font-size: 2vw;
    color: #ffffff;
}

button {
    font-family: 'ArcadeClassic', sans-serif;
    padding: 10px 20px;
    margin: 10px;
    font-size: 1.5vw;
    background-color: #1f1f1f;
    color: #e0e0e0;
    border: 2px solid #333;
    border-radius: 8px;
    transition: background 0.2s, transform 0.1s;
}

@media (min-width: 1000px) {
    button {
        font-size: 16px;
    }

    h1 {
        font-size: 32px;
    }
}

#active_players {
    color: #4caf50; /* bright green accent */
    font-size: 20px;
    text-align: left;
        padding: 0;
    margin: 0;
}

#pasteInfo {
    color: #e69f1b; /* bright green accent */
    font-size: 20px;
    text-align: left;
    padding: 0;
    margin: 0;
}

#solved_puzzles {
    color: #657deb; /* bright green accent */
    font-size: 20px;
    text-align: left;
    padding: 0;
    margin: 0;
}

#title-container {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    padding: 10px;
    background-color: rgba(30, 30, 30, 0);
}

#title {
    font-size: 4vw;
    background: linear-gradient(270deg, #ff6ec7, #ff9f40, #4ef2b5, #40bfff, #ff6ec7);
    background-size: 1000% 1000%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientAnimation 8s ease infinite;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h1 {
    margin-bottom: 10px;
}

#game-area {
    flex-grow: 1; /* take remaining space */
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;  /* flex-grow:1, flex-shrink:1 */
    min-width: 300px; /* optional */
}

#game-board {
    display: grid;
    grid-template-columns: repeat(5, 60px);
    grid-template-rows: repeat(5, 60px);
    position: relative;
}

#domino-pool {
    margin-top: 20px;
    margin-right: 10px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    background-color: #1e1e1e; 
    border: 2px solid #333;
    border-radius: 100px;
    min-height: 80px;
    width: 100%;       /* fill available space */
    box-sizing: border-box; /* include padding in width */
}

.cell {
    width: 52px;
    height: 52px;
    background-color: #2a2a2a; /* dark gray cells */
    border: 3px solid rgba(80, 80, 80, 0.6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.domino {
    position: absolute;
    cursor: grab;
    border-radius: 12px;
    border: 2px solid #222;
    background-color: #333;
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 0;
}


.highlighted_square {
    position: absolute;
    border-radius: 12px;
    border: 4px solid #919191;
    background-color: rgba(0, 17, 255, 0.062);
    color: #d4d4d4;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.75rem;
    pointer-events: none;
    width: calc(112px);
    height: calc(112px);
    z-index: 2000;
    text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
}

.highlighted_square_completed {
    background-color: rgba(255, 217, 0, 0.185); /* yellow with some transparency */
    border-color: #ffd700; /* solid gold border */
}

#domino-pool .domino {
    position: static;
    cursor: grab;
    margin: 0;
    background-color: #444;
    color: #f0f0f0;
    flex-wrap: nowrap; /* force single row */
}

.domino.horizontal {
    width: 116px;
    height: 54px;
    flex-direction: row;
}

.domino.vertical {
    width: 54px;
    height: 116px;
    flex-direction: column;
}

.domino span {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.domino.dragging {
    opacity: 0.6;
}

.pip-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    height: 100%;
}

.pip {
    display: flex;
    padding: 3px;
    align-items: center;
    justify-content: center;
}

.pip.active::before {
    content: "";
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
}

#next-level-btn,
#reset-button,
#show-win-button,
#leaderboard-button,
#solution {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #3a3f5c, #2e2b4f);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

#next-level-btn:hover,
#reset-button:hover,
#show-win-button,
#leaderboard-button,
#solution:hover {
    background: linear-gradient(135deg, #2e2b4f, #26223f);
    transform: translateY(-2px);
}

#next-level-btn:active,
#reset-button:active,
#show-win-button,
#leaderboard-button,
#solution:active {
    transform: translateY(1px);
}

#solution:hover {
    background: red;
    transform: translateY(-2px);
}

/* Solution clicked (persistent green) */
#solution.clicked {
    background: green !important;
}

#button-container {
    margin-bottom: 30px;
    text-align: center;
    margin-left: 0%;
    width: 1200px;
    /*border: 2px solid white;*/
}

#timer {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;
    margin-top: -5px;
    color: #ffffff;
}

.solution-overlay {
  transition: opacity 0.3s;
}

#solution-board {
    position: relative;
    width: 5 * 60px; /* GRID_SIZE * CELL_SIZE */
    height: 5 * 60px;
    background-color: #222; /* optional background */
    border: 2px solid #444;
}


/* Common container style */
.paste-container {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  z-index: 1000;
  background-color: #141414; /* sleek black background */
}

/* Vertical placement */
.paste-container { top: 14%; }

/* Input style */
#seedCopyText, #seedPasteText {
  flex-grow: 1;
  border: none;
  padding: 10px 12px;
  background-color: transparent; /* inherit dark background */
  color: #ffffff;
  font-size: 25px;
  font-weight: bold;
  outline: none;
  text-align: left;
  margin: 0; /* no extra spacing */
}

/* Buttons style */
#pasteButton {
  background-color: #333; /* dark gray button */
  color: #ffffff;
  border: none;
  width: 100%;
  padding: 100%;
  white-space: nowrap;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.2s, transform 0.1s;
}

#copyButton:hover, #pasteButton:hover {
  background-color: #555; /* slightly lighter on hover */
  transform: translateY(-1px);
}

#copyButton:active, #pasteButton:active {
  transform: translateY(1px);
}

/* Optional: remove spacing between input and button */
.copy-container input, .paste-container input {
  margin-right: 2px;
}

#auth-area {
    position: fixed;
    top: 50px;       /* distance from top */
    left: 40px;      /* distance from left */
    z-index: 1000;
    display: flex;
    flex-direction: column;  /* stack text and button vertically */
    align-items: flex-start; /* align everything to the left */
    gap: 10px;               /* space between text and button */
}

#auth-area button {
    position: fixed;
    top: 95px;       /* distance from top */
    left: 30px;      /* distance from left */
    font-size: 16px;
    border-radius: 8px;
    background-color: #1f1f1f;
    color: #e0e0e0;
    border: 2px solid #333;
    cursor: pointer;
}

#auth-area button:hover {
    background-color: #333;
}

#solution-text {
    color: #ffffff;
    text-align: center;
    left: 0%;
    top: 0%;
    margin-top: -2%;
    margin-bottom: -1%;
}

.user-info {
  line-height: 1.2;   /* reduces space between lines */
  margin-top: 0px; /* small gap before the logout button */
}

.user-name {
  font-weight: bold;
  font-size: 1.2em;
        background: linear-gradient(270deg, #ff6ec7, #ff9f40, #4ef2b5, #40bfff, #ff6ec7);
    background-size: 1000% 1000%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientAnimation 12s ease infinite;
}

.user-email {
  font-size: 1em;
  color: #ccc;        /* softer gray for email */
  
}

/* Position on center-left of the screen */
/* XP bar container, absolute center-left */
/* Fixed XP container (HUD-style) */
/* Fixed XP container inside sidebar */
.xp-container {
  width: 100%;                /* fill sidebar width */
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;        /* space below for other sidebar items */
}

/* Horizontal XP bar background */
.xp-bar-bg {
  width: 100%;                 /* full width of container */
  height: clamp(20px, 3vh, 30px); /* responsive height */
  background: #2c2c2c;
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.5);
}

/* XP bar fill */
.xp-bar-fill {
  position: absolute;
  left: 0;                     /* fill from left to right */
  top: 0;
  height: 100%;
  width: 0%; /* dynamically updated by JS */
  background: linear-gradient(90deg, #ff9a9e 0%, #fad0c4 50%, #a18cd1 100%);
  border-radius: 1rem 0 0 1rem; /* round only left side to avoid overflow */
  box-shadow: 0 0 10px rgba(255,255,255,0.3);
  transition: width 0.5s ease;
}

/* XP label (optional above the bar) */
.xp-label {
  margin-top: 5px;
  font-size: clamp(12px, 1vw, 18px);
  text-align: center;
  white-space: nowrap;
  background: linear-gradient(270deg, #ff6ec7, #ff9f40, #4ef2b5, #40bfff, #ff6ec7);
  background-size: 1000% 1000%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientAnimation 12s ease infinite;
}





.btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 13rem;
  overflow: hidden;
  height: 3rem;
  background-size: 300% 300%;
  cursor: pointer;
  backdrop-filter: blur(1rem);
  border-radius: 5rem;
  transition: 0.5s;
  animation: gradient_301 5s ease infinite;
  border: double 4px transparent;
  background-image: linear-gradient(#212121, #212121),
    linear-gradient(
      137.48deg,
      #ffdb3b 10%,
      #fe53bb 45%,
      #8f51ea 67%,
      #0044ff 87%
    );
  background-origin: border-box;
  background-clip: content-box, border-box;
}

.btn.selected {
  background-image: linear-gradient(#212121, #212121),
    linear-gradient(137.48deg, #3bff6a 10%, #6aff8f 45%, #21c74d 67%, #00a335 87%);
  /* light-green palette */
  background-origin: border-box;
  background-clip: content-box, border-box;
  border: double 4px #3bff6a;
}

#container-stars {
  position: absolute;
  z-index: -1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transition: 0.5s;
  backdrop-filter: blur(1rem);
  border-radius: 5rem;
}

strong {
  z-index: 2;
  font-family: "Avalors Personal Use";
  font-size: 12px;
  letter-spacing: 5px;
  color: #ffffff;
  text-shadow: 0 0 4px white;
}

#glow {
  position: absolute;
  display: flex;
  width: 12rem;
}

.circle {
  width: 100%;
  height: 30px;
  filter: blur(2rem);
  animation: pulse_3011 4s infinite;
  z-index: -1;
}

.circle:nth-of-type(1) {
  background: rgba(254, 83, 186, 0.636);
}

.circle:nth-of-type(2) {
  background: rgba(142, 81, 234, 0.704);
}

.btn:hover #container-stars {
  z-index: 1;
  background-color: #212121;
}

.btn:hover {
  transform: scale(1.1);
}

.btn:active {
  border: double 4px #fe53bb;
  background-origin: border-box;
  background-clip: content-box, border-box;
  animation: none;
}

.btn:active .circle {
  background: #fe53bb;
}

#stars {
  position: relative;
  background: transparent;
  width: 200rem;
  height: 200rem;
}

#stars::after {
  content: "";
  position: absolute;
  top: -10rem;
  left: -100rem;
  width: 100%;
  height: 100%;
  animation: animStarRotate 90s linear infinite;
}

#stars::after {
  background-image: radial-gradient(#ffffff 1px, transparent 1%);
  background-size: 50px 50px;
}

#stars::before {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 170%;
  height: 500%;
  animation: animStar 60s linear infinite;
}

#stars::before {
  background-image: radial-gradient(#ffffff 1px, transparent 1%);
  background-size: 50px 50px;
  opacity: 0.5;
}

@keyframes animStar {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-135rem);
  }
}

@keyframes animStarRotate {
  from {
    transform: rotate(360deg);
  }

  to {
    transform: rotate(0);
  }
}

@keyframes gradient_301 {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulse_3011 {
  0% {
    transform: scale(0.75);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
  }

  100% {
    transform: scale(0.75);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}


#type-button-container {
        margin-bottom: 30px;
    text-align: center;
    width: 50%;
        display: inline-flex;
    justify-content: center;
    /*border: 2px solid white;*/
}


#main-wrapper {
    display: flex;
    flex-direction: row; /* sidebar left, game area right */
    justify-content: flex-start; /* align items to left by default */
    align-items: flex-start;
    width: 100%;
    min-height: 100%;
    padding: 10px;
    box-sizing: border-box;
    gap: 0px; /* spacing between sidebar and game */
}

#sidebar {
    width: 220px; /* fixed width */
    min-height: 100%;
    background: #1e1e1e;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: stretch; /* make buttons fill width properly */
    gap: 5px; /* smaller gap between items */
    flex: 0 1 220px; /* flex-grow:0, flex-shrink:1, base width 220px */
    min-width: 150px; /* don’t shrink too small */
    max-width: 220px;
}

#sidebar h2 {
    color: #ffffff;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 10px; /* extra spacing before buttons */
}

#sidebar button {
    width: 100%; /* fills container width */
    padding: 10px; /* slightly smaller padding so buttons aren’t tall */
    cursor: pointer;
}
#sidebar button:hover {
    transform: scale(1.05);
}

.section {
    padding: 10px 0;
    margin-bottom: 2%;
    margin-top: -5%;
    border-bottom: 2px solid #ffffff; /* solid line */
}

/* optional: remove last border */
.section:last-child {
    border-bottom: none;
}

#circular-button {
  width: 40px; /* Or any desired size */
  height: 40px; /* Must be equal to width for a perfect circle */
  border-radius: 50%;
  position: absolute;
  top: 6%;
  left: 50%;
  background-color: gray; /* Example background color */
  color: rgb(0, 0, 0);
  border: none;
  display: flex; /* For centering content */
  justify-content: center; /* For centering content */
  align-items: center; /* For centering content */
  font-size: 16px;
  cursor: pointer;
  outline: none; /* Removes default focus outline */
}

/* Tutorial popup window */
#tutorial-popup {
  position: fixed;
  top: 55%;
  left: 40%;
  transform: translate(-50%, -50%);
  width: 45%;
  padding: 20px;
  background: #222;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  text-align: center;
  z-index: 2000;

  /* start hidden */
  display: none;
}

#tutorial-popup h2 {
  margin-top: 0;
  font-size: 1.4em;
  color: #ffd700;
}

#tutorial-popup p {
  font-size: 0.95em;
  line-height: 1.4;
}



/* Sparkle background effect */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(2px 2px at 20% 30%, white, transparent),
                    radial-gradient(2px 2px at 80% 70%, white, transparent),
                    radial-gradient(1.5px 1.5px at 50% 90%, white, transparent),
                    radial-gradient(1.5px 1.5px at 10% 80%, white, transparent),
                    radial-gradient(2px 2px at 90% 20%, white, transparent),
                    radial-gradient(1px 1px at 70% 40%, white, transparent);
  background-repeat: repeat;
  background-size: 200px 200px;
  opacity: 0.3;
  pointer-events: none;
  animation: twinkle 8s infinite alternate;
  z-index: 0;
}

/* Ensure content stays above the stars */
body > * {
  position: relative;
  z-index: 1;
}

/* Twinkling animation */
@keyframes twinkle {
  from { opacity: 0.2; }
  to { opacity: 0.5; }
}
