/* Chip Chat walkie demo — phone-first, no Win95 chrome on the main screen. */
:root{
  --neon-cyan:#00E8FF;
  --neon-magenta:#FF2BD6;
  --neon-yellow:#F5FF3A;
  --yellow:#FFC90E;
  --yellow-dk:#D4A000;
  --yellow-lt:#FFE56A;
  --red:#C4102E;
  --red-dk:#8E0B20;
  --red-lt:#E23A4C;
  --lcd:#a3b386;
  --lcd-ink:#1c2414;
  --shell:#111;
  --ok:#1db954;
  --ink:#1a1200;
  --safe-t:env(safe-area-inset-top, 0px);
  --safe-b:env(safe-area-inset-bottom, 0px);
  --safe-l:env(safe-area-inset-left, 0px);
  --safe-r:env(safe-area-inset-right, 0px);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:#141414;color:#fff;
  font-family:Nunito,system-ui,-apple-system,sans-serif;
  min-height:100dvh; overflow:hidden;}
body{padding:var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);}

body::before{content:"";position:fixed;top:0;left:0;right:0;height:2px;z-index:40;
  background:linear-gradient(90deg,var(--neon-cyan),var(--neon-magenta),var(--neon-yellow));pointer-events:none;}
.demo-tag{
  position:fixed; top:calc(8px + var(--safe-t)); left:0; right:0;
  z-index:20; text-align:center; pointer-events:none;
  font-size:11px; letter-spacing:.06em; text-transform:uppercase;
  color:rgba(255,255,255,.72); font-weight:800;
  display:flex; flex-direction:column; align-items:center; gap:4px;
}
.demo-brand{width:72px;height:auto;display:block;background:#07040f;border-radius:8px;
  border:1px solid var(--neon-cyan);}


/* ---------- Setup ---------- */
.screen{position:fixed; inset:0; display:flex; align-items:center; justify-content:center;
  padding:calc(36px + var(--safe-t)) 20px calc(24px + var(--safe-b));}
.screen[hidden],.sheet[hidden],.ios-tip[hidden],[hidden]{display:none !important}

