html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  min-height: 100vh;
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  background: linear-gradient(120deg, #182238 40%, #242948 100%);
  color: #e6eaf3;
}

header.glass-header {
  width: 100vw;
  position: fixed;
  top: 0; left: 0; z-index: 99;
  background: rgba(30, 35, 46, 0.88);
  backdrop-filter: blur(15px);
  border-bottom: 1.5px solid #2d3750;
  box-shadow: 0 2px 10px #151a2930;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-content {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2vw;
}
.app-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #326dff;
  letter-spacing: 2.5px;
  opacity: 0.98;
  font-family: 'Segoe UI Semibold', sans-serif;
}
.app-owner {
  font-size: 1.03rem;
  font-weight: 400;
  color: #8faef7;
  opacity: 0.7;
  letter-spacing: 1.5px;
}

.container {
  margin: 6.1rem auto 2.5rem;
  width: 96vw;                      /* Default for most screens */
  max-width: 660px;                 /* For desktop screens */
  min-width: 272px;
  padding: 2.5rem 2.2rem 2.2rem 2.2rem;
  border-radius: 22px;
  background: rgba(35, 39, 52, 0.89);
  box-shadow: 0 10px 60px #1a203d42, 0 4px 24px #0f133118;
  border: 1.5px solid #2d3750;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
h1 {
  text-align: center;
  color: #326dff;
  letter-spacing: 2.4px;
  font-size: 2.1rem;
  margin-bottom: 1.4rem;
  font-weight: 700;
  font-family: 'Segoe UI', Arial, sans-serif;
}

#name-ui, #room-ui, #party-ui {
  margin-bottom: 1.3rem;
  width: 100%;
}

button, input[type="text"], input[type="file"] {
  font-size: 1.07rem;
  border: none;
  border-radius: 12px;
  padding: 0.8em 1.1em;
  box-shadow: 0 1px 3px #0c163145;
  outline: none;
  margin-bottom: 0.35rem;
  transition: background 0.15s, box-shadow 0.15s, color 0.10s;
}

button {
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(90deg, #326dff 10%, #26324c 80%);
  color: #f2f4f9;
  border: 1px solid #264594;
  transition: background 0.16s, color 0.12s, box-shadow 0.15s;
  width: max-content;
  min-width: 115px;
  margin-right: 6px;
}
button:last-child { margin-right: 0; }
button:hover, button:focus {
  background: linear-gradient(90deg, #264594 40%, #558fff 95%);
  color: #fff;
  box-shadow: 0 6px 20px #26459422;
}

input[type="text"], input[type="file"] {
  background: rgba(239,242,255,0.06);
  color: #d7e2f3;
  width: 100%;
  max-width: 100%;
  margin-bottom: 7px;
  border: 1.2px solid #1a234020;
  font-size: 1.08em;
  font-weight: 500;
  box-sizing: border-box;
}
input[type="text"]:focus {
  border: 1.4px solid #326dff;
  background: rgba(32,109,255,0.09);
  color: #326dff;
}
input[type="file"] {
  color: #8faef7;
  padding: 0.42em 0.5em;
  font-size: 0.97em;
}

/* Room header */
.room-header {
  margin-bottom: 0.8em;
  color: #e2e9f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(41,62,92,0.19);
  border-radius: 9px;
  padding: 0.45em 1em;
  font-weight: 600;
  letter-spacing: 1.7px;
  box-shadow: 0 1px 8px #17213a18;
  width: 100%;
  box-sizing: border-box;
}

#chat-section {
  background: rgba(255,255,255,0.07);
  border-radius: 17px;
  margin: 1.2em 0 0.55em 0;
  padding: 1.1em 0.7em 0.7em 0.7em;
  box-shadow: 0 0px 12px #1a274084;
  max-height: 205px;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
#chat-box {
  overflow-y: auto;
  max-height: 90px;
  min-height: 55px;
  margin-bottom: 0.5em;
  padding: 0.45em 0.13em;
  color: #23304f;
  font-weight: 500;
  letter-spacing: 1.10px;
  font-size: 1.06em;
  background: rgba(40,55,68,0.08);
  border-radius: 0.4em;
  box-shadow: 0 1px 3px #222c4232;
  width: 100%;
  box-sizing: border-box;
}
#chat-form {
  display: flex;
  gap: 0.42em;
  width: 100%;
}
#chat-input {
  flex: 1;
  font-size: 1.13em;
  color: #182238;
  background: #edf7ff0c;
  border: 1px solid #326dff18;
}
.my-msg {
  color: #326dff!important;
  font-weight: bold;
  letter-spacing: 1.5px;
}
.user-msg {
  color: #e94242 !important;
  font-weight: 600;
  letter-spacing: 1.3px;
}


#video-player-container {
  margin-top: 1.0em;
  background: rgba(21, 33, 44, 0.14);
  border-radius: 15px;
  min-height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid #22347718;
  box-shadow: 0 3px 7px #2645941a;
  transition: background 0.12s;
  overflow: auto;
  width: 100%;
  box-sizing: border-box;
}
#video-player-container video, #ytplayer {
  border-radius: 10px;
  box-shadow: 0 2px 8px #15286a40;
  margin: 4px 0;
  width: 97%;
  max-width: 98%;
}
#video-controls {
  margin: 0.85em 0 0.5em 0;
  display: flex;
  flex-direction: column;
  gap: 0.18em;
  width: 100%;
  box-sizing: border-box;
}

#video-call-section {
  margin-top: 0.85em;
  padding: 0.87em 0;
  border-radius: 14px;
  background: rgba(60,64,96,0.10);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 1px 8px #19306708;
  width: 100%;
  box-sizing: border-box;
}
#peers-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0.2em 0;
  min-height: 53px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
}
#peers-container video {
  width: 82px; height: 62px;
  border-radius: 10px;
  object-fit: cover;
  margin: 1.4px;
  border: 2.2px solid #326dff;
  background: rgba(255,255,255,0.10);
  transition: border 0.29s;
  box-shadow: 0 2px 7px #26459428;
}
.hidden { display: none; }
::-webkit-scrollbar { display:none; }

footer.glass-footer {
  position: fixed;
  left: 0; bottom: 0;
  width: 100vw;
  min-height: 39px;
  padding: 0 2vw;
  box-sizing: border-box;
  background: rgba(30, 35, 46, 0.82);
  backdrop-filter: blur(12px);
  border-top: 1.1px solid #34476b;
  box-shadow: 0 -1px 12px #21315c22;
  color: #326dff;
  z-index: 99;
  display: flex; align-items: center; justify-content: center;
}
.footer-content {
  width: 100%; max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 500;
}
.footer-content a {
  color: #8faef7;
  text-decoration: none;
  font-weight: 700;
}
.footer-content a:hover { 
  text-decoration: underline;
  color: #326dff;
}
.footer-right {
  color: #7d91ac;
  opacity: 0.87;
}

@media (max-width: 800px) {
  .container { max-width: 100vw; padding: 1.1rem 0.30rem;}
  h1 { font-size: 1.1rem; }
  .header-content, .footer-content { flex-direction: column; gap: 2px; align-items: flex-start;}
  .footer-content { font-size: 0.91rem; }
  #video-player-container { min-height: 80px;}
}
@media (max-width: 480px) {
  .container { padding: 0.82rem 0.03rem;}
  .app-title { font-size: 1.05rem;}
  #video-player-container { min-height: 60px;}
}
