/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #e0e0e0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 50px;
  background-color: #d6d6d6;
}

header h1 {
  font-size: 1.8rem;
}

nav a {
  margin-left: 20px;
  text-decoration: none;
  color: black;
  font-weight: bold;
}

nav a:hover {
  text-decoration: underline;
}


/* Main */
main {
  flex: 1;
  display: block;
  padding: 40px 50px;
}




/* new main*/


.games-description {
  margin-top: 30px;
  text-align: center;
}



.left-side {
  display: flex;
  flex-direction: column;
  align-items: center;
}




.project-card {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  max-width: 700px;
  flex-wrap: wrap; /* KEY */
}


.project-text {
  min-width: 160px; /* prevents ugly squeezing */
}


.project-image {
  width: 300px;
  height: 220px;
  border-radius: 20px;
  overflow: hidden; /* IMPORTANT */
  flex-shrink: 0;
  box-shadow:
    -2px 2px 10px rgb(0 4 165 / 14%);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* SAME behavior as game-card */
  display: block;
  border: 1px solid #19008478;
  border-radius: 20px;
}


.project-text h3 {
  margin-bottom: 15px;
}


.section-title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 40px;
  text-decoration: underline;
}


.vertical-divider {
  background-color: black;
  width: 2px;
}


.split-layout {
  display: grid;
  grid-template-columns: 1fr 2px 1fr;
  gap: 40px;
  padding: 40px 50px;
}






/*info pages */
.info-page {
  padding: 60px 100px;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
}

.info-page h2 {
  margin-bottom: 20px;
}



/* Footer */
footer {
  text-align: center;
  padding: 10px;
  font-size: 0.8rem;
  background-color: #d6d6d6;
  position: fixed;
  bottom: 0;
  width: 100%;
}







/* ---------- GAME MENU ---------- */
.game-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-color: #e0e0e0;
  text-align: center;
}

