/* PLAY MODE — tela do PLAY (play.php). Veio do sandbox do GALATEA
   (adapters/json-sandbox/www/sandbox.css); palco 9:16, cena trocável, sugestões,
   final com a recompensa e as travas. */
:root {
    --sb-orange: #ff7a1a;
    --sb-orange-dark: #e2620a;
    --sb-ink: #14101f;
    --sb-text: #fff;
    --sb-glass: rgba(20, 16, 31, .62);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
    background: #07050d;
    color: var(--sb-text);
    font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
}
/* Palco 9:16: tela cheia no celular, coluna vertical no PC. */
.sb-stage {
    position: relative;
    width: min(100vw, calc(100dvh * 9 / 16));
    height: min(100dvh, calc(100vw * 16 / 9));
    max-height: 100dvh;
    overflow: hidden;
    background: var(--sb-ink);
    display: flex;
    flex-direction: column;
}
@media (max-width: 600px) {
    .sb-stage { width: 100vw; height: 100dvh; }
}
.sb-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sb-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.05) 35%, rgba(0,0,0,.78)); pointer-events: none; }
.sb-shade.is-strong { background: linear-gradient(to bottom, rgba(10,6,20,.55), rgba(10,6,20,.82)); }
.sb-badge {
    position: absolute; top: 14px; right: 14px; z-index: 2;
    font: 700 11px/1 system-ui, sans-serif; letter-spacing: .08em;
    padding: 5px 8px; border-radius: 6px; background: rgba(255,255,255,.18); backdrop-filter: blur(6px);
}
.sb-badge.is-inline { position: static; display: inline-block; padding: 3px 5px; font-size: 9px; vertical-align: middle; }

