/* ======================================================
   Ortak oyun sayfası stilleri (Pişti, 66)
   Masa, kartlar, üst çubuk, skor, pencereler ve animasyonlar.
   Oyuna özgü düzenler pisti.css ve altmisalti.css içindedir.
   ====================================================== */
.game-page {
    --p-green: #1A4D2E;
    --p-green-deep: #0f2e1b;
    --p-mustard: #E5A93B;
    --p-bordo: #9B111E;
    --p-brown: #1C0F0A;
    --p-cream: #f6e7d0;
    --p-sage: #c3d2bd;
    --p-sage-dim: #93a68d;
    --p-wood: #5a3720;
    --p-card: #fbf6ea;
    --p-ink: #1d1714;
    --cw: clamp(56px, min(16vw, 10.2vh), 98px);
    --ch: calc(var(--cw) * 1.4);
    --radius: calc(var(--cw) * 0.09);

    background: var(--p-brown);
    color: var(--p-sage);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
}

/* Kıraathane fotoğrafı yalnızca kenarlarda, karartılmış ve hafif bulanık. */
.game-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background: url("../img/hero.jpg") center / cover no-repeat;
    filter: blur(3px) saturate(.7) brightness(.32);
    transform: scale(1.04);
}
.game-page::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 70% 65% at 50% 55%, rgba(28,15,10,.92) 0%, rgba(28,15,10,.75) 55%, rgba(28,15,10,.45) 100%),
        radial-gradient(ellipse at 50% 0%, rgba(229,169,59,.10), transparent 60%);
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Üst çubuk ---------- */
.pg-header {
    display: flex;
    align-items: center;
    gap: 14px 22px;
    flex-wrap: wrap;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 20px 10px;
    background: rgba(20, 11, 7, .82);
    border-bottom: 1px solid rgba(229, 169, 59, .18);
    backdrop-filter: blur(6px);
}
.pg-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--serif);
    font-size: 26px;
    line-height: 1;
    color: var(--p-cream);
    padding: 6px 4px;
    border-radius: 8px;
}
.pg-brand-icon { width: 28px; height: 28px; fill: var(--p-mustard); }
.pg-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding-left: 22px;
    border-left: 1px solid rgba(229, 169, 59, .25);
}
.pg-title h1 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: 30px;
    line-height: 1;
    color: var(--p-cream);
}
.pg-mode {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid rgba(229, 169, 59, .55);
    border-radius: 999px;
    color: var(--p-mustard);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.pg-actions {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    font: 500 15px/1.1 var(--sans);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.pg-btn svg, .pg-icon-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.pg-btn-ghost { background: rgba(255,255,255,.03); color: var(--p-cream); border-color: rgba(246,231,208,.22); }
.pg-btn-ghost:hover { border-color: var(--p-mustard); color: var(--p-mustard); }
.pg-btn-primary { background: var(--p-mustard); color: var(--p-brown); font-weight: 600; }
.pg-btn-primary:hover { background: #f0bb57; }
#btn-sound .ico-sound-on { display: none; }
#btn-sound.is-on .ico-sound-on { display: block; }
#btn-sound.is-on .ico-sound-off { display: none; }
#btn-sound.is-on { color: var(--p-mustard); border-color: rgba(229,169,59,.55); }

.game-page :focus-visible {
    outline: 3px solid var(--p-mustard);
    outline-offset: 3px;
}

/* ---------- Ana alan ---------- */
.pg-main {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---------- Skor ---------- */
.pg-scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 10px;
}
.pg-score {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 14px;
    align-items: center;
    padding: 10px 16px;
    background: rgba(20, 11, 7, .78);
    border: 1px solid rgba(229, 169, 59, .2);
    border-radius: 12px;
}
.pg-score-name {
    grid-column: 1;
    color: var(--p-cream);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .02em;
}
.pg-score-total {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    font-family: var(--serif);
    font-weight: 400;
    font-size: 40px;
    line-height: 1;
    color: var(--p-mustard);
}
.pg-score-sub { grid-column: 1; color: var(--p-sage-dim); font-size: 13px; }
.pg-score-cpu { grid-template-columns: 1fr auto; }
.pg-score-cpu .pg-score-name, .pg-score-cpu .pg-score-sub { grid-column: 2; text-align: right; }
.pg-score-cpu .pg-score-total { grid-column: 1; justify-self: start; }
.pg-roundinfo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 14px;
    color: var(--p-sage);
    font-size: 13.5px;
    text-align: center;
}
.pg-target { color: var(--p-cream); font-size: 14px; }
.pg-target strong { color: var(--p-mustard); font-weight: 600; }

/* ---------- Masa ---------- */
.pg-table {
    position: relative;
    isolation: isolate;
    flex: 1;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    align-items: center;
    gap: 6px;
    min-height: 0;
    padding: 16px 18px 12px;
    border-radius: 30px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
/* Ahşap kenar */
.pg-table::before {
    content: "";
    position: absolute;
    inset: -11px;
    z-index: -2;
    border-radius: 40px;
    background:
        repeating-linear-gradient(95deg, rgba(0,0,0,.08) 0 3px, transparent 3px 11px),
        linear-gradient(180deg, #7a4c2c 0%, var(--p-wood) 45%, #3c2414 100%);
    box-shadow: 0 0 0 1px #24130a, inset 0 1px 0 rgba(255, 220, 170, .25);
}
/* Yeşil çuha: ahşap kenarın üstünde ayrı katman (öğenin kendi arka planı negatif katmanların altında kalır). */
.pg-table::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 1px, transparent 1px 4px),
        radial-gradient(ellipse at 50% 42%, rgba(255, 214, 140, .14) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 50%, var(--p-green) 0%, #164227 55%, var(--p-green-deep) 100%);
    box-shadow:
        inset 0 0 0 2px rgba(229, 169, 59, .22),
        inset 0 0 90px rgba(0, 0, 0, .55);
}

.pg-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-width: 0;
}
.pg-row-cpu, .pg-row-player { position: relative; }
.pg-row-center {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

/* ---------- Kart temeli ---------- */
.pg-card {
    position: relative;
    display: block;
    width: var(--cw);
    height: var(--ch);
    border-radius: var(--radius);
    flex-shrink: 0;
}
.pc-face, .pc-back {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    overflow: hidden;
}
.pc-face {
    background: linear-gradient(180deg, #fffdf6 0%, var(--p-card) 100%);
    box-shadow: 0 0 0 1px rgba(0,0,0,.18), 0 3px 8px rgba(0,0,0,.35);
    color: var(--p-ink);
    font-family: var(--sans);
}
.pc-red { color: var(--p-bordo); }
.pc-black { color: var(--p-ink); }
.pc-face svg { fill: currentColor; display: block; }
.pc-corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(var(--cw) * 0.22);
    line-height: 1;
}
.pc-corner-tl { top: calc(var(--cw) * 0.05); left: calc(var(--cw) * 0.04); }
.pc-corner-br { bottom: calc(var(--cw) * 0.05); right: calc(var(--cw) * 0.04); transform: rotate(180deg); }
.pc-rank {
    font-weight: 700;
    font-size: calc(var(--cw) * 0.21);
    letter-spacing: -.04em;
}
.pc-face[data-rank="10"] .pc-rank { font-size: calc(var(--cw) * 0.18); letter-spacing: -.08em; }
.pc-corner-suit { width: calc(var(--cw) * 0.15); height: calc(var(--cw) * 0.15); margin-top: 1px; }
.pc-body {
    position: absolute;
    inset: 12% 18%;
}
.pc-pip {
    position: absolute;
    width: calc(var(--cw) * 0.17);
    height: calc(var(--cw) * 0.17);
    transform: translate(-50%, -50%);
}
.pc-pip-flip { transform: translate(-50%, -50%) rotate(180deg); }
.pc-ace {
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--cw) * 0.44);
    height: calc(var(--cw) * 0.44);
    transform: translate(-50%, -50%);
}
.pc-court {
    position: absolute;
    inset: 2% -4%;
    border: 1.5px solid var(--p-mustard);
    border-radius: calc(var(--radius) * .6);
    background:
        repeating-linear-gradient(135deg, rgba(229,169,59,.12) 0 2px, transparent 2px 6px),
        linear-gradient(180deg, #fff6e2, #f7e9cc);
    display: grid;
    place-items: center;
}
.pc-court-letter {
    font-family: var(--serif);
    font-size: calc(var(--cw) * 0.46);
    line-height: 1;
}
.pc-court-suit {
    position: absolute;
    width: calc(var(--cw) * 0.15);
    height: calc(var(--cw) * 0.15);
    top: 6%;
    left: 8%;
}
.pc-court-suit.pc-pip-flip { top: auto; left: auto; bottom: 6%; right: 8%; transform: rotate(180deg); }

.pc-back {
    background:
        repeating-linear-gradient(45deg, rgba(229,169,59,.22) 0 1.5px, transparent 1.5px 7px),
        repeating-linear-gradient(-45deg, rgba(229,169,59,.22) 0 1.5px, transparent 1.5px 7px),
        radial-gradient(circle at 50% 50%, #b51e2c, var(--p-bordo) 70%, #6e0b15);
    border: calc(var(--cw) * 0.045) solid #f3e6cf;
    box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 3px 8px rgba(0,0,0,.35), inset 0 0 0 2px rgba(229,169,59,.55);
}

/* ---------- Oyuncunun eli ---------- */
.pg-hand {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(6px, 1.6vw, 14px);
    min-height: var(--ch);
}
.pg-card-btn {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    transition: transform .16s ease, filter .16s ease;
    touch-action: manipulation;
}
.pg-card-btn:hover:not([aria-disabled="true"]) { transform: translateY(-10px); }
.pg-card-btn:focus-visible { transform: translateY(-10px); outline-offset: 4px; }
.pg-card-btn[aria-disabled="true"] { cursor: default; }
.pg-hand-player.is-locked .pg-card-btn { filter: brightness(.82) saturate(.85); }

/* ---------- Bilgisayarın eli ---------- */
.pg-hand-cpu {
    min-height: calc(var(--ch) * .78);
    gap: 0;
}
.pg-hand-cpu .pg-card {
    width: calc(var(--cw) * .78);
    height: calc(var(--ch) * .78);
    margin-left: calc(var(--cw) * -0.22);
    transform: rotate(calc((var(--i) - 1.5) * 4deg)) translateY(calc(var(--i) * 0px));
}
.pg-hand-cpu .pg-card:first-child { margin-left: 0; }

/* ---------- Toplanan kartlar ---------- */
.pg-pile {
    position: absolute;
    right: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--p-sage);
    font-size: 13px;
}
.pg-row-cpu .pg-pile { top: 50%; transform: translateY(-50%); }
.pg-row-player .pg-pile { bottom: 8px; }
.pg-pile-stack {
    position: relative;
    width: calc(var(--cw) * .5);
    height: calc(var(--ch) * .5);
    border-radius: calc(var(--radius) * .6);
    border: 1.5px dashed rgba(195, 210, 189, .25);
}
.pg-pile-stack .pc-back {
    border-width: 2px;
    border-radius: calc(var(--radius) * .6);
    transform: translate(calc(var(--i) * 2px), calc(var(--i) * -2px));
}
.pg-pile-count {
    min-width: 2.2em;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0,0,0,.35);
    color: var(--p-cream);
    font-weight: 600;
    text-align: center;
}

/* ---------- Deste ---------- */
.pg-deck {
    justify-self: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-left: 4px;
}
.pg-deck-stack {
    position: relative;
    width: calc(var(--cw) * .8);
    height: calc(var(--ch) * .8);
}
.pg-deck-stack .pc-back { transform: translate(calc(var(--i) * -1.5px), calc(var(--i) * -1.5px)); }
.pg-deck.is-empty .pg-deck-stack {
    border: 1.5px dashed rgba(195,210,189,.25);
    border-radius: var(--radius);
}
.pg-deck-label { font-size: 13px; color: var(--p-sage); white-space: nowrap; }
.pg-deck-label strong { color: var(--p-cream); font-weight: 600; }

/* ---------- Sıra ve durum ---------- */
.pg-row-turn {
    flex-direction: column;
    gap: 6px;
    min-height: 66px;
}
.pg-turn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: .01em;
    transition: background .2s, color .2s;
}
.pg-turn[data-turn="human"] { background: var(--p-mustard); color: var(--p-brown); box-shadow: 0 0 0 4px rgba(229,169,59,.18); }
.pg-turn[data-turn="cpu"] { background: rgba(0,0,0,.35); color: var(--p-cream); box-shadow: inset 0 0 0 1.5px rgba(229,169,59,.5); }
.pg-turn[data-turn="cpu"]::after {
    content: "";
    width: 22px;
    height: 6px;
    background:
        radial-gradient(circle, var(--p-mustard) 2.5px, transparent 3px) 0 50% / 8px 6px repeat-x;
    animation: thinking 1s steps(3) infinite;
}
.pg-turn[data-turn="over"] { background: rgba(0,0,0,.35); color: var(--p-sage); }
.pg-turn.is-pulse { animation: pulse .5s ease; }
@keyframes thinking { from { width: 6px; } to { width: 24px; } }
@keyframes pulse { 50% { transform: scale(1.06); } }

