/* PCG Games — shared styles. Page parts inherit the theme's text colour so
   they read in both light and dark mode; the game frame is always dark. */

.pcgg-wrap { --pcgg-accent: #22c55e; --pcgg-line: rgba(127,127,127,.25); --pcgg-soft: rgba(127,127,127,.08); max-width: 960px; margin: 0 auto; }
.pcgg-wrap *, .pcgg-wrap *::before, .pcgg-wrap *::after { box-sizing: border-box; }
.pcgg-h { font-size: 1.15rem; margin: 0 0 .6rem; }
.pcgg-section { margin: 1.6rem 0; }
.pcgg-more { margin: .6rem 0 0; font-size: .95rem; }
.pcgg-note { padding: .8rem 1rem; border: 1px dashed var(--pcgg-line); border-radius: 8px; }
.pcgg-loading { padding: 3rem 1rem; text-align: center; opacity: .7; color: #cbd5e1; }

/* Game frame */
.pcgg-frame { background: #0b0f17; border-radius: 14px; padding: 10px 10px 0; display: flex; flex-direction: column; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.pcgg-game { position: relative; width: 100%; display: flex; justify-content: center; min-height: 200px; }
.pcgg-bar { width: 100%; height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #94a3b8; font: 12px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding: 0 4px; }
.pcgg-bar__brand { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcgg-bar__full { background: rgba(255,255,255,.08); color: #e2e8f0; border: 1px solid rgba(255,255,255,.15); border-radius: 6px; padding: 7px 10px; font: inherit; cursor: pointer; white-space: nowrap; }
.pcgg-bar__full:hover { background: rgba(255,255,255,.15); }
.pcgg-frame--full { position: fixed; inset: 0; z-index: 100000; border-radius: 0; padding: 0; justify-content: center; background: #05070c; }
.pcgg-frame--full .pcgg-game { flex: 1 1 auto; align-items: center; }
.pcgg-frame--full .pcgg-bar { flex: 0 0 44px; padding: 0 10px; padding-bottom: env(safe-area-inset-bottom); }
html.pcgg-noscroll, html.pcgg-noscroll body { overflow: hidden !important; }

/* Ads */
.pcgg-ad { margin: 1rem auto; text-align: center; max-width: 100%; overflow: hidden; }
.pcgg-ad img { max-width: 100%; height: auto; border-radius: 8px; }
.pcgg-ad__label { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; opacity: .55; margin-bottom: 4px; }

/* Game-over panel (inside the dark frame) */
.pcgg-panel { position: absolute; inset: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: rgba(6,9,16,.9); backdrop-filter: blur(2px); color: #e2e8f0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; border-radius: 10px; }
.pcgg-panel__inner { width: min(360px, 100%); padding: 22px 18px 18px; margin: auto 0; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.pcgg-panel__title { font: 15px/1.5 "Press Start 2P", ui-monospace, monospace; color: #ff6b5b; margin: 0; text-shadow: 2px 2px 0 #000; }
.pcgg-panel__score { font: 28px/1.2 "Press Start 2P", ui-monospace, monospace; color: #ffd23f; }
.pcgg-panel__best { font: 10px/1 "Press Start 2P", ui-monospace, monospace; color: #4ade80; animation: pcgg-blink .6s steps(2) infinite; }
@keyframes pcgg-blink { 50% { opacity: .3; } }
.pcgg-panel__stats { display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; text-align: left; font-size: 13px; color: #cbd5e1; margin: 0 auto; min-width: 220px; }
.pcgg-panel__stats span:nth-child(even) { text-align: right; color: #fff; font-weight: 600; }
.pcgg-status { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 12px; text-align: left; }
.pcgg-status p { margin: 0 0 8px; }
.pcgg-status p:last-child { margin-bottom: 0; }
.pcgg-panel__ad:empty { display: none; }
.pcgg-panel__ad { background: rgba(255,255,255,.04); border-radius: 8px; padding: 6px; min-height: 60px; }
.pcgg-panel__actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pcgg-panel__link { color: #7dd3fc; font-size: 13px; }
.pcgg-ok { color: #bbf7d0; }
.pcgg-error { color: #fca5a5; }
.pcgg-muted { color: #94a3b8; }
.pcgg-small { font-size: 12px; }

/* Buttons */
.pcgg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding: 12px 16px; border-radius: 8px; border: 0; cursor: pointer;
  background: #ffd23f; color: #1a1a1a; text-decoration: none; box-shadow: 0 3px 0 #b8860b; }
.pcgg-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #b8860b; }
.pcgg-btn[disabled] { opacity: .6; cursor: wait; }
.pcgg-btn--play { font-family: "Press Start 2P", ui-monospace, monospace; font-size: 12px; padding: 14px 18px; }
.pcgg-btn--ghost { background: transparent; color: inherit; border: 1px solid rgba(148,163,184,.5); box-shadow: none; }
.pcgg-btn--google { background: #fff; color: #1f1f1f; box-shadow: 0 1px 0 rgba(0,0,0,.2); border: 1px solid #dadce0; }
.pcgg-signin { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }

/* Forms */
.pcgg-form { display: flex; flex-direction: column; gap: 6px; }
.pcgg-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.pcgg-form label em { font-weight: 400; opacity: .7; }
.pcgg-form input[type=text], .pcgg-form input:not([type]), .pcgg-form input[inputmode] { font: 16px/1.2 system-ui, sans-serif; padding: 10px; border-radius: 8px; border: 1px solid rgba(148,163,184,.45); background: rgba(255,255,255,.06); color: inherit; width: 100%; }
.pcgg-form .pcgg-check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
.pcgg-form .pcgg-check input { margin-top: 3px; }
.pcgg-form a { color: #7dd3fc; }
.pcgg-form button { margin-top: 6px; }

/* Leaderboards (page) */
.pcgg-board { font-size: 15px; }
.pcgg-board__title { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; opacity: .75; margin-bottom: 6px; }
.pcgg-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pcgg-tabs button { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--pcgg-line, rgba(127,127,127,.3)); background: transparent; color: inherit; cursor: pointer; }
.pcgg-tabs button.is-on { background: var(--pcgg-accent, #22c55e); border-color: transparent; color: #fff; }
.pcgg-tabs--games button { font-weight: 600; }
.pcgg-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--pcgg-line, rgba(127,127,127,.25)); border-radius: 10px; overflow: hidden; }
.pcgg-rows li { display: grid; grid-template-columns: 2.4em 1fr auto; align-items: center; padding: 8px 12px; border-top: 1px solid var(--pcgg-line, rgba(127,127,127,.2)); }
.pcgg-rows li:first-child { border-top: 0; }
.pcgg-rows li.is-me { background: rgba(34,197,94,.14); }
.pcgg-rank { font-weight: 700; opacity: .7; }
.pcgg-rows li.is-top1 .pcgg-rank { color: #eab308; opacity: 1; }
.pcgg-rows li.is-top2 .pcgg-rank { color: #94a3b8; opacity: 1; }
.pcgg-rows li.is-top3 .pcgg-rank { color: #c2410c; opacity: 1; }
.pcgg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcgg-name em { font-style: normal; opacity: .6; font-size: .9em; }
.pcgg-score { font-variant-numeric: tabular-nums; font-weight: 700; }
.pcgg-empty, .pcgg-myrank { opacity: .75; margin: .4rem 0; }
.pcgg-panel .pcgg-rows { border-color: rgba(255,255,255,.1); }
.pcgg-panel .pcgg-rows li { border-color: rgba(255,255,255,.08); padding: 6px 10px; font-size: 13px; }
.pcgg-board--mini .pcgg-rows li { padding: 5px 10px; font-size: 13px; }

/* Hub */
.pcgg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pcgg-card { border: 1px solid var(--pcgg-line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; background: var(--pcgg-soft); }
.pcgg-card__art { display: block; aspect-ratio: 3 / 2; background: #111; }
.pcgg-card__art svg { width: 100%; height: 100%; display: block; }
.pcgg-card__body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcgg-card__body h3 { margin: 0; font-size: 1.15rem; }
.pcgg-card__body h3 a { color: inherit; text-decoration: none; }
.pcgg-card__body p { margin: 0; opacity: .85; }
.pcgg-card__body .pcgg-btn { align-self: flex-start; margin-top: auto; background: var(--pcgg-accent); color: #fff; box-shadow: none; }
.pcgg-card--plain { padding: 18px; }

/* Profile */
.pcgg-profile__head h2 { margin: 0 0 12px; }
.pcgg-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.pcgg-table th, .pcgg-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--pcgg-line); }
.pcgg-form--profile { max-width: 420px; }
.pcgg-form--profile .pcgg-ok { color: #16a34a; }
.pcgg-form--profile .pcgg-error { color: #dc2626; }
.pcgg-form--profile .pcgg-muted { color: inherit; opacity: .7; font-weight: 400; }
