/* =====================================================================
   Peanut Games — Higher or Lower. All classes prefixed .hilo- so nothing
   collides with the arcade's .bac-/.bj-/.pcard styles. Dark navy panel
   (#0C2340) + gold accents (#f4b400), rounded tiles, white text.
   Reuses shared .btn / .status-pill from styles.css.
   ===================================================================== */
.hilo {
  --hilo-navy: #0C2340;
  --hilo-navy-2: #133056;
  --hilo-gold: #f4b400;
  --hilo-ink: #ffffff;
  --hilo-ink-soft: #b8c6da;
  --hilo-line: rgba(244, 180, 0, 0.28);
  max-width: 640px;
  margin: 0 auto;
}

.hilo-panel {
  background: linear-gradient(165deg, var(--hilo-navy-2) 0%, var(--hilo-navy) 60%);
  color: var(--hilo-ink);
  border: 1px solid var(--hilo-line);
  border-radius: var(--radius, 16px);
  box-shadow: var(--shadow, 0 6px 20px rgba(12, 35, 64, 0.35));
  padding: 18px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hilo-h2 {
  margin: 0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--hilo-ink);
}

/* ----- name entry ----- */
.hilo-nameform { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hilo-input {
  flex: 1 1 220px;
  max-width: 320px;
  min-height: 44px;
  padding: 10px 14px;
  font: inherit;
  font-size: 1rem;
  color: #16202c;
  background: #fff;
  border: 2px solid var(--hilo-gold);
  border-radius: 999px;
}
.hilo-input:focus-visible { outline: 2px solid var(--hilo-gold); outline-offset: 2px; }
.hilo-btn-start { min-height: 44px; padding: 0 22px; font-weight: 800; }

/* ----- rules ----- */
.hilo-rules {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--hilo-line);
  border-radius: var(--radius-sm, 10px);
  padding: 12px 14px;
}
.hilo-rules-title {
  font-weight: 800;
  color: var(--hilo-gold);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
}
.hilo-rules-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.hilo-rules-list li { font-size: 0.9rem; color: var(--hilo-ink-soft); line-height: 1.35; }

/* ----- scoreboard ----- */
.hilo-scoreboard {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}
.hilo-stat {
  flex: 1 1 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--hilo-line);
  border-radius: var(--radius-sm, 10px);
}
.hilo-stat-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--hilo-ink-soft); }
.hilo-stat-value { font-size: 1.7rem; font-weight: 900; color: var(--hilo-gold); line-height: 1; }
.hilo-player {
  flex: 1 1 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--hilo-line);
  border-radius: var(--radius-sm, 10px);
}
.hilo-player-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--hilo-ink-soft); }
.hilo-player-name { font-size: 1rem; font-weight: 800; color: var(--hilo-ink); text-align: center; word-break: break-word; }

/* ----- card table ----- */
.hilo-table {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 148px;
  padding: 6px 0;
}
.hilo-vs { font-size: 1.6rem; color: var(--hilo-gold); font-weight: 900; }

/* CSS-drawn playing card */
.hilo-card {
  position: relative;
  width: 96px;
  height: 134px;
  border-radius: 12px;
  background: linear-gradient(160deg, #ffffff, #eef1f6);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  flex: 0 0 auto;
}
.hilo-card.red { color: #c0392b; }
.hilo-card.black { color: #16202c; }
.hilo-card.is-current { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 0 0 2px var(--hilo-gold); }
.hilo-card.is-reveal { animation: hiloDeal 0.42s cubic-bezier(0.2, 0.75, 0.3, 1) both; }

.hilo-corner { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: 0.9; }
.hilo-corner.tl { top: 6px; left: 7px; }
.hilo-corner.br { bottom: 6px; right: 7px; transform: rotate(180deg); }
.hilo-corner .hilo-rank { font-size: 1.05rem; font-weight: 900; }
.hilo-corner .hilo-suit { font-size: 0.85rem; }
.hilo-pip {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  line-height: 1;
}

@keyframes hiloDeal {
  from { opacity: 0; transform: translateY(-14px) rotate(-6deg) scale(0.9); }
  to { opacity: 1; transform: none; }
}

/* ----- banner / prompt ----- */
.hilo-banner { min-height: 30px; display: flex; align-items: center; justify-content: center; text-align: center; }
.hilo-prompt { color: var(--hilo-ink-soft); font-size: 0.95rem; font-weight: 600; }
.hilo-banner .status-pill { font-size: 0.9rem; font-weight: 800; padding: 6px 16px; }
.hilo-banner.win .status-pill  { background: #e3f5ea; color: #157a41; border-color: #bfe6cd; }
.hilo-banner.lose .status-pill { background: #fdeaea; color: #b62d2d; border-color: #f3c4c4; }
.hilo-banner.push .status-pill { background: #fff4d6; color: #8a5a00; border-color: #f2d287; }

/* ----- guess buttons ----- */
.hilo-actions { display: flex; gap: 12px; }
.hilo-btn {
  flex: 1 1 0;
  min-height: 54px;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm, 10px);
}
.hilo-btn:disabled { opacity: 0.5; cursor: default; }
.hilo-higher { background: #1c8a4d; color: #fff; border-color: #1c8a4d; }
.hilo-higher:hover:not(:disabled) { background: #23a75f; }
.hilo-lower { background: #b62d2d; color: #fff; border-color: #b62d2d; }
.hilo-lower:hover:not(:disabled) { background: #cf3636; }

/* ----- game over ----- */
.hilo-final { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hilo-final-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--hilo-ink-soft); }
.hilo-final-score { font-size: 3.2rem; font-weight: 900; color: var(--hilo-gold); line-height: 1; }
.hilo-newbest { text-align: center; }
.hilo-newbest .status-pill { background: #fff4d6; color: #8a5a00; border-color: #f2d287; font-weight: 800; font-size: 0.85rem; }
.hilo-rankline { text-align: center; font-weight: 700; color: var(--hilo-ink); }
.hilo-btn-again { align-self: center; min-height: 46px; padding: 0 26px; font-weight: 800; }

/* ----- leaderboard ----- */
.hilo-lb {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--hilo-line);
  border-radius: var(--radius-sm, 10px);
  padding: 10px 12px;
}
.hilo-lb-title {
  font-weight: 800;
  color: var(--hilo-gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  margin-bottom: 6px;
}
.hilo-lb-empty { font-size: 0.85rem; color: var(--hilo-ink-soft); }
.hilo-lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.hilo-lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 0.9rem;
}
.hilo-lb-row.is-you { background: rgba(244, 180, 0, 0.18); box-shadow: inset 0 0 0 1px var(--hilo-gold); }
.hilo-lb-rank { flex: 0 0 32px; color: var(--hilo-ink-soft); font-weight: 700; font-size: 0.8rem; }
.hilo-lb-name { flex: 1 1 auto; color: var(--hilo-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hilo-lb-row.is-you .hilo-lb-name { color: var(--hilo-gold); font-weight: 800; }
.hilo-lb-score { flex: 0 0 auto; font-weight: 900; color: var(--hilo-gold); }