.setup{background:linear-gradient(#1b1b1b,#2a2208);}
.setup-card{width:min(400px,100%); background:#fff; color:var(--ink); border-radius:28px;
  padding:28px 22px 22px; box-shadow:0 18px 50px rgba(0,0,0,.45);}
.setup-mini{display:flex; flex-direction:column; align-items:center; margin:0 0 10px;}
.mini-ant{width:10px;height:18px;background:#222;border-radius:6px 6px 0 0;}
.mini-body{width:42px;height:58px;background:var(--yellow);border:2px solid #111;border-radius:10px;
  box-shadow:inset 0 -18px 0 var(--red);}
.setup-card h1{margin:0 0 8px; font-size:1.7rem; font-weight:800; text-align:center;}
.setup-lead{margin:0 0 18px; text-align:center; color:#444; line-height:1.35;}
.setup-card label{display:block; font-size:.85rem; font-weight:800; margin:10px 0 4px;}
.setup-card input[type=text]{
  width:100%; font:800 1.35rem Nunito,system-ui,sans-serif; letter-spacing:.08em;
  text-transform:uppercase; padding:12px 14px; border:2px solid #111; border-radius:14px;
  background:#fff8d6;}
.setup-go{
  display:block; width:100%; margin:18px 0 8px; padding:16px 12px;
  background:var(--yellow); color:#111; border:3px solid #111; border-radius:999px;
  font:800 1.2rem Nunito,system-ui,sans-serif; min-height:56px; cursor:pointer;}
.setup-go:active{transform:scale(.98)}
.setup-skip{display:block; width:100%; background:none; border:0; color:#444;
  font:800 .95rem Nunito,system-ui,sans-serif; padding:10px; cursor:pointer; text-decoration:underline;}
.err{color:#c4102e; font-weight:800; margin:8px 0 0}

/* ---------- Walkie ---------- */
.walkie-screen{
  flex-direction:column; background:
    radial-gradient(ellipse at 50% 30%, #3a3a3a, #141414 70%);
  padding:calc(40px + var(--safe-t)) 12px calc(16px + var(--safe-b));
}
.gear{
  position:fixed; top:calc(28px + var(--safe-t)); right:calc(14px + var(--safe-r));
  z-index:15; width:44px; height:44px; border:0; border-radius:50%;
  background:rgba(255,255,255,.12); color:#fff; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.gear:active{background:rgba(255,255,255,.25)}

.walkie{width:min(420px,92vw); margin:0 auto; display:flex; flex-direction:column; align-items:center;
  filter:drop-shadow(0 18px 28px rgba(0,0,0,.55));
  transform-origin:top center;
}
.antenna{position:relative; width:28px; height:clamp(52px, 8vh, 72px); margin-bottom:-8px; z-index:2;}
.ant-stem{position:absolute; left:50%; bottom:0; transform:translateX(-50%);
  width:14px; height:100%; background:linear-gradient(90deg,#3a3a3a,#1a1a1a 40%,#444);
  border-radius:8px; border:2px solid #000;}
.ant-cap{position:absolute; left:50%; top:-6px; transform:translateX(-50%);
  width:24px; height:18px; background:radial-gradient(circle at 35% 35%,#555,#1a1a1a);
  border:2px solid #000; border-radius:50%;}

.shell{
  width:100%;
  background:
    linear-gradient(180deg,var(--yellow-lt) 0%, var(--yellow) 18%, var(--yellow) 78%, var(--yellow-dk) 100%);
  border:4px solid #111;
  border-radius:42px 42px 48px 48px;
  padding:18px 18px 22px;
  box-shadow: inset 6px 8px 0 rgba(255,255,255,.28), inset -8px -10px 0 rgba(0,0,0,.12);
  display:flex; flex-direction:column; align-items:center; gap:14px;
}

.lcd-row{display:flex; align-items:stretch; gap:10px; width:100%;}
.led{
  width:18px; flex:none; border-radius:6px; background:#2a0a0a;
  border:3px solid #111; box-shadow:inset 0 0 6px #000;
  transition:background .15s, box-shadow .15s;
}
.led.on-talk{background:#ff2a2a; box-shadow:0 0 10px #ff3b3b, inset 0 0 4px #fff6;}
.led.on-reply{background:#39ff6a; box-shadow:0 0 10px #39ff6a, inset 0 0 4px #fff6;}

.lcd{
  flex:1; background:linear-gradient(#b7c49a,#8fa073);
  border:5px solid #1a1a1a; border-radius:8px; min-height:64px;
  padding:6px 10px; text-align:center; color:var(--lcd-ink);
  font-family:"DotGothic16",monospace; letter-spacing:.08em;
  box-shadow:inset 0 0 0 2px #3a3a3a, inset 0 2px 6px rgba(0,0,0,.25);
}
.lcd-who{font-size:clamp(26px, 6.4vw, 36px); line-height:1.05; font-weight:400;}
.lcd-meta{font-size:clamp(13px, 3.4vw, 16px); opacity:.85; margin-top:2px;}

.grille{
  width:78%; height:clamp(36px, 6vh, 52px);
  background:
    repeating-linear-gradient(90deg, #2a2a2a 0 8px, transparent 8px 16px),
    repeating-linear-gradient(#2a2a2a 0 3px, transparent 3px 8px);
  background-color:#d8b008;
  border:2px solid #111; border-radius:8px; opacity:.9;
}

/* The one big button */
.ptt{
  position:relative; width:clamp(148px, 42vw, 200px); height:clamp(148px, 42vw, 200px);
  margin:8px 0 0; border:0; padding:0; border-radius:50%; cursor:pointer;
  background:transparent; touch-action:none; user-select:none; -webkit-user-select:none;
}
.ptt-ring{
  position:absolute; inset:0; border-radius:50%;
  background:radial-gradient(circle at 50% 40%, #666, #111 70%);
  box-shadow:0 8px 0 #000, inset 0 2px 0 #888;
}
.ptt-face{
  position:absolute; inset:12px; border-radius:50%;
  background:radial-gradient(circle at 35% 28%, var(--red-lt), var(--red) 45%, var(--red-dk));
  border:3px solid #3a0008; color:#fff;
  font:800 clamp(22px, 5.4vw, 30px) Nunito,system-ui,sans-serif;
  letter-spacing:.08em;
  display:flex; align-items:center; justify-content:center;
  box-shadow:inset 0 8px 0 rgba(255,255,255,.18), inset 0 -10px 0 rgba(0,0,0,.2), 0 4px 0 #5a0610;
  transition:transform .06s, box-shadow .06s;
}
.ptt.on .ptt-face, .ptt:active .ptt-face{
  transform:translateY(4px) scale(.97);
  box-shadow:inset 0 10px 12px rgba(0,0,0,.35), 0 0 0 #5a0610;
}
.hint{margin:4px 0 0; font-size:.85rem; font-weight:800; color:#111; text-align:center; min-height:1.2em;}

/* ---------- iOS tip ---------- */
.ios-tip{
  position:fixed; left:12px; right:12px; bottom:calc(16px + var(--safe-b));
  z-index:30; background:#fff; color:var(--ink); border-radius:18px;
  padding:14px 16px 12px; box-shadow:0 10px 30px rgba(0,0,0,.4);
  font-size:.92rem; line-height:1.35;
}
.ios-tip ol{margin:6px 0 0; padding-left:1.2em}
.ios-tip-x{position:absolute; top:6px; right:10px; border:0; background:none;
  font-size:22px; cursor:pointer; color:#333; line-height:1;}

/* ---------- Gear sheet ---------- */
.sheet{position:fixed; inset:0; z-index:40; background:rgba(0,0,0,.55);
  display:flex; align-items:flex-end; justify-content:center;
  padding:0 0 env(safe-area-inset-bottom, 0px);}
.sheet-card{
  width:min(520px,100%); max-height:min(88dvh, 760px); overflow:auto;
  background:#f6f4ef; color:var(--ink); border-radius:24px 24px 0 0;
  padding:16px 18px calc(24px + var(--safe-b));
  box-shadow:0 -8px 30px rgba(0,0,0,.3);
}
.sheet-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:8px;}
.sheet-head h2{margin:0; font-size:1.25rem;}
.sheet-close{width:40px;height:40px;border:0;background:#eee;border-radius:50%;
  font-size:24px; cursor:pointer; line-height:1;}
.sheet-walkie{margin:0 0 14px; color:#444}
.sheet-card h3{margin:16px 0 8px; font-size:.95rem; text-transform:uppercase; letter-spacing:.06em;}
.plain{list-style:none; margin:0; padding:0}
.plain li{display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid #ddd; font-weight:800}
.plain span{font-weight:600; color:#555}
.toggle{display:flex; gap:10px; align-items:center; margin:6px 0; font-weight:700;}
.toggle input{width:20px;height:20px}
.limit-lab{display:block; font-weight:800; margin-bottom:6px}
input[type=range]{width:100%}
.price-note{background:#fff3c4; border:2px solid #111; border-radius:14px; padding:12px 14px; margin-top:16px;}
.price-note h3{margin:0 0 6px}
.price-note p{margin:0 0 8px}
.fine{font-size:.85rem; color:#555; margin:4px 0 0; font-weight:600;}
.texty{display:block; width:100%; margin:14px 0 0; background:none; border:0;
  color:#333; font:800 .95rem Nunito,system-ui,sans-serif; text-align:left;
  text-decoration:underline; cursor:pointer; padding:6px 0;}

@media (max-height:700px){
  .antenna{height:44px}
  .grille{height:28px}
  .shell{padding:12px 14px 14px; border-radius:32px; gap:10px}
  .lcd{min-height:52px}
}
@media (prefers-reduced-motion:reduce){
  .ptt-face,.led{transition:none}
}

/* Live / phone-to-phone temp test */
.warn{background:#fff3c4;border:2px solid #111;border-radius:12px;padding:10px 12px;
  color:#1a1200;font-weight:800;font-size:.92rem;line-height:1.3;margin:0 0 14px;}
.or{text-align:center;color:#666;font-weight:800;margin:12px 0 8px}
.big-code{font:800 2rem Nunito,system-ui,sans-serif;letter-spacing:.2em;text-align:center;
  background:#fff8d6;border:2px solid #111;border-radius:14px;padding:10px;margin:8px 0 12px;}
.setup-go.alt{background:#fff;margin-top:10px}
.live-banner{
  position:fixed; left:10px; right:10px; top:calc(26px + var(--safe-t));
  z-index:14; background:#fff3c4; color:#1a1200; border:2px solid #111;
  border-radius:12px; padding:6px 44px 6px 10px; font-size:11px; font-weight:800;
  line-height:1.3; text-align:center;
}
.walkie-screen.live-on{padding-top:calc(110px + var(--safe-t))}
.walkie-screen.live-on .gear{top:calc(28px + var(--safe-t))}
.live-stat{margin-top:4px;font-size:11px;font-weight:800;line-height:1.3;color:#1a1200;word-break:break-word;}
.tap-play{
  display:block; width:100%; margin:10px 0 0; padding:14px 10px;
  border:3px solid #111; border-radius:16px; background:#ff4d4d; color:#fff;
  font:800 1.05rem Nunito,system-ui,sans-serif; cursor:pointer;
}
.tap-play[hidden]{display:none !important}
#walkie-audio{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none;}
.live-note{background:#fff;border:2px solid #111;border-radius:14px;padding:12px 14px;margin-top:16px;}
.live-note h3{margin:0 0 6px}
.live-note .setup-go{margin:10px 0 0}
#live-share-link{font-size:.85rem;letter-spacing:0;text-transform:none;font-weight:600}
.led{background:#1a1a1a}

.invite-btn{
  display:block; width:100%; margin:14px 0 0; padding:12px 10px;
  border:2px solid #111; border-radius:14px; background:#fff8d6;
  font:800 .95rem Nunito,system-ui,sans-serif; color:#111; cursor:pointer;
}
.invite-btn:active{transform:translateY(1px)}
#join-code{font-size:.95rem;letter-spacing:.06em;text-transform:uppercase;font-weight:800}
#invite-link,#live-share-link{
  display:block; width:100%; box-sizing:border-box; margin:0 0 10px;
  padding:10px 12px; border:2px solid #111; border-radius:14px; background:#fff8d6;
  font:600 .72rem/1.35 Nunito,system-ui,sans-serif; letter-spacing:0; text-transform:none;
  word-break:break-all; overflow-wrap:anywhere;
}
