:root { --bg: #000; --text: #fff; --muted: #b8b8b8; --green: #39ff14; --pink: #fe019a; --card: #141414; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 ui-monospace, Menlo, Consolas, monospace; }
main, footer { max-width: 760px; margin: 0 auto; padding: 0 20px; }
a { color: var(--green); }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: 2.4rem; color: var(--green); text-shadow: 0 0 18px rgba(57, 255, 20, .6); margin: 48px 0 8px; }
h2 { color: var(--pink); margin-top: 48px; }
nav { display: flex; gap: 20px; max-width: 760px; margin: 0 auto; padding: 20px; }
nav a { color: var(--text); text-decoration: none; }
nav a:first-child { color: var(--green); font-weight: bold; margin-right: auto; }
.lede { font-size: 1.3rem; color: var(--muted); margin: 0 0 32px; }
.muted { color: var(--muted); }
.store { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin: 24px 0; }
.button { display: inline-block; background: var(--green); color: #000; font-weight: bold; padding: 14px 24px; border-radius: 999px; text-decoration: none; }
button.button { border: 0; font: inherit; font-weight: bold; cursor: pointer; }
.badge { display: inline-block; line-height: 0; }
.badge img { height: 50px; width: auto; }
/* Google's PNG carries its own transparent margin; this lines its art up with Apple's. */
.badge.play img { height: 75px; margin: -12.5px; }
.button.secondary { background: transparent; color: var(--green); box-shadow: inset 0 0 0 2px var(--green); }
.qr { display: none; width: 120px; background: #fff; border-radius: 8px; }
@media (hover: hover) and (min-width: 900px) { .qr { display: block; } }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; padding: 0; list-style: none; }
.cards li { background: var(--card); border-radius: 16px; padding: 16px; }
.code { font-size: 3rem; letter-spacing: .3em; color: var(--green); text-shadow: 0 0 18px rgba(57, 255, 20, .6); margin: 16px 0; }
dt { font-weight: bold; margin-top: 16px; }
dd { margin: 4px 0 0; color: var(--muted); }
footer { margin-top: 64px; padding-bottom: 40px; color: var(--muted); font-size: .9rem; }
footer a { color: var(--muted); margin-right: 16px; }

/* The /r/CODE room preview (functions/src/web.ts): full screen on a phone, a phone frame on a computer. */
.preview .side { display: none; }
.phone { position: fixed; inset: 0 0 auto; height: 100dvh; z-index: 1; background: #000; overflow: hidden; }
.phone p, .phone h2 { margin: 0; }
.chat { display: flex; flex-direction: column; height: 100%; }
.chat header { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.chat header div { flex: 1; min-width: 0; }
.chat header strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--room); text-shadow: 0 0 12px var(--room); line-height: 1.3; }
.chat header small { display: block; color: #9a9aa0; font-size: 12px; line-height: 1.3; }
.timer { font-size: 15px; font-variant-numeric: tabular-nums; }
.timer.low { color: #ff3355; font-weight: bold; }
.join { border: 0; border-radius: 999px; padding: 10px 18px; font: inherit; font-size: 15px; font-weight: bold; color: #000; background: var(--room); cursor: pointer; }
.list { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; touch-action: pinch-zoom; overscroll-behavior: none; }
.phone .hint { padding: 8px 16px; text-align: center; font-size: 13px; color: #9a9aa0; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--room); box-shadow: 0 0 8px var(--room); animation: pulse 1.6s ease-in-out infinite; }
.fresh { animation: pop .34s cubic-bezier(.34, 1.4, .64, 1); transform-origin: left bottom; }
.counts:empty { display: none; }
/* Over the bubbles, so the newest stay at the bottom and older ones run off the top. */
.msgs { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding: 0 12px 12px; }
.msg { flex: none; max-width: 78%; align-self: flex-start; cursor: pointer; user-select: none; -webkit-user-select: none; }
.bubble { width: fit-content; padding: 12px 16px; border-radius: 15px; color: #000; background: var(--c); box-shadow: 0 0 8px var(--c); line-height: 1.3; }
.bubble span { filter: blur(6px); overflow-wrap: anywhere; }
.counts { display: flex; gap: 8px; margin-top: 4px; }
.count { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #9a9aa0; }
.empty { margin: auto; padding: 24px; text-align: center; }
.ghost { font-size: 48px; line-height: 1.2; }
.bar { height: 6px; margin-top: 20px; border-radius: 999px; overflow: hidden; background: #1f1f22; }
.bar i { display: block; transition: width .4s ease-out; height: 100%; background: var(--room); }
#composer { display: flex; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, .1); }
#composer input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 20px; font: inherit; font-size: 16px; color: #fff; background: #161618; }
#composer input::placeholder { color: #86868c; }
#composer button { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 999px; font: inherit; font-size: 20px; color: var(--room); background: rgba(255, 255, 255, .08); cursor: pointer; }
.sheet { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; gap: 14px; overscroll-behavior: contain; padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; text-align: center; background: #000; }
.sheet.on { display: flex; animation: rise .25s cubic-bezier(.23, 1, .32, 1); }
.sheet::before, .sheet::after { content: ''; margin: auto; }
.sheet h2 { color: var(--room); text-shadow: 0 0 18px var(--room); outline: none; }
.sheet .code { display: flex; align-items: center; gap: 4px; max-width: 100%; margin: 0 0 6px; padding: 10px 18px; border: 2px solid var(--green); border-radius: 20px; background: none; font: inherit; font-size: 2rem; line-height: 1.2; letter-spacing: .25em; cursor: pointer; }
.sheet .code:active { background: rgba(57, 255, 20, .15); }
.badges { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; }
.badges .badge:not(.play) { flex: 0 1 150px; min-width: 0; }
.badges .badge:not(.play) img { width: 100%; height: auto; }
.sheet .muted { font-size: 14px; line-height: 1.4; }
.back { border: 0; padding: 12px; font: inherit; font-size: 15px; color: #b8b8b8; background: none; text-decoration: underline; cursor: pointer; }
@media (max-width: 899px) {
  html:has(.preview), body:has(.preview) { height: 100%; overflow: hidden; overscroll-behavior: none; }
  body:has(.preview) nav { display: none; }
}
[hidden] { display: none !important; }
@keyframes rise { from { transform: translateY(40px); } }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes pop { from { transform: translateY(14px) scale(.6); } }
@media (prefers-reduced-motion: reduce) { .sheet.on, .dot, .fresh { animation: none; } }
@media (min-width: 900px) {
  body:has(.preview) nav { max-width: 960px; }
  main.preview { display: flex; align-items: center; justify-content: center; gap: 64px; max-width: 960px; min-height: calc(100vh - 90px); padding-bottom: 24px; }
  .preview .side { display: block; flex: 1; }
  .room-qr { width: 180px; line-height: 0; }
  .room-qr svg { width: 100%; height: auto; border-radius: 12px; }
  .phone { position: relative; inset: auto; flex: none; width: 390px; height: min(800px, calc(100vh - 120px)); border: 10px solid #26262a; border-radius: 48px; }
}
