/* Chat to Strangers text chat. Builds on /style.css tokens. */
.tx { height: 100dvh; overflow: hidden; }
.tx-app { height: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; position: relative; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }

.tx-start { padding: 28px 22px 32px; overflow-y: auto; height: 100%; }
.tx-start h1 { font-size: 36px; }
.opt { color: var(--mute); font-weight: 500; }
.chips-box {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; min-height: 52px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
}
.chips-box:focus-within { outline: 3px solid var(--rose); outline-offset: 2px; }
.chips { display: contents; list-style: none; margin: 0; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 14px; font-weight: 500; }
.chip button { all: unset; cursor: pointer; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; color: var(--soft); }
.chip button:hover { background: var(--burgundy); color: #fff; }
.chip button:focus-visible { outline: 2px solid var(--rose); }
.chips-box input[type="text"] { flex: 1 1 140px; min-width: 120px; height: 36px; border: 0; background: transparent; padding: 0 6px; }
.chips-box input[type="text"]:focus-visible { outline: none; }
.tx-go { width: 100%; min-height: 60px; font-size: 19px; margin-top: 22px; border-radius: 18px; box-shadow: 0 10px 26px rgba(155, 28, 69, .4); }
.live { display: flex; align-items: center; gap: 10px; color: var(--soft); font-size: 15px; margin: 16px 0 0; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #4bd37b; box-shadow: 0 0 0 4px rgba(75, 211, 123, .2); flex: none; }

/* Chat */
.tx-chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.tx-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.tx-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tx-who strong { display: block; font: 700 17px var(--display); }
.tx-who .sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-who > div { min-width: 0; }
.tx-tools { display: flex; gap: 8px; flex: none; }
.dot.live { background: #4bd37b; }
.dot.wait { background: var(--rose); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.tx-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.bubble { max-width: 82%; padding: 10px 15px; border-radius: 18px 18px 18px 5px; background: var(--surface-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble.me { align-self: flex-end; border-radius: 18px 18px 5px 18px; background: var(--burgundy); color: #fff; }
.sys { align-self: center; max-width: 92%; text-align: center; color: var(--mute); font-size: 14px; padding: 6px 12px; }
.sys.warn { color: var(--rose); }
.sys .btn { margin-top: 10px; }
.invite-card { align-self: flex-start; max-width: 88%; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--border-strong); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.invite-card.me { align-self: flex-end; }
.invite-card strong { font: 700 17px var(--display); }
.tx-typing { margin: 0; padding: 0 18px 6px; color: var(--mute); font-size: 13px; min-height: 1.4em; }
.tx-composer { display: flex; gap: 10px; padding: 10px 14px 6px; }
.tx-composer input[type="text"] { height: 52px; border-radius: 16px; }
.tx-composer .btn { min-height: 52px; border-radius: 16px; }
.tx-actions { display: flex; gap: 10px; padding: 6px 14px calc(14px + env(safe-area-inset-bottom)); }
.tx-actions .btn { flex: 1; }
.tx-actions #skip { flex: 2; background: var(--surface-2); }

/* Sheets and overlay */
.sheet { position: absolute; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(14, 5, 23, .78); }
.sheet-card { width: 100%; max-width: 520px; max-height: 88%; overflow-y: auto; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: var(--surface-2); border: 1px solid var(--border-strong); display: flex; flex-direction: column; gap: 12px; }
.sheet-card h2 { margin: 0; }
.report-list { display: grid; gap: 8px; }
.report-list .btn { justify-content: flex-start; text-align: left; }
.overlay { position: absolute; inset: 0; z-index: 30; background: var(--bg); display: flex; flex-direction: column; }
.overlay-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.overlay iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }

@media (min-width: 761px) {
  .sheet { align-items: center; }
  .sheet-card { border-radius: 26px; }
}
@media (prefers-reduced-motion: reduce) { .dot.wait { animation: none; } }

.invite-card.prompt { align-self: stretch; max-width: none; border-color: var(--rose); background: var(--surface-2); }
.prompt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.nudge { animation: nudge 1.1s ease-in-out 5; border-color: var(--rose); }
@keyframes nudge { 50% { box-shadow: 0 0 0 6px rgba(240, 138, 174, .35); } }
@media (prefers-reduced-motion: reduce) { .btn.nudge { animation: none; } }

.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.sug { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--soft); font: 500 14px var(--body); cursor: pointer; }
.sug:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.sug:disabled { opacity: .4; cursor: default; }
.perks { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; }
.perks li { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--soft); font-size: 13px; }

/* Profile, friends, reactions */
.me-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.me-btn { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.me-btn:focus-visible { outline: 3px solid var(--rose); }
.me-btn { overflow: hidden; }
.me-btn > span:last-child { min-width: 0; }
.me-btn strong { display: block; font: 700 15px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-btn small { color: var(--mute); font-size: 12px; }
.av { flex: none; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; background: var(--surface-2); border: 1px solid var(--border-strong); }
.udot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--rose); margin-left: 4px; }
.udot[hidden] { display: none; }
.topline { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.topline h1 { font-size: 28px; margin: 0; }
.friend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.friend-row { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.friend-row:hover, .friend-row:focus-visible { background: var(--surface-2); border-color: var(--border-strong); }
.friend-row strong { display: block; font: 700 16px var(--display); }
.friend-row span.sub2 { color: var(--mute); font-size: 13px; }
.friend-row .grow { flex: 1; min-width: 0; }
.friend-row .on { width: 10px; height: 10px; border-radius: 50%; background: #4bd37b; flex: none; }
.friend-row .off { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); flex: none; }
.badge { min-width: 22px; padding: 2px 7px; border-radius: 999px; background: var(--burgundy); color: #fff; font: 700 12px var(--body); text-align: center; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatar-grid button { all: unset; box-sizing: border-box; cursor: pointer; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 24px; border-radius: 14px; background: var(--surface); border: 2px solid transparent; }
.avatar-grid button[aria-pressed="true"] { border-color: var(--rose); background: var(--surface-2); }
.avatar-grid button:focus-visible { outline: 3px solid var(--rose); }

.tx-logwrap { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.tx-logwrap .tx-log { flex: 1; }
.fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fx-float { position: absolute; bottom: 8px; font-size: 38px; animation: floatup 2.1s ease-out forwards; }
@keyframes floatup { from { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-30px) scale(1.1); } to { transform: translateY(-260px) scale(1); opacity: 0; } }
.reactions { display: flex; justify-content: center; gap: 6px; padding: 4px 14px 0; }
.reactions button { all: unset; cursor: pointer; width: 42px; height: 38px; display: flex; align-items: center; justify-content: center; font-size: 22px; border-radius: 12px; }
.reactions button:hover:not(:disabled) { background: var(--surface-2); }
.reactions button:active:not(:disabled) { transform: scale(1.2); }
.reactions button:focus-visible { outline: 3px solid var(--rose); }
.reactions button:disabled { opacity: .35; cursor: default; }
.toast { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 40; max-width: 420px; margin: 0 auto; padding: 12px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--rose); box-shadow: 0 10px 30px rgba(0,0,0,.4); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast[hidden] { display: none; }
.bubble .who { display: block; font-size: 12px; color: var(--mute); margin-bottom: 2px; }
@media (prefers-reduced-motion: reduce) { .fx-float { animation-duration: 1.2s; } }

.alerts-row { margin: 4px 0 14px; display: grid; gap: 6px; justify-items: start; }
.alerts-row .fine { margin: 0; }

.game-pop { display: flex; align-items: center; gap: 10px; margin: 0 14px 8px; padding: 8px 8px 8px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 14px; animation: pop-in .25s ease-out; }
.game-pop[hidden] { display: none; }
.game-pop span { flex: 1; min-width: 0; }
.game-pop-x { all: unset; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; text-align: center; line-height: 32px; font-size: 20px; color: var(--soft); }
.game-pop-x:hover { background: var(--surface); }
.game-pop-x:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .game-pop { animation: none; } }

.tx-aside { display: none; }

/* Desktop: use the room. A two-column start screen and the chat as a centred card. */
@media (min-width: 900px) {
  .tx-app { max-width: 1120px; padding: 28px 32px; }
  .tx-start {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); column-gap: 56px; align-content: start;
    padding: clamp(16px, 7vh, 80px) 8px 32px;
  }
  .tx-start > .me-row { grid-column: 1 / -1; margin-bottom: 28px; }
  .me-row .me-btn { flex: 0 1 auto; min-width: 280px; padding-right: 22px; }
  .me-row .me-btn + .btn { margin-left: 4px; }
  .tx-start > *:not(.me-row):not(.tx-aside) { grid-column: 1; }
  .tx-start h1 { font-size: 56px; line-height: 1.05; }
  .tx-start .lead { font-size: 20px; }
  .tx-go { min-height: 68px; font-size: 21px; }
  .tx-aside {
    display: block; grid-column: 2; grid-row: 2 / span 14; align-self: start; margin-top: 8px;
    padding: 28px 28px 24px; border-radius: 26px; border: 1px solid var(--border-strong); background: var(--surface);
  }
  .tx-aside h2 { margin: 0 0 16px; font-size: 24px; }
  .tx-aside ol { margin: 0; padding: 0 0 0 22px; display: grid; gap: 16px; color: var(--soft); }
  .tx-aside li::marker { color: var(--rose); font-weight: 700; }
  .tx-aside strong { color: var(--text); }

  .tx-chat {
    height: min(100%, 880px); margin: auto 0; border: 1px solid var(--border-strong); border-radius: 26px;
    overflow: hidden; background: var(--bg); box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  }
  .tx-bar { padding: 16px 24px; }
  .tx-log { padding: 24px 28px; gap: 10px; }
  .bubble { max-width: 66%; font-size: 17px; padding: 12px 17px; }
  .tx-composer { padding: 14px 24px 8px; }
  .tx-actions { padding: 8px 24px 20px; }
  .tx-typing { padding: 0 28px 6px; }
  .sheet-card { max-width: 560px; }
}

/* ---- Colour and life ---- */
/* Interest tiles: each topic has its own colour (set as --c from the script). */
.suggest { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.sug {
  --c: #b58cff; padding: 14px 10px; border-radius: 16px; font: 700 15px var(--body); color: #fff; text-align: center;
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 8%, transparent));
  transition: transform .15s ease, box-shadow .15s ease;
}
.sug:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 20px color-mix(in srgb, var(--c) 28%, transparent); background: linear-gradient(145deg, color-mix(in srgb, var(--c) 42%, transparent), color-mix(in srgb, var(--c) 12%, transparent)); color: #fff; }
.chip.tinted { border-color: color-mix(in srgb, var(--c) 70%, transparent); background: color-mix(in srgb, var(--c) 22%, var(--surface-2)); }
.perks li:nth-child(1) { border-color: rgba(75, 211, 123, .5); }
.perks li:nth-child(2) { border-color: rgba(255, 184, 77, .5); }
.perks li:nth-child(3) { border-color: rgba(122, 162, 255, .5); }
.tx-start h1 { background: linear-gradient(90deg, #fff, #ffb3d0 70%, #ff7aa8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tx-go { background-image: linear-gradient(90deg, var(--burgundy), #c2255f); }

/* First-message cards */
.openers { padding: 8px 14px 4px; }
.openers-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; color: var(--soft); font-size: 13px; }
.openers-shuffle { all: unset; cursor: pointer; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong); font: 600 13px var(--body); color: var(--soft); white-space: nowrap; }
.openers-shuffle:hover { background: var(--surface-2); color: #fff; }
.openers-shuffle:focus-visible, .opener:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; }
.openers-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: none; }
.openers-row::-webkit-scrollbar { display: none; }
.opener {
  all: unset; box-sizing: border-box; cursor: pointer; flex: 0 0 220px; scroll-snap-align: start; display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 18px; color: #fff; border: 1px solid var(--oc-b); background: linear-gradient(145deg, var(--oc-a), rgba(18, 7, 28, .6));
  transition: transform .15s ease, box-shadow .15s ease;
}
.opener:hover { transform: translateY(-2px); box-shadow: 0 10px 24px var(--oc-g); }
.opener:disabled { opacity: .5; cursor: default; transform: none; }
.op-icon { font-size: 24px; line-height: 1; flex: none; }
.op-body { display: grid; gap: 3px; min-width: 0; }
.op-body small { font: 700 11px var(--body); letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.op-body strong { font: 600 14px/1.35 var(--body); }
.op-ice  { --oc-a: rgba(155, 110, 255, .5); --oc-b: rgba(155, 110, 255, .7); --oc-g: rgba(155, 110, 255, .35); }
.op-wyr  { --oc-a: rgba(255, 160, 60, .45);  --oc-b: rgba(255, 160, 60, .7);  --oc-g: rgba(255, 160, 60, .3); }
.op-hot  { --oc-a: rgba(255, 70, 130, .5);   --oc-b: rgba(255, 90, 140, .7);  --oc-g: rgba(255, 70, 130, .35); }
.op-deep { --oc-a: rgba(60, 140, 255, .45);  --oc-b: rgba(90, 160, 255, .7);  --oc-g: rgba(60, 140, 255, .3); }
.op-game { --oc-a: rgba(40, 200, 130, .45);  --oc-b: rgba(60, 220, 150, .7);  --oc-g: rgba(40, 200, 130, .3); }
@media (max-width: 899px) { .tx-chat:has(.tx-composer input:focus) .openers { display: none; } }
@media (min-width: 900px) {
  .openers { padding: 6px 24px 6px; }
  .openers-row { display: grid; grid-template-columns: repeat(4, 1fr); overflow: visible; }
  .opener { flex: none; }
}
@media (prefers-reduced-motion: reduce) { .sug, .opener { transition: none; } .sug:hover:not(:disabled), .opener:hover { transform: none; } }

/* Small screens: header on two rows, compact first-message cards */
@media (max-width: 560px) {
  .tx-bar { flex-wrap: wrap; row-gap: 10px; }
  .tx-who { flex: 1 1 100%; }
  .tx-who strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tx-tools { width: 100%; }
  .tx-tools .btn { flex: 1; }
  .opener { flex-basis: 168px; padding: 10px 12px; }
  .op-body strong { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .op-icon { font-size: 20px; }
}

.overlay-bar .btn { min-height: 46px; padding: 0 20px; font-size: 16px; font-weight: 700; }

.game-left { padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border-strong); color: var(--text); font-weight: 600; text-align: center; }
.overlay-bar .btn.attn { background: var(--burgundy); border-color: transparent; color: #fff; animation: vp-pulse 1.4s ease-in-out infinite; }
@keyframes vp-pulse { 50% { box-shadow: 0 0 0 6px rgba(240,138,174,.28); } }
@media (prefers-reduced-motion: reduce) { .overlay-bar .btn.attn { animation: none; } }

.tx-friend { color: var(--text, #fff); width: 100%; min-height: 50px; margin-top: 10px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18); color: inherit; font-weight: 700; }
.friend-join { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin: 16px 0 6px; padding: 14px 16px; border-radius: 16px; background: rgba(194,37,95,.16); border: 1px solid rgba(255,107,154,.45); }
.link-card { display: flex; flex-direction: column; gap: 10px; align-items: stretch; text-align: left; }
.link-box { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.3); color: inherit; font: inherit; font-size: 14px; }

/* Sponsored rows in the friends list */
.ad-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.ad-row { --c: #ff5c7a; --ink: #2b0010; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; background: var(--surface); border: 2px solid var(--c); border-radius: 4px; box-shadow: 3px 3px 0 var(--c); color: var(--text); text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
.ad-row:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--c); }
.ad-row:focus-visible { outline: 3px solid #ffc247; outline-offset: 3px; }
.ad-th { flex: none; width: 46px; height: 46px; border: 2px solid #fff; border-radius: 3px; overflow: hidden; background: var(--surface-2); }
.ad-th img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-tx { flex: 1; min-width: 0; }
.ad-tx strong { display: flex; align-items: center; gap: 6px; font: 800 14px/1.1 var(--display); text-transform: uppercase; white-space: nowrap; }
.ad-tx strong i { font: 800 9px/1.5 var(--body); font-style: normal; letter-spacing: .1em; text-transform: uppercase; background: #fff; color: #000; padding: 0 5px; border-radius: 2px; }
.ad-tx small { display: block; color: var(--soft); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-btn { flex: none; background: var(--c); color: var(--ink); font: 800 11.5px var(--body); text-transform: uppercase; letter-spacing: .05em; padding: 9px 12px; border-radius: 3px; }
.ad-coral { --c: #ff5c7a; --ink: #2b0010; } .ad-blue { --c: #4cc9f0; --ink: #03212b; } .ad-yellow { --c: #ffc247; --ink: #2a1800; }
.ad-green { --c: #2fb67a; --ink: #04281a; } .ad-violet { --c: #b68cf0; --ink: #1c0838; }
@media (prefers-reduced-motion: reduce) { .ad-row { transition: none; } .ad-row:hover { transform: none; } }

.sys-link{align-self:center;background:none;border:0;color:inherit;text-decoration:underline;font:inherit;font-size:13px;padding:6px 10px;cursor:pointer}
