/* SÓ ME FOLD — Mesa do host (PC): tela cheia, sem rolagem, escuro igual ao logo */
body.hp { height: 100vh; overflow: hidden; display: block; font-size: 17px; }
.hp-btn {
  font: inherit; font-size: 17px; color: var(--ink); background: var(--surface); border: 2px solid var(--edge); border-radius: 12px;
  min-height: 48px; padding: 6px 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap;
}
.hp-btn:hover:not(:disabled) { border-color: var(--red); }
.hp-btn:active:not(:disabled) { transform: scale(.97); }
.hp-btn:disabled { opacity: .35; cursor: not-allowed; }
.hp-btn.primary { background: var(--grad-primary); border-color: var(--red-line); color: #fff; font-weight: 700; }
.hp-btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.hp-btn.danger { color: var(--red-txt); border-color: var(--red); background: transparent; font-weight: 700; }
.hp-btn.danger.solid, .hp-btn.danger.armed { background: var(--red); color: #fff; }
.hp-btn.small { min-height: 44px; font-size: 16px; padding: 4px 12px; }
.hp-btn.warn { border-color: var(--gold-line); color: var(--gold); }
.hp-x { font: inherit; font-size: 22px; background: transparent; border: 1px solid var(--line); color: var(--ink-2); border-radius: 10px; width: 48px; height: 48px; cursor: pointer; }
.hp-x:hover { border-color: var(--red); color: var(--ink); }

/* entrada */
.hp-login { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 20%, #1D1D22, #0B0B0D 65%); }
.hp-login-box { text-align: center; width: 380px; max-width: 92vw; }
.hp-login-logo { width: 120px; border-radius: 16px; }
.hp-login h1 { font-family: var(--serif); text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 0; background: var(--steel); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 34px; }
.hp-pin-dots { display: flex; gap: 12px; justify-content: center; margin: 16px 0; min-height: 22px; }
.hp-pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--edge); }
.hp-pin-dots span.on { background: var(--red-txt); border-color: var(--red-txt); }
.hp-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hp-key { font: inherit; font-size: 28px; font-weight: 700; min-height: 72px; border-radius: 14px; border: 2px solid var(--edge); background: var(--surface); color: var(--ink); cursor: pointer; }
.hp-key:hover { border-color: var(--red); }
.hp-key.ok { background: var(--red); border-color: var(--red-line); color: #fff; font-size: 20px; }
.hp-err { color: var(--red-txt); min-height: 24px; font-weight: 700; }

/* estrutura da tela: topo · (relógio | jogadores) · barra de status */
.hp-app { position: relative; z-index: 0; display: grid; grid-template-rows: auto 1fr auto; height: 100vh; }
.hp-top { display: flex; align-items: center; gap: 14px; padding: 8px 18px; border-bottom: 2px solid var(--red); background: linear-gradient(180deg, #16161A, #0B0B0D); }
.hp-brand { display: flex; align-items: baseline; gap: 8px; }
.hp-brand .spade { font-size: 28px; }
.hp-brand-name { font-family: var(--serif); font-weight: 700; font-size: 28px; letter-spacing: .05em; background: var(--steel); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hp-brand-sub { font-family: var(--serif); color: var(--red-txt); letter-spacing: .18em; text-transform: uppercase; font-size: 15px; font-weight: 700; }
.hp-pill { font-family: var(--serif); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; padding: 4px 12px; border-radius: 999px; border: 2px solid var(--edge); color: var(--ink-2); font-size: 15px; }
.hp-pill.rodando { border-color: var(--ok); color: var(--ok); }
.hp-pill.pausado { border-color: var(--gold-line); color: var(--gold); background: var(--gold-soft); animation: hp-blink 1.4s steps(2) infinite; }
.hp-pill.fim { border-color: var(--red); color: var(--red-txt); }
.hp-conn { width: 12px; height: 12px; border-radius: 50%; background: var(--edge); }
.hp-conn.ok { background: var(--ok); } .hp-conn.bad { background: var(--red-txt); }
.hp-top-actions { margin-left: auto; display: flex; gap: 8px; }
#undo:not(:disabled) { color: var(--ink); border-color: var(--edge); max-width: 380px; overflow: hidden; text-overflow: ellipsis; }

.hp-main { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr); min-height: 0; }
.hp-clock { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2vh; padding: 1.5vh 2vw; border-right: 1px solid var(--line); min-height: 0; text-align: center; }
/* faixa "NÍVEL X": espaço reservado ACIMA do relógio (nunca cobre o tempo) */
.hp-banner { width: 100%; height: 13vh; min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 18px; border: 2px solid transparent; position: relative; transition: background .3s; }
.hp-banner-t { font-family: var(--serif); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: clamp(30px, 5vh, 56px); line-height: 1; background: var(--steel); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hp-banner-s { color: var(--ink-2); font-size: clamp(16px, 2.2vh, 24px); margin-top: .6vh; }
.hp-banner.flash { background: linear-gradient(180deg, #C61E27, #7E0D13); border-color: #E2333C; animation: hp-pulse 0.9s ease-in-out 6; box-shadow: 0 0 40px rgba(226, 51, 60, .45); }
.hp-banner.flash .hp-banner-t { background: none; color: #fff; font-size: clamp(40px, 7.5vh, 84px); }
.hp-banner.flash .hp-banner-s { color: #FFE3E4; font-weight: 700; }
.hp-banner-ok { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: #fff; color: #7E0D13; border-color: #fff; font-weight: 700; }
.hp-time { font-family: var(--serif); font-weight: 700; font-variant-numeric: tabular-nums; line-height: .9; font-size: clamp(110px, min(26vh, 15vw), 300px); /* H9: cabe em 1180 px */ letter-spacing: .02em; color: var(--ink); }
.hp-time.low { color: var(--red-txt); }
body.paused .hp-time { opacity: .55; }
.hp-bar-wrap { width: 80%; height: 10px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.hp-progress { height: 100%; width: 0; background: linear-gradient(90deg, var(--red-2), var(--red-txt)); transition: width .25s linear; }
.hp-blinds { display: flex; gap: 4vw; align-items: flex-end; justify-content: center; }
.hp-blinds div { display: flex; flex-direction: column; align-items: center; }
.hp-blinds small { color: var(--ink-2); text-transform: uppercase; letter-spacing: .12em; font-size: 15px; }
.hp-blinds strong { font-family: var(--serif); font-size: clamp(40px, 8vh, 92px); line-height: 1; font-variant-numeric: tabular-nums; }
#ante-box strong { font-size: clamp(30px, 5.5vh, 64px); color: var(--ink-2); }
#ante-box.dim { opacity: .35; }
.hp-next { font-size: clamp(18px, 2.6vh, 28px); color: var(--ink); }
.hp-sub { color: var(--ink-2); font-size: 16px; min-height: 22px; }
.hp-ctrl { display: grid; grid-template-columns: 1fr 1fr 1.6fr 1fr 1fr; gap: 10px; width: min(100%, 760px); margin-top: .8vh; } /* H9: 5 controles numa linha fixa */
.hp-ctrl .hp-btn { min-height: 64px; min-width: 0; font-size: 19px; padding: 6px 8px; }
.hp-main-btn { font-size: 24px !important; }
.hp-ctrl2 { display: flex; gap: 10px; justify-content: center; }

.hp-side { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; min-height: 0; }
.hp-quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.hp-quick .hp-btn { min-height: 56px; padding: 4px 8px; font-size: 16px; white-space: normal; }
.hp-tip { margin: 0; color: var(--ink-2); font-size: 15px; }
.hp-killer { border: 2px solid var(--red); border-radius: 14px; padding: 8px 10px; background: var(--red-soft); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hp-killer > span { width: 100%; font-weight: 700; }
.hp-killer-list { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.hp-grid { flex: 1; min-height: 0; overflow: auto; /* H9: degradê mostra que tem mais para rolar */ -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent); padding-bottom: 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-content: start; }
.hp-grid-h { grid-column: 1 / -1; font-family: var(--serif); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-size: 15px; border-bottom: 1px solid var(--line); padding: 4px 0 2px; margin-top: 2px; }
.hp-card { font: inherit; text-align: left; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 12px; min-height: 64px; padding: 6px 10px; cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.hp-card:hover { border-color: var(--red); background: var(--red-soft); }
.hp-card-n { font-weight: 700; font-size: 18px; line-height: 1.1; }
.hp-card-m { display: flex; flex-wrap: wrap; gap: 4px; }
.hp-card .tag { font-size: 14px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.hp-card .tag.ko { color: var(--gold); border-color: var(--gold-dim); }
.hp-card .tag.out { color: var(--red-txt); border-color: var(--red-2); }
.hp-card.gone { opacity: .55; }
.hp-card.none { border-style: dashed; color: var(--ink-2); background: transparent; }

.hp-status { display: flex; border-top: 2px solid var(--red); background: #0F0F12; }
.hp-st { flex: 1 1 0; min-width: 0; padding: 6px 10px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.hp-st:last-child { border-right: 0; }
.hp-st small { color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; font-size: 14px; }
.hp-st strong { font-variant-numeric: tabular-nums; font-size: clamp(15px, 1.15vw, 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* menu do jogador */
.hp-sheet { position: fixed; right: 18px; top: 140px; width: 360px; max-width: 92vw; background: #16161A; border: 2px solid var(--red); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); z-index: 20; padding: 12px; }
.hp-sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hp-sheet-h strong { font-family: var(--serif); font-size: 28px; text-transform: uppercase; letter-spacing: .04em; }
.hp-sheet-b { display: flex; flex-direction: column; gap: 8px; }
.hp-act { font: inherit; text-align: left; color: var(--ink); background: var(--surface); border: 2px solid var(--edge); border-radius: 14px; min-height: 64px; padding: 8px 14px; cursor: pointer; display: flex; flex-direction: column; justify-content: center; }
.hp-act strong { font-size: 20px; }
.hp-act small { color: var(--ink-2); font-size: 14px; }
.hp-act:hover:not(:disabled) { border-color: var(--red); }
.hp-act.primary { background: var(--grad-primary); border-color: var(--red-line); }
.hp-act.primary small { color: #FFE3E4; }
.hp-act.danger { border-color: var(--red); }
.hp-act.danger strong { color: var(--red-txt); }
.hp-act:disabled { opacity: .35; cursor: not-allowed; }

/* janelas */
.hp-overlay { position: fixed; inset: 0; background: rgba(5, 5, 7, .78); display: grid; place-items: center; z-index: 30; }
.hp-ov-box { width: 560px; max-width: 94vw; max-height: 92vh; display: flex; flex-direction: column; background: var(--card); border: 2px solid var(--edge); border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.hp-ov-box.wide { width: 1180px; }
.hp-ov-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.hp-ov-h h2 { margin: 0; font-family: var(--serif); text-transform: uppercase; letter-spacing: .05em; font-size: 26px; }
.hp-ov-b { padding: 14px 16px; overflow: auto; }
.hp-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.hp-col { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.hp-confirm-t { font-size: 19px; }
.hp-steprow { display: grid; grid-template-columns: 90px 64px 1fr 64px; gap: 10px; align-items: center; margin: 10px 0; }
.hp-steprow .hp-btn { min-height: 64px; font-size: 26px; }
.hp-stepv { text-align: center; font-size: 26px; font-variant-numeric: tabular-nums; }
.hp-toggle { justify-content: flex-start; min-height: 56px; }
.hp-toggle.on { border-color: var(--ok); color: var(--ok); }
.hp-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 10px; }
.hp-table { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.hp-table h3 { margin: 0 0 6px; font-family: var(--serif); text-transform: uppercase; }
.hp-table ol { list-style: none; margin: 0; padding: 0; columns: 2; }
.hp-table li { padding: 2px 0; }
.hp-moves { color: var(--gold); font-weight: 700; }
.hp-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.hp-pick .hp-btn { min-height: 64px; min-width: 140px; font-size: 19px; }
.hp-result { columns: 2; font-size: 19px; padding-left: 0; list-style: none; }
.hp-result li { padding: 4px 0; color: var(--ink-2); }
.hp-result li.on { color: var(--ink); font-weight: 700; }
.hp-result li.todo { color: var(--edge); }
.hp-toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: #F1F1F2; color: #0B0B0D; padding: 12px 22px; border-radius: 14px; font-weight: 700; z-index: 40; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); max-width: 80vw; }

@keyframes hp-pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
@keyframes hp-blink { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .hp-banner.flash, .hp-pill.pausado { animation: none; } }
/* notebook 1366×768 */
@media (max-height: 800px) {
  .hp-ctrl .hp-btn { min-height: 56px; min-width: 0; font-size: 17px; }
  .hp-main-btn { font-size: 21px !important; }
  .hp-banner { min-height: 70px; }
  .hp-card { min-height: 56px; }
}

/* E2: telas até 1280 px de largura (notebook, tablet deitado) — nada sai da tela */
@media (max-width: 1280px) {
  .hp-top { flex-wrap: wrap; gap: 8px 10px; padding: 6px 12px; }
  .hp-brand-sub, .hp-fmt { display: none; }
  .hp-top-actions { flex-wrap: wrap; gap: 6px; }
  .hp-top-actions .hp-btn { min-height: 44px; padding: 4px 10px; font-size: 15px; }
  #undo:not(:disabled) { max-width: 240px; }
  .hp-main { grid-template-columns: minmax(0, 1fr) minmax(330px, .95fr); }
  .hp-quick { grid-template-columns: repeat(3, 1fr); }
  .hp-ctrl .hp-btn { min-width: 0; font-size: 16px; padding: 4px 6px; }
  .hp-ctrl .hp-main-btn { min-width: 0 !important; font-size: 20px !important; }
  .hp-status { flex-wrap: wrap; }
  .hp-st { flex: 1 1 18%; }
}
/* pergunta curta: sempre por cima das janelas */
.hp-dlg { z-index: 35; }
.hp-input { font: inherit; font-size: 19px; width: 100%; min-height: 56px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--edge); background: var(--paper-2); color: var(--ink); }
.hp-input:focus { border-color: var(--red-txt); outline: none; }

.hp-fmt { font-family: var(--serif); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-size: 16px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* H1: pedidos esperando o host, direto na tela do PC */
.hp-btn.pending { background: var(--red); border-color: var(--red-line); color: #fff; font-weight: 700; animation: hp-pending 1.6s ease-in-out infinite; }
@keyframes hp-pending { 50% { box-shadow: 0 0 0 6px rgba(239, 81, 87, .25); } }
.hp-pend-h { font-family: var(--serif); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 14px 0 6px; font-size: 16px; }
.hp-pend { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hp-pend strong { font-size: 18px; } .hp-pend small { color: var(--ink-2); display: block; }
.hp-pend .hp-row { justify-content: flex-end; }
.hp-pend img { width: 120px; max-height: 160px; object-fit: contain; border-radius: 8px; border: 1px solid var(--edge); grid-column: 1 / -1; cursor: zoom-in; }
.hp-code { font-family: var(--serif); font-size: 30px; letter-spacing: .12em; }
/* H11: atalhos */
.hp-keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; font-size: 18px; }
.hp-keys kbd { font: inherit; font-weight: 700; border: 2px solid var(--edge); border-bottom-width: 4px; border-radius: 8px; padding: 2px 10px; background: var(--paper-2); min-width: 44px; text-align: center; display: inline-block; }
/* D10: a marca não quebra em 2 linhas */
.hp-brand { flex: none; white-space: nowrap; }
.hp-fmt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hp-ctrl .hp-main-btn { min-width: 0 !important; } /* H9: o botão principal cabe na grade de 5 */
.hp-ic { display: inline-block; margin-right: 6px; filter: grayscale(1) brightness(1.4) contrast(.9); } /* D9 */

/* 07/10: escolha do som da troca de nível */
.hp-sounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 10px; margin-top: 8px; }
.hp-sound { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid var(--edge); border-radius: 14px; background: var(--paper-2); }
.hp-sound.on { border-color: var(--ok); }
.hp-sound-t { flex: 1; min-width: 0; } .hp-sound-t strong { display: block; } .hp-sound-t small { display: block; color: var(--ink-2); line-height: 1.3; }
.hp-sound .hp-btn { min-width: 0; white-space: nowrap; }

/* 08/10 (host): marca d'água do logo atrás do relógio e logo na barra de cima */
.hp-clock { position: relative; isolation: isolate; }
.hp-clock::before { content: ''; position: absolute; inset: 10% 6%; z-index: -1; background: url(/logo.webp) center / contain no-repeat; opacity: .15; pointer-events: none; }
.hp-brand { align-items: center; }
.hp-brand-mark { height: 30px; width: auto; display: block; }
/* 08/10: com o botão 🌙 Encerrar jogo, a barra de cima aperta um pouco em telas até 1600px (nada sai da tela) */
.hp-app { grid-template-columns: minmax(0, 1fr); }
.hp-top-actions { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 1600px) {
  .hp-top { gap: 10px; padding: 8px 12px; }
  .hp-top-actions { gap: 6px; }
  .hp-top-actions .hp-btn { padding: 4px 10px; font-size: 15px; }
}
