/* Phase 5: mini-games — the hub, each game's window, and what the table shows (potato, snow, the sack,
   icebreaker, ghosts). Every game window takes its colour from --mc (the game's colour in the panel). */

/* the hub */
.mg-hub { display: flex; flex-direction: column; gap: 8px; }
.mg-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: #f6f0ff; border-inline-start: 5px solid var(--mc); }
.mg-card.live { background: linear-gradient(90deg, color-mix(in srgb, var(--mc) 14%, #fff), #fff); }
.mg-ico { font-size: 30px; text-align: center; }
.mg-ico img { width: 40px; height: 40px; object-fit: contain; }
.mg-main p { margin: 2px 0 0; font-size: .75rem; color: var(--muted); }
.mg-when { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: .75rem; text-align: end; }

/* a game's window */
.mg-wrap { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(10, 4, 25, .6); }
.mg-window { --mc: #7b2ff7; position: relative; width: min(560px, 96vw); max-height: 92vh; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--mc) 35%, #2a1250), #2a1250); color: #fff; box-shadow: 0 30px 70px rgba(0, 0, 0, .5); }
.mg-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: color-mix(in srgb, var(--mc) 80%, #000); }
.mg-head b { font-size: 1.1rem; flex: 1; }
.mg-emoji { font-size: 26px; }
.mg-left { font-size: .8rem; font-weight: 800; opacity: .9; }
.mg-info { width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #2a1250; font-weight: 900; font-style: italic; }
.mg-close { color: #fff; font-size: 18px; }
.mg-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.mg-note { font-size: .75rem; opacity: .8; text-align: center; margin: 0; }
.mg-done { text-align: center; font-weight: 900; font-size: 1.1rem; }
.mg-bar { position: relative; height: 14px; border-radius: 999px; background: rgba(0, 0, 0, .3); overflow: hidden; text-align: center; font-size: .65rem; font-weight: 900; margin-top: 3px; }
.mg-bar div { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ffd84a, #ff9f1c); }
[dir="rtl"] .mg-bar div { inset: 0 0 0 auto; }
.mg-bar span { position: relative; }
.mg-tasks { display: flex; flex-direction: column; gap: 6px; }
.mg-task { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .1); }
.mg-task > span:first-child { font-size: 20px; text-align: center; }
.mg-task b { font-size: .82rem; }
.mg-task.done { opacity: .6; }
.mg-pts { padding: 3px 8px; border-radius: 8px; background: rgba(255, 255, 255, .15); font-weight: 900; white-space: nowrap; }
.mg-daily { font-size: .65rem; opacity: .8; }
.mg-body .pp-group { color: #ffd84a; }
.mg-body .rw-chip { background: rgba(255, 255, 255, .9); }

/* Treasure Map */
.dm-board { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(7, 1fr); gap: 4px; aspect-ratio: 1; width: 100%; max-width: 460px; margin: 0 auto;
  padding: 6px; border-radius: 16px; background: radial-gradient(circle, #f4d9a0 0%, #d9a85b 70%, #a8742f 100%); }
.dm-sq { position: relative; display: grid; place-items: center; border-radius: 8px; background: #fff6e0; color: #6b3d00; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); min-width: 0; }
.dm-sq .rw-big i { font-size: 18px; }
.dm-sq .rw-big b { font-size: .55rem; }
.dm-sq.here { outline: 3px solid #ff3d8b; background: #ffe3ee; }
.dm-token { position: absolute; top: -12px; font-size: 22px; animation: bob 1s ease-in-out infinite; }
.dm-start { position: absolute; bottom: -2px; font-size: .5rem; font-weight: 900; color: #2f9e44; }
.dm-center { grid-row: 2 / 7; grid-column: 2 / 7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #5a3200; }
.dm-house { font-size: 64px; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .3)); }
.dm-laps, .dm-dice { font-weight: 900; }
.dm-stages { display: flex; gap: 6px; font-size: 20px; }
.dm-stages span { opacity: .35; }
.dm-stages span.on { opacity: 1; }
.dm-die { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); font-size: 90px; color: #fff; text-shadow: 0 4px 10px rgba(0, 0, 0, .5); animation: popIn .4s; z-index: 3; pointer-events: none; }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* Bingo */
.bg-tabs { display: flex; gap: 4px; }
.bg-tabs button { flex: 1; padding: 6px; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; font-weight: 800; }
.bg-tabs button.on { background: #fff; color: #2b8a3e; }
.bg-tabs button.done { box-shadow: inset 0 0 0 2px #8ce99a; }
.bg-full { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; }
.bg-grid { display: grid; grid-template-columns: repeat(3, 1fr) 54px; gap: 6px; }
.bg-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 10px; background: #fff; color: #2b2b2b; text-align: center; min-height: 82px; }
.bg-cell > span { font-size: 20px; }
.bg-cell small { font-size: .62rem; font-weight: 700; line-height: 1.15; }
.bg-cell .mg-bar { width: 100%; background: #e9ecef; color: #2b2b2b; }
.bg-cell.done { background: #d3f9d8; box-shadow: inset 0 0 0 3px #40c057; }
.bg-side { display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .12); }
.bg-side.paid { background: #40c057; }
.bg-side .rw-big i { font-size: 20px; }
.bg-side .rw-big b { font-size: .6rem; }

/* Potions */
.al-stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.al-stage { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: rgba(255, 255, 255, .08); opacity: .6; text-align: center; }
.al-stage > span { font-size: 30px; }
.al-stage > small { font-weight: 800; font-size: .7rem; }
.al-stage.on { opacity: 1; background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 2px #e599f7; }
.al-stage.done { opacity: 1; }
.al-pot { display: flex; align-items: center; justify-content: center; gap: 16px; }
.al-cauldron { position: relative; font-size: 70px; line-height: 1; }
.al-cauldron b { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: .9rem; background: #2a1250; padding: 0 6px; border-radius: 8px; }

/* event shops */
.sh-balance { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 1.4rem; }
.sh-balance small { font-size: .8rem; opacity: .8; }
.sh-switch { margin: 0; }
.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.sh-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; background: #fff7e0; color: #5a3200; border: 2px solid #f5b301; }
.sh-item.out { filter: grayscale(1); opacity: .6; }
.sh-item .st-buy { min-width: 0; width: 100%; padding: 5px 4px; }
.sh-reload { align-self: center; background: linear-gradient(180deg, #ffe46b, #f5b301); color: #5a3200; font-weight: 900; }

/* Flirt Academy */
.ac-total { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ac-total b { font-size: 1.5rem; }
.ac-track { position: relative; width: 100%; height: 18px; border-radius: 999px; background: rgba(0, 0, 0, .35); margin: 10px 0; }
.ac-track > div { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, #ff8fb1, #e64980); }
.ac-mark { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #46288c; border: 2px solid #fff; font-size: .7rem; font-weight: 900; }
.ac-mark.on { background: #ffd84a; color: #5a3200; }
.ac-me { text-align: center; }
.ac-lv { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #ffd84a; color: #5a3200; font-weight: 900; }
.ac-top { display: flex; flex-direction: column; gap: 4px; }
.ac-row { display: grid; grid-template-columns: 24px 30px 1fr auto; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 10px; background: rgba(255, 255, 255, .08); }
.ac-row.me { background: rgba(255, 216, 74, .25); }
.ac-row img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.ac-row em { font-style: normal; font-weight: 900; }
.ac-bands { display: grid; gap: 4px; font-size: .75rem; }
.ac-bands > div { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, .06); }

/* Cruise */
.gg-days { display: flex; gap: 4px; overflow-x: auto; }
.gg-days span { flex: 1 0 auto; padding: 4px 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: .75rem; font-weight: 800; text-align: center; }
.gg-days span.on { background: #fff; color: #0b7285; }
.gg-days span.past { opacity: .6; }
.gg-goal { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .1); text-align: center; }
.gg-reward { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.gg-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.gg-step { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; border-radius: 10px; background: rgba(255, 255, 255, .08); font-size: .7rem; }
.gg-step.done { background: rgba(64, 192, 87, .45); }
.gh-info { text-align: center; }
.gh-info span { font-size: 64px; }

/* at the table */
.seat-fx { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; border-radius: inherit; pointer-events: none; }
.seat-fx.transform { background: rgba(232, 89, 12, .55); }
.seat-fx.transform span { font-size: calc(var(--u, 1px) * 60); animation: bob 1.2s ease-in-out infinite; }
.seat-fx.frozen { background: linear-gradient(180deg, rgba(165, 216, 255, .75), rgba(116, 192, 252, .6)); box-shadow: inset 0 0 18px #fff; }
.seat-fx.frozen span { font-size: calc(var(--u, 1px) * 40); }
.potato-on { position: absolute; top: -10px; inset-inline-start: -10px; z-index: 4; display: flex; align-items: center; gap: 2px; padding: 2px 6px; border-radius: 999px; background: #e8590c; color: #fff; font-weight: 900; font-size: calc(var(--u, 1px) * 12); animation: shake .5s ease-in-out infinite; }
.potato-on span { font-size: calc(var(--u, 1px) * 18); }
@keyframes shake { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.fly-throw { position: absolute; z-index: 6; font-size: 34px; transform: translate(-50%, -50%); transition: left .7s ease-in, top .7s ease-in; pointer-events: none; }
.fly-throw.go { animation: spinThrow .7s linear; }
@keyframes spinThrow { to { transform: translate(-50%, -50%) rotate(720deg); } }
.snow-stack { position: absolute; bottom: 18%; left: 0; right: 0; z-index: 3; text-align: center; font-size: calc(var(--u, 1px) * 12); letter-spacing: -2px; pointer-events: none; }
/* the sack: the bag alone (no card around it), a golden glow and its time under it, sized with the seats */
.sack-btn { position: absolute; z-index: 7; pointer-events: auto; cursor: pointer; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0;
  background: none; border: 0; box-shadow: none; animation: bob 1s ease-in-out infinite; }
.sack-btn span { font-size: clamp(26px, calc(var(--u, 1px) * 44), 46px); line-height: 1; filter: drop-shadow(0 0 8px #ffd43b) drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.sack-btn b { padding: 1px 7px; border-radius: 8px; background: rgba(0, 0, 0, .55); color: #ffe066; font-size: .7rem; line-height: 1.4; }
.sack-btn b:empty { display: none; }
.icebreaker { position: absolute; left: 50%; top: 26%; transform: translate(-50%, -50%); z-index: 8; display: flex; align-items: center; gap: 6px; max-width: 70%; padding: 8px 14px; border-radius: 18px;
  background: #fff; color: #2a1250; font-weight: 800; font-size: .85rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); animation: popIn .35s; pointer-events: none; }
.mg-ghost { position: absolute; z-index: 45; font-size: 54px; transform: translate(-50%, -50%); transition: left 1.5s ease-in-out, top 1.5s ease-in-out; filter: drop-shadow(0 4px 10px rgba(124, 92, 255, .8)); animation: bob 1.4s ease-in-out infinite; }
.throw-btn { display: inline-flex; align-items: center; gap: 4px; }
