/* Lucky Gate — small additions on top of the original site styles (site.css, rich-content.css, extra-games.css). */

/* buttons of the original page are links here: keep their box the same */
a.lang, a.cp-main, a.cp-ghost, a.support, a.side-tab, a.p-go, a.fb-body { display: grid; place-items: center; text-align: center; }
a.ib-btn { white-space: nowrap; }
.dr-links a { display: flex; align-items: center; gap: 10px; }

/* whole picture / row is clickable: an invisible link laid over it */
.lpg-cover { position: absolute; inset: 0; z-index: 2; display: block; }
.promo, .slide, .hot-card .thumb { position: relative; }
.promo .p-go, .slide .cta, .img-slide .cta { position: relative; z-index: 3; }
.img-slide .cta { position: absolute; }
.badge { z-index: 3; pointer-events: none; }
.thumb .kit-mascot { pointer-events: none; }

/* cartoon picked in the admin instead of the built-in sprite */
.mid-ball img, .fb-body img.spr-img, img.cp-ava { width: 46px; height: 46px; object-fit: contain; border-radius: 12px; }
.spr.one { background-size: 100% 100%; background-position: center; image-rendering: auto; }

/* WordPress admin bar (logged-in owner only) */
.admin-bar .topbar { top: 32px; }
.admin-bar .catbar { top: 92px; }
@media (max-width: 782px) { .admin-bar .topbar { top: 46px; } .admin-bar .catbar { top: 106px; } }
@media (max-width: 600px) { .admin-bar .topbar { top: 0; } .admin-bar .catbar { top: 60px; } }

/* daily free wheel (floating button + popup) */
#dw-fab { position: fixed; left: max(8px, calc(50% - 240px - 82px)); bottom: calc(98px + env(safe-area-inset-bottom)); z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 76px; min-height: 92px; padding: 8px 4px 9px;
  border: 2px solid rgba(255, 226, 151, .92); border-radius: 22px; cursor: pointer; color: #fff;
  background: linear-gradient(150deg, #bd6def 0%, #9a56d8 35%, #eb5caa 72%, #f4768f 100%);
  box-shadow: 0 3px 0 #863b9b, 0 9px 22px rgba(88, 30, 103, .29), inset 0 1px 0 rgba(255, 255, 255, .6);
  -webkit-tap-highlight-color: transparent; transition: transform .2s ease, box-shadow .2s ease; }
#dw-fab::before { content: ''; position: absolute; inset: 4px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 16px; pointer-events: none; }
#dw-fab::after { content: '✦'; position: absolute; top: 5px; right: 6px; font: 14px Kanit, sans-serif; color: #ffed9b; text-shadow: 0 0 7px #fff; pointer-events: none; }
#dw-fab canvas { width: 57px; height: 57px; display: block; flex: none; filter: drop-shadow(0 3px 3px rgba(70, 20, 76, .45)); animation: dw-fab-spin 16s linear infinite; }
#dw-fab .dw-fab-pin { position: absolute; left: 50%; top: 5px; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 10px solid #fff8c5; filter: drop-shadow(0 2px 0 #a72e73); }
#dw-fab .dw-fab-tag { position: relative; display: block; max-width: 100%; white-space: nowrap; border-radius: 99px; padding: 2px 4px;
  font: 700 10px/1.2 Kanit, sans-serif; letter-spacing: .05px; text-shadow: 0 1px 2px rgba(71, 15, 65, .4); }
