/* public.opikula.dev: CMD / CRT vzhled. Barvy jsou z palety konzole Windows. */
:root {
  --bg: #0C0C0C;
  --fg: #CCCCCC;
  --fg-strong: #F2F2F2;
  --muted: #9A9A9A;
  --line: #3A3A3A;
  --line-soft: #2A2A2A;
  --link: #61D6D6;
  --ok: #16C60C;
  --admin: #F9F1A5;
  --err: #E74856;
  --thumb: #767676;
  --mono: Consolas, 'IBM Plex Mono', monospace;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  color: var(--fg);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.55;
  text-shadow: 0 0 2px rgba(204, 204, 204, 0.2);
  -webkit-font-smoothing: antialiased;
}

/* Scanlines a viněta přes celou stránku. Neblokují kliky. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 1px, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, 0) 3px);
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.65);
}

a {
  color: var(--link);
}

a:hover {
  color: var(--admin);
}

:focus-visible {
  outline: 1px solid var(--admin);
  outline-offset: 2px;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

h1 {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 600;
  color: var(--fg-strong);
}

h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-strong);
}

/* Vlastní scrollbary (Firefox i Chromium) */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--thumb) var(--bg);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--thumb);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.muted {
  color: var(--muted);
}

.error {
  min-height: 1.55em;
  margin: 8px 0 0;
  color: var(--err);
}

.tag-admin {
  color: var(--admin);
}

.tag-mod {
  color: var(--ok);
}

.tag-err {
  color: var(--err);
}

/* Tlačítka: text v hranatých závorkách */
.btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}

.btn:hover {
  color: var(--admin);
}

.btn-box {
  background: transparent;
  border: 1px solid var(--fg);
  padding: 6px 16px;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}

.btn-box:hover {
  border-color: var(--admin);
  color: var(--admin);
}

.btn:disabled,
.btn-box:disabled {
  color: var(--muted);
  border-color: var(--muted);
  cursor: default;
}

/* Vstupy: jen spodní linka, žádný rámeček */
input[type="text"],
input[type="password"] {
  min-width: 0;
  padding: 4px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--muted);
  border-radius: 0;
  color: var(--fg);
  font: inherit;
  caret-color: var(--fg);
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-bottom-color: var(--admin);
}

input::placeholder {
  color: var(--muted);
  opacity: 1;
}

/* Checkbox: skrytý nativní vstup, viditelné je [ ] nebo [X] z ::before */
.check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.check input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.check span::before {
  content: "[ ] ";
}

.check input[type="checkbox"]:checked + span::before {
  content: "[X] ";
}

.check input[type="checkbox"]:focus-visible + span {
  outline: 1px solid var(--admin);
  outline-offset: 2px;
}

.check input[type="checkbox"]:disabled + span {
  color: var(--muted);
  cursor: default;
}

/* Chat */
.term {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.term-top {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
  overflow-wrap: anywhere;
}

.yt {
  color: var(--link);
  text-decoration: underline;
}

.term-bottom {
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
}

.cooldown {
  min-height: 1.55em;
  color: var(--muted);
  white-space: pre;
}

.composer {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-top: 6px;
}

.prompt {
  white-space: nowrap;
}

.send {
  flex: none;
  font-size: 14px;
  color: var(--muted);
}

#nick-input {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--fg);
}

#nick-input::placeholder {
  color: var(--muted);
}

#nick-input:disabled {
  color: var(--fg);
  cursor: default;
}

#chat-input {
  flex: 1;
  min-width: 0;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px solid var(--muted);
  border-radius: 0;
}

#chat-input:focus {
  border-bottom-color: var(--admin);
}

/* Pravidla */
.doc {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.doc h1 {
  margin: 28px 0 8px;
  font-size: 22px;
}

.doc .intro {
  margin: 0 0 28px;
  color: var(--muted);
}

.doc section {
  margin-bottom: 24px;
}

.doc h2 {
  font-size: 16px;
}

.doc section p {
  margin: 4px 0 0;
}

.doc .foot {
  margin: 32px 0 0;
  color: var(--muted);
}

/* Přihlášení a pozvánka */
.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}

.window {
  width: 100%;
  max-width: 560px;
  padding: 28px 24px;
  border: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 14px 16px;
  align-items: center;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: 20px;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.section-title {
  margin: 28px 0 14px;
  color: var(--fg-strong);
}

.info {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 8px 16px;
  margin: 16px 0 0;
}

.info dt {
  color: var(--muted);
}

.info dd {
  margin: 0;
}

/* Admin */
.admin-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.admin-status {
  margin-right: auto;
}

.admin-body {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 32px;
  padding: 20px 24px;
}

.admin-main {
  flex: 999 1 560px;
  min-width: 0;
}

.admin-side {
  flex: 1 1 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.admin-body h2 {
  margin-bottom: 12px;
}

.msg-list {
  max-height: 240px;
  overflow-y: auto;
  border-top: 1px solid var(--line-soft);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}

.row .text {
  flex: 1 1 200px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.row .actions {
  margin-top: 0;
}

.user {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}

.invite-result {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
}

.invite-result .link {
  color: var(--fg-strong);
  overflow-wrap: anywhere;
}

/* Telefon */
@media (max-width: 600px) {
  body {
    font-size: 15px;
  }

  .term-top {
    padding: 10px 12px;
  }

  .log {
    padding: 10px 12px;
  }

  .term-bottom {
    padding: 8px 12px 10px;
  }

  #chat-input {
    font-size: 16px;
  }

  .window {
    padding: 22px 16px;
  }

  .form-grid,
  .info {
    grid-template-columns: 1fr;
  }

  .admin-top,
  .admin-body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .doc {
    padding: 24px 16px 40px;
  }
}