.game-menu h1 {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 40px;
  text-decoration: underline;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.menu-buttons button {
  background-color: #6ec1ff;
  border: none;
  padding: 12px 40px;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.menu-buttons button:hover {
  transform: scale(1.05);
  background-color: #4da8f7;
}

/* ---------- POPUP ---------- */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.hidden {
  display: none;
}

.popup-content {
  background-color: white;
  padding: 30px 50px;
  border-radius: 10px;
  text-align: center;
  position: relative;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

.popup-content .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
}








/* ---------- HOW TO PLAY PAGE ---------- */
.howto-page {
  background-color: #f3f3f3;
  font-family: Arial, sans-serif;
  padding: 40px 0;
}

.howto-container {
  max-width: 800px;
  margin: 60px auto;
  text-align: left; /* ✅ align text to the left */
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: visible;
}


.howto-container h1 {
  margin-bottom: 20px;
  text-decoration: underline;
}

.back-btn {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #4b6ef5;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
  z-index: 999;
}

.back-btn:hover {
  background-color: #3454d1;
  transform: translateX(-50%) scale(1.05);
}












/* --------- WAVELENGTH LAYOUT --------- */
.exit-btn{
  position: fixed;
  top: 12px; left: 12px;
  background:#6ec1ff; border:none; padding:10px 16px;
  border-radius:8px; font-weight:bold; cursor:pointer;
}

.wavelength{
  min-height:100vh;
  padding:80px 40px 120px;
  display:flex; flex-direction:column; gap:28px;
  align-items:center; justify-content:flex-start;
}

.category-row{
  width: min(1000px, 92vw);
  display:flex; justify-content:space-between; align-items:center;
  font-size:1.6rem; font-weight:700;
}

/* points zone + blocker */
.zone-wrap{
  width: min(1000px, 92vw);
  position: relative;
  height: 84px;
}


.zone-bg {
  position: absolute;
  inset: 0;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.08);
  overflow: hidden; /* keeps bars inside */
}

.zone-bars {
  display: flex;
  gap: 4px;
  transition: transform 0.3s ease;
}



.bar{
  width:46px; height:48px; border-radius:4px;
  display:flex; align-items:center; justify-content:center;
  font-weight:700;
}
.bar-2{ background:#7bc77a; } /* green = 2 */
.bar-3{ background:#e9c76a; } /* yellow = 3 */
.bar-4{ background:#d96a5a; } /* red = 4 */

.blocker{
  position:absolute; inset:0;
  background:#6ec1ff; border-radius:12px;
  transition: opacity .2s ease;
}

/* Meter */
.meter{
  width:min(1000px, 92vw);
  display:flex; flex-direction:column; align-items:center; gap:10px;
}
.meter-labels{ width:100%; display:flex; justify-content:space-between; padding:0 6px; color:#333; }
.guess-value{ font-size:2rem; font-weight:700; }

/* Range styling (simple, cross-browser safe) */
input[type="range"]{
  width:100%;
  -webkit-appearance:none; appearance:none;
  height:10px; border-radius:6px; background:#fff; outline:none;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.08);
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none;
  width:18px; height:28px; border-radius:4px;
  background:#d25645; cursor:pointer; border:none;
}
input[type="range"]::-moz-range-thumb{
  width:18px; height:28px; border-radius:4px;
  background:#d25645; cursor:pointer; border:none;
}

/* Points */
.score{ font-size:3rem; font-weight:800; }

/* Panels */
.panels{
  width:min(1000px, 92vw);
  display:grid; grid-template-columns: 1fr 1fr; gap:24px;
}
.panel{
  background:#6ec1ff; border-radius:14px; padding:24px;
  display:flex; flex-direction:column; gap:14px; align-items:center;
}
.panel h3{
  text-decoration:underline; font-size:1.4rem; margin-bottom:6px;
}
.panel button, .reset{
  background:#f0cf80; border:none; padding:12px 22px;
  border-radius:12px; font-weight:700; cursor:pointer;
}
.panel button:hover, .reset:hover{ filter:brightness(0.98); }
.reset{
  margin-top:8px; background:#f16322; color:#fff; border-radius:10px;
  padding:12px 28px; font-weight:800;
}



/*---------------SCORE-----------------*/

.score {
  font-size: 3rem;
  font-weight: 800;
  transition: color 0.3s ease;
}

/* Animation effect for score change */
.score-animate {
  color: #2ecc71; /* green */
  animation: popScore 0.6s ease;
}

@keyframes popScore {
  0% { transform: scale(1); }
  30% { transform: scale(1.4); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}







/*---------------TICTACTOE-----------------*/



/* === Ultimate Tic-Tac-Toe (Local) === */
.mega-container{
  max-width: 1100px;
  margin: 40px auto 80px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Exit button (fallback if not already in your CSS) */
.exit-btn{
  position: fixed;
  top: 12px;
  left: 12px;
  background:#7ec8f5;
  border:none;
  padding:10px 14px;
  border-radius:6px;
  font-weight:700;
  cursor:pointer;
}

/* Main 3×3 mega grid */
.mega-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 14px;                 /* space between big boards (blue bars) */
  width: min(86vmin, 900px);
  height: min(86vmin, 900px);
}

/* Each big board wrapper (empty in HTML; JS inserts .sub-board inside) */
.board{
  background: transparent;
  position: relative;
}

/* Inner 3×3 board */
.sub-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  background: #f5f5f5;
  border: 8px solid #7ec8f5;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

/* Each small cell inside the 3x3 sub-board */
.cell {
  border: 2px solid #7ec8f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: clamp(18px, 4vmin, 44px);
  cursor: pointer;
  user-select: none;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}


/* Active target board (red outline) */
.sub-board.active{
  outline: 6px solid #e45555;
  outline-offset: -6px;
}

/* Board won/tied visuals */
.sub-board.won{ opacity: .45; }
.sub-board.tied{ opacity: .45; }

/* Big X/O overlay when a sub-board is won */
.winner-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: clamp(60px, 14vmin, 180px);
  font-weight:900;
  color:#111;
  pointer-events:none;
}

/* Turn text */
.turn-text{
  font-weight:700;
  font-size: clamp(18px, 2.6vmin, 28px);
}

/* Scoreboard (matches your blue cards style) */
.scoreboard{
  display:flex;
  gap:14px;
  background:#7ec8f5;
  padding:16px 22px;
  border-radius:12px;
  font-weight:700;
}
.score-box{
  min-width:110px;
  text-align:center;
}
.score-box p:first-child{ margin:0 0 6px; }
.score-box p:last-child{
  margin:0;
  font-size: clamp(18px, 2.6vmin, 28px);
}

/* Reset button (fallback if not already styled) */
.reset-btn{
  align-self: flex-end;
  margin-right: 16px;
  background:#ff7a1a;
  color:#111;
  border:none;
  padding:12px 22px;
  border-radius:10px;
  font-weight:800;
  cursor:pointer;
}




/* === Winner Popup === */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.popup.hidden {
  display: none;
}

.popup-content {
  background: white;
  padding: 30px 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.popup-content h2 {
  margin-bottom: 20px;
  font-size: 1.6rem;
}

.popup-content button {
  background: #7ec8f5;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.popup .close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
}




/*Explanation styiling for the coding page*/
.info-page {
  max-width: 900px;
  margin: 60px auto;
  padding: 40px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: left;
}

.project-explanation {
  margin-top: 40px;
}

.project-explanation h3 {
  color: #4b6ef5;
  margin-bottom: 10px;
}

.project-explanation ul {
  list-style: disc;
  margin-left: 20px;
  color: #333;
}
