/* Shared game actions; pq aliases retain existing installed-game markup. */
.gr-button,:where(.pq-app) .pq-button { display:inline-flex; align-items:center; justify-content:center; gap:12px; min-width:44px; min-height:58px; padding:13px 18px; border:1px solid #b6c9b880; border-radius:10px; background:#d0ebd60a; color:#edf1df !important; font:inherit; font-size:max(16pt,1em); line-height:1.35; text-decoration:none !important; font-weight:600; text-align:center; white-space:normal; overflow-wrap:anywhere; transition:background .15s,border-color .15s; }
.gr-button svg,:where(.pq-app) .pq-button svg { width:28px; height:28px; flex:0 0 28px; }
.gr-button:hover,:where(.pq-app) .pq-button:hover { background:#d0ebd621; border-color:#e0d6ad; }
.gr-button--primary,:where(.pq-app) .pq-button--gold { color:#153a3b !important; background:linear-gradient(110deg,#ebcc97,#d5ae73); border-color:#f0d49d; box-shadow:0 5px 16px #021e2633; text-shadow:none; }
.gr-button--primary:hover,:where(.pq-app) .pq-button--gold:hover { background:linear-gradient(110deg,#f7dda9,#e7c489); border-color:#ffedbd; }
.gr-button--large,:where(.pq-app) .pq-button--large { min-height:64px; padding:16px 22px; gap:13px; }
.gr-button--large svg:last-child,:where(.pq-app) .pq-button--large svg:last-child { margin-left:8px; }
.gr-button--quiet,:where(.pq-app) .pq-button--quiet { background:transparent; border-color:transparent; color:#d2e0cf !important; box-shadow:none; }
.gr-button--quiet:hover,:where(.pq-app) .pq-button--quiet:hover { background:#c4d8bc16; border-color:#c4d8bc40; }
.gr-button--wide,:where(.pq-app) .pq-button--wide { width:100%; }
.gr-button:disabled,:where(.pq-app) .pq-button:disabled,:where(.pq-app) .pq-disabled { opacity:.62; pointer-events:none; }
.gr-button:focus-visible { outline:4px solid #f4cc83; outline-offset:4px; }
/* Enter defaults are drawn inside the existing rounded button. An external
 * outline is clipped by mobile scroll containers and can square its corners. */
.pq-app :is(button,a).gr-default-action,
.gr-action-scope :is(button,a).gr-default-action { box-shadow:inset 0 0 0 2px #f2ce8b,inset 0 0 0 5px #f2ce8b32; }
.pq-app .gr-action-scope :is(button,a).pq-button:focus-visible,
.gr-action-scope .gr-button:focus-visible { outline:2px solid #b5e5df; outline-offset:-7px; }
.pq-app .gr-action-scope :is(button,a).pq-button.gr-default-action:focus-visible,
.gr-action-scope .gr-button.gr-default-action:focus-visible { outline-color:#fff0bf; }
/* Theme link rules must not turn action anchors into blue underlined text. */
:is(.gr-dialog,.gr-game-screen,.arc-app,.pq-app,.career-app) a:is(.arc-button,.pq-button,.cl-button,.gr-button),
:is(.gr-dialog,.gr-game-screen,.arc-app,.pq-app,.career-app) a:is(.arc-button,.pq-button,.cl-button,.gr-button):is(:link,:visited,:hover,:focus,:active){text-decoration:none!important;color:#f2f7ff!important;display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:44px;border:1px solid #b5cee86b;border-radius:12px;padding:11px 20px;background:#193448;font:inherit;font-size:max(14px,1em);line-height:1.3;text-align:center;}
:is(.gr-dialog,.gr-game-screen,.arc-app,.pq-app,.career-app) a:is(.arc-button--primary,.pq-button--gold,.cl-button--primary,.gr-button--primary),
:is(.gr-dialog,.gr-game-screen,.arc-app,.pq-app,.career-app) a:is(.arc-button--primary,.pq-button--gold,.cl-button--primary,.gr-button--primary):is(:link,:visited,:hover,:focus,:active){color:#081d2b!important;background:var(--arc-accent,#f0cf8a);border-color:var(--arc-accent,#f0cf8a);font-weight:700;}
:is(.gr-dialog,.gr-game-screen,.arc-app,.pq-app,.career-app) a:is(.arc-button--danger,.cl-button--danger),
:is(.gr-dialog,.gr-game-screen,.arc-app,.pq-app,.career-app) a:is(.arc-button--danger,.cl-button--danger):is(:link,:visited,:hover,:focus,:active){color:#fff!important;background:#a82739;border-color:#f49aaa;}
:is(.gr-dialog,.gr-game-screen,.arc-app,.pq-app,.career-app) a:is(.arc-button,.pq-button,.cl-button,.gr-button):focus-visible{outline:3px solid #ffe299;outline-offset:3px;}
@media(prefers-reduced-motion:reduce) { .gr-button,:where(.pq-app) .pq-button { transition:none; } }

/* Game-only reusable transient feedback. A game positions its own notice host. */
.gr-notice-host { position:absolute; z-index:8; left:16px; right:16px; top:16px; display:flex; justify-content:center; pointer-events:none; }
.gr-notice { display:flex; align-items:center; gap:12px; width:max-content; max-width:min(100%,760px); padding:12px 18px; border:1px solid #91b8af; border-radius:12px; background:#123b43f5; color:#eef0db; box-shadow:0 8px 24px #00151d66; font:max(16pt,1rem)/1.25 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; animation:gr-notice-in .22s ease-out; appearance:none; text-align:start; white-space:normal; cursor:pointer; touch-action:manipulation; pointer-events:auto; box-sizing:border-box; }
.gr-notice:focus-visible { outline:3px solid #ffe2a1; outline-offset:3px; }
.gr-notice__icon { display:flex; align-items:center; color:#b1d4c1; flex:none; }
.gr-notice__icon svg { display:block; width:32px; height:32px; }
.gr-notice__copy { display:grid; gap:4px; min-width:0; overflow-wrap:anywhere; }
.gr-notice__copy>strong { font-size:inherit; color:inherit; font-weight:650; }
.gr-notice__copy>span { font-size:inherit; color:#cfddd0; }
.gr-notice--warning { border-color:#e8bb76; background:#483b26f5; color:#ffdda1; }
.gr-notice--warning .gr-notice__icon { color:#f6ce8e; }
.gr-notice--success { border-color:#9bcfae; }
@keyframes gr-notice-in { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
@media(max-width:480px) { .gr-notice-host { left:8px; right:8px; top:8px; }.gr-notice { padding:10px 12px; gap:10px; } }
@media(prefers-reduced-motion:reduce) { .gr-notice { animation:none; } }

/* Opt-in whole-game screen shell, independent of any installed game's theme. */
.gr-screen-dialog { position:fixed; inset:0; width:100dvw; max-width:none; height:100dvh; max-height:none; margin:0; border:0; border-radius:0; background:var(--gr-screen-background,#0b2c36); box-shadow:none; }
.gr-screen-dialog::backdrop { background:var(--gr-screen-background,#0b2c36); backdrop-filter:none; }
.gr-screen-dialog>.gr-dialog__head { padding:16px 24px; background:var(--gr-screen-header,#10343d); }
.gr-screen-dialog>.gr-dialog__body { flex:1; width:min(100%,1600px); margin:0 auto; padding:24px; display:block; min-height:0; overflow:visible; }
.gr-screen-dialog>.gr-dialog__body.gr-scroll-viewport { overflow-x:hidden; overflow-y:auto; }
.gr-screen-dialog>.gr-dialog__body.gr-scroll-needed { padding-right:48px; }
.gr-screen-dialog>.gr-dialog__body>:last-child { margin-bottom:0; }
@media(max-width:600px) { .gr-screen-dialog>.gr-dialog__head { padding:12px 16px; }.gr-screen-dialog>.gr-dialog__body { padding:16px; }.gr-screen-dialog>.gr-dialog__body.gr-scroll-needed { padding-right:44px; } }
@media(max-height:500px) and (min-width:601px) { .gr-screen-dialog>.gr-dialog__head { padding:4px 16px; }.gr-screen-dialog>.gr-dialog__head .gr-icon-button { width:56px; height:56px; flex-basis:56px; padding:8px; }.gr-screen-dialog>.gr-dialog__body { padding:8px 16px; } }

/* One shared, caller-clocked countdown for every timed game. */
.gr-countdown { position:absolute; z-index:12; top:clamp(8px,1.4vw,18px); right:clamp(8px,1.4vw,18px); display:grid; justify-items:center; gap:2px; min-width:2.5em; max-width:calc(100% - 16px); padding:7px 13px 9px; box-sizing:border-box; border:1px solid #ffe0a78a; border-radius:12px; background:linear-gradient(145deg,#07151df5,#18313bf5); box-shadow:0 5px 18px #0008,inset 0 1px 0 #fff2; color:#fff3cb; pointer-events:none; font-family:ui-rounded,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; text-align:center; text-shadow:0 2px 3px #000,0 0 12px #000; contain:layout style; }
.gr-countdown[hidden] { display:none!important; }
.gr-countdown > .gr-countdown__label { max-width:14em; overflow-wrap:anywhere; font-size:clamp(10px,1.4vw,13px); line-height:1.2; font-weight:750; letter-spacing:.04em; text-transform:uppercase; }
.gr-countdown > .gr-countdown__value { position:relative; display:grid; place-items:center; min-width:2.2ch; font-size:clamp(28px,4vw,48px); font-weight:850; font-variant-numeric:tabular-nums; line-height:1.05; white-space:nowrap; }
.gr-countdown__digit,.gr-countdown__old { display:block; grid-area:1/1; transform-origin:50% 60%; }
.gr-countdown__old { animation:gr-countdown-out .18s ease-in both; }
.gr-countdown__digit--enter { animation:gr-countdown-in .38s cubic-bezier(.2,.75,.3,1.1) .14s both; }
.gr-countdown--urgent { color:#fff4e4; border-color:#ffb39b; background:linear-gradient(145deg,#38101af7,#572b22f7); }
.gr-countdown--paused { color:#d7e4e8; border-color:#a9bdc7; }
.gr-countdown--paused .gr-countdown__digit,.gr-countdown--paused .gr-countdown__old { animation-play-state:paused; }
.gr-countdown--expired .gr-countdown__digit { animation:none; }
@keyframes gr-countdown-out { from { opacity:1; transform:scale(1); } to { opacity:0; transform:scale(.5); } }
@keyframes gr-countdown-in { from { opacity:0; transform:scale(1.35); } 70% { opacity:1; transform:scale(.94); } to { opacity:1; transform:scale(1); } }
@media(prefers-reduced-motion:reduce) { .gr-countdown__old { display:none; }.gr-countdown__digit--enter { animation:none; } }

.gr-countdown--inline { position:relative; top:auto; right:auto; display:inline-grid; vertical-align:middle; margin-inline-start:auto; }
