/* =======================================================
   1. CORE BASE STYLES
   ======================================================= */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 20px 0;
  background-color: #0f172a;
  color: #f8fafc;
  transition: background-color 0.3s ease;
}

a {
  text-decoration: none;
  color: inherit;
}

.main-container {
  margin: 0 auto;
  max-width: 1250px;
  width: 95%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.player-board {
  display: grid;
  grid-auto-rows: 110px;
  gap: 10px;
  background: #1e293b;
  padding: 20px;
  border-radius: 12px;
}

.word-row {
  font-size: 80px;
  font-weight: 800;
  letter-spacing: 4px;
  padding: 0 25px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  text-transform: uppercase;
}

.link-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  display: inline-block;
}

.hr-decor {
  border: none;
  height: 10px;
  margin: 10px auto;
}

.reset-container {
  text-align: center;
  margin-top: 20px;
}

.reset-btn {
  width: 500px;
  height: 100px;
  font-size: 40px;
  cursor: pointer;
  border: none;
}

/* =======================================================
   2. INTERACTIVE COMPONENTS (Lobby, Admin, & Overlays)
   ======================================================= */
.hidden { 
  display: none !important; 
}

.lobby-box {
  text-align: center;
  max-width: 420px;
  margin: 80px auto;
  padding: 40px 30px;
  background: #1e293b;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  border-left: 5px solid #10b981;
}

.lobby-box h2 {
  margin-top: 0;
  color: #f8fafc;
  font-size: 26px;
  font-weight: 700;
}

.lobby-box input {
  font-size: 24px;
  padding: 12px;
  margin: 15px 0;
  width: 100%;
  box-sizing: border-box;
  background: #334155;
  border: 2px solid #475569;
  color: #fff;
  border-radius: 6px;
  text-align: center;
  font-weight: bold;
  letter-spacing: 2px;
}

.lobby-box button {
  font-size: 18px;
  padding: 14px;
  margin: 8px 0;
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.btn-primary {
  background: #0ea5e9;
  color: white;
}

.btn-secondary {
  background: #334155;
  color: #cbd5e1;
}

.admin-controls {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: #1e293b;
  border-bottom: 3px solid #334155;
  color: #f8fafc;
}

.theme-select {
  font-size: 16px;
  padding: 8px 12px;
  background: #334155;
  color: white;
  border: 1px solid #475569;
  border-radius: 4px;
}

.dimmed-letter {
  opacity: 0.25;
  font-weight: 500;
  font-style: italic;
}

.winner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.winner-overlay h1 {
  font-size: 65px;
  margin: 0 0 15px 0;
  font-weight: 900;
}

.winner-overlay p {
  font-size: 26px;
  margin: 0;
  color: #94a3b8;
}

.dismiss-btn {
  margin-top: 30px;
  font-size: 18px;
  padding: 12px 30px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

/* =======================================================
   3. THEME ACCENTS & ADAPTIVE BREAKPOINTS
   ======================================================= */
@media (max-width: 900px) {
  .main-container {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .word-row {
    font-size: 45px;
    padding: 0 15px;
  }
}

/* Paperback Theme Layout Enhancements */
body[style*="background-color: rgb(251, 251, 251)"] .word-row {
  border: 1px solid #e4e4e7 !important;
  box-shadow: 0 4px 6px -1px rgba(9, 9, 11, 0.05), 0 2px 4px -2px rgba(9, 9, 11, 0.05) !important;
}

body[style*="background-color: rgb(251, 251, 251)"] .dimmed-letter {
  color: #71717a !important;
  opacity: 0.50 !important;
}

/* Monochrome Stark Theme Overrides */
body[style*="background-color: rgb(0, 0, 0)"] .word-row {
  border: 2px solid #262626 !important;
  border-radius: 0px !important;
}

body[style*="background-color: rgb(0, 0, 0)"] .word-row b {
  text-shadow: none !important;
  letter-spacing: 5px !important;
}

body[style*="background-color: rgb(0, 0, 0)"] .dimmed-letter {
  color: #a3a3a3 !important;
  opacity: 0.35 !important;
}