.sb-btn {
    display: block; width: 100%; max-width: 340px; padding: 16px 20px; border: 0; border-radius: 999px;
    font: 800 17px/1 system-ui, sans-serif; letter-spacing: .06em; text-align: center; text-decoration: none; cursor: pointer;
    transition: transform .12s ease, filter .12s ease;
}
@media (hover: hover) and (pointer: fine) { .sb-btn:hover { transform: translateY(-1px); filter: brightness(1.05); } }
.sb-btn:active { transform: translateY(1px); }
.sb-btn-play { background: var(--sb-orange); color: #fff; box-shadow: 0 8px 26px rgba(255,122,26,.45); }
.sb-btn-talk { background: #fff; color: var(--sb-ink); }
.sb-back {
    position: absolute; top: 12px; left: 12px; z-index: 3; color: #fff; text-decoration: none;
    background: rgba(0,0,0,.35); padding: 6px 12px; border-radius: 999px; font-size: 15px;
}

/* ---- PLAY ---- */
.pl-top {
    position: relative; z-index: 2; display: flex; align-items: center; gap: 10px;
    padding: 12px 12px 10px 56px; min-height: 58px;
}
.pl-top .sb-back { top: 13px; }
.pl-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.pl-who img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.6); }
.pl-who small { display: block; opacity: .75; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-restart { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 999px; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.pl-goal {
    position: relative; z-index: 2; margin: 0 12px 6px; padding: 10px 12px; border-radius: 14px;
    background: var(--sb-glass); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.1);
}
.pl-wants { font-weight: 600; font-size: 14px; }
.pl-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; padding: 0; }
.pl-steps li { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.1); opacity: .7; }
.pl-steps li.is-now { opacity: 1; background: rgba(255,122,26,.25); box-shadow: inset 0 0 0 1px var(--sb-orange); }
.pl-steps li.is-done { opacity: 1; background: rgba(80,200,120,.25); }
.pl-turns { font-size: 11px; opacity: .65; text-align: right; }
.pl-list { position: relative; z-index: 2; padding: 12px; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.pl-list button {
    text-align: left; color: #fff; background: var(--sb-glass); border: 1px solid rgba(255,255,255,.14); border-radius: 14px;
    padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
}
.pl-list button span { opacity: .85; font-size: 14px; }
.pl-list button small { color: var(--sb-orange); font-weight: 700; }
.pl-log { position: relative; z-index: 2; flex: 1; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.pl-msg { max-width: 82%; padding: 9px 13px; border-radius: 18px; font-size: 15px; word-wrap: break-word; animation: plIn .18s ease; }
.pl-msg.is-her { align-self: flex-start; background: rgba(255,255,255,.94); color: var(--sb-ink); border-bottom-left-radius: 6px; }
.pl-msg.is-me { align-self: flex-end; background: var(--sb-orange); color: #fff; border-bottom-right-radius: 6px; }
.pl-msg.is-act { background: transparent; color: rgba(255,255,255,.88); padding: 2px 4px; max-width: 100%; font-size: 14px; }
.pl-msg img, .pl-msg video { max-width: 100%; border-radius: 12px; display: block; }
.pl-msg.is-typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: #888; animation: plDot 1s infinite; }
.pl-msg.is-typing span:nth-child(2) { animation-delay: .15s; }
.pl-msg.is-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes plDot { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes plIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pl-form { position: relative; z-index: 2; display: flex; gap: 8px; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); }
.pl-form input { flex: 1; min-width: 0; padding: 13px 16px; border-radius: 999px; border: 0; font-size: 16px; background: rgba(255,255,255,.95); color: var(--sb-ink); }
.pl-form button { width: 48px; border: 0; border-radius: 50%; background: var(--sb-orange); color: #fff; font-size: 18px; cursor: pointer; }
.pl-end { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 24px max(20px, env(safe-area-inset-bottom)); text-align: center; }
.pl-end strong { font-size: 18px; }
.is-won .pl-end strong { color: #ffd27a; }
.pl-debug {
    position: relative; z-index: 2; margin: 0 12px 10px; padding: 8px 10px; border-radius: 10px; max-height: 96px; overflow: auto;
    background: rgba(0,0,0,.6); color: #9fe6b0; font: 11px/1.35 ui-monospace, Consolas, monospace; white-space: pre-wrap;
}
/* [WaifuChat] :hover só com mouse (convenção do site: no celular grudaria no toque). */
/* PLAY v2: cena trocável, sugestões, final com recompensa, travas. */
.pl-scene { position: absolute; inset: 0; }
.pl-suggest { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px; justify-content: flex-end; }
.pl-suggest button {
    border: 1px solid rgba(255,255,255,.55); background: rgba(20,16,31,.55); color: #fff; backdrop-filter: blur(6px);
    border-radius: 999px; padding: 7px 12px; font-size: 13px; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .pl-suggest button:hover { background: rgba(255,122,26,.35); border-color: var(--sb-orange); } }
/* Botões do desafio (uma resposta cada): embaixo, acima das sugestões; maiores
   que elas, menores que PLAY WITH HER / JUST TALK (.sb-btn). */
.pl-choices { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 4px; }
.pl-suggest .pl-choice {
    flex: 1 1 0; min-width: 120px; max-width: 220px; padding: 12px 16px; border: 0;
    background: rgba(255,255,255,.94); color: var(--sb-ink); font: 800 15px/1.1 system-ui, sans-serif; letter-spacing: .03em;
    box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
@media (hover: hover) and (pointer: fine) { .pl-suggest .pl-choice:hover { background: var(--sb-orange); color: #fff; border: 0; } }
.pl-reward, .pl-unlocked a {
    display: block; width: 100%; max-width: 340px; padding: 10px 14px; border-radius: 12px; font-size: 14px;
    background: rgba(255,255,255,.12); color: #fff; text-decoration: none;
}
.pl-reward a { color: #ffd27a; }
.pl-unlocked { display: flex; flex-direction: column; gap: 6px; width: 100%; align-items: center; }
.pl-unlocked a { background: rgba(80,200,120,.22); box-shadow: inset 0 0 0 1px rgba(80,200,120,.6); }
.pl-price { background: #ffd27a; color: var(--sb-ink); padding: 1px 6px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.pl-list button.is-locked { opacity: .75; }
.pl-list button.is-locked small { color: #ffd27a; }
.pl-locked { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 12px; text-align: center; }
.pl-soon { opacity: .8; font-size: 14px; }
.pl-404 { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; height: 100%; padding: 24px; text-align: center; position: relative; z-index: 2; }

/* [WaifuGame] Página de personas (play.php sem ?c= → play/hub.php): cartões 9:16
   que imitam a tela de cada personagem. Rola como página normal (o body do PLAY
   é um palco centrado). */
body.sb-hubpage { display: block; height: auto; min-height: 100%; overflow-y: auto; }
.hub-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; height: 54px; padding: 8px 14px; background: rgba(16,16,16,.93); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,.08); }
.hub-brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; min-width: 0; }
.hub-brand .site-logo { max-height: 34px; max-width: 150px; }
.hub-title { margin-left: auto; letter-spacing: .14em; color: var(--sb-orange); font-size: 15px; }
.hub-back { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.hub-main { max-width: 1180px; margin: 0 auto; padding: 18px 14px 40px; }
.hub-intro h1 { font-size: clamp(22px, 5vw, 32px); margin: 6px 0; }
.hub-intro p { margin: 0 0 16px; opacity: .75; }
.hub-empty { opacity: .85; }
.hub-empty a { color: var(--sb-orange); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.hub-card { position: relative; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: var(--sb-ink); box-shadow: 0 10px 30px rgba(0,0,0,.5); isolation: isolate; }
.hub-bg, .hub-bg video, .hub-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hub-initial { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 72px/1 system-ui, sans-serif; color: rgba(255,255,255,.2); background: radial-gradient(at top, #50263a, #171119); }
.hub-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(10,6,20,.55), transparent 26%, transparent 48%, rgba(10,6,20,.92)); pointer-events: none; }
.hub-top { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 2; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.hub-face { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.7); flex: none; }
.hub-top strong { font-size: 15px; }
.hub-top small { display: block; font-size: 11px; color: #7dffb0; }
.hub-tags { position: absolute; top: 56px; left: 10px; right: 10px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.hub-tags span { font-size: 10px; background: rgba(230,60,50,.88); padding: 2px 6px; border-radius: 6px; }
.hub-cover { position: absolute; inset: 0; z-index: 1; }
.hub-bottom { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.hub-bottom p { margin: 0 0 2px; font-weight: 800; font-size: clamp(14px, 3.2vw, 18px); text-shadow: 0 2px 10px rgba(0,0,0,.75); }
.hub-play, .hub-talk { display: block; padding: 12px 10px; border-radius: 999px; font: 800 14px/1.05 system-ui, sans-serif; letter-spacing: .05em; text-decoration: none; }
.hub-play { background: var(--sb-orange); color: #fff; box-shadow: 0 6px 18px rgba(255,122,26,.45); }
.hub-play small { display: block; font-size: 10px; font-weight: 600; opacity: .85; margin-top: 3px; letter-spacing: 0; }
.hub-talk { background: #fff; color: var(--sb-ink); }
@media (max-width: 520px) {
    .hub-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .hub-bottom { left: 8px; right: 8px; bottom: 8px; gap: 6px; }
    .hub-bottom p { font-size: 12px; }
    .hub-play, .hub-talk { padding: 9px 6px; font-size: 11px; }
    .hub-top strong { font-size: 13px; }
    .hub-face { width: 28px; height: 28px; }
}
@media (hover: hover) and (pointer: fine) {
    .hub-card { transition: transform .15s ease; }
    .hub-card:hover { transform: translateY(-3px); }
    .hub-back:hover { border-color: #fff; }
}

/* [WaifuGame] "Abre na tela": cartão na conversa e o quadro por cima do jogo. */
.pl-msg.is-open { display: flex; gap: 10px; align-items: center; max-width: 88%; padding: 8px; }
.pl-msg.is-open img { width: 54px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; background: #222; }
.pl-msg.is-open strong { display: block; font-size: 14px; margin-bottom: 6px; }
.pl-open-btn { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--sb-orange); color: #fff; font: 800 13px/1 system-ui, sans-serif; cursor: pointer; }
.pl-frame { position: absolute; inset: 0; z-index: 20; background: #000; }
.pl-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.pl-frame-x { position: absolute; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.pl-frame.has-own-exit .pl-frame-x { display: none; }
