/* -----------------------------------------------------------------------------
   Author:       Todor Belchev
   Description:  Hall picker (halls.html): two large hall cards on a dark page, phone first, side by side
                 from 720px; one of four languages at a time, crossfading in auto mode. CONNEXUS brand logo,
                 font (Science Gothic) and colours.
   ----------------------------------------------------------------------------- */

:root {
  --bg: #030a11;
  --fg: #f4f8fa;
  --muted: #a3b3bf;
  --accent: #00cdff;      /* brand teal */
  --tile: #0a1a26;
  --tile-hover: #0e2433;
  --tile-line: #1d3a4e;
  --note: #ffd479;
  --note-bg: rgba(245, 170, 30, 0.12);
  --note-line: rgba(245, 170, 30, 0.55);
  color-scheme: dark;
}

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

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Science Gothic", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "locl" 0;  /* lang="bg" switches on Bulgarian letterforms; keep standard Cyrillic */
  -webkit-text-size-adjust: 100%;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: max(72px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px));
  text-align: center;
}

/* --- one language at a time (all four share one grid cell: switching never moves the layout) --- */
.bi { display: inline-grid; }
h1.bi, p.bi, span.bi { display: grid; }
.bi > * { grid-area: 1 / 1; transition: opacity 0.55s ease, visibility 0s linear 0.55s; }
html:not([data-lang="bg"]) .bi > [lang="bg"],
html:not([data-lang="en"]) .bi > [lang="en"],
html:not([data-lang="tr"]) .bi > [lang="tr"],
html:not([data-lang="ro"]) .bi > [lang="ro"] { opacity: 0; visibility: hidden; }
html[data-lang="bg"] .bi > [lang="bg"],
html[data-lang="en"] .bi > [lang="en"],
html[data-lang="tr"] .bi > [lang="tr"],
html[data-lang="ro"] .bi > [lang="ro"] { transition: opacity 0.65s ease 0.45s, visibility 0s linear 0.45s; }
@media (prefers-reduced-motion: reduce) { .bi > * { transition: none !important; } }

/* --- header --- */
.head { display: grid; justify-items: center; gap: 8px; }
.brand { margin: 0 0 6px; font-size: 22px; font-weight: 600; white-space: nowrap; }
.brand .year { color: var(--accent); }
/* CONNEXUS logo: its letters are 67 % of the image height, so 1.05em matches the cap height of the text */
.cx-logo { display: inline-block; height: 1.05em; width: auto; vertical-align: -0.17em; }
h1 { margin: 0; font-size: clamp(28px, 7.6vw, 56px); font-weight: 600; line-height: 1.12; }
.sub { margin: 0; font-size: clamp(15px, 4vw, 22px); font-weight: 500; color: var(--muted); }

/* --- hall cards --- */
.halls {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.halls[aria-busy="true"] { min-height: 196px; }
.hall {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 96px;
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--tile);
  border: 2px solid var(--tile-line);
  color: var(--fg);
  text-decoration: none;
  text-align: left;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.hall:hover { background: var(--tile-hover); border-color: var(--accent); }
.hall:active { transform: scale(0.985); }
.hall:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.hall-icon {
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(0, 205, 255, 0.12);
  color: var(--accent);
}
.hall-name { flex: 1 1 auto; min-width: 0; font-size: clamp(21px, 5.8vw, 28px); font-weight: 600; line-height: 1.15; }
.hall-name > * { align-self: center; }   /* a one-line name in a cell sized by a two-line one */
.hall-go { flex: none; width: 30px; height: 30px; color: var(--muted); }
.hall svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hall-icon svg { width: 60%; height: 60%; }

.error { margin: 0; font-size: 16px; font-weight: 500; color: var(--note); }

.reminder {
  margin: 0;
  max-width: 980px;
  padding: 10px 18px;
  border-radius: 18px;
  background: var(--note-bg);
  border: 1px solid var(--note-line);
  color: var(--note);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
}
.reminder > [lang] { display: flex; align-items: center; justify-content: center; gap: 10px; }
.reminder svg { flex: none; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* --- БГ | EN | TR | RO | auto switch --- */
.lang-switch {
  position: fixed;
  z-index: 2;
  top: max(14px, env(safe-area-inset-top, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(3, 10, 17, 0.8);
  border: 1px solid var(--tile-line);
}
.lang-switch button {
  min-width: 40px;
  height: 34px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-feature-settings: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--tile); color: var(--fg); box-shadow: inset 0 0 0 1px var(--tile-line); }
.lang-switch svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- wide screens (a lobby display, a laptop): the two halls side by side --- */
@media (min-width: 720px) {
  .page { gap: 40px; }
  .brand { font-size: 28px; }
  .halls { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .halls[data-count="1"] { grid-template-columns: minmax(0, 480px); justify-content: center; }
  /* icon on top, the name centred in the middle, the arrow at the bottom: aligned across both cards */
  .hall { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 20px; min-height: 260px; padding: 32px 28px; text-align: center; border-radius: 28px; }
  .hall-icon { width: 84px; height: 84px; border-radius: 22px; }
  .hall-name { flex: none; font-size: clamp(28px, 3vw, 42px); }
  .hall-go { width: 36px; height: 36px; }
  .reminder { font-size: 18px; padding: 12px 24px; border-radius: 999px; }
}
