/* ========================
   VARIABLES
   ======================== */
:root {
  --primary-color: #E20816;        /* Main red */
  --secondary-color: #0d8cc2;      /* Button active / click */
  --background-color: #f8f9fa;     /* Background for connect button */
  --header-bg-color: #14BAEF;      /* Header background */
  --footer-bg-color: #14BAEF;      /* Footer background */
  --overlay-bg: rgba(0,0,0,0.7);   /* Inactivity overlay */
  --input-bg: #D9D9D9;             /* Code input background */
  --footer-color: #FFF;            /* Footer text */
  --text-color: #000;              /* General text */

  /* Sizes */
  --header-height: 80px;
  --logo-width: 120px;
  --back-btn-size: 45px;
  --button-radius: 25px;

  /* Channel button sizes */
  --channel-btn-width-desktop: 90%;
  --channel-btn-width-mobile: 100%;
  --channel-btn-height: 70px;


  /* Fonts */
  --main-font: 'Inter', Arial, sans-serif;
}

/* ========================
   HEADER
   ======================== */
header {
  display: flex;
  justify-content: center;
  align-items: center;
  height: var(--header-height);
  border-bottom: 4px solid #e6e6e6;
  background-color: var(--header-bg-color);
}
header .logo {
  width: var(--logo-width);
}

/* ========================
   BACK BUTTON
   ======================== */
.back-btn {
  width: var(--back-btn-size);
  height: var(--back-btn-size);
  border-radius: 50%;
  background: #000;
  border: 2px solid #e6e6e6;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 20px;
}
.back-btn:hover {
  text-decoration: underline;
}

/* ========================
   INACTIVITY OVERLAY
   ======================== */
#inactivityOverlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#inactivityOverlay.active {
  display: flex;
}
#inactivityBox {
  background: grey;
  padding: 40px 60px;
  border-radius: 20px;
  text-align: center;
  color: #fff;
}
#inactivityCountdown {
  font-size: 64px;
  font-weight: bold;
  color: #fff;
}

/* ========================
   FOOTER
   ======================== */
footer {
  text-align: center;
  height: 27px;
  line-height: 27px;
  font-size: 0.9em;
  color: var(--footer-color);
  font-weight: bold;
  position: absolute;
  bottom: 30px;
  width: 100%;
  background-color: var(--footer-bg-color);
}
.footer-text a {
  color: var(--footer-color);
  text-decoration: none;
}
.footer-text a:hover {
  text-decoration: underline;
}

/* ========================
   MAIN CONTAINER & SCREENS
   ======================== */
main.container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 4vh 2vw;
  text-align: center;
}
.screen {
  display: none;
  width: 100%;
  max-width: 600px;
}
.screen.active {
  display: block;
}

/* ========================
   ROOM & SCREEN ID
   ======================== */
#welcome-container_room p {
  margin: 0;
}
#roomId {
  font-weight: 500;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: var(--primary-color);
}
#screenId {
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--text-color);
  margin-bottom: 2vh;
}

/* ========================
   CODE INPUTS
   ======================== */
.code-input input {
  width: clamp(50px, 6vw, 70px);
  height: clamp(70px, 8vh, 90px);
  font-size: 2.2em;
  text-align: center;
  background: var(--input-bg);
  border: none;
  border-radius: 20px;
  outline: none;
  text-transform: uppercase;
  color: var(--primary-color);
}
.code-input input::placeholder {
  color: var(--primary-color);
  opacity: 1;
  transform: translateY(20%);
}

/* ========================
   BUTTONS
   ======================== */
button.global-btn {
  background: var(--primary-color);
  color: #fff;
  font-family: var(--main-font);
  font-weight: 700;
  font-size: 25px;
  border: none;
  width: 352px;
  height: 80px;
  border-radius: var(--button-radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
button.global-btn:active {
  background: var(--secondary-color);
}

/* Connect button */
#connectButton {
  font-size: 2.5rem;
  width: 30vw;
  height: 10vh;
  background: var(--background-color);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: var(--button-radius);
}

/* Submit code button */
#submitCode {
  background-color: rgba(226,8,22,0.4);
  pointer-events: none;
  color: #fff;
}
#submitCode.active {
  background-color: var(--primary-color);
  pointer-events: auto;
  color: #fff;
}

/* ========================
   CHANNEL BUTTONS
   ======================== */
#channelButtons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 3vh;
  width: 100%;
}
.channel-btn, .home-btn {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  border-radius: 15px;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  width: var(--channel-btn-width-desktop);
  height: var(--channel-btn-height);

}
.channel-btn:hover, .home-btn:hover {
  background-color: rgba(226,8,22,0.1);
}
.home-btn.active, #step2 button.active {
  background: var(--primary-color);
  color: #fff;
}

/* ========================
   CODE INSTRUCTION
   ======================== */
.code-instruction {
  font-family: var(--main-font);
  font-weight: 500;
  font-size: 21px;
  line-height: 36px;
  text-align: center;
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 768px) {
  main.container { padding: 6vh 3vw; }
  .channel-btn,.home-btn { width: 90%; }
  button.global-btn { width: 220px; height: 50px; font-size: 1.2rem; }
  .code-input input { width: 60px; height: 80px; }
  #connectButton { width: 60vw; height: 8vh; font-size: 1rem; }
  .back-btn { width: 30px; height: 30px; }
}

@media screen and (min-width: 1920px) and (min-height: 1080px) {
  header {
        width: 100%; 
        height: 181px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 auto;
  }
  header .logo {  width: var(--logo-width); }
  .code-input input { width: 136px; height: 211px; font-size: 6rem; }
  .code-instruction { font-size: 36px; }
  #channelButtons { gap: 24px; padding-top: 40px; }
  .channel-btn { font-size: 2rem; width: 90%; }
  .home-btn { width: 147px; height: 43px; font-size: 15px; }
}
