/* page window */
* { 
  box-sizing: border-box; 
}

body {
  margin: 0;
  min-height: 100vh;
  background: #fefae0;
  color: #2d3142;
  font-family: system-ui, -apple-system, sans-serif;
}

.hidden { 
  display: none !important; 
}

/* Nav bar */
#navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  width: 100%;
  height: 64px;
  background: #d4a373;
  color: white;
  padding: 0 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.site-name {
  font-size: 1.4rem;
  letter-spacing: 2px;
  font-weight: 700;
}

.back-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.back-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* Menu grid design */
#games {
  margin-top: 96px;
  width: 90%;
  max-width: 1000px;
  padding-bottom: 40px;
  margin-left: auto;
  margin-right: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 120px;
  gap: 16px;
}

.block {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 16px;
  transition: all 0.3s ease;
}

.block:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}
.block img {
  width: 60px;
  height: 60px;
  margin-bottom: 8px;
  opacity: 0.8;
  
}

.block.wide img {
  width: 80px;
  height: 60px;
}

.block span {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
  text-align: center;
}

.wide { 
  grid-column: span 2; 
}

/* Game Screens */
.game-screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 40px;
}

.game-screen h2 {
  font-size: 2rem;
  margin-bottom: 10px;
  text-align: center;
}

.game-screen .instructions {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 30px;
  text-align: center;
  max-width: 500px;
}

.content {
  text-align: center;
  max-width: 800px;
  width: 100%;
}

/* Standard Game Button */
.game-btn {
  background: #d4a373;
  color: white;
  border: none;
  padding: 20px 40px;
  font-size: 1.2rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.game-btn:hover {
  transform: scale(1.05);
}

.game-btn:active {
  transform: scale(0.95);
}

/* Reaction Time Game */
#reactionBox {
  width: 400px;
  height: 200px;
  background: #ef4444;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  margin: 20px auto;
  transition: background 0.3s;
}

#reactionBox.green {
  background: #22c55e;
}

#reactionResult {
  margin-top: 20px;
  font-size: 1.1rem;
  min-height: 40px;
}

/* Guess Number Game */
#guessInput {
  padding: 12px 20px;
  font-size: 1.2rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  width: 200px;
  text-align: center;
  margin-right: 10px;
}

#guessResult {
  margin-top: 20px;
  font-size: 1.1rem;
  min-height: 60px;
}

/* Spend Money Game */
#moneyLeft {
  font-size: 3rem;
  font-weight: 900;
  color: #d4a373;
  margin: 20px 0;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.item-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.item-card h3 {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
}

.item-price {
  color: #d4a373;
  font-weight: 600;
  margin-bottom: 10px;
}

.item-owned {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.buy-btn {
  background: #d4a373;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  font-weight: 600;
}

.buy-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Password Game */
#passwordInput {
  width: 100%;
  max-width: 600px;
  padding: 12px;
  font-size: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 20px;
}

.rules-list {
  text-align: left;
  background: white;
  padding: 20px;
  border-radius: 12px;
  margin-top: 20px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.rule {
  padding: 10px;
  margin: 5px 0;
  border-left: 3px solid #ccc;
  padding-left: 15px;
}

.rule.valid {
  border-color: #22c55e;
  background: #f0fdf4;
}

.rule.invalid {
  border-color: #ef4444;
  background: #fef2f2;
}

/* Invisible Buttons Game */
#invisible-screen {
  background: white;
  position: relative;
}

.invisible-btn {
  position: absolute;
  width: 120px;
  height: 60px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.invisible-btn:hover {
  background: rgba(212, 163, 115, 0.05);
}

.assumption {
  position: fixed;
  background: #d4a373;
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  max-width: 300px;
  text-align: center;
}

#invisible-hint {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: #6b7280;
  font-style: italic;
  opacity: 0.6;
}

/* Bored Button */
#boredBtn {
  background: #d4a373;
  color: white;
  border: none;
  padding: 40px 80px;
  font-size: 2rem;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 900;
  width: 200px;
  height: 200px;
  transition: all 0.3s ease;
}

#boredBtn:hover {
  transform: rotate(10deg) scale(1.1);
}

#boredResult {
  margin-top: 40px;
  font-size: 1.3rem;
  min-height: 80px;
  line-height: 1.6;
}

/* Quotes */
#quoteDisplay {
  background: white;
  padding: 40px;
  border-radius: 12px;
  margin: 20px 0;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-style: italic;
  line-height: 1.6;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Type Racer */
#typeText {
  background: white;
  padding: 30px;
  border-radius: 12px;
  font-size: 1.3rem;
  margin: 20px 0;
  line-height: 1.8;
  min-height: 100px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

#typeInput {
  width: 100%;
  max-width: 600px;
  padding: 15px;
  font-size: 1.1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 20px;
}

#typeResult {
  font-size: 1.2rem;
  margin-top: 20px;
  min-height: 40px;
}

/* Memory Match */
#memoryScore {
  font-size: 1.2rem;
  margin-bottom: 20px;
  font-weight: 600;
}

#memoryGrid {
  display: grid;
  grid-template-columns: repeat(4, 100px);
  gap: 10px;
  margin: 20px auto;
  width: fit-content;
}

.memory-card {
  width: 100px;
  height: 100px;
  background: #d4a373;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: transparent;
  transition: all 0.3s ease;
}

.memory-card:hover {
  transform: scale(1.05);
}

.memory-card.flipped {
  background: white;
  color: black;
}

.memory-card.matched {
  background: #22c55e;
  color: white;
  cursor: default;
}

/* Click Speed */
#speedCount {
  font-size: 4rem;
  font-weight: 900;
  color: #d4a373;
  margin: 20px 0;
}

#speedResult {
  margin-top: 20px;
  font-size: 1.2rem;
  min-height: 60px;
}

/* Tic Tac Toe */
#tttGrid {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  gap: 5px;
  margin: 20px auto;
  width: fit-content;
}

.ttt-cell {
  width: 100px;
  height: 100px;
  background: white;
  border: 3px solid #e5e7eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: bold;
  transition: all 0.3s ease;
}

.ttt-cell:hover {
  background: #f0f0f0;
}

.ttt-cell.taken {
  cursor: default;
}

#tttResult {
  font-size: 1.3rem;
  margin: 20px 0;
  min-height: 40px;
  font-weight: 600;
}

/* Color Guesser */
#colorRGB {
  font-size: 2rem;
  font-weight: 900;
  margin: 20px 0;
  padding: 20px;
  background: white;
  border-radius: 12px;
}

#colorGrid {
  display: grid;
  grid-template-columns: repeat(3, 150px);
  gap: 15px;
  margin: 20px auto;
  width: fit-content;
}

.color-box {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 3px solid transparent;
}

.color-box:hover {
  transform: scale(1.05);
  border-color: #d4a373;
}

#colorResult {
  font-size: 1.2rem;
  margin-top: 20px;
  min-height: 40px;
}

/* Responsive design implementing */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .wide { 
    grid-column: span 2; 
  }
  
  .items-grid {
    grid-template-columns: 1fr;
  }
  
  #reactionBox {
    width: 300px;
    height: 150px;
  }
  
  #memoryGrid {
    grid-template-columns: repeat(4, 80px);
  }
  
  .memory-card {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }
  
  #tttGrid {
    grid-template-columns: repeat(3, 80px);
  }
  
  .ttt-cell {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }
  
  #colorGrid {
    grid-template-columns: repeat(3, 100px);
  }
  
  .color-box {
    width: 100px;
    height: 100px;
  }
}