/* Phone screens (also used by pass-the-phone). Designed from 320px up. */
:root { --u: 1px; }
body { min-height: 100dvh; padding-bottom: 56px; }
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center-text { text-align: center; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.wordmark { font-size: 46px; line-height: .95; text-align: center; text-shadow: 3px 3px 0 var(--ink), 5px 5px 0 var(--robe); }
.wordmark span { color: var(--accent); display: block; }
h2 { font-size: 28px; line-height: 1.1; }
a { color: var(--accent); }

.ptop { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; background: #100f14e6; border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.brand { display: inline-flex; gap: 7px; align-items: center; font-family: var(--display); font-size: 18px; color: var(--paper); text-decoration: none; white-space: nowrap; }
.brand .star { color: var(--accent); width: 18px; height: 18px; }
.ptop-right { display: flex; gap: 6px; align-items: center; }
.score-pill { font-weight: 800; font-size: 13px; color: var(--ink); background: var(--accent); border-radius: 999px; padding: 3px 9px; }
.sound-btn { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.sound-btn[aria-pressed="true"] { color: var(--ink); background: var(--accent); border-color: var(--ink); }

.pwrap { width: min(480px, 100% - 32px); margin: 0 auto; padding: 18px 0 24px; }
.screen { display: flex; flex-direction: column; gap: 14px; animation: fadeUp .35s ease both; }
.screen.center { align-items: center; text-align: center; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

.btn.wide { width: 100%; font-size: 20px; padding: 16px 20px; }
.err { color: var(--danger); font-weight: 700; min-height: 1.2em; font-size: 14px; }
.err:empty { min-height: 0; }
.err.close { color: var(--cosmic); font-style: italic; }

/* join */
.join-logo { width: min(100%, 420px); align-self: center; filter: drop-shadow(0 8px 20px #000a); animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.join-form { display: grid; gap: 12px; }
.join-form label { display: grid; gap: 6px; font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
input { font: inherit; font-size: 22px; font-weight: 800; color: var(--ink); background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; padding: 12px 14px; width: 100%; box-shadow: 0 4px 0 var(--ink); text-transform: none; letter-spacing: normal; }
input:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
#inCode { text-transform: uppercase; letter-spacing: .3em; font-family: var(--display); font-size: 30px; text-align: center; }

/* lobby */
.me-big { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }

/* secret card */
.secret { position: relative; width: min(100%, 340px); aspect-ratio: 3 / 4; border-radius: 22px; border: 4px solid var(--ink); background: var(--robe); color: var(--paper); box-shadow: 8px 8px 0 var(--ink); padding: 0; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.secret .cover { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; gap: 8px; background: repeating-linear-gradient(45deg, #2b2366, #2b2366 14px, #33297a 14px, #33297a 28px); transition: transform .35s cubic-bezier(.5, 0, .3, 1); }
.secret .cover b { font-family: var(--display); font-size: 30px; font-weight: 400; }
.cover-star { font-size: 56px; color: var(--accent); animation: spin 6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.secret.open .cover { transform: translateY(-100%); }
.inside { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 18px; background: var(--paper); color: var(--ink); text-align: center; }
.inside.imp { background: #1a1533; color: var(--paper); }
.inside .label { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.inside .word { font-family: var(--display); font-size: clamp(30px, 10vw, 44px); line-height: 1.05; word-break: break-word; }
.inside.imp .word { color: var(--accent); }
.inside .cat { font-weight: 800; font-size: 16px; }
.inside .hint { font-size: 14px; font-weight: 700; background: var(--accent); color: var(--ink); border-radius: 8px; padding: 3px 10px; }
.inside .tip { font-size: 13px; opacity: .8; }
.peek-btn { align-self: center; border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 10px 16px; font-weight: 700; font-size: 14px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.peek-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: #000c; padding: 20px; }
.peek-overlay .inside { position: relative; inset: auto; width: min(100%, 340px); aspect-ratio: 3 / 4; border-radius: 22px; border: 4px solid var(--ink); }

/* turns */
.turn-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.ptimer { font-family: var(--display); font-size: 28px; width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 4px solid var(--accent); color: var(--accent); }
.ptimer:empty, .ptimer[hidden] { visibility: hidden; display: grid !important; }
.ptimer.urgent { border-color: var(--danger); color: var(--danger); animation: throb .5s ease-in-out infinite alternate; }
@keyframes throb { to { transform: scale(1.08); } }
.cat-line { font-weight: 800; font-size: 16px; color: var(--muted); }
.cat-line b { color: var(--accent); }
.clue-form { display: grid; gap: 10px; }
.mini-board { display: grid; gap: 8px; margin-top: 4px; }
.mrow { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.mrow.now { border-color: var(--accent); }
.mrow .nm { font-weight: 800; font-size: 14px; min-width: 64px; max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .cl { display: flex; flex-wrap: wrap; gap: 5px; }
.mrow .clue { background: var(--paper); color: var(--ink); border-radius: 8px; padding: 1px 8px; font-weight: 800; font-size: 14px; }
.mrow .clue.none { background: transparent; color: var(--muted); border: 1px dashed var(--line); font-weight: 500; }
.mrow .tick { margin-left: auto; color: var(--accent); font-weight: 800; font-size: 13px; }

/* vote */
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.vbtn { display: grid; justify-items: center; gap: 6px; padding: 10px 6px; border-radius: 16px; border: 3px solid var(--line); background: var(--surface); color: var(--paper); font-weight: 800; font-size: 14px; }
.vbtn .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vbtn .cl { font-size: 12px; color: var(--muted); font-weight: 600; line-height: 1.25; }
.vbtn.on { border-color: var(--accent); background: #d5ed5822; box-shadow: 0 0 0 3px #d5ed5844; }
.vbtn.off { opacity: .45; }

/* results */
.res-title { font-size: 42px; line-height: 1; }
.res-title.win { color: var(--accent); }
.res-title.lose { color: var(--cosmic); }
.word-chip { display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 20px; }
.word-chip b { font-family: var(--display); font-size: 32px; color: var(--accent); font-weight: 400; }
.res-points { font-weight: 800; font-size: 18px; }

/* coupons */
.coupon-box { display: grid; gap: 8px; justify-items: center; width: 100%; }
.coupon-box .coupon, .wallet .coupon { margin: 0 auto; }
.wallet { width: 100%; text-align: left; }
.wallet summary { cursor: pointer; font-weight: 800; color: var(--muted); font-size: 14px; padding: 6px 0; }
.wallet-list { display: grid; gap: 10px; padding-top: 6px; }
.coupon-list { display: grid; gap: 12px; width: 100%; }
.coupon-list .who { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; margin-bottom: 4px; }

/* pass-the-phone extras */
.list-edit { display: grid; gap: 8px; }
.list-edit .row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; }
.list-edit .row .nm { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-edit .x { border: 0; background: transparent; color: var(--muted); font-size: 22px; padding: 4px 8px; }
.add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.add-row .btn { padding: 10px 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.chip.on { background: var(--accent); color: var(--ink); border-color: var(--ink); }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opts label { display: grid; gap: 4px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.opts select { font: inherit; font-size: 16px; background: var(--bg); color: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.opts .toggle { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--paper); }
.opts .toggle input { width: 22px; height: 22px; accent-color: var(--accent); box-shadow: none; }
.scroggy-says { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; align-items: end; }
.scroggy-says img { width: 90px; height: 110px; object-fit: contain; object-position: bottom; }
.scroggy-says .speech { font-size: 15px; padding: 10px 12px; border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); }
.scroggy-says .speech:empty { visibility: hidden; }

.home-link { right: 12px; }
/* Phone on its side: the secret card and its button sit side by side so both fit. */
@media (orientation: landscape) and (max-height: 560px) {
  .pwrap { width: min(760px, 100% - 32px); padding-top: 10px; }
  #s-card { display: grid; grid-template-columns: auto minmax(0, 280px); align-items: center; justify-content: center; gap: 10px 28px; text-align: left; }
  #s-card > .eyebrow { grid-column: 1 / -1; text-align: center; }
  #s-card .secret { grid-row: 2 / span 2; width: calc((100dvh - 130px) * .75); }
  .secret .inside, .peek-overlay .inside { gap: 4px; padding: 10px; }
  .inside .avatar { --size: 64px !important; }
  .inside .tip { display: none; }
  .peek-overlay .inside { width: calc((100dvh - 60px) * .75); }
  .me-big .avatar { --size: 96px !important; }
}
@media (max-width: 360px) { .brand { font-size: 15px; } .sound-btn { padding: 5px 8px; } h2 { font-size: 24px; } }
