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

/* Hide elements forcefully when needed */
.hidden {
  display: none !important;
}

/* === BODY BACKGROUND (Woodgrain stripes using CSS only) === */
body {
  font-family: 'Montserrat', sans-serif;
  height: 100vh;
  color: #f8e7c3;
  background: repeating-linear-gradient(
    45deg,
    #5c3b1e,
    #5c3b1e 10px,
    #6e4723 10px,
    #6e4723 20px
  );
}

/* === ENTRY SCREEN === */
.entry-screen {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    #4a2f16,
    #4a2f16 20px,
    #5c3b1e 20px,
    #5c3b1e 40px
  );
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 999;
}

.door {
  background: linear-gradient(to bottom, #6e4723, #5c3b1e);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.5), inset 0 0 10px rgba(0,0,0,0.4);
  text-align: center;
  transition: transform 1s ease-in-out;
}

.door.open {
  transform: rotateY(90deg);
}

.entry-screen h1 {
  font-family: 'Roboto Slab', serif;
  margin-bottom: 20px;
}

.entry-screen input, .entry-screen button {
  padding: 10px;
  border-radius: 6px;
  border: none;
  font-size: 1rem;
  margin-bottom: 10px;
}

.entry-screen input {
  border: 2px solid #d4af37;
}

.entry-screen button {
  background: #d4af37;
  font-weight: bold;
  cursor: pointer;
}
.entry-screen button:hover {
  background: #ffdb6b;
}

/* === CLUBHOUSE LAYOUT === */
#clubhouse {
  display: flex;
  height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: repeating-linear-gradient(
    to bottom,
    #6e4723,
    #6e4723 50px,
    #5c3b1e 50px,
    #5c3b1e 100px
  );
  border-right: 4px solid #d4af37;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.club-sign {
  font-family: 'Roboto Slab', serif;
  background: #3b2616;
  padding: 12px;
  border: 3px solid #d4af37;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 25px;
}

.sidebar button,
.sidebar a.logout {
  background: #d4af37;
  border: none;
  color: #2e1c0f;
  font-weight: bold;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.sidebar button:hover,
.sidebar button.active {
  background: #ffdb6b;
  transform: translateX(4px);
}

.sidebar a.logout {
  text-align: center;
  margin-top: auto;
  background: #a33e2f;
  color: white;
}
.sidebar a.logout:hover {
  background: #d14f3f;
}

/* === MAIN CONTENT === */
.content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  background: radial-gradient(circle at top left, rgba(255,223,128,0.15), transparent),
              radial-gradient(circle at bottom right, rgba(255,223,128,0.15), transparent),
              #2e1c0f;
}

/* Only show active tab section */
.content section {
  display: none;
}
.content section.active {
  display: block;
  animation: fadeIn 0.4s ease-in-out;
}

/* Fade-in animation for sections */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === CHAT ROOM === */
#chat-container {
  background: linear-gradient(to bottom, #3b2616, #2a1a0d);
  border: 2px solid #cfa84a;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  height: 350px;
}

#messages {
  flex-grow: 1;
  overflow-y: auto;
  list-style: none;
}

#messages li {
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: linear-gradient(to bottom, #5c3b1e, #3b2616);
}

.owner-msg {
  background: linear-gradient(to bottom, #6e4723, #5a3d1f);
  border: 2px solid gold;
  box-shadow: 0 0 8px gold;
}

#chat-input-area {
  display: flex;
  margin-top: 8px;
}

#msgInput {
  flex-grow: 1;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #cfa84a;
}

#sendBtn {
  background: #cfa84a;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  margin-left: 6px;
  cursor: pointer;
}

/* === OWNER EDITOR === */
#ownerEditor {
  background: repeating-linear-gradient(
    45deg,
    #f7f2e7,
    #f7f2e7 10px,
    #f0e8d2 10px,
    #f0e8d2 20px
  );
  border: 3px solid #d4af37;
  border-radius: 10px;
  padding: 10px;
  margin-top: 15px;
}

#ownerEditor h3 {
  text-align: center;
  color: #2e1c0f;
  background: #ffdb6b;
  border-radius: 6px;
  padding: 4px;
}

#ownerEditor input, #ownerEditor textarea {
  width: 100%;
  margin: 6px 0;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid #cfa84a;
}

#ownerEditor button {
  width: 100%;
  background: #cfa84a;
  color: #2e1c0f;
  font-weight: bold;
  padding: 6px;
  border: none;
  border-radius: 6px;
  margin-top: 6px;
}

/* === USERNAME PROMPT === */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.prompt-box {
  background: #3b2616;
  border: 3px solid #cfa84a;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.prompt-box input {
  margin: 8px 0;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #cfa84a;
}

.prompt-box button {
  padding: 8px 14px;
  background: #cfa84a;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* === RESPONSIVE === */
@media (max-width: 700px) {
  #clubhouse {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
  }
  .content {
    padding: 15px;
  }
}
