/* ZimaTalk — radio-hardware aesthetic
   body #1c211b olive-charcoal / panel #262c24 / amber LCD #ffb454 on #14170f / TX #ff5a3c */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --body: #1c211b;
  --panel: #262c24;
  --edge: #3a4237;
  --text: #d8ddd2;
  --muted: #8b9384;
  --amber: #ffb454;
  --lcd-bg: #14170f;
  --tx: #ff5a3c;
}

html, body { height: 100%; }
body {
  background:
    radial-gradient(120% 90% at 50% 0%, #232a21 0%, var(--body) 60%);
  color: var(--text);
  font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
  display: flex; justify-content: center;
  user-select: none;
}

.screen {
  width: 100%; max-width: 430px; min-height: 100dvh;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
}

/* ── brand ── */
.brand { display: flex; align-items: baseline; gap: 10px; padding-bottom: 4px; border-bottom: 1px solid var(--edge); }
.brand h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }
.brand-sub { font-size: 0.72rem; color: var(--muted); }
.led {
  width: 9px; height: 9px; border-radius: 50%;
  background: #555; align-self: center; flex-shrink: 0;
  box-shadow: 0 0 0 2px #00000040 inset;
  transition: background .3s, box-shadow .3s;
}
.led.on { background: #7ee06e; box-shadow: 0 0 8px #7ee06e88; }

.warn {
  background: #3a2a1a; border: 1px solid #6b4a24; color: #f0c78a;
  border-radius: 10px; padding: 10px 12px; font-size: 0.82rem; line-height: 1.7;
}

/* ── fields & buttons ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 0.78rem; color: var(--muted); }
input {
  background: var(--lcd-bg); border: 1px solid var(--edge); border-radius: 10px;
  color: var(--amber); font: inherit; padding: 11px 13px; outline: none;
}
input:focus { border-color: var(--amber); }
input::placeholder { color: #5a5f52; }

.btn {
  background: var(--panel); border: 1px solid var(--edge); border-radius: 10px;
  color: var(--text); font: inherit; font-weight: 700; padding: 12px; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn.ghost { background: none; color: var(--muted); }
.btn:focus-visible, input:focus-visible, .ptt:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.section-title { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

/* ── channel list ── */
.channels { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.channels li {
  background: var(--panel); border: 1px solid var(--edge); border-radius: 12px;
  padding: 13px 14px; display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.channels li:active { background: #2d342b; }
.chan-name { font-weight: 700; flex: 1; }
.chan-lock { font-size: 0.9rem; }
.chan-online { font-size: 0.75rem; color: var(--muted); }
.channels .empty { color: var(--muted); cursor: default; justify-content: center; font-size: 0.85rem; }

.create summary { cursor: pointer; color: var(--amber); font-size: 0.9rem; padding: 6px 0; }
.create[open] { display: flex; flex-direction: column; gap: 12px; }

/* ── LCD ── */
.lcd {
  background: var(--lcd-bg);
  border: 1px solid var(--edge); border-radius: 12px;
  box-shadow: inset 0 2px 10px #000000aa;
  padding: 12px 14px;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  display: flex; flex-direction: column; gap: 6px;
}
.lcd-row { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.lcd-status { font-size: 0.8rem; font-weight: 400; color: #d99b45; min-height: 1.4em; }
.lcd-status.rx { color: #7ee06e; }
.lcd-status.tx { color: var(--tx); }

/* ── members ── */
.members { list-style: none; display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; }
.members li {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 10px;
  padding: 9px 12px; font-size: 0.9rem;
}
.members .dot { width: 8px; height: 8px; border-radius: 50%; background: #566052; flex-shrink: 0; }
.members li.talking .dot { background: #7ee06e; box-shadow: 0 0 7px #7ee06e; animation: pulse 1s infinite; }
.members li.talking { border-color: #4a6b42; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* ── PTT: the signature element ── */
.ptt-zone { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; }
.ptt {
  position: relative; width: 168px; height: 168px; border-radius: 50%;
  border: 1px solid #4a5245;
  background:
    radial-gradient(circle at 50% 34%, #39412f 0%, #262c24 55%, #171b16 100%);
  box-shadow:
    0 10px 24px #000000cc,
    inset 0 2px 2px #ffffff14,
    inset 0 -8px 18px #00000090;
  color: var(--text); font: inherit; font-size: 1.15rem; font-weight: 800;
  cursor: pointer; touch-action: none;
  transition: box-shadow .15s, transform .08s;
}
.ptt-ring {
  position: absolute; inset: 12px; border-radius: 50%;
  border: 2px dashed #4a5245; pointer-events: none;
  transition: border-color .15s;
}
.ptt.tx {
  transform: scale(0.97);
  background: radial-gradient(circle at 50% 34%, #6b2418 0%, #3d130c 60%, #240a06 100%);
  border-color: var(--tx);
  box-shadow: 0 0 34px #ff5a3c66, inset 0 -6px 14px #00000090;
  color: #ffd9d0;
}
.ptt.tx .ptt-ring { border-color: var(--tx); animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ptt-hint { font-size: 0.72rem; color: var(--muted); text-align: center; line-height: 1.8; }

/* ── toast ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #0f120e; border: 1px solid var(--edge); color: var(--amber);
  border-radius: 10px; padding: 10px 16px; font-size: 0.85rem;
  box-shadow: 0 6px 20px #000c; z-index: 10; max-width: 90vw; text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .ptt.tx .ptt-ring, .members li.talking .dot { animation: none; }
}
