/* Perfect Pour, Wobbly Dock edition. The lobby uses the site's style.css plus the .pp-lobby rules here;
   the game page (game.php) uses only this file. Sea blue, yellow and ink, Kalam and Poppins, like the site. */
:root { --ink: #111; --sea: #1c4fd8; --sea-deep: #0d2f8f; --sea-dark: #0a2470; --yellow: #ffc72c; --mist: #f2f6fc; --line: #d8e2ee; --muted: #5d6b78; --ok: #1a8f5a; --red: #c62828; }

/* ---------- lobby (inside the normal site page) ---------- */
.pp-lobby { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 24px; align-items: start; }
.pp-lobby .pp-how { grid-column: 1 / -1; }
.pp-hello { font-size: 1.15rem; margin: 0 0 4px; }
.pp-play { font-size: 1.2rem; padding: 14px 22px; margin-top: 6px; }
.pp-board-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pp-board-head .box-title { margin: 0; }
.pp-seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.pp-seg button { font: inherit; font-weight: 700; font-size: .85rem; padding: 6px 14px; border: 0; background: #fff; cursor: pointer; }
.pp-seg button.on { background: var(--sea); color: #fff; }
.pp-board { list-style: none; margin: 0; padding: 0; }
.pp-board li { display: grid; grid-template-columns: 38px 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 9px 6px; border-bottom: 1px dashed var(--line); }
.pp-board li .pos { grid-row: 1 / 3; font-weight: 800; text-align: center; font-size: 1.05rem; }
.pp-board li .sc { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.1rem; color: var(--sea-dark); }
.pp-board li small { grid-column: 2 / 4; color: var(--muted); font-size: .8rem; }
.pp-board li.me { background: #fff6d6; border-radius: 10px; }
.pp-board li.empty { display: block; color: var(--muted); border: 0; }
.pp-rules { margin: 0; padding-left: 20px; } .pp-rules li { margin: 5px 0; }
@media (max-width: 820px) { .pp-lobby { grid-template-columns: 1fr; } }

/* ---------- game page ---------- */
.pp-play-page { margin: 0; min-height: 100vh; background: linear-gradient(180deg, var(--sea) 0%, var(--sea-dark) 100%); color: #fff;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
.pp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  background: #fff; color: var(--ink); border-bottom: 4px solid var(--ink); }
.pp-toplogo { height: 34px; width: auto; vertical-align: middle; }
.pp-link { font: inherit; font-weight: 700; font-size: .9rem; color: var(--ink); background: none; border: 0; padding: 6px 8px; border-radius: 10px; cursor: pointer; text-decoration: none; }
.pp-link:hover { background: var(--mist); }
.pp-best { font-weight: 600; font-size: .9rem; } .pp-best b { font-weight: 800; color: var(--sea-dark); }
.pp-tools-top { display: flex; gap: 2px; }
.pp-conn { background: #fff4dc; color: #7a4a00; text-align: center; padding: 6px 10px; font-weight: 600; font-size: .9rem; }
.pp-game { max-width: 560px; margin: 0 auto; padding: 10px 12px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pp-hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 420px; }
.pp-hud div { background: rgba(255, 255, 255, .12); border: 2px solid rgba(255, 255, 255, .25); border-radius: 14px; text-align: center; padding: 4px 6px; }
.pp-hud small { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; opacity: .85; font-weight: 700; }
.pp-hud b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.pp-stage { position: relative; touch-action: none; border: 3px solid var(--ink); border-radius: 18px; overflow: hidden; box-shadow: 5px 5px 0 var(--ink); background: #0a2470; }
.pp-stage canvas { display: block; }
.pp-overlay[hidden] { display: none; }
.pp-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 36, 112, .45); padding: 14px; }
.pp-card { background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 4px 4px 0 var(--ink); padding: 18px 18px 16px; text-align: center; max-width: 290px; width: 100%; display: grid; gap: 6px; }
.pp-card > b { font-family: 'Kalam', 'Poppins', sans-serif; font-size: 1.7rem; line-height: 1.1; }
.pp-card small { color: var(--muted); font-size: .9rem; }
.pp-card em { font-style: normal; font-weight: 700; color: var(--sea); }
.pp-big { font-size: 2.6rem; font-weight: 800; color: var(--sea-dark); line-height: 1; font-variant-numeric: tabular-nums; }
.pp-new { background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px; font-weight: 800; padding: 3px 10px; justify-self: center; }
.pp-err { color: var(--red) !important; font-weight: 600; }
.pp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.pp-stats div { background: var(--mist); border-radius: 10px; padding: 4px; } .pp-stats small { display: block; font-size: .68rem; } .pp-stats b { font-size: 1.1rem; }
.pp-ranks { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; font-size: .78rem; font-weight: 700; color: var(--sea-dark); }
.pp-ranks span { background: #e8effd; border-radius: 999px; padding: 2px 8px; }
.pp-row { display: flex; gap: 8px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.pp-btn { font: inherit; font-weight: 800; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 9px 18px; box-shadow: 3px 3px 0 var(--ink); cursor: pointer; text-decoration: none; }
.pp-btn.pp-ghost { background: #fff; }
.pp-serve { font: inherit; font-weight: 800; font-size: 1.35rem; width: 100%; max-width: 420px; padding: 14px; border-radius: 999px; border: 3px solid var(--ink);
  background: var(--yellow); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); cursor: pointer; touch-action: manipulation; }
.pp-serve:disabled { background: #c9d3e3; color: #5d6b78; box-shadow: 2px 2px 0 var(--ink); }
.pp-serve:not(:disabled):active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.pp-tip { margin: 0; font-size: .8rem; opacity: .85; text-align: center; }
.pp-endrow { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 420px; font-size: .85rem; }
.pp-endrow .pp-link { color: #fff; } .pp-endrow .pp-link:hover { background: rgba(255, 255, 255, .12); }
.pp-who b { color: var(--yellow); }
.pp-sheet { position: fixed; inset: 0; z-index: 30; display: grid; place-items: end center; }
.pp-sheet[hidden] { display: none; }
.pp-sheet-back { position: absolute; inset: 0; background: rgba(5, 18, 55, .6); }
.pp-sheet-panel { position: relative; background: #fff; color: var(--ink); width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; border: 3px solid var(--ink); border-bottom: 0; padding: 18px 20px 26px; max-height: 80vh; overflow: auto; }
.pp-sheet-panel h2 { font-family: 'Kalam', 'Poppins', sans-serif; margin: 0 0 6px; font-size: 1.7rem; }
.pp-sheet-x { position: absolute; top: 8px; right: 12px; font-size: 1.8rem; background: none; border: 0; cursor: pointer; }