.pg-status {
    min-height: 24px;
    padding: 3px 14px;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--p-cream);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .25s, transform .25s;
}
.pg-status.is-visible { opacity: 1; transform: none; }
.pg-status[data-tone="good"] { background: rgba(134, 215, 166, .16); color: #cfeedd; }
.pg-status[data-tone="bad"] { background: rgba(155, 17, 30, .35); color: #ffd9d4; }
.pg-status[data-tone="pisti"] { background: var(--p-mustard); color: var(--p-brown); font-weight: 700; }
.pg-status[data-tone="neutral"] { background: rgba(0,0,0,.3); }

.pg-keyhint {
    margin: 4px 0 0;
    text-align: center;
    font-size: 12.5px;
    color: var(--p-sage-dim);
}
.pg-keyhint kbd {
    display: inline-block;
    min-width: 1.6em;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid rgba(195,210,189,.3);
    font: 600 11.5px/1.4 var(--sans);
    color: var(--p-sage);
    text-align: center;
}
@media (hover: none) { .pg-keyhint { display: none; } }

/* ---------- Animasyonlar ---------- */
.pg-fx { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.pg-ghost { position: fixed; display: block; will-change: transform; }
.pg-hand.is-dealing .pg-card { animation: deal-in .42s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 70ms); }
.pg-hand-cpu.is-dealing .pg-card { animation-name: deal-in-cpu; }
@keyframes deal-in { from { opacity: 0; transform: translate(-40px, -50px) scale(.85); } }
@keyframes deal-in-cpu { from { opacity: 0; transform: translate(-40px, 40px) scale(.85); } }

/* ---------- Pencereler ---------- */
.pg-dialog {
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100dvh - 48px);
    padding: 0;
    border: 1px solid rgba(229, 169, 59, .35);
    border-radius: 16px;
    background: #21130c;
    color: var(--p-sage);
    box-shadow: 0 30px 80px rgba(0,0,0,.7);
}
.pg-dialog::backdrop { background: rgba(10, 5, 3, .7); backdrop-filter: blur(2px); }
.pg-dialog h2 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: 28px;
    color: var(--p-cream);
}
.pg-dialog-head {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px 12px;
    background: #21130c;
    border-bottom: 1px solid rgba(229,169,59,.18);
}
.pg-dialog-body { padding: 18px 22px 22px; font-size: 15px; line-height: 1.6; }
.pg-dialog-body h3 {
    margin: 18px 0 6px;
    font-family: var(--serif);
    font-weight: 400;
    font-size: 20px;
    color: var(--p-cream);
}
.pg-dialog-body ul { margin: 0; padding-left: 20px; }
.pg-dialog-body li { margin-bottom: 4px; }
.pg-dialog-body strong { color: var(--p-cream); font-weight: 600; }
.pg-dialog-body p { margin: 0 0 10px; }
.pg-icon-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,.05);
    color: var(--p-cream);
    cursor: pointer;
}
.pg-icon-btn:hover { color: var(--p-mustard); }
.pg-rules-table, .pg-result-table { width: 100%; border-collapse: collapse; }
.pg-rules-table td { padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.07); }
.pg-rules-table td:last-child { text-align: right; color: var(--p-mustard); font-weight: 600; }
.pg-dialog-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.pg-dialog-small { width: min(420px, calc(100vw - 32px)); }

