:root {
  color-scheme: dark;
  --bg: #14110e;
  --panel: #221c17;
  --ink: #f6efe6;
  --muted: #cbbbaa;
  --line: #3a3129;
  --accent: #e07a4c;
  --accent-ink: #2a1208;
  --danger: #ffb4a8;
  font-family: "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 10% -10%, #3a2418 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
}

main { min-height: 100vh; }

.panel {
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0;
}

.call {
  display: grid;
  grid-template-columns: 1fr 320px;
  min-height: 100vh;
}

.brand {
  margin: 0 0 28px;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2 { font-weight: 560; letter-spacing: -0.03em; margin: 0 0 12px; }
h1 { font-size: 2.4rem; }
p { color: var(--muted); line-height: 1.5; }

.note { font-size: 0.92rem; }

.rules {
  margin: 18px 0;
  padding: 0 0 0 18px;
  color: var(--muted);
}

.rules li { margin: 0 0 8px; }

#ban-list { list-style: none; padding: 0; }
#ban-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#ban-list button { padding: 6px 12px; }

fieldset {
  margin: 20px 0;
  padding: 12px 14px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

legend { padding: 0 6px; color: var(--ink); }

label { display: block; margin: 0 0 10px; }

.check { margin: 8px 0 16px; }

input[type="text"], textarea {
  width: 100%;
  margin: 6px 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #120e0b;
  color: var(--ink);
  font: inherit;
}

textarea { min-height: 76px; resize: vertical; }

#account-bar { margin: 18px 0; }

#account-line { color: var(--ink); margin: 0 0 8px; }

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

button.block { width: 100%; }

.pitch {
  margin: 18px 0;
  padding: 16px 16px 12px;
  border: 1px solid #e7a07a;
  border-radius: 18px;
  background:
    radial-gradient(140% 90% at 100% 0%, rgba(224, 122, 76, 0.45), transparent 58%),
    linear-gradient(165deg, #4a2a1c, #1c120e 70%);
  box-shadow: 0 0 0 1px rgba(224, 122, 76, 0.28), 0 16px 36px rgba(0, 0, 0, 0.28);
}

.pitch-title {
  margin: 0 0 10px;
  color: #fff7f2;
  font-size: 1.45rem;
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.pitch ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pitch li {
  margin: 0 0 6px;
  color: #fff7f2;
}

.pitch li::before {
  content: "— ";
  color: #ffb088;
}

.ad-slot {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  width: 300px;
  height: 250px;
  overflow: hidden;
  flex: 0 0 auto;
  align-self: center;
}

.ad-slot ins { display: block; width: 300px; height: 250px; }

details {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
}

summary { cursor: pointer; color: var(--ink); }

.warning { color: var(--danger); }

.stage {
  position: relative;
  background: #000;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

#remote, #local {
  background: #000;
  object-fit: contain;
}

#remote {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#local {
  position: absolute;
  width: 180px;
  height: 120px;
  right: 16px;
  bottom: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  z-index: 3;
  cursor: pointer;
}

#local.mirrored { transform: scaleX(-1); }

.call.self-large #local {
  inset: 0;
  width: 100%;
  height: 100%;
  right: auto;
  bottom: auto;
  border: 0;
  border-radius: 0;
  z-index: 1;
  cursor: default;
}

.call.self-large #remote {
  inset: auto 16px 16px auto;
  width: 180px;
  height: 120px;
  border-radius: 12px;
  border: 1px solid var(--line);
  z-index: 3;
  cursor: pointer;
}

.identity {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  max-width: calc(100% - 140px);
}

.identity p { margin: 0; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }

#partner-label { font-size: 0.95rem; }

.status {
  position: absolute;
  left: 16px;
  top: 76px;
  z-index: 2;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--ink);
}

.stage-actions {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 2;
}

.stage-actions button {
  background: rgba(20, 17, 14, 0.82);
  color: var(--ink);
  border: 1px solid var(--line);
}

.stage-actions button.icon {
  width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
}

.stage-actions svg { width: 24px; height: 24px; display: block; }

.icon .icon-off { display: none; }
.icon[aria-pressed="true"] .icon-on { display: none; }
.icon[aria-pressed="true"] .icon-off { display: block; }

#chat-form { display: flex; gap: 8px; align-items: center; }
#chat-form input { margin: 0; }
#chat-form button { flex: 0 0 auto; }

.partner-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 12px;
  color: var(--ink);
  font-size: 1.05rem;
}

.partner-name img { border-radius: 2px; display: block; }

.side {
  padding: 24px 20px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.messages {
  flex: 1;
  overflow: auto;
  margin: 8px 0 12px;
  padding-right: 4px;
}

.bubble {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #2c241e;
  color: var(--ink);
}

.bubble.mine { background: #4a2b1e; }

.bubble.intro { border: 1px dashed var(--line); }

.kicker, .translation {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.kicker { margin-bottom: 2px; letter-spacing: 0.08em; text-transform: uppercase; }

.translation { margin-top: 4px; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@media (max-width: 800px) {
  h1 { font-size: 2rem; }

  html.call-open,
  html.call-open body {
    position: fixed;
    inset: 0;
    width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: #000;
  }

  html.call-open main {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .call {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .stage { min-height: 100%; height: 100%; }

  .side {
    position: absolute;
    inset: 0;
    z-index: 4;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    pointer-events: none;
    justify-content: flex-end;
  }

  .messages,
  #chat-form,
  .side .actions,
  .ad-slot,
  #call-error { pointer-events: auto; }

  .messages {
    flex: 0 1 auto;
    max-height: 34dvh;
    margin: 0 124px 8px 12px;
    padding: 0;
  }

  .bubble { background: rgba(20, 17, 14, 0.45); }
  .bubble.mine { background: rgba(74, 43, 30, 0.55); }

  #chat-form { margin: 0 12px 8px; }

  #chat-input {
    background: rgba(0, 0, 0, 0.35);
    border-color: transparent;
  }

  .side .actions {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
  }

  .side .actions button { padding: 8px 12px; }

  #call-error { margin: 0 12px 8px; }

  .ad-slot {
    margin: 0;
    width: 100%;
    height: 250px;
    align-self: stretch;
    display: flex;
    justify-content: center;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: content-box;
  }

  #local {
    width: 104px;
    height: 146px;
    right: 10px;
    bottom: calc(310px + env(safe-area-inset-bottom));
    z-index: 5;
  }

  .call:has(#ad-slot[hidden]) #local {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .call.self-large #local {
    inset: 0;
    width: 100%;
    height: 100%;
    right: auto;
    bottom: auto;
  }

  .call.self-large #remote {
    width: 104px;
    height: 146px;
    right: 10px;
    bottom: calc(310px + env(safe-area-inset-bottom));
    left: auto;
    top: auto;
  }

  .call.self-large:has(#ad-slot[hidden]) #remote {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .stage-actions {
    top: 42%;
    bottom: auto;
    left: 12px;
    z-index: 6;
    flex-direction: column;
  }
}
