/* ==========================================================================
   MMO11 — 3D MİNİ OYUN SAYFASI (MiniGame3D, miniGame3d.js): the panel (tries, "Oyna", tree / ranking) and, while
   playing, the scene full screen — the hub hidden, the stage a panel over the whole window (AGENTS.md §4.2).
   ========================================================================== */

.mg3-body { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; align-items: stretch; }
.mg3-entry { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 26px 22px; }
.mg3-icon { font-size: 54px; line-height: 1; }
.mg3-title { margin: 0; font-size: 24px; font-weight: 900; color: #1f2937; }
.mg3-how { margin: 0; max-width: 460px; font-size: 15px; line-height: 1.45; color: #475569; }
.mg3-tries { display: flex; flex-direction: column; align-items: center; padding: 10px 26px; border-radius: 16px; background: #eef6ff; }
.mg3-tries span { font-size: 13px; font-weight: 800; color: #64748b; text-transform: uppercase; }
 /* the entry's buttons (Oyna / Hakkını Yenile, Arkadaşınla oyna, Premium): one size, each its own colour */
.mg3-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 300px; }
.mg3-act {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; height: 56px; padding: 0 18px; border: 0; border-radius: 16px;
  font-family: inherit; font-size: 19px; font-weight: 900; white-space: nowrap; color: #ffffff; cursor: pointer;
}
.mg3-act:disabled { cursor: default; background: #cbd5e1; color: #475569; box-shadow: none; }
.mg3-play { background: linear-gradient(135deg, #ffa24d, #f0611c); box-shadow: 0 6px 16px rgba(240, 97, 28, 0.35); }
/* no tries left: in the play button's place (10 Token → the day's tries back to full) */
.mg3-refill-btn { background: linear-gradient(135deg, #22c55e, #15803d); box-shadow: 0 6px 16px rgba(21, 128, 61, 0.35); }
.mg3-friend-btn { background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 6px 16px rgba(29, 78, 216, 0.35); }
.mg3-premium-btn { background: linear-gradient(135deg, #a855f7, #6d28d9); box-shadow: 0 6px 16px rgba(109, 40, 217, 0.35); }
.mg3-premium-on { background: #f3e8ff; color: #6d28d9; cursor: default; }
.mg3-tries b { font-size: 40px; font-weight: 900; color: #1d6fb0; line-height: 1.1; }
.mg3-tries b small { font-size: 20px; color: #94a3b8; }
.mg3-tries em { font-style: normal; font-size: 13px; font-weight: 700; color: #16a34a; }
.mg3-end b { display: block; font-size: 28px; font-weight: 900; color: #1f2937; }
.mg3-end.won b { color: #16a34a; }
.mg3-end.lost b { color: #dc2626; }
.mg3-end span { display: block; font-size: 15px; color: #475569; }
.mg3-side { display: flex; flex-direction: column; padding: 18px 20px; }

/* the tree and the ranking at full size (the page's main part) */
.mg3-side { --mg-label: 96px; --mg-cell: 168px; }
.mg3-side .mg-tabs button { font-size: 17px; padding: 10px 14px; }
.mg3-side .mg-tree-head { font-size: 20px; }
.mg3-side .mg-tree-head span { font-size: 19px; }
.mg3-side .mg-tree-bar { height: 14px; border-radius: 7px; }
.mg3-side .mg-tree-grid { gap: 10px; }
.mg3-side .mg-track-label { font-size: 15px; }
.mg3-side .mg-cell { min-height: 104px; padding: 12px 8px; gap: 6px; }
.mg3-side .mg-rw { font-size: 17px; }
.mg3-side .mg-rw img { width: 26px; height: 26px; }
.mg3-side .mg-cell-state { font-size: 15px; }
.mg3-side .mg-tier-no { font-size: 15px; }
.mg3-side .mg-rank { max-height: 460px; gap: 6px; }
.mg3-side .mg-rank-row { font-size: 18px; padding: 10px 14px; grid-template-columns: 46px minmax(0, 1fr) auto; }
.mg3-side .mg-prize { font-size: 17px; padding: 8px 12px; }
.mg3-side .mg-box-title { font-size: 15px; }

/* playing: only the scene */
#gameViewport.mg-fullscreen > #clientHubScreen { visibility: hidden; }   /* (only the hub: a panel over the game — the connection notice — still shows) */
.mg3-stage { position: absolute; inset: 0; z-index: 40; background: transparent; }
.mg3-exit {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}
.mg3-load {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: #1f2937;
  font-size: 15px;
  font-weight: 800;
}
/* a live rival's turn: a line at the top, the scene stays visible */
.mg3-note {
  top: 72px;
  transform: translateX(-50%);
}

/* the premium track: the button under "Oyna" and its offer panel (in the window, AGENTS.md §4.2) */
.mg3-refill-cost { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.22); }
.mg3-refill-cost b { font-size: 18px; font-weight: 900; color: #ffffff; }
.mg3-prem-overlay { position: absolute; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; background: rgba(8, 12, 28, 0.72); }
.mg3-prem-card { position: relative; width: min(760px, 94%); max-height: 94%; overflow-y: auto; border-radius: 22px; background: #ffffff; box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5); }
.mg3-prem-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.2); color: #ffffff; font-size: 18px; font-weight: 900; cursor: pointer; }
.mg3-prem-hero { padding: 22px 26px 18px; color: #ffffff; background: linear-gradient(120deg, #3b1d8f, #7a2bbf 55%, #c2307a); border-radius: 22px 22px 0 0; }
.mg3-prem-kicker { font-size: 13px; font-weight: 900; letter-spacing: 2px; color: #ffd76a; }
.mg3-prem-hero h3 { margin: 6px 0 4px; font-size: 26px; font-weight: 900; color: #ffffff; }
.mg3-prem-hero p { margin: 0; font-size: 15px; line-height: 1.4; color: #f1e8ff; }
.mg3-prem-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 22px 6px; }
.mg3-prem-col { padding: 12px 14px; border-radius: 14px; background: #f5f8fc; border: 1px solid #e2e8f0; }
.mg3-prem-col span { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 900; color: #64748b; text-transform: uppercase; }
.mg3-prem-col div { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.mg3-prem-col.gold { background: #fff8e6; border-color: #f5c542; }
.mg3-prem-col.gold span { color: #b45309; }
.mg3-prem-tiers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 10px 22px; }
.mg3-prem-tier { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-radius: 12px; background: #fffbeb; border: 1px solid #fde68a; text-align: center; }
.mg3-prem-tier b { font-size: 13px; color: #b45309; }
.mg3-prem-tier span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mg3-prem-buy { display: flex; justify-content: center; padding: 12px 22px 4px; }
.mg3-prem-go {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 320px;
  justify-content: center;
  padding: 14px 28px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #5cc8ff, #2f8fe8 60%, #2563eb);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(47, 143, 232, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  cursor: pointer;
}
.mg3-prem-go span { font-size: 19px; font-weight: 900; }
.mg3-prem-go b { padding: 4px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.22); font-size: 22px; font-weight: 900; }
.mg3-prem-go:active { transform: translateY(1px); }
.mg3-prem-trust { padding: 8px 22px 18px; text-align: center; font-size: 13px; color: #64748b; }

/* the search for a rival (over the scene, while it loads) */
.mg3-match { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; background: rgba(8, 15, 30, 0.82); }
.mg3-match[hidden] { display: none; }
.mg3-match-card { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 32px 46px; border-radius: 22px; background: #ffffff; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45); }
.mg3-match-title { font-size: 26px; font-weight: 900; color: #1f2937; }
.mg3-match-card.found .mg3-match-title { color: #16a34a; }
.mg3-spinner { width: 64px; height: 64px; border-radius: 50%; border: 7px solid #dbeafe; border-top-color: #2f9be8; animation: mg3-spin 0.9s linear infinite; }
@keyframes mg3-spin { to { transform: rotate(360deg); } }
.mg3-match-vs { display: flex; align-items: center; gap: 18px; font-size: 24px; color: #1f2937; }
.mg3-match-vs b { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; }
.mg3-match-vs b:first-child { color: #1d6fb0; }
.mg3-match-vs b:last-child { color: #ea580c; }
.mg3-match-vs i { font-style: normal; font-size: 18px; font-weight: 900; color: #94a3b8; }

@media (max-width: 980px) {
  .mg3-body { grid-template-columns: 260px minmax(0, 1fr); gap: 10px; }
  .mg3-side { --mg-label: 80px; --mg-cell: 140px; padding: 12px 14px; }
  .mg3-entry { padding: 16px 14px; gap: 6px; }
  .mg3-actions { gap: 8px; }
  .mg3-act { height: 46px; font-size: 16px; }
  .mg3-icon { font-size: 38px; }
  .mg3-tries b { font-size: 30px; }
}
@media (max-width: 640px) {
  .mg3-body { grid-template-columns: minmax(0, 1fr); }
}

/* "Arkadaşınla oyna": the button under Oyna and the online friends panel */
.mg3-friends-card { position: relative; width: min(420px, 92%); max-height: 80%; display: flex; flex-direction: column; background: #111827; color: #f9fafb; border: 1px solid #374151; border-radius: 16px; padding: 18px 16px 14px; }
.mg3-friends-title { margin: 0 32px 12px 0; font-size: 18px; color: #f9fafb; }
.mg3-friends-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.mg3-friends-empty { padding: 24px 8px; text-align: center; color: #d1d5db; font-size: 15px; }
.mg3-friend-row { display: flex; align-items: center; gap: 10px; padding: 10px; background: #1f2937; border-radius: 12px; }
.mg3-friend-dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; flex: none; }
.mg3-friend-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mg3-friend-name b { color: #f9fafb; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg3-friend-name small { color: #9ca3af; font-size: 12px; }
.mg3-friend-invite { flex: none; padding: 8px 14px; }
.mg3-event-pick { width: 100%; }
