:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #101010;
  --panel-2: #151515;
  --text: #eeeeee;
  --muted: #999999;
  --edge: #2a2a2a;
  --red: #ff2d2d;
  --red-soft: rgba(255, 45, 45, 0.16);
  --gold: #c8a44d;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at top, #1a1a1a 0, var(--bg) 46%),
    linear-gradient(180deg, #090909 0%, #050505 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(100%, 1480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr);
  gap: 18px;
  align-items: stretch;
}

.stream-panel,
.chat-panel {
  width: 100%;
  min-height: calc(100vh - 36px);
  background: linear-gradient(180deg, var(--panel-2), #0b0b0b);
  border: 1px solid var(--edge);
  border-radius: 8px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.66);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.stream-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.brand,
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--edge);
}

h1 {
  margin: 0;
  font-size: clamp(24px, 5vw, 42px);
  line-height: 1;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

p {
  margin: 0;
}

.brand p,
.topbar p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.3px;
}

.status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-top: 5px;
}

.stream-status {
  padding-top: 8px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px rgba(255, 45, 45, 0.75);
}

.player-shell {
  align-self: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.9);
}

iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000000;
}

.messages {
  min-height: 280px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-color: #444 #111;
}

.empty {
  margin: auto;
  color: var(--muted);
  text-align: center;
}

.message {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 8px;
  padding: 10px;
}

.message-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
}

.name {
  color: #ffffff;
  font-weight: 700;
}

.time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.text {
  color: #dddddd;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.delete {
  margin-top: 8px;
  border: 1px solid rgba(255, 45, 45, 0.45);
  background: var(--red-soft);
  color: #ffffff;
  border-radius: 6px;
  padding: 7px 9px;
  cursor: pointer;
}

.composer {
  border-top: 1px solid var(--edge);
  padding: 12px;
  background: rgba(0, 0, 0, 0.24);
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

label strong {
  float: right;
  color: #777777;
  font-weight: 400;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: #080808;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 66px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(255, 45, 45, 0.66);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.actions {
  display: flex;
  gap: 8px;
}

button {
  border: 1px solid var(--edge);
  background: #202020;
  color: var(--text);
  border-radius: 6px;
  padding: 11px 14px;
  min-height: 42px;
  cursor: pointer;
}

#sendButton {
  flex: 1 1 auto;
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#adminButton {
  flex: 0 0 auto;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.feedback {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--gold);
  font-size: 13px;
}

.admin-feedback {
  min-height: 18px;
  margin-top: 12px;
  color: var(--gold);
  font-size: 13px;
}

dialog {
  width: min(92vw, 420px);
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: #101010;
  color: var(--text);
  padding: 0;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.admin-form {
  padding: 18px;
}

.admin-form h2 {
  margin: 0 0 16px;
}

menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
}

@media (max-width: 720px) {
  .shell {
    padding: 0;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .stream-panel {
    min-height: auto;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .chat-panel {
    min-height: 52vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .brand {
    padding: 14px;
  }

  .player-shell {
    align-self: start;
  }

  .topbar {
    padding: 12px;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .actions {
    grid-template-columns: 1fr auto;
  }
}
