/* Big Island Blessah Club: game page layout (CrazyGames style).
   Shared by every game page. Load after site.css.

   Page shape:
     header.site
     .page
       section.player   game panel: .stage (.hudbar, .timebar, .screen > .frame) + .ptool toolbar
       .rail            "Play next" tiles + a board/stats card
       section.about    breadcrumbs, title, short intro, extra cards, how to play
     footer.note

   Game shape: set --ar on .player (width / height of the play field).
   Coconut Catch is 3:4 (.75), the default. */

.page { max-width: 1040px; margin: 0 auto; padding: 12px 16px 24px; display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }

/* ---------- Player panel ---------- */
.player { --ar: .75; background: var(--panel); border: 1px solid rgba(255,248,234,.1); border-radius: 18px; padding: 10px 10px 0; }
.stage { width: 100%; }

.hudbar { display: grid; grid-template-columns: 1fr 1fr 1.25fr 1.1fr; gap: 6px; margin-bottom: 6px; }
.hudbar .hc { background: rgba(255,248,234,.08); border: 1px solid var(--line); border-radius: 12px;
  padding: 3px 6px 4px; text-align: center; min-width: 0; }
.hudbar .label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .6rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--mint); }
.hudbar .label.lvl { color: var(--gold); font-size: .68rem; letter-spacing: .06em; }
.hudbar .value { display: block; font-family: var(--font-head); font-size: 1.15rem; font-weight: 800; line-height: 1.15;
  color: var(--cream); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hudbar .value.goldv { color: var(--gold); }
.hudbar .value.sm { font-size: .9rem; line-height: 1.45; color: var(--mist); }
.hudbar.bump .lvl { animation: lvlbump .45s ease; display: inline-block; }
@keyframes lvlbump { 0% { transform: scale(1); } 35% { transform: scale(1.28); } 100% { transform: scale(1); } }
.lives { display: flex; justify-content: center; align-items: center; gap: 3px; min-height: 1.3rem; padding-top: 2px; }
.lives svg { width: 17px; height: 15px; }
.lives .lost { opacity: .22; filter: grayscale(1); }

.timebar { height: 6px; margin-bottom: 8px; border-radius: 999px; background: rgba(255,248,234,.14);
  overflow: hidden; border: 1px solid rgba(255,248,234,.12); }
.timebar > div { height: 100%; width: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), #ff9d3c); transition: width .2s linear; }
.timebar.low > div { background: linear-gradient(90deg, var(--coral), #ff3d5e); }

/* The screen spans the panel; the play field (.frame) keeps the game's own shape, centered. */
.screen { position: relative; border-radius: 18px; overflow: hidden; display: flex; justify-content: center;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255,201,60,.10), transparent 60%),
    linear-gradient(180deg, rgba(14,124,111,.35), rgba(6,31,28,.2)); }
.screen::before { content: ""; position: absolute; inset: -20px; background-position: center; background-size: cover; /* each page sets background-image */
  filter: blur(18px) saturate(1.1); opacity: .28; }
.frame { position: relative; border-radius: 22px; overflow: hidden; border: 3px solid rgba(255,201,60,.55);
  box-shadow: 0 18px 44px rgba(0,0,0,.45), 0 4px 0 rgba(0,0,0,.25); background: #7ec8e3;
  aspect-ratio: var(--ar); margin: 0 auto;
  width: min(100%, calc((100dvh - 222px) * var(--ar)), calc(746px * var(--ar))); }
.frame canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.frame canvas:active { cursor: grabbing; }
@media (min-width: 900px) { .frame { width: min(100%, calc((100dvh - 250px) * var(--ar)), calc(746px * var(--ar))); } }
@media (max-width: 560px) { .screen { background: none; } .screen::before { display: none; } }

/* ---------- Overlays on the play field ---------- */
.overlay { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 22px; background: linear-gradient(180deg, rgba(4,38,34,.55), rgba(4,38,34,.82)); backdrop-filter: blur(2px); }
.overlay[hidden] { display: none; }
.overlay .ov-hero { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .38; z-index: -1; }
.overlay.start { isolation: isolate; }
.overlay .badge { font-family: var(--font-head); font-weight: 800; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); background: var(--gold); border-radius: 999px; padding: 5px 14px; box-shadow: 0 3px 0 var(--gold-deep); }
.overlay h2 { font-family: var(--font-head); font-size: clamp(1.7rem, 7.5vw, 2.3rem); line-height: 1.05; margin: 14px 0 6px; color: var(--cream); }
.overlay p { margin: 0 0 6px; font-weight: 700; color: #d7efe4; max-width: 34ch; }
.overlay .final-score { font-family: var(--font-head); font-size: 3.4rem; font-weight: 800; line-height: 1; color: var(--gold);
  margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.overlay .newbest { color: var(--gold); font-weight: 900; letter-spacing: .06em; text-transform: uppercase; font-size: .8rem; margin-bottom: 4px; }
.overlay .tally { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 10px 0 4px; font-weight: 800; font-size: .92rem; color: var(--cream); }
.overlay .tally span b { color: var(--gold); font-variant-numeric: tabular-nums; }
.overlay .hint { margin-top: 12px; font-size: .85rem; color: #a9d8c8; font-weight: 700; }
.overlay .vstatus { color: var(--gold); font-weight: 900; min-height: 1.2em; }
.overlay .challenge { margin: 0 0 10px; padding: 8px 14px; border-radius: 14px; background: rgba(255,107,74,.18);
  border: 1.5px solid rgba(255,107,74,.6); font-weight: 800; font-size: .95rem; color: var(--cream); }
.overlay .challenge b, .overlay .beatline b { color: var(--gold); }
.overlay .beatline { font-weight: 900; font-size: .9rem; color: var(--cream); margin: 2px 0 4px; }
.overlay .btn.ovv { margin-top: 10px; font-size: .95rem; padding: 9px 20px; }
.overrow { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 12px; }
.overrow .btn { margin-top: 0; min-width: 0; padding: 11px 24px; }

/* Share sheet: score card image + share links */
.sharesheet { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 18px; text-align: center; background: rgba(4,38,34,.97); }
.sharesheet[hidden] { display: none; }
.sharesheet h3 { font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; margin: 0; color: var(--gold); }
.sharesheet img { width: 100%; max-width: 340px; border-radius: 12px; border: 2px solid rgba(255,201,60,.5); }
.sharesheet .sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 340px; }
.sharesheet .sgrid a, .sharesheet .sgrid button { font-family: var(--font-body); font-weight: 900; font-size: .95rem; padding: 11px 8px;
  border-radius: 12px; text-decoration: none; cursor: pointer; background: rgba(255,248,234,.12); color: var(--cream); border: 1.5px solid rgba(255,248,234,.35); }
.sharesheet .sgrid .sx { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.sharesheet .stip { font-size: .8rem; color: #a9d8c8; font-weight: 700; margin: 0; max-width: 340px; }
.sharesheet .snative { margin: 0; width: 100%; max-width: 340px; min-width: 0; padding: 11px 20px; }
.sharesheet .srow { display: flex; gap: 22px; justify-content: center; }
.sharesheet .sclose { background: none; border: none; color: var(--sand); font-weight: 800; font-size: .9rem; cursor: pointer; text-decoration: underline; }

/* ---------- Toolbar under the game ---------- */
.ptool { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: nowrap;
  padding: 10px 4px; margin-top: 10px; border-top: 1px solid rgba(255,248,234,.08); }
.pt-id { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.pt-id > div { min-width: 0; }
.pt-icon { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.pt-id b { display: block; font-family: var(--font-head); font-size: 1.05rem; line-height: 1.1; color: var(--cream);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-id small { display: block; font-size: .74rem; font-weight: 800; color: var(--mint); }
.pt-act { display: flex; gap: 6px; flex-wrap: nowrap; flex-shrink: 0; }
.pt-act button { font-family: var(--font-body); font-weight: 900; font-size: .84rem; color: var(--cream); cursor: pointer;
  background: rgba(255,248,234,.09); border: 1px solid rgba(255,248,234,.16); border-radius: 10px; padding: 6px 11px; min-height: 2.5rem; }
.pt-act button:hover { background: rgba(255,248,234,.16); }
.pt-act button[aria-pressed="true"] { background: rgba(255,201,60,.18); border-color: rgba(255,201,60,.55); color: var(--gold); }
.pt-act .ib { width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; }
.pt-act [hidden] { display: none; }
.pt-act .ib.done { color: var(--gold); border-color: rgba(255,201,60,.6); }
@media (max-width: 560px) {
  .pt-act .fs { display: none; } .pt-id small { display: none; } .pt-act { gap: 5px; }
  .pt-act .ib { width: 40px; height: 40px; } .pt-icon { width: 30px; height: 30px; } .pt-id { gap: 7px; } .pt-id b { font-size: .95rem; } .ptool { gap: 6px; }
}
.player:fullscreen { display: flex; flex-direction: column; justify-content: center; border-radius: 0; padding: 12px; }
.player:fullscreen .frame { width: min(100%, calc((100dvh - 130px) * var(--ar))); }

/* ---------- Right rail: Play next + board ---------- */
.rail { display: grid; gap: 14px; align-content: start; }
.next h2, .about h1 { font-family: var(--font-head); font-weight: 800; color: var(--cream); margin: 0; }
.next h2 { font-size: 1.15rem; margin-bottom: 8px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { position: relative; display: block; text-decoration: none; color: var(--cream); border-radius: 14px; overflow: hidden;
  background: #0b2e2a; border: 1px solid rgba(255,248,234,.12); }
a.tile:hover { border-color: rgba(255,201,60,.7); transform: translateY(-1px); }
.tart { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; font-size: 38px; overflow: hidden; }
.tart img { height: 78%; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
.tart img.cover { width: 100%; height: 100%; object-fit: cover; filter: none; }
.tart.pp { background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.18) 0 22%, transparent 23%),
  linear-gradient(180deg, transparent 49%, rgba(255,255,255,.75) 49% 51%, transparent 51%), #12a08b; }
.tart.cc { background: linear-gradient(180deg, #8fd3ec 0 52%, #2ba8a0 52% 70%, #f9e7bd 70%); }
.tart.nx { background: linear-gradient(135deg, #2b1e5c, #b04a8f); }
.tname { display: block; padding: 7px 9px 9px; font-family: var(--font-head); font-weight: 800; font-size: .95rem; line-height: 1.1; }
.tbadge { position: absolute; top: 7px; left: 7px; font-size: .64rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: rgba(5,38,34,.85); color: var(--cream); }
.tbadge.soon { background: var(--coral); color: #fff; }
.tbadge.new { background: var(--gold); color: var(--ink); }

.boardlist { list-style: none; margin: 8px 0 0; padding: 0; }
.boardlist li { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 8px; align-items: baseline;
  padding: 6px 2px; border-top: 1px solid rgba(255,248,234,.1); font-weight: 800; font-size: .93rem; }
.boardlist li:first-child { border-top: none; }
.boardlist .rk { font-family: var(--font-head); color: var(--mint); text-align: center; }
.boardlist .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cream); }
.boardlist .nm small { display: block; font-size: .74rem; font-weight: 700; color: var(--mint); }
.boardlist .sc { font-family: var(--font-head); font-size: 1.1rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.boardlist li.empty { display: block; color: var(--mint); font-weight: 700; }
.cardnote { margin: 8px 0 0; font-size: .8rem; font-weight: 700; color: var(--mint); }

/* ---------- About section under the game ---------- */
.about { display: grid; gap: 14px; }
.crumbs { font-size: .84rem; font-weight: 800; color: var(--mint); }
.crumbs a { color: var(--mist); text-decoration: none; }
.crumbs span { color: var(--cream); }
.about h1 { font-size: 1.8rem; line-height: 1; margin-top: -4px; }
.about .lede { margin: -4px 0 0; font-weight: 700; color: var(--mist); max-width: 60ch; }
.about-grid { display: grid; gap: 12px; grid-template-columns: minmax(0,1fr); }
details.howto2 { padding: 10px 14px; }
details.howto2 summary { font-family: var(--font-head); font-size: 1.05rem; color: var(--cream); }
details.howto2 p, details.howto2 li { font-size: .88rem; font-weight: 600; color: #d7efe4; line-height: 1.5; }
details.howto2 p { margin: 8px 0 0; }
details.howto2 ul { margin: 8px 0 0; padding-left: 18px; }
details.howto2 b { color: var(--cream); }
@media (min-width: 640px) { .about-grid { grid-template-columns: 1fr 1fr; } }

@media (min-width: 900px) {
  .page { grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "player rail" "about rail"; align-items: start; }
  .player { grid-area: player; }
  .rail { grid-area: rail; position: sticky; top: 64px; }
  .rail .board { order: -1; }
  .about { grid-area: about; }
}

/* Get on the board (verified play), used by every game page */
.verified { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px 18px;
  background: rgba(255,248,234,.08); border: 1px solid rgba(255,201,60,.45); border-radius: 16px; }
.verified .vtitle { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; line-height: 1.2;
  font-family: var(--font-head); font-weight: 800; font-size: 1.02rem; }
.verified .vpill { font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(255,201,60,.18); color: var(--gold); border: 1px solid rgba(255,201,60,.5); border-radius: 999px; padding: 2px 9px; }
.verified p { margin: 0; line-height: 1.45; font-size: .9rem; font-weight: 700; color: #d7efe4; }
.verified .vnote { font-size: .8rem; color: var(--mint); }
.verified .vbtn { font-family: var(--font-head); font-weight: 800; font-size: 1rem; border: none; border-radius: 999px;
  padding: 9px 22px; margin: 4px 0 0; background: var(--gold); color: var(--ink); box-shadow: 0 4px 0 var(--gold-deep); cursor: pointer; }
.verified .vbtn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--gold-deep); }
.verified .vbtn[hidden] { display: none; }
.verified .vstatus:empty { display: none; }