.pg-result-eyebrow {
    margin: 0 0 4px !important;
    color: var(--p-mustard);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.pg-result-note { color: var(--p-sage); }
.pg-dialog-result[data-mode="won"] h2 { color: var(--p-mustard); }
.pg-result-table-wrap { overflow-x: auto; margin-top: 6px; }
.pg-result-table th, .pg-result-table td {
    padding: 7px 8px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.pg-result-table th[scope="row"] { text-align: left; font-weight: 400; color: var(--p-sage); }
.pg-result-table th[scope="col"] { color: var(--p-cream); font-weight: 600; font-size: 14px; }
.pg-result-table td { color: var(--p-cream); }
.pg-result-table tr.is-total th, .pg-result-table tr.is-total td { font-weight: 700; color: var(--p-mustard); }
.pg-result-table tr.is-total th { color: var(--p-cream); }

.pg-noscript { padding: 20px; text-align: center; color: var(--p-cream); }

/* ---------- Duyarlı yerleşim ---------- */
@media (max-width: 760px) {
    .pg-header { padding-left: 14px; padding-right: 14px; gap: 10px 14px; }
    .pg-brand { font-size: 22px; }
    .pg-title { padding-left: 14px; }
    .pg-title h1 { font-size: 24px; }
    .pg-actions { width: 100%; margin-left: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
    .pg-actions .pg-btn { padding: 8px 6px; font-size: 13px; gap: 6px; }
    .pg-score { padding: 8px 12px; }
    .pg-score-total { font-size: 32px; }
    .pg-roundinfo { font-size: 12px; padding: 4px 6px; }
}
@media (max-width: 520px) {
    .game-page { --cw: clamp(54px, min(19vw, 9.6vh), 84px); }
    .pg-actions .pg-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .pg-actions .pg-btn { min-width: 44px; }
    .pg-mode { font-size: 11px; padding: 3px 8px; }
    .pg-main { padding: 10px 12px 14px; gap: 10px; }
    .pg-scoreboard { grid-template-columns: 1fr 1fr; }
    .pg-roundinfo { grid-column: 1 / -1; grid-row: 2; flex-direction: row; gap: 10px; justify-content: center; padding: 0; }
    .pg-score-total { font-size: 28px; }
    .pg-score-sub { font-size: 11.5px; }
    .pg-table { padding: 12px 10px 10px; border-radius: 22px; }
    .pg-table::before { inset: -8px; border-radius: 28px; }
    .pg-pile { right: 0; gap: 4px; }
    .pg-pile-stack { width: calc(var(--cw) * .4); height: calc(var(--ch) * .4); }
    .pg-row-player .pg-pile { bottom: auto; top: calc(var(--ch) * -0.5); }
    .pg-hand-player { gap: 6px; }
    .pg-turn { font-size: 15px; padding: 7px 16px; }
    .pg-status { font-size: 13.5px; }
}
@media (max-width: 420px) {
    .pg-brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .pg-brand { padding: 6px; }
    .pg-title { padding-left: 12px; gap: 8px; }
    .pg-header { gap: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); padding-bottom: 8px; }
}
@media (max-width: 520px) and (max-height: 760px) {
    .game-page { --cw: clamp(50px, min(19vw, 8.4vh), 80px); }
    .pg-score { padding: 6px 10px; }
    .pg-score-total { font-size: 24px; }
    .pg-row-turn { min-height: 52px; gap: 4px; }
    .pg-table { gap: 2px; padding-top: 10px; }
    .pg-main { gap: 8px; padding-top: 8px; }
}
@media (max-height: 640px) and (min-width: 521px) {
    .game-page { --cw: clamp(50px, 9.4vh, 80px); }
}

@media (prefers-reduced-motion: reduce) {
    .game-page *, .game-page *::before, .game-page *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .pg-card-btn:hover:not([aria-disabled="true"]), .pg-card-btn:focus-visible { transform: none; }
}
