* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #120b24; color: #f6efe0; font-family: "Trebuchet MS", Verdana, sans-serif; overflow: hidden; }
#game { display: flex; flex-direction: column; height: 100%; }
#hud { display: flex; align-items: center; gap: 14px; padding: 6px 12px; background: #1d1236; flex-wrap: wrap; font-size: 14px; }
#hud a { color: #ffc861; text-decoration: none; }
#hud a:hover { text-decoration: underline; }
#mapname { font-weight: bold; color: #ffc861; }
#stat-pellets, #stat-size { color: #d9d0ee; }
#mute { margin-left: auto; }
button { font: inherit; color: #2a1505; background: #ffc861; border: 0; border-radius: 8px; padding: 4px 12px; cursor: pointer; }
button:hover { background: #ffd98c; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#stage { position: relative; flex: 1; min-height: 0; display: flex; }
#screen { flex: 1; min-width: 0; height: 100%; display: block; touch-action: none; }
#board { width: 190px; padding: 8px; background: #181030; font-size: 13px; overflow: hidden; }
#board .row { display: flex; align-items: center; gap: 6px; padding: 3px 2px; border-radius: 4px; }
#board .row.me { background: #33245c; }
#board .row.gone { opacity: .45; text-decoration: line-through; }
#board .chip { width: 10px; height: 10px; border-radius: 50%; flex: none; }
#board .name { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#board .tag { font-size: 10px; opacity: .65; }
#banner { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); padding: 6px 16px; background: rgba(20, 10, 40, .88); border-radius: 18px; font-weight: bold; text-align: center; max-width: 90%; }
#powerbar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: min(280px, 60%); height: 12px; background: rgba(0, 0, 0, .55); border-radius: 6px; overflow: hidden; }
#powerfill { height: 100%; width: 100%; background: #7ddf5a; }
/* Inside #stage, so an overlay can never cover the top bar and its Games Hub link. */
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10, 5, 25, .72); padding: 12px; overflow: auto; }
.overlay[hidden], [hidden] { display: none !important; }
.card { background: #24174a; border: 3px solid #ffc861; border-radius: 16px; padding: 18px 24px; max-width: 460px; width: 100%; text-align: center; max-height: 100%; overflow: auto; }
.card.wide { max-width: 580px; }
.card h1 { margin: 4px 0; font-size: 38px; color: #ffc861; }
.card h2 { margin: 2px 0 4px; color: #ffc861; font-size: 26px; }
.card a { color: #ffc861; }
.leave { margin: 12px 0 0; }
.card a.hub-btn { display: inline-block; padding: 8px 18px; border: 2px solid #ffc861; border-radius: 8px; text-decoration: none; font-weight: bold; }
.card a.hub-btn:hover { background: #33245c; }
#play { font-size: 22px; padding: 10px 44px; font-weight: bold; }
.how { text-align: left; font-size: 14px; line-height: 1.5; padding-left: 20px; margin: 14px 0 6px; }
#lifetime, #score-life { color: #a7e88e; font-size: 14px; }
#score-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
#score-table th { font-size: 12px; opacity: .7; padding: 2px 4px; }
#score-table td { padding: 3px 4px; border-top: 1px solid #3d2d6e; }
#score-table td:nth-child(2) { text-align: left; }
#score-table tr.me { background: #33245c; }
#score-table tr.winner td { color: #ffc861; font-weight: bold; }
@media (max-width: 760px) {
  #board { display: none; }
  #hud { gap: 8px; font-size: 12px; }
}
/* Short screens, like a phone on its side: keep Play and the hub button in view. */
@media (max-height: 480px) {
  #logo, .how { display: none; }
  .card { padding: 10px 16px; }
  .card h1 { font-size: 26px; }
}
