/* Poolside phone app. Room colours arrive as --bg / --fg / --txt / --link. */
:root {
  --bg: #0099CC; --fg: #ffffff; --txt: #ffffff; --link: #ffee88;
  --deep: #00264d; --bar: #004c80; --card: #ffffff; --ink: #10233a; --muted: #5b6b7d;
  --accent: #00a3d9; --danger: #c0392b;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 16px/1.4 "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--deep) url("/graphics/back12.jpg") fixed; color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
a { color: #0068a8; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: 10px 16px;
         background: var(--accent); color: #fff; }
button.ghost { background: transparent; color: inherit; padding: 8px 10px; }
button.big { display: block; width: 100%; padding: 14px; font-size: 17px; font-weight: 600; margin-top: 12px; }
button.danger { background: var(--danger); }
button.gray { background: #6b7785; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
label.check input { width: auto; }
.reason { font-weight: 400; display: flex; gap: 10px; align-items: center; padding: 8px 10px; margin: 4px 0; background: #f1f5f9; border-radius: 8px; }
.reason input { width: auto; }
#v-birth { display: flex; align-items: center; justify-content: center; padding: 20px 14px; }
input, textarea { font: inherit; font-size: 16px; /* 16px stops phones zooming in */
  width: 100%; padding: 12px; border: 1px solid #b8c6d4; border-radius: 10px; background: #fff; color: #000; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
.small { font-size: 14px; color: var(--muted); }
.err { background: #fde2e0; color: #8a1f14; padding: 10px; border-radius: 8px; }
.card { background: var(--card); border-radius: 16px; padding: 18px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }

.view { min-height: 100%; }
/* ---- login ---- */
#v-login { display: flex; align-items: center; justify-content: center; padding: 20px 14px calc(20px + var(--safe-b)); }
.login { width: 100%; max-width: 420px; }
.login .logo { width: 100%; height: auto; border-radius: 10px; display: block; }
.guest { background: #e1f4fb; padding: 12px; border-radius: 10px; text-align: center; }
.adult { font-size: 14px; color: #5a1d1d; }
.tip { background: #fff7d6; padding: 10px; border-radius: 8px; color: #5a4a00; }

/* ---- bars ---- */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(8px + var(--safe-t)) 10px 8px; background: var(--bar); color: #fff; }
.bar .grow { flex: 1; min-width: 0; line-height: 1.2; }
.bar .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .sub { font-size: 13px; opacity: .8; }
.me-icon { max-height: 40px; max-width: 80px; border-radius: 6px; }

/* ---- rooms ---- */
.rooms-main { max-width: 640px; margin: 0 auto; padding: 12px 12px calc(24px + var(--safe-b)); }
.rooms-main h2 { color: #fff; margin: 8px 4px 12px; text-shadow: 0 1px 3px #000; }
.room-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 560px) { .room-list { grid-template-columns: 1fr 1fr 1fr; } }
.room-list button { width: 100%; min-height: 72px; text-align: left; border-radius: 14px; padding: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,.3); display: flex; flex-direction: column; justify-content: space-between; }
.room-list .rn { font-weight: 700; font-size: 17px; }
.room-list .rc { font-size: 13px; opacity: .85; }
.private .row { display: flex; gap: 8px; }
.private .row button { flex: 0 0 auto; }
.links { text-align: center; color: #dde; }
.links a { color: #fff; }

/* ---- chat ---- */
#v-chat { position: relative; display: flex; flex-direction: column; height: 100%; height: 100dvh;
  background: var(--bg) var(--bgimg, none) repeat top left; color: var(--txt); }
.room-bar { background: color-mix(in srgb, var(--bg) 55%, #000); }
button.quiet { display: block; margin: 16px auto 0; background: none; color: #6b7785; font-size: 14px; text-decoration: underline; padding: 6px; }
.exit { background: #c0392b; color: #fff; padding: 6px 10px; font-size: 14px; border-radius: 8px; flex: 0 0 auto; }
.mail { color: #fff; text-decoration: none; font-size: 22px; position: relative; padding: 4px 8px; }
#mail-n { position: absolute; top: -2px; right: -2px; background: #e33; color: #fff; font-size: 11px;
  border-radius: 9px; padding: 1px 5px; }
.notice { background: #fff3c4; color: #5a4700; padding: 8px 12px; font-size: 14px; }
.lines { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 10px; overscroll-behavior: contain; }
.line { padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--txt) 20%, transparent); overflow-wrap: anywhere; }
.line.w { background: color-mix(in srgb, #fff 18%, transparent); border-radius: 10px; padding: 8px; margin: 4px 0; border: 0; }
.line img { max-width: 100%; height: auto; max-height: 120px; vertical-align: middle; }
.line img[alt="Image"] { max-height: 300px; border-radius: 6px; }
.line hr { display: none; }
.line font[size="1"] { font-size: 12px; }
.line font[size="2"] { font-size: 15px; }
.line font[size="3"] { font-size: 17px; }
.line font[size="4"] { font-size: 20px; }
.line font[size="5"], .line font[size="6"], .line font[size="7"] { font-size: 24px; }
.line li { list-style: none; display: inline; font-style: italic; opacity: .85; }
.line a { color: var(--link); }
.newer { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b));
  border-radius: 20px; box-shadow: 0 3px 10px rgba(0,0,0,.4); z-index: 4; }
.room-bar { order: 0; } .notice { order: 1; } .composer { order: 2; } .lines { order: 3; }
.composer { background: color-mix(in srgb, var(--bg) 70%, #000); padding: 8px; }
.lines { padding-bottom: calc(8px + var(--safe-b)); }
#f-send { display: flex; align-items: flex-end; gap: 6px; }
#msg { resize: none; max-height: 140px; border-radius: 20px; padding: 10px 14px; }
.round { width: 44px; height: 44px; border-radius: 50%; padding: 0; flex: 0 0 44px; font-size: 20px; }
#b-more { background: rgba(255,255,255,.2); color: #fff; }
.send { background: #00b36b; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #ffe066; color: #222;
  border-radius: 16px; padding: 4px 4px 4px 12px; margin: 0 0 6px 4px; font-size: 14px; }
.chip button { background: rgba(0,0,0,.15); color: #222; padding: 2px 9px; border-radius: 12px; }
.more { padding: 6px 6px 2px; color: #fff; }
.more label { font-weight: 400; display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.more input { width: auto; }
.more .small { color: #dde; }
.more-btns { display: flex; gap: 8px; margin: 10px 0 4px; }
.more-btns button { flex: 1; }
.btnlink { flex: 1; display: block; text-align: center; background: #6b4fbb; color: #fff; text-decoration: none; padding: 10px 16px; border-radius: 10px; }

/* ---- sheets ---- */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { background: #fff; color: var(--ink); width: 100%; max-width: 560px; max-height: 80vh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 12px 16px calc(16px + var(--safe-b)); }
.small-card { max-height: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; font-size: 18px; }
.sheet-head button { font-size: 26px; color: #444; }
.sheet h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
.people { list-style: none; margin: 0; padding: 0; }
.people button { width: 100%; display: flex; align-items: center; gap: 10px; background: #f1f5f9; color: var(--ink);
  margin: 4px 0; text-align: left; }
.people img { max-height: 44px; max-width: 70px; border-radius: 4px; }
.people .me { opacity: .6; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + var(--safe-b)); z-index: 30;
  background: #222; color: #fff; padding: 10px 16px; border-radius: 10px; max-width: 90%; box-shadow: 0 4px 16px rgba(0,0,0,.4); }

@media (min-width: 900px) {
  #v-chat { max-width: 900px; margin: 0 auto; box-shadow: 0 0 30px rgba(0,0,0,.5); }
}
