body { background: linear-gradient(180deg, var(--bg-2), var(--bg)); min-height: 100dvh; }
#app { max-width: 720px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; position: relative; }
.pad { padding: 1.2rem; }
.join { margin: auto; width: 100%; padding: 1.5rem; }
.join .logo { font-size: 1.1rem; display: flex; justify-content: center; margin-bottom: 1.5rem; }
.panel { background: #fff; border-radius: 28px; padding: 1.8rem; box-shadow: 0 10px 40px rgba(8, 36, 51, .08); }
.panel h1 { font-size: 1.9rem; letter-spacing: -.03em; line-height: 1.1; }
.panel p.sub { color: var(--slate); margin: .6rem 0 1.4rem; line-height: 1.4; }
label { display: block; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1rem 0 .4rem; }
.inp { width: 100%; border: 2px solid #dbe7ee; border-radius: 16px; padding: .9rem 1.1rem; font-size: 1.1rem; font-weight: 600; background: #f8fbfd; outline: 0; transition: border-color .15s; }
.inp:focus { border-color: var(--coral); background: #fff; }
.inp.code { text-transform: uppercase; letter-spacing: .25em; text-align: center; font-size: 1.6rem; font-weight: 800; }
.panel .btn { width: 100%; margin-top: 1.4rem; font-size: 1.05rem; }
.err { color: var(--red); font-weight: 700; margin-top: .9rem; font-size: .95rem; }

.head { padding: 1rem 1.2rem; display: flex; align-items: center; gap: .8rem; background: #fff; border-radius: 0 0 24px 24px; box-shadow: 0 4px 24px rgba(8, 36, 51, .06); position: sticky; top: 0; z-index: 3; }
.head .me { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--pc); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.head .who { flex: 1; min-width: 0; line-height: 1.2; }
.head .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head .who small { color: var(--muted); font-weight: 700; font-size: .78rem; }
.head .tm { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.head .tm.low { color: var(--red); animation: pulse 1s infinite; }

.chat { flex: 1; padding: 1.2rem; display: flex; flex-direction: column; gap: .9rem; }
.bub { max-width: 92%; border-radius: 22px; padding: .9rem 1.2rem; line-height: 1.45; font-weight: 500; animation: pop .4s both; word-wrap: break-word; }
.bub.sys { background: #fff; align-self: stretch; max-width: 100%; border: 2px dashed var(--coral); }
.bub.sys small { display: block; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; color: var(--coral-d); margin-bottom: .3rem; }
.bub.sys p { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.bub.me { background: var(--navy); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.bub.ai { background: #fff; align-self: flex-start; border-bottom-left-radius: 6px; padding: .5rem; }
.bub.ai img { width: 100%; display: block; border-radius: 16px; }
.bub.ai .sk { aspect-ratio: 1; width: min(70vw, 340px); border-radius: 16px; display: grid; place-items: center; color: var(--muted); font-weight: 700; text-align: center; padding: 1rem; }
.bub.ai .cap { padding: .5rem .6rem .2rem; font-size: .8rem; color: var(--muted); font-weight: 600; }
.bub.bad { background: var(--red-l); color: #a3242a; align-self: flex-start; font-weight: 600; font-size: .92rem; }
.info { text-align: center; color: var(--slate); font-weight: 600; padding: 1rem; line-height: 1.5; }
.info.big { background: #fff; border-radius: 24px; font-size: 1.15rem; padding: 1.6rem; margin: auto 0; }
.info.win { background: var(--green-l); color: #136b40; } .info.lose { background: var(--grey); }

.composer { position: sticky; bottom: 0; background: #fff; padding: .9rem 1rem calc(.9rem + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; box-shadow: 0 -4px 24px rgba(8, 36, 51, .08); }
.composer .row { display: flex; gap: .7rem; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 2px solid #dbe7ee; border-radius: 18px; padding: .8rem 1rem; background: #f8fbfd; outline: 0; font-weight: 500; max-height: 9rem; line-height: 1.35; }
.composer textarea:focus { border-color: var(--coral); background: #fff; }
.composer .btn { padding: .85rem 1.3rem; border-radius: 18px; }
.composer .meta { font-size: .78rem; color: var(--muted); font-weight: 700; margin-bottom: .5rem; display: flex; justify-content: space-between; }
body { background: #fff; }
.bub.ai { border: 1.5px solid #f6e4d8; }
.inp, .composer textarea { background: #fffaf6; border-color: #f0dccd; }
