/* Chatline 1980 Tribute in the browser: the look of the apps, a navy terminal with gold text and scanlines. */

:root {
  --navy-top: #0b1338;
  --navy-bottom: #16246f;
  --panel: rgba(5, 10, 35, 0.62);
  --window: #0a1240;
  --field: #050a23;
  --frame: #4f5fe0;
  --gold: #e8c14a;
  --text: #c9cfe6;
  --bright: #ffffff;
  --dim: #8a93c0;
  --alert: #ff7a7a;
  --ok: #6ee7a0;
  --link: #9aa6ff;
  --dark: #0a0a0a;
  color-scheme: dark;
}

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

html, body { margin: 0; min-height: 100%; }

body {
  min-height: 100vh;
  background: linear-gradient(var(--navy-top), var(--navy-bottom)) fixed;
  color: var(--text);
  font-family: Consolas, "Lucida Console", "Courier New", monospace;
  font-size: 16px;
  line-height: 1.45;
}

/* The scanlines of the apps, over everything but never in the way of the mouse. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.14) 0 1px, transparent 1px 4px);
}

a { color: var(--link); }
p { margin: 0 0 10px; }
h2 { color: var(--gold); font-size: 20px; margin: 0 0 12px; letter-spacing: 1px; }
h3 { color: var(--gold); font-size: 15px; margin: 18px 0 6px; letter-spacing: 1px; }

.frame { border: 3px double var(--frame); background: var(--panel); }
.gold { color: var(--gold); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.alert { color: var(--alert); }
/* Turnstile: the widget is 65px high; the place is kept while it loads. */
.human { min-height: 65px; margin: 4px 0 10px; }
.ok { color: var(--ok); }
.big { font-size: 22px; color: var(--bright); margin: 4px 0 12px; overflow-wrap: anywhere; }
.big-text { font-size: 19px; color: var(--bright); }
.center { text-align: center; }

.logo {
  color: var(--gold);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: bold;
  line-height: 1.1;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(232, 193, 74, 0.45);
  margin-bottom: 16px;
}
.logo.small { font-size: 20px; margin-bottom: 0; }

.user .name { font-weight: bold; }

/* Buttons: brackets around the label when selected, like "[ YES ]" in the apps. */
.button {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: transparent;
  border: 2px solid var(--frame);
  padding: 8px 14px;
  cursor: pointer;
  letter-spacing: 1px;
}
.button::before { content: "[ "; opacity: 0; }
.button::after { content: " ]"; opacity: 0; }
.button.primary { border-color: var(--gold); color: var(--gold); }
.button.danger { border-color: var(--alert); color: var(--alert); }
/* Selected: dark text on gold. After the colors above, so it wins over them. */
.button:hover:not(:disabled), .button:focus-visible {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--dark);
  outline: none;
}
.button:hover:not(:disabled)::before, .button:hover:not(:disabled)::after,
.button:focus-visible::before, .button:focus-visible::after { opacity: 1; }
.button.danger:hover:not(:disabled), .button.danger:focus-visible { background: var(--alert); border-color: var(--alert); color: var(--dark); }
.button:disabled { opacity: 0.45; cursor: default; }
.button.wide { display: block; width: 100%; margin-top: 8px; }

.link {
  font: inherit;
  color: var(--link);
  background: none;
  border: none;
  padding: 6px;
  text-decoration: underline;
  cursor: pointer;
}
.link:disabled { opacity: 0.5; cursor: default; }

input, textarea {
  display: block;
  width: 100%;
  margin: 6px 0 4px;
  padding: 8px 10px;
  font: inherit;
  font-size: 17px;
  color: var(--bright);
  background: var(--field);
  border: 2px solid var(--frame);
}
input:focus, textarea:focus { outline: none; border-color: var(--gold); }
textarea { resize: vertical; min-height: 110px; }
input[type="checkbox"] { display: inline-block; width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--gold); }
label { display: block; margin-top: 10px; }

/* First visit and login */

.single { max-width: 780px; margin: 24px auto; padding: 0 16px; }
.box { padding: 22px 24px; }
.rules { padding-left: 20px; }
.rules li { margin-bottom: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 8px; }

.login {
  max-width: 1100px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 16px;
  display: grid;
  grid-template-columns: 1fr minmax(0, 520px);
  gap: 40px;
  align-items: center;
}
.lead { font-size: 19px; color: var(--bright); }
.server { margin-top: 24px; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: #c0392b; vertical-align: -1px; }
.dot.on { background: #2ecc71; }
.links { font-size: 14px; }

/* The room */

.room {
  height: 100vh;
  padding: 14px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}
.side { padding: 14px; display: flex; flex-direction: column; gap: 16px; overflow: auto; }
.you-label { font-size: 17px; overflow-wrap: anywhere; }
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu-item {
  font: inherit;
  font-size: 18px;
  text-align: left;
  color: var(--text);
  background: none;
  border: 2px solid transparent;
  padding: 8px 10px;
  cursor: pointer;
  letter-spacing: 1px;
}
.menu-item::before { content: "  "; white-space: pre; }
.menu-item.current { color: var(--gold); }
.menu-item.current::before { content: "> "; }
.menu-item:hover, .menu-item:focus-visible { background: var(--gold); color: var(--dark); outline: none; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }

.panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--frame); flex-wrap: wrap; }
.count { color: var(--gold); }
.spacer { flex: 1; }
.search { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--frame); }
.search input { margin: 0; }

.list { list-style: none; margin: 0; padding: 6px 0; overflow: auto; flex: 1; }
.list .empty { padding: 12px; }
.row {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 12px;
  font: inherit;
  font-size: 18px;
  text-align: left;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
}
.row:hover, .row:focus-visible { background: rgba(232, 193, 74, 0.16); outline: 2px solid var(--gold); outline-offset: -2px; }
.row .user { overflow-wrap: anywhere; }
.num { color: var(--dim); flex: none; }
.tag { font-size: 12px; border: 1px solid var(--dim); color: var(--dim); padding: 0 4px; flex: none; }
.you-tag { color: var(--gold); border-color: var(--gold); }

.profile { padding: 16px 18px; overflow: auto; }
.inner { padding: 12px 14px; margin: 14px 0; max-width: 640px; }

.msgbar {
  grid-column: 1 / -1;
  padding: 8px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Windows */

#overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 12, 0.62);
}
.window {
  width: min(600px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 20px 22px;
  background: var(--window);
}
.buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.options { display: flex; flex-direction: column; gap: 2px; }
.options .button.wide { margin-top: 6px; }
.scroll { max-height: 50vh; overflow: auto; padding-right: 4px; }
.messages { max-height: 30vh; overflow: auto; padding: 10px 12px; margin: 6px 0 10px; background: var(--field); }
.message { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--bright); padding-bottom: 8px; border-bottom: 1px dashed var(--frame); }
.message:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.reply { padding: 10px 12px; }
.editor-foot { display: flex; justify-content: space-between; gap: 10px; }

/* Narrow screens: one column, the menu on top. */
@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; gap: 20px; align-items: start; }
  .room { height: auto; min-height: 100vh; grid-template-columns: 1fr; grid-template-rows: auto minmax(60vh, 1fr) auto; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .menu { flex-direction: row; flex-wrap: wrap; }
  .menu-item { font-size: 16px; padding: 6px 8px; }
  .side-foot { margin-top: 0; flex-direction: row; gap: 12px; }
  .msgbar { white-space: normal; }
}
