/* Copied from the Reddit app's public/reddit.css for the web portal builds of shihab (tools/build_portal.py, with
   window.QG_DAILY): the daily card and its results, and the wide-screen layout. Copy it again after the Reddit styles change. */
/* Shihab on Reddit: what the Reddit build adds to the web game's own styles (linked by the Reddit app's
   tools/import_shihab.py; the web game itself never loads this file). */

/* the Daily Run card on the home screen, at the top in place of the logo (the post's cover already shows the logo);
   sized in the game's unit --u, 1% of the game column */
#home .logo-wrap, #home .logo-sub { display: none; }
.rd-card {
  position: relative; z-index: 6; flex: none; margin: calc(var(--u) * 5) 0 calc(var(--u) * 3.5);
  width: calc(var(--u) * 88); display: flex; align-items: center; gap: calc(var(--u) * 2.6); padding: calc(var(--u) * 2.2) calc(var(--u) * 3);
  cursor: pointer; border-radius: calc(var(--u) * 5); color: #fff; font: inherit; text-align: start;
  background: linear-gradient(135deg, rgba(92, 40, 110, 0.95), rgba(214, 96, 84, 0.95));
  border: 2px solid rgba(255, 222, 130, 0.9); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(255, 222, 130, 0.18);
  animation: rd-glow 2.4s ease-in-out infinite;
}
.rd-card img { width: calc(var(--u) * 13); height: calc(var(--u) * 13); object-fit: contain; margin: calc(var(--u) * -3) 0; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.4)); }
.rd-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rd-txt b { font-size: calc(var(--u) * 5.4); font-weight: 800; }
.rd-txt small { font-size: calc(var(--u) * 3.4); opacity: 0.92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-go {
  padding: calc(var(--u) * 2) calc(var(--u) * 4.5); border-radius: 999px; font-weight: 800; font-size: calc(var(--u) * 4.6); color: #5a3000;
  background: linear-gradient(180deg, #ffe08a, #f2a632); box-shadow: 0 3px 0 #b06e10;
}
.rd-card:active { transform: translateY(2px); }
@keyframes rd-glow { 50% { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 0 7px rgba(255, 222, 130, 0.32); } }

/* the Daily Run results (inside the game's #results screen) */
#results .rd-panel { width: min(calc(var(--u) * 92), 440px); max-height: calc(100% - var(--u) * 12); overflow-y: auto; gap: 8px; padding-top: calc(var(--u) * 8); color: #fff; text-align: center; }
.rd-stats { display: flex; gap: 8px; width: 100%; }
.rd-stats div { flex: 1; padding: 8px 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.12); display: flex; flex-direction: column; }
.rd-stats small { font-size: 12px; opacity: 0.85; }
.rd-stats b { font-size: 22px; font-weight: 800; }
.rd-new { font-size: 18px; font-weight: 800; color: #ffe08a; margin: 0; }
.rd-new.hidden { display: none; }
.rd-rank { font-size: 15px; font-weight: 700; color: #ffe9c7; margin: 0; }
.rd-panel h3 { font-size: 15px; font-weight: 800; opacity: 0.9; margin: 2px 0 0; }
.rd-board { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 4px; }
.rd-board li { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.1); font-weight: 700; font-size: 15px; }
.rd-board .n { width: 22px; opacity: 0.75; }
.rd-board .who { flex: 1; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-board .pts { font-weight: 800; }
.rd-board li.me { background: linear-gradient(90deg, #ffd56b, #f2a632); color: #4a2600; }
.rd-board li.rd-empty { justify-content: center; opacity: 0.8; font-weight: 600; }
.rd-btns { display: flex; gap: 10px; width: 100%; margin-top: 4px; }
.rd-btns .btn { flex: 1; font-size: 16px; padding: 12px 8px; line-height: 1.2; }
.rd-btns .btn span { font-size: inherit; }
.rd-share.hidden { display: none; }
.rd-share .btn[disabled] { opacity: 0.55; }

/* a short message (stars received, link copied) */
.rd-note {
  position: absolute; z-index: 95; left: 50%; top: 42%; transform: translate(-50%, -10px); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 999px; font: 800 17px var(--font, system-ui); color: #4a2600; white-space: nowrap;
  background: linear-gradient(180deg, #ffe08a, #f2a632); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); transition: opacity 0.25s, transform 0.25s;
}
.rd-note.show { opacity: 1; transform: translate(-50%, 0); }

/* the full-screen button (computers, when Reddit's frame allows it): bottom right, small, out of the way */
.rd-fs {
  position: absolute; z-index: 45; right: 12px; bottom: 12px; width: 40px; height: 40px; border-radius: 12px; border: 0;
  font: 700 20px/1 system-ui, sans-serif; color: #fff; cursor: pointer;
  background: rgba(40, 16, 46, 0.6); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35); opacity: 0.75;
}
.rd-fs:hover { opacity: 1; }
body[data-mode='run'] .rd-fs { opacity: 0.35; }
@media (max-aspect-ratio: 3/5) { .rd-fs { display: none; } }   /* a narrow window: no room beside the bottom buttons */

/* Wider than a phone (a computer, a tablet): the 3D city fills the whole screen and the HUD sits at its corners. The menus
   keep the size they were designed at (--u is 1% of a phone-shaped column, --w): every menu screen is that column,
   centred; the map screens' paper colour reaches out to the screen's edges. */
@media (min-aspect-ratio: 3/5) {
  html, body { background: #2a1534; }
  #game { width: 100vw; box-shadow: none; }
  #game > .screen { left: calc(50% - var(--w) / 2); right: auto; width: var(--w); }
  #game > #results { left: 0; width: 100%; }
  #game > .map-screen { box-shadow: 0 0 0 100vmax #2a1534; }
  #home { background: none; }
  #home::before { content: ''; position: absolute; top: 0; bottom: 0; left: calc(var(--w) / 2 - 50vw); width: 100vw; pointer-events: none;
    background: linear-gradient(rgba(60, 25, 50, 0.15), rgba(60, 25, 50, 0) 40%, rgba(50, 20, 30, 0.55)); }
  #hud .top { padding-inline: max(calc(var(--u) * 3.5), 2vw); }
}
