/* augh yahh! -- house style: dark ground, neon glow, phone first.
   Tokens copied from businesses/mndz-automation/artifacts/house-style.css
   Single theme on purpose. Every colour painted explicitly. */

:root {
  --void:    #05070C;
  --panel:   #0A0F17;
  --panel-2: #0D1420;
  --line:    #1B2637;

  --cyan:   #21E6FF;   /* the work, normal steps */
  --violet: #9D6BFF;   /* design and build */
  --amber:  #FF9A3C;   /* a gate, anything irreversible, warnings */
  --green:  #3BFF9E;   /* done, proven */
  --pink:   #FF3DA6;   /* zero, broken */
  --lime:   #C6FF3D;   /* the lobbies: open to anyone */

  --text:   #DCE8F5;
  --text-2: #8C9FB8;
  --text-3: #5A6B82;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

/* Hold the page still: no double-tap zoom, no rubber-banding past the edges,
   and no sideways drift. Pinching is turned away in fixed.js, because Safari
   ignores the viewport tag that asks it not to. */
html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}

html { background: var(--void); }

body {
  margin: 0;
  overscroll-behavior: none;
  overflow-x: hidden;
  background:
    radial-gradient(120% 55% at 50% -8%, rgba(33,230,255,.11), transparent 60%),
    radial-gradient(90% 45% at 95% 40%, rgba(157,107,255,.07), transparent 65%),
    var(--void);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---- the mark ---- */
.mark {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1;
  margin: 0;
  color: #F2FAFF;
  text-shadow: 0 0 20px rgba(33,230,255,.5);
}
.mark i { font-style: normal; color: var(--cyan); text-shadow: 0 0 18px rgba(33,230,255,.85); }

/* ---- a middle-of-the-screen card ---- */
.stage {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.05rem 2rem;
}

.card {
  width: 100%;
  max-width: 26rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.kick {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0;
}

h1.big {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.025em;
  color: #F2FAFF;
  margin: 0;
  text-wrap: balance;
}

p.sub { margin: 0; font-size: .92rem; color: var(--text-2); }

/* ---- buttons ---- */
.btn {
  display: block;
  width: 100%;
  padding: .85rem 1rem;
  border-radius: 6px;
  text-align: center;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(33,230,255,.55);
  color: #04121A;
  background: linear-gradient(180deg, #3BF0FF, #12C4E0);
  box-shadow: 0 0 20px -4px rgba(33,230,255,.75);
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }

.btn.ghost {
  background: transparent;
  color: var(--cyan);
  border-color: rgba(33,230,255,.4);
  box-shadow: none;
  font-weight: 500;
}
.btn.ghost:hover { background: rgba(33,230,255,.07); filter: none; }

.btn.done {
  background: linear-gradient(180deg, #6BFFC0, #23D98A);
  border-color: rgba(59,255,158,.6);
  box-shadow: 0 0 20px -4px rgba(59,255,158,.75);
}

/* ---- the link box ---- */
.linkbox {
  width: 100%;
  border: 1px solid rgba(59,255,158,.4);
  border-radius: 6px;
  background: rgba(59,255,158,.05);
  box-shadow: 0 0 18px -6px rgba(59,255,158,.5);
  padding: .75rem .8rem;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--green);
  text-shadow: 0 0 10px rgba(59,255,158,.4);
  word-break: break-all;
  text-align: left;
}

/* ---- name field ---- */
.field {
  width: 100%;
  border: 1px solid rgba(33,230,255,.35);
  border-radius: 6px;
  background: rgba(33,230,255,.04);
  padding: .75rem .8rem;
  font-family: var(--mono);
  /* Never below 16px. Safari on the iPhone zooms the whole page in the moment
     you tap a smaller box, and does not zoom back out afterwards. That was
     the "zooming on the phone" Martin saw, 2026-08-18. */
  font-size: 16px;
  color: var(--text);
  text-align: left;
}
.field::placeholder { color: var(--text-3); }
.field:focus { outline: 2px solid rgba(33,230,255,.5); outline-offset: 1px; }

/* ---- your own camera, before you go in ---- */
.preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, #132030, #0A121C);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview .placeholder { font-family: var(--mono); font-size: .72rem; color: var(--text-3); padding: 1rem; }

.note {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .04em;
  color: var(--text-3);
  margin: 0;
}
.note a { color: var(--text-3); }

/* an amber line: something you should read before you press on */
.warn {
  font-family: var(--mono);
  font-size: .72rem;
  line-height: 1.6;
  color: var(--amber);
  text-shadow: 0 0 12px rgba(255,154,60,.35);
  margin: 0;
  text-align: left;
  border: 1px solid rgba(255,154,60,.35);
  border-radius: 6px;
  background: rgba(255,154,60,.05);
  padding: .6rem .7rem;
}

.bad {
  font-family: var(--mono);
  font-size: .72rem;
  line-height: 1.6;
  color: var(--pink);
  text-shadow: 0 0 12px rgba(255,61,166,.4);
  margin: 0;
  text-align: left;
  border: 1px solid rgba(255,61,166,.4);
  border-radius: 6px;
  background: rgba(255,61,166,.05);
  padding: .6rem .7rem;
}

.hidden { display: none !important; }

/* ============================ in the room ============================ */

.room {
  height: 100dvh;
  height: calc(100dvh - 3.1rem - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  padding: .7rem;
  gap: .55rem;
}

.roomtop {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--line);
}
.roomtop .cnt { color: var(--cyan); text-shadow: 0 0 10px rgba(33,230,255,.5); }
.roomtop button {
  font: inherit;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--green);
  text-shadow: 0 0 10px rgba(59,255,158,.5);
  background: none;
  border: 1px solid rgba(59,255,158,.35);
  border-radius: 5px;
  padding: .3rem .55rem;
  cursor: pointer;
}
.roomtop button:hover { background: rgba(59,255,158,.08); }

.grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: .4rem;
  grid-template-columns: 1fr;
}
.grid[data-n="2"], .grid[data-n="3"], .grid[data-n="4"] { grid-template-columns: 1fr 1fr; }
.grid[data-n="5"], .grid[data-n="6"] { grid-template-columns: 1fr 1fr; }

@media (min-width: 700px) {
  .grid[data-n="3"], .grid[data-n="4"] { grid-template-columns: 1fr 1fr; }
  .grid[data-n="5"], .grid[data-n="6"] { grid-template-columns: 1fr 1fr 1fr; }
}

.tile {
  position: relative;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(150deg, #132030, #0A121C);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile.me { border-color: rgba(33,230,255,.5); box-shadow: 0 0 16px -6px rgba(33,230,255,.6); }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.me video { transform: scaleX(-1); }
.tile.camoff video { display: none; }

/* The first letter of a name, shown in place of the video when the camera
   is off. Hidden the rest of the time. */
.tile .initial {
  display: none;
  font-family: var(--mono);
  font-size: 1.6rem;
  color: var(--text-3);
}
.tile.camoff .initial { display: block; }

.tile .nm {
  position: absolute;
  left: .35rem;
  bottom: .3rem;
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-2);
  background: rgba(5,7,12,.72);
  padding: .1rem .32rem;
  border-radius: 3px;
  max-width: calc(100% - 4.5rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile .mic {
  position: absolute;
  right: .35rem;
  bottom: .3rem;
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--pink);
  text-shadow: 0 0 8px rgba(255,61,166,.6);
  background: rgba(5,7,12,.72);
  padding: .1rem .32rem;
  border-radius: 3px;
}
.tile .connecting {
  position: absolute;
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
}

.ctrls { flex: 0 0 auto; display: flex; gap: .4rem; }
.ctrl {
  flex: 1;
  padding: .7rem .3rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-2);
  text-align: center;
  background: rgba(255,255,255,.02);
  cursor: pointer;
}
.ctrl:hover { background: rgba(255,255,255,.05); }
.ctrl[aria-pressed="true"] {
  border-color: rgba(255,61,166,.5);
  color: var(--pink);
  text-shadow: 0 0 10px rgba(255,61,166,.5);
}
.ctrl.leave {
  border-color: rgba(255,154,60,.5);
  color: var(--amber);
  text-shadow: 0 0 10px rgba(255,154,60,.5);
}
.ctrl.leave:hover { background: rgba(255,154,60,.08); }

/* a line that slides in over the room: copied, someone left, connection lost */
.toast {
  position: fixed;
  left: 50%;
  bottom: 5.2rem;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .06em;
  color: var(--green);
  text-shadow: 0 0 10px rgba(59,255,158,.5);
  background: rgba(5,7,12,.94);
  border: 1px solid rgba(59,255,158,.4);
  border-radius: 6px;
  padding: .5rem .8rem;
  z-index: 20;
  max-width: calc(100vw - 2rem);
  text-align: center;
}
.toast.warnish { color: var(--amber); border-color: rgba(255,154,60,.45); text-shadow: 0 0 10px rgba(255,154,60,.5); }

/* ---- a plain page of words (privacy) ---- */
.page { max-width: 34rem; margin: 0 auto; padding: 2rem 1.05rem 4rem; }
.page h1 { font-size: 1.6rem; letter-spacing: -.025em; color: #F2FAFF; margin: .4rem 0 1rem; }
.page h2 {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-3);
  margin: 2rem 0 .6rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line);
}
.page p { color: var(--text-2); font-size: .92rem; }
.page a { color: var(--cyan); }
.page footer {
  margin-top: 2.5rem; border-top: 1px solid var(--line); padding-top: 1rem;
  font-family: var(--mono); font-size: .68rem; line-height: 1.75; color: var(--text-3);
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ======================= home: the two choices ======================= */

.choice {
  border: 1px solid rgba(33,230,255,.28);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 0 22px -8px rgba(33,230,255,.5);
  padding: .95rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  text-align: left;
}
/* The lobby is the public one, so it does not share the colour of the
   private room. Lime means "this one is open to anyone". */
.choice.lobbyish {
  border-color: rgba(198,255,61,.3);
  box-shadow: 0 0 22px -8px rgba(198,255,61,.45);
}
.choice-kick {
  margin: 0;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(33,230,255,.5);
}
.choice.lobbyish .choice-kick { color: var(--lime); text-shadow: 0 0 12px rgba(198,255,61,.5); }
.choice-sub { margin: 0; font-size: .82rem; color: var(--text-2); }

.btn.lime {
  color: var(--lime);
  border-color: rgba(198,255,61,.4);
}
.btn.lime:hover { background: rgba(198,255,61,.08); }
.btn.lime span { color: var(--text-3); letter-spacing: .04em; text-transform: none; }

/* ============================ bottom tabs ============================ */

.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  border-top: 1px solid var(--line);
  background: rgba(5,7,12,.94);
  backdrop-filter: blur(8px);
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1;
  padding: .85rem .5rem;
  text-align: center;
  text-decoration: none;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.tab.on { color: var(--cyan); text-shadow: 0 0 12px rgba(33,230,255,.6); }

/* Room the tabs need at the bottom of the page. */
body.has-nav .stage { padding-bottom: 5.5rem; }

/* ============================== the lobby ============================== */

.lobby {
  position: fixed;
  inset: 0;
  height: auto;
  max-height: 100dvh;
  bottom: calc(3.1rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  padding: .7rem .7rem .4rem;
  gap: .5rem;
}

.who {
  flex: 0 0 auto;
  max-height: 8rem;
  overflow-y: auto;
  border: 1px solid rgba(198,255,61,.28);
  border-radius: 6px;
  background: rgba(198,255,61,.04);
  padding: .5rem .6rem;
}
.who ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.who li {
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--lime);
  border: 1px solid rgba(198,255,61,.3);
  border-radius: 999px;
  padding: .12rem .5rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lines {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  margin: 0;
  padding: .2rem .1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.line { max-width: 100%; }
.line-head { display: flex; align-items: baseline; gap: .45rem; }
.line-who {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(33,230,255,.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}
.line.mine .line-who { color: var(--green); text-shadow: 0 0 10px rgba(59,255,158,.45); }
.line-when { font-family: var(--mono); font-size: .6rem; color: var(--text-3); }
.line-text {
  margin: .1rem 0 0;
  font-size: .9rem;
  color: var(--text);
  overflow-wrap: anywhere;   /* a 500-character word must not widen the page */
  white-space: pre-wrap;
}

.line.note-line {
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--text-3);
  text-align: center;
  padding: .1rem 0;
}

.say { flex: 0 0 auto; display: flex; gap: .4rem; }
.say .field { flex: 1; min-width: 0; }
.say .btn { width: auto; flex: 0 0 auto; padding: .75rem 1rem; }

.lobby-note { text-align: center; margin: .1rem 0 0; font-size: .62rem; }
.lobby-note a { color: var(--text-3); }

/* Built for a phone, but on a laptop a full-width column of chat is a lot of
   empty space with a few words floating in it. Keep it a readable column. */
@media (min-width: 46rem) {
  .lobby { max-width: 42rem; margin: 0 auto; }
  .room  { max-width: 60rem; margin: 0 auto; }
}

/* Who you are, and how long the name is yours for. */
.me-chip {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .04em;
  text-transform: none;
  color: var(--green);
  text-shadow: 0 0 10px rgba(59,255,158,.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}
.me-chip .fading { color: var(--amber); text-shadow: 0 0 10px rgba(255,154,60,.5); }

/* Logging out gives the name up, so it is amber like everything you cannot
   take back. */
.roomtop button.out {
  color: var(--amber);
  border-color: rgba(255,154,60,.4);
  text-shadow: 0 0 10px rgba(255,154,60,.5);
}
.roomtop button.out:hover { background: rgba(255,154,60,.08); }
.roomtop { gap: .4rem; }
.roomtop button { flex: 0 0 auto; }
