/* Player screen: phone, portrait, thumb-friendly (all targets >= 48 px). */
/* Neutral SoToy! look (no game world here): plush lavender felt. */
body.play { min-height: 100%; background: #DCC8F5 url('/assets/bg/stage-phone.webp') center top / cover no-repeat; background-attachment: fixed; }

.ptop { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
.plogo { font-weight: 800; font-size: 28px; color: var(--ink); letter-spacing: -1px; }
.plogo .bang { display: inline-block; color: var(--accent); transform: rotate(12deg); }
.ptop .lang-switch { font-size: 15px; }
.ptop .lang-switch button { min-height: 40px; min-width: 52px; }

.view { min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px); padding: 6px 16px 32px; }

/* The ticket. Perforation on the left edge + a stub at the bottom. */
.ticket {
  position: relative; max-width: 460px; margin: 0 auto; background: var(--paper); color: var(--paper-ink);
  border: 3px solid var(--ink); border-radius: 10px; padding: 18px 18px 0; box-shadow: 4px 6px 0 rgba(0,0,0,.35);
}
.ticket::before { /* punched holes */
  content: ''; position: absolute; left: -9px; top: 20px; bottom: 90px; width: 16px;
  background: radial-gradient(circle at 8px 10px, #DCC8F5 0 6px, transparent 7px) 0 0 / 16px 26px repeat-y;
}
.ticket-title { margin: 0 0 12px; font-size: 26px; font-weight: 800; line-height: 1.1; }
.field { display: block; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field-label { display: block; font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--brand); margin-bottom: 4px; padding: 0; }
.field-hint { display: block; font-size: 13px; opacity: .75; margin-top: 3px; }
.field input {
  width: 100%; height: 56px; border: 3px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink);
  font: 800 24px var(--font); padding: 0 14px; outline: none;
}
.field input:focus { box-shadow: 0 0 0 4px var(--accent); }
#codeInput { letter-spacing: 6px; font-variant-numeric: tabular-nums; }

.avatar-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.avatar-btn { position: relative; aspect-ratio: 1; min-height: 56px; border: 3px solid transparent; border-radius: 12px; background: #EFE3CD; padding: 4px; }
.avatar-btn[aria-pressed="true"] { border-color: var(--ink); background: var(--accent); transform: translateY(-2px) rotate(-3deg); box-shadow: 0 4px 0 var(--ink); }
.avatar-btn:disabled { opacity: .45; cursor: not-allowed; }
.avatar-btn .taken { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%) rotate(-6deg); background: var(--ink); color: var(--paper); font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 4px; text-transform: uppercase; }

.form-error { margin: 0 0 12px; background: var(--brand); color: #fff; font-weight: 600; font-size: 16px; padding: 10px 12px; border-radius: 8px; border: 2px solid var(--ink); }

.btn-big {
  width: 100%; min-height: 60px; border: 3px solid var(--ink); border-radius: 14px; background: var(--accent); color: var(--ink);
  font-weight: 800; font-size: 22px; box-shadow: 0 5px 0 var(--ink); margin-bottom: 18px;
}
.btn-big:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn-big:disabled { opacity: .6; }

.stub { margin: 0 -18px; border-top: 3px dashed var(--ink); padding: 10px 18px 12px; display: flex; justify-content: space-between; font-weight: 800; letter-spacing: 3px; font-size: 14px; opacity: .7; }

/* Waiting room and game screens: centred column. */
.view.center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.you-bubble { margin: 8px 0 22px; padding: 12px 26px; }
.you-bubble::after { content: ''; position: absolute; left: 50%; bottom: -16px; margin-left: -12px; border: 12px solid transparent; border-top: 16px solid var(--ink); border-bottom: 0; }
.you-bubble h1 { margin: 0; font-size: 40px; line-height: 1.1; }
.my-portrait { width: 170px; height: 170px; }
.portrait-bg { background: #F3E6CF; display: grid; place-items: center; padding: 6%; }
.my-label { margin-top: 12px; min-width: 180px; transform: rotate(-1.2deg); font-size: 22px; }
.my-label .label-sub { font-size: 14px; }
.look { font-size: 26px; font-weight: 800; margin: 26px 0 0; }
.look-help { font-size: 15px; font-style: italic; margin: 2px 0 0; color: #4A3F66; }
.wait-line { font-size: 17px; font-weight: 600; color: #4A3F66; margin: 16px 0 0; max-width: 320px; }

.msg-card { max-width: 420px; margin: 40px auto 0; font-size: 22px; padding: 22px; display: flex; flex-direction: column; gap: 18px; }

.toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); font-weight: 600; padding: 10px 18px; border-radius: 999px; z-index: 5; }

/* In the game (phone). */
.game-view { gap: 14px; padding-bottom: 40px; }
.game-view .word-card { padding: 8px 18px 12px; transform: rotate(-1deg); text-align: center; }
.game-view .word-meta { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: var(--brand); }
.game-view .word { display: block; font-size: 34px; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.game-view .av.big { width: 140px; height: 140px; }
.game-view .av img { width: 100%; height: 100%; object-fit: contain; }
.help-id { display: block; font-size: 14px; font-style: italic; color: #4A3F66; margin-top: -8px; }
.p-cap { font-size: 22px; font-weight: 800; margin: 6px 0 0; }
.my-answer { font-size: 20px; font-weight: 600; max-width: 340px; padding: 12px 16px; }
.write-form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.write-form .p-cap { text-align: center; }
.write-form .help-id { text-align: center; margin: -6px 0 0; }
.answer { width: 100%; border: 3px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); font: 600 20px/1.35 var(--font); padding: 12px 14px; resize: none; outline: none; }
.answer:focus { box-shadow: 0 0 0 4px var(--accent); }
.count-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: #4A3F66; }
.count-row .count { font-weight: 800; flex: none; }
.write-form .btn-big { margin: 4px 0 0; }
.vote-list { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.vote-btn {
  display: flex; gap: 12px; align-items: baseline; text-align: left; min-height: 56px; padding: 12px 14px;
  border: 3px solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--paper-ink);
  font: 600 18px/1.3 var(--font); box-shadow: 0 4px 0 var(--ink);
}
.vote-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.vote-btn:disabled { opacity: .55; box-shadow: none; }
.vote-btn .opt-no { flex: none; font-weight: 800; color: var(--brand); }
.vote-btn .opt-text { flex: 1; }
.own-tag { flex: none; align-self: center; background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }
.gain { font-size: 34px; font-weight: 800; color: var(--brand); margin: 0; }
.total { font-size: 22px; padding: 10px 18px; }

.btn-quiet-dark { margin-top: 28px; min-height: 48px; padding: 0 18px; border: 2px solid var(--ink); border-radius: 12px; background: transparent; color: var(--ink); font-weight: 800; font-size: 16px; }
.host-off { position: sticky; top: calc(64px + env(safe-area-inset-top)); margin: 0 12px 8px; z-index: 6; background: var(--brand); color: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 10px 14px; font-weight: 800; font-size: 15px; text-align: center; }