#dw-fab.ready { box-shadow: 0 3px 0 #863b9b, 0 9px 22px rgba(88, 30, 103, .29), 0 0 0 4px rgba(255, 223, 117, .22); }
#dw-fab.ready .dw-fab-tag { background: rgba(120, 29, 102, .36); }
#dw-fab.done { filter: saturate(.78); }
#dw-fab.done canvas { animation-duration: 45s; }
#dw-fab:hover { transform: translateY(-3px); box-shadow: 0 5px 0 #863b9b, 0 13px 24px rgba(88, 30, 103, .32); }
#dw-fab:active { transform: translateY(1px); }
#dw-fab:focus-visible { outline: 3px solid #592065; outline-offset: 3px; }
body:has(#chat-pop:not([hidden])) #dw-fab { visibility: hidden; pointer-events: none; }
@media (max-width: 480px) { #dw-fab { left: max(0px, env(safe-area-inset-left)); bottom: calc(104px + env(safe-area-inset-bottom)); width: 68px; min-height: 88px; border-radius: 0 20px 20px 0; border-left: 0; }
  #dw-fab::before { border-radius: 0 15px 15px 0; } #dw-fab canvas { width: 53px; height: 53px; } }
@keyframes dw-fab-spin { to { transform: rotate(360deg); } }

#dw-modal { position: fixed; inset: 0; z-index: 2147482000; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 50% 40%, rgba(80, 20, 90, 0.55), rgba(10, 4, 20, 0.88)); opacity: 0; transition: opacity 0.25s; }
#dw-modal.show { opacity: 1; }
#dw-modal[hidden] { display: none; }
.dw-card { position: relative; width: min(420px, 100%); max-height: 100%; overflow: auto; padding: 22px 18px 20px; border-radius: 28px; text-align: center; font-family: Kanit, sans-serif;
  background: linear-gradient(180deg, #fff8fc, #ffe6f2); box-shadow: 0 0 0 4px #ffd34d, 0 0 0 8px #b0306a, 0 24px 60px rgba(0, 0, 0, 0.5); }
.dw-x { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; font-size: 24px; line-height: 1; cursor: pointer; color: #7a2a5e; background: rgba(176, 48, 106, 0.12); }
.dw-title { margin: 2px 30px 4px; font-size: 24px; font-weight: 800; line-height: 1.2;
  background: linear-gradient(180deg, #ff4a8a, #b0306a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dw-text { margin: 0 6px 10px; font-size: 14px; color: #7a4a6a; }
.dw-wrap { position: relative; width: min(330px, 82vw); aspect-ratio: 1; margin: 0 auto; }
.dw-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.dw-pointer { position: absolute; left: 50%; top: -16px; width: 46px; height: 60px; margin-left: -23px; z-index: 2;
  background: linear-gradient(180deg, #ff6a9a, #e0105a); clip-path: polygon(50% 100%, 6% 22%, 6% 8%, 50% 0, 94% 8%, 94% 22%); filter: drop-shadow(0 0 0 #fff) drop-shadow(0 3px 0 #7a0a3a); transform-origin: 50% 20%; }
.dw-pointer::after { content: ""; position: absolute; left: 50%; top: 12px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff6c0; box-shadow: 0 0 8px #fff; }
.dw-pointer.tick { animation: dw-tick 0.12s ease-out; }
@keyframes dw-tick { 50% { transform: rotate(-14deg); } }
.dw-go { position: absolute; left: 50%; top: 50%; width: 27%; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 2; border: 0; border-radius: 50%; cursor: pointer;
  font: 800 clamp(16px, 5vw, 22px) Kanit, sans-serif; color: #fff; text-shadow: 0 2px 0 #b0306a;
  background: radial-gradient(circle at 50% 30%, #ff9ac8, #ff3a8a 55%, #b0105a); box-shadow: 0 0 0 5px #fff, 0 0 0 8px #ffd34d, 0 8px 16px rgba(0, 0, 0, 0.35); }
.dw-go:disabled { cursor: default; filter: saturate(0.6); }
.dw-go:not(:disabled) { animation: dw-go 1.4s ease-in-out infinite; }
@keyframes dw-go { 50% { transform: translate(-50%, -50%) scale(1.07); } }
.dw-result { min-height: 64px; margin-top: 14px; font-size: 18px; color: #7a2a5e; }
.dw-result b { display: block; font-size: 30px; color: #ff3a8a; }
.dw-result.bonus b { background: linear-gradient(90deg, #ff3a8a, #ffb43a, #3ab0ff, #ff3a8a); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: dw-rainbow 1.5s linear infinite; }
@keyframes dw-rainbow { to { background-position: 300% 0; } }
.dw-note { margin-top: 8px; font-size: 12px; color: #9a7a90; }
.dw-play { display: inline-block; margin-top: 10px; padding: 10px 26px; border-radius: 99px; font-weight: 700; color: #fff; text-decoration: none; background: linear-gradient(135deg, #ff5a8a, #b07aff); }
.dw-play[hidden] { display: none; }
#dw-fx { position: fixed; inset: 0; z-index: 2147482001; pointer-events: none; }
body:has(.drawer.open) #dw-fab { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { #dw-fab canvas, .dw-go { animation: none !important; } #dw-fab { transition: none; } }

/* welcome popup (optional, off by default) */
#m-welcome { align-items: center; padding: 16px; }
.welcome { position: relative; width: min(100%, 360px); padding: 0 18px 14px; border-radius: 26px; background: #fff; text-align: center; overflow: hidden; box-shadow: 0 20px 50px rgba(90, 30, 80, 0.35); }
.wl-art { display: block; margin: 0 -18px 12px; }
.wl-art img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.welcome h3 { font-size: 22px; }
.welcome p { color: var(--muted); margin: 4px 0 14px; font-size: 14px; }
.welcome .btn { width: 100%; }
.welcome .sh-x { z-index: 2; background: rgba(255, 255, 255, 0.85); }
.wl-hide { justify-content: center; margin-top: 6px; }

/* posts / pages / archives */
.page-main { padding: 16px 14px 0; }
.page-h { margin: 4px 4px 14px; }
.entry-card { margin-bottom: 14px; padding: 16px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.entry-thumb img { width: calc(100% + 32px); max-width: none; margin: -16px -16px 12px; height: auto; }
.entry-title { font-size: 20px; line-height: 1.3; margin-bottom: 8px; }
.entry { font-size: 15px; line-height: 1.75; }
.entry p, .entry ul, .entry ol, .entry figure { margin-bottom: 12px; }
.entry ul, .entry ol { padding-left: 22px; }
.entry a { color: var(--pink-2); text-decoration: underline; }
.entry img { height: auto; max-width: 100%; border-radius: 12px; }
.pager .nav-links { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.pager .page-numbers { min-width: 38px; padding: 6px 10px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.pager .current { background: var(--pink-2); color: #fff; }
