/* watch.otrhvn.org — a dark room in otrhvn's colours (cream, green, brown). */
:root {
  --bg: #161816;
  --panel: #1f2220;
  --line: #333833;
  --text: #ece0c2;
  --muted: #a39a85;
  --green: #3f9c7a;
  --green-dim: #2a7a5e;
  --brown: #b07a45;
  --danger: #d07a5e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 "Garamond", "EB Garamond", Georgia, serif;
}

button, input { font: inherit; color: inherit; }

.bar {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .55rem 1rem;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.brand { color: var(--green); text-decoration: none; font-size: 1.25rem; letter-spacing: .08em; }
.brand:hover { text-decoration: underline; }
.dot { color: var(--muted); }
.bar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: normal;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viewers { color: var(--muted); font-size: .95rem; white-space: nowrap; cursor: default; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21rem;
  height: calc(100% - 3rem);
  min-height: 0;
}

.stage { padding: 1rem; overflow-y: auto; min-height: 0; }

.screen {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 7.5rem);
  width: 100%;
  border: 1px solid var(--line);
}
.screen video { width: 100%; height: 100%; display: block; background: #000; }

.empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  background: #000;
}
.empty p { margin: .2rem 0; font-size: 1.3rem; }
.empty .sub { font-size: 1rem; color: var(--muted); }

.join {
  position: absolute;
  inset: 0;
  margin: auto;
  width: max-content;
  height: max-content;
  padding: .8rem 1.6rem;
  font-size: 1.3rem;
  background: var(--green-dim);
  border: 1px solid var(--green);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 30px rgba(0, 0, 0, .6);
}
.join:hover { background: var(--green); }

.notice {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 3.5rem;
  padding: .6rem .8rem;
  background: rgba(20, 20, 20, .92);
  border-left: 3px solid var(--danger);
  font-size: .95rem;
}

.status { color: var(--muted); margin: .5rem 0 0; min-height: 1.4em; font-size: .95rem; }

.host, .login {
  margin-top: 1rem;
  padding: .8rem 1rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  max-width: 48rem;
}
.host h2 { margin: 0 0 .6rem; font-size: 1.1rem; font-weight: normal; color: var(--brown); }
.host label, .login label { display: block; margin-bottom: .6rem; color: var(--muted); font-size: .95rem; }
.host input[type=text], .login input {
  display: block;
  width: 100%;
  margin-top: .2rem;
  padding: .4rem .5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .5rem; }
.check { display: flex !important; gap: .4rem; align-items: center; color: var(--text) !important; margin: 0 !important; }

button {
  padding: .4rem .9rem;
  background: var(--green-dim);
  border: 1px solid var(--green);
  border-radius: 4px;
  cursor: pointer;
}
button:hover { background: var(--green); }
button:disabled { opacity: .5; cursor: wait; }
button.quiet { background: transparent; border-color: var(--line); }
button.quiet:hover { border-color: var(--muted); }
.hostmsg { margin: .6rem 0 0; min-height: 1.2em; font-size: .95rem; }
.hostmsg.bad { color: var(--danger); }
.hostmsg.warn { color: var(--brown); }

.chat {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  min-height: 0;
  background: var(--panel);
}
.messages {
  list-style: none;
  margin: 0;
  padding: .6rem .8rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.messages li { margin: 0 0 .35rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.messages .when { color: var(--muted); font-size: .8rem; margin-right: .35rem; }
.messages .who { color: var(--green); margin-right: .35rem; }
.messages .who.host { color: var(--brown); }
.messages .who.host::after { content: " ★"; font-size: .8em; }
.messages .sys { color: var(--muted); font-style: italic; font-size: .92rem; }
.messages .del {
  float: right;
  padding: 0 .35rem;
  background: none;
  border: none;
  color: var(--muted);
  visibility: hidden;
}
.messages li:hover .del { visibility: visible; }
.messages .del:hover { color: var(--danger); }

.chatform { border-top: 1px solid var(--line); padding: .6rem .8rem .8rem; }
.chatform input {
  padding: .4rem .5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.chatform .name { width: 100%; margin-bottom: .4rem; font-size: .9rem; }
.say { display: flex; gap: .4rem; }
.say input { flex: 1; min-width: 0; }

@media (max-width: 800px) {
  html, body { height: auto; }
  .layout { display: block; height: auto; }
  .stage { padding: 0; }
  .screen { border-left: 0; border-right: 0; max-height: none; }
  .status, .host, .login { margin-left: .8rem; margin-right: .8rem; }
  .chat { border-left: 0; border-top: 1px solid var(--line); height: 60vh; }
}
