/* ============ Tab views: Today, charts, Arcade, Search, product page ============ */

/* ---------- Today ---------- */
.today-cards { display: grid; gap: 14px; align-items: start; }
.ed-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-elev);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.ed-art-wrap { position: relative; }
.ed-art-wrap svg.ed-art { width: 100%; height: 100%; display: block; }
.ed-card:not(.ed-story) .ed-art-wrap { aspect-ratio: 1.54; }
.ed-hero .ed-art-wrap { aspect-ratio: 1.16; }
.ed-story .ed-art-wrap { aspect-ratio: 1.9; }

.ed-tag {
  font-size: 12px; font-weight: 800; letter-spacing: 0.09em;
  color: rgba(255, 255, 255, 0.94); text-transform: uppercase;
}
.ed-title { font-size: 26px; font-weight: 800; line-height: 1.12; color: #fff; letter-spacing: -0.01em; margin-top: 5px; }
.ed-hero .ed-title { font-size: 33px; }
.ed-tagline { font-size: 14.5px; font-weight: 500; color: rgba(255, 255, 255, 0.92); margin-top: 6px; line-height: 1.3; }
.ed-hero .ed-tagline { font-size: 16px; }

.ed-hero-text { position: absolute; left: 18px; right: 18px; bottom: 16px; }
.ed-overlay-text { position: absolute; left: 16px; right: 16px; bottom: 14px; }
.ed-chip {
  position: absolute; top: 14px; left: 14px;
  width: 44px; height: 44px; border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.ed-chip svg { width: 100%; height: 100%; display: block; }

.ed-story .ed-text { padding: 16px 18px 18px; }
.ed-story .ed-title { color: var(--label); font-size: 22px; }
.ed-story .ed-tag { color: var(--tertiary); }
.ed-blurb { font-size: 14.5px; color: var(--secondary); line-height: 1.35; margin-top: 4px; }
.ed-cta { margin-top: 12px; font-size: 15px; font-weight: 600; color: var(--blue); }

.ed-collection .coll-icons {
  display: flex; align-items: flex-end; gap: 9px;
  padding: 0 16px 14px;
}
.coll-icon { width: 48px; height: 48px; border-radius: 11px; overflow: hidden; box-shadow: var(--shadow-card); }
.coll-icon svg { width: 100%; height: 100%; display: block; }
.coll-icon:nth-child(2) { margin-bottom: 9px; }
.coll-icon:nth-child(3) { margin-bottom: 18px; }

.today-footer { padding: 34px 4px 8px; text-align: center; }
.today-footer-title { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.today-footer-copy { font-size: 13.5px; color: var(--secondary); line-height: 1.45; max-width: 420px; margin: 0 auto; }

/* ---------- Charts (Games/Apps) ---------- */
.chart-sec .chart-list { background: var(--bg-elev); border-radius: 12px; overflow: hidden; }
.chart-list .app-row { padding: 9px 14px; border-radius: 0; }
.chart-list .app-row + .app-row { box-shadow: inset 0 0.5px 0 var(--separator); }
.chart-list .app-row:active { background: var(--fill); }

/* ---------- Arcade ---------- */
.arcade-hero {
  position: relative; margin-top: 4px;
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(150deg, #241b3f 0%, #4a2c7a 55%, #8b2f8f 100%);
  color: #fff; padding: 26px 20px 24px;
  cursor: pointer;
  box-shadow: 0 10px 34px rgba(74, 44, 122, 0.35);
}
.arcade-logo { width: 72px; height: 72px; }
.arcade-logo svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 12px rgba(0,0,0,.3)); }
.arcade-slogan h2 { margin: 16px 0 6px; font-size: 27px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; }
.arcade-slogan p { margin: 0; font-size: 14.5px; line-height: 1.4; color: rgba(255, 255, 255, 0.82); max-width: 320px; }
.arcade-cta { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.arcade-try {
  padding: 0 20px; height: 36px; border-radius: 18px;
  background: #fff; color: #4a2c7a; font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center;
  transition: transform 0.14s ease;
}
.arcade-try:active { transform: scale(0.95); }
.arcade-price { font-size: 13px; color: rgba(255, 255, 255, 0.7); }

.arcade-banner {
  border-radius: 14px; overflow: hidden;
  background: linear-gradient(120deg, #14213d, #1d3557);
  color: #fff; padding: 16px 18px;
}
.arcade-banner-title { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; color: #ffd60a; }
.arcade-banner-copy { font-size: 14px; margin-top: 4px; line-height: 1.35; color: rgba(255, 255, 255, 0.88); }
.arcade-banner-games { display: flex; gap: 10px; margin-top: 12px; }
.arcade-banner-games::after { content: ""; }
.arcade-banner .arcade-banner-games {
  gap: 10px;
}
.arcade-banner-games > div { width: 46px; height: 46px; border-radius: 10.5px; overflow: hidden; }
.arcade-banner-games > div > svg, .arcade-banner-games svg { width: 100%; height: 100%; display: block; }
.arcade-banner-games .ghost {
  background: rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; justify-content: center;
}
.arcade-list .row-iap { color: #8e44ad; }
.arcade-list .row-iap { font-weight: 500; }
.arcade-footnote { padding: 26px 4px 6px; font-size: 13px; color: var(--secondary); line-height: 1.5; text-align: center; }
.arcade-footnote-small { font-size: 12px; color: var(--tertiary); margin-top: 6px; }

/* ---------- Search ---------- */
.search-field {
  display: flex; align-items: center; gap: 7px;
  background: var(--fill);
  border-radius: 11px;
  height: 38px; padding: 0 10px;
  margin-bottom: 18px;
  transition: box-shadow 0.2s ease, background 0.2s ease;
}
.search-field:focus-within { box-shadow: 0 0 0 3.5px rgba(0, 122, 255, 0.28); background: var(--bg-elev); }
.sf-icon { color: var(--secondary); display: flex; }
.sf-input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-size: 16.5px; color: var(--label);
}
.sf-input::placeholder { color: var(--secondary); }
.sf-input::-webkit-search-cancel-button { display: none; }
.sf-clear { color: var(--tertiary); font-size: 14px; width: 24px; height: 24px; border-radius: 50%; background: var(--fill-2); display: flex; align-items: center; justify-content: center; }
.sf-clear:active { transform: scale(0.9); }

.trending-title { margin: 8px 0 4px; font-size: 21px; font-weight: 700; }
.trend-list { background: var(--bg-elev); border-radius: 12px; overflow: hidden; }
.trend-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 11px 14px;
  font-size: 15.5px;
  transition: background 0.12s ease;
}
.trend-row:active { background: var(--fill); }
.trend-row + .trend-row { box-shadow: inset 0 0.5px 0 var(--separator); }
.trend-arrow { color: var(--tertiary); display: flex; }

.results-head { font-size: 20px; font-weight: 700; padding: 6px 2px 10px; }
.search-results { padding-bottom: 20px; }
.search-results .app-row { border-radius: 0; }
.search-results .app-row + .app-row { box-shadow: inset 0 0.5px 0 var(--separator); }

.no-results { text-align: center; padding: 64px 20px; color: var(--tertiary); }
.nr-icon { margin-bottom: 14px; }
.nr-title { font-size: 21px; font-weight: 700; color: var(--label); }
.nr-copy { font-size: 14px; color: var(--secondary); margin: 8px auto 0; max-width: 300px; line-height: 1.45; }

/* ---------- Product sheet ---------- */
.pd-sheet .sheet-scroll { padding: 0 16px 28px; }
.pd-grab { height: 30px; }
.pd-head { display: flex; align-items: flex-start; gap: 15px; padding-top: 6px; }
.pd-icon { width: 118px; height: 118px; flex: none; border-radius: 26.3px; overflow: hidden; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); }
.pd-icon svg { width: 100%; height: 100%; display: block; }
.pd-titles { flex: 1; min-width: 0; padding-top: 6px; }
.pd-name { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.pd-sub { font-size: 14.5px; color: var(--secondary); margin-top: 3px; line-height: 1.25; }
.pd-dev { font-size: 14.5px; color: var(--blue); font-weight: 500; margin-top: 5px; }
.pd-actions { display: flex; flex-direction: column; align-items: center; gap: 7px; padding-top: 8px; flex: none; }
.pd-iap { font-size: 11px; color: var(--tertiary); text-align: center; white-space: nowrap; }
.pd-share {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--fill); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  margin-left: 4px;
  transition: transform 0.2s ease, background 0.2s ease;
}
.pd-share:active { transform: scale(0.9); }
.pd-share.shared { background: rgba(0, 122, 255, 0.18); transform: scale(1.08); }

.pd-stats {
  display: flex; align-items: stretch;
  margin-top: 18px;
  box-shadow: inset 0 0.5px 0 var(--separator), inset 0 -0.5px 0 var(--separator);
}
.pd-stat { flex: 1; text-align: center; padding: 9px 6px 11px; cursor: default; }
.pd-stat[role="button"] { cursor: pointer; border-radius: 8px; }
.pd-stat[role="button"]:active { background: var(--fill); }
.pd-stat + .pd-stat { box-shadow: inset 0.5px 0 0 var(--separator); }
.pd-stat-top { display: flex; align-items: center; justify-content: center; gap: 5px; }
.stat-num { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.pd-stat-bottom { font-size: 11.5px; color: var(--secondary); margin-top: 3px; }

.pd-shots-sec { margin-top: 20px; }
.pd-shots-label { font-size: 13px; font-weight: 600; color: var(--secondary); margin: 0 2px 9px; }
.pd-shots {
  display: flex; gap: 11px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 -16px; padding: 0 16px 6px;
  scrollbar-width: none;
}
.pd-shots::-webkit-scrollbar { display: none; }
.pd-shot { flex: none; width: 62.5%; scroll-snap-align: start; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-card); background: #101018; }
.pd-shot svg { width: 100%; height: auto; display: block; }

.pd-desc { margin-top: 22px; }
.pd-desc-head { font-size: 16px; font-weight: 600; margin-bottom: 7px; }
.pd-desc-body { font-size: 15px; line-height: 1.45; color: var(--label); position: relative; }
.pd-desc-body p { margin: 0 0 12px; }
.pd-desc-body.is-clamped p { display: none; }
.pd-desc-body.is-clamped p:first-child {
  display: block;
  overflow: hidden;
  max-height: 87px;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 98%);
  mask-image: linear-gradient(180deg, #000 55%, transparent 98%);
}
.pd-more { font-size: 16px; font-weight: 600; color: var(--blue); padding: 2px 0; }

.pd-ratings { margin-top: 12px; }
.pd-rating-top { display: flex; gap: 18px; align-items: flex-start; padding-top: 6px; }
.pd-rating-top.big { padding: 10px 4px 4px; }
.pd-rating-big { flex: none; text-align: center; }
.pd-rating-num { font-size: 54px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.pd-rating-outof { font-size: 14px; color: var(--secondary); margin-top: 5px; }
.pd-rating-count { font-size: 13px; color: var(--secondary); margin-top: 3px; }
.hist { flex: 1; padding-top: 6px; min-width: 0; }
.hist-row { display: flex; align-items: center; gap: 7px; margin-bottom: 5.5px; }
.hist-label { font-size: 12px; color: var(--secondary); width: 8px; text-align: right; }
.hist-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--fill-2); overflow: hidden; }
.hist-fill { display: block; height: 100%; border-radius: 2px; background: var(--star); }
.hist-count { font-size: 11px; color: var(--tertiary); width: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.pd-reviews { margin-top: 14px; display: grid; gap: 10px; }
.review { background: var(--bg); border-radius: 12px; padding: 13px 15px 12px; }
.review-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.review-title { font-size: 15px; font-weight: 600; }
.review-date { font-size: 12px; color: var(--tertiary); flex: none; }
.review-body { font-size: 14px; line-height: 1.4; margin-top: 6px; color: var(--label); }
.review-name { font-size: 12.5px; color: var(--secondary); margin-top: 8px; }

.pd-info { margin-top: 24px; }
.info-table { background: var(--bg-elev); border-radius: 12px; overflow: hidden; }
.chart-sec .chart-list, .info-table { box-shadow: none; }
.info-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 14px; font-size: 15px; }
.info-row + .info-row { box-shadow: inset 0 0.5px 0 var(--separator); }
.info-label { color: var(--label); flex: none; }
.info-value { color: var(--secondary); text-align: right; }

.pd-similar { margin-top: 10px; margin: 14px -16px 0; padding: 0 16px; }
.sim-rail { padding: 4px 0 8px; }
.sim-item { width: 88px; flex: none; text-align: center; cursor: pointer; scroll-snap-align: start; }
.sim-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 14.3px; overflow: hidden; box-shadow: var(--shadow-card); }
.sim-icon svg { width: 100%; height: 100%; }
.sim-name { margin-top: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-sub { font-size: 11px; color: var(--secondary); margin-top: 1px; }
.sim-item .get-btn { margin-top: 5px; }
.pd-foot { text-align: center; font-size: 12px; color: var(--tertiary); padding: 22px 10px 6px; line-height: 1.5; }

.sub-sheet .pd-reviews { padding: 4px 16px 20px; }
.sub-sheet .pd-rating-top.big { padding: 8px 16px 8px; }

/* ---------- Responsive ---------- */
@media (min-width: 700px) {
  .pd-shot { width: 46%; }
}
@media (min-width: 900px) {
  .today-cards { grid-template-columns: 1fr 1fr; }
  .ed-hero { grid-column: 1 / -1; }
  .ed-story { grid-column: auto; }
  .page-col { padding: 0 20px; }
  .today-shelf { margin: 0 -20px; }
  .shelf-rail { padding: 4px 20px 8px; }
  .chart-sec .chart-list .app-row:nth-child(2n) { box-shadow: none; }
  .chart-list {
    display: grid; grid-template-columns: 1fr 1fr;
    column-gap: 26px;
    padding: 0 10px;
  }
  .chart-list .app-row { box-shadow: inset 0 0.5px 0 var(--separator) !important; }
  .arcade-hero { padding: 34px 30px; }
  .arcade-slogan p { max-width: 460px; }
}
@media (max-width: 380px) {
  .pd-icon { width: 100px; height: 100px; border-radius: 22.3px; }
  .pd-name { font-size: 19px; }
  .pd-shot { width: 68%; }
}

/* Dark-mode specific touches */
@media (prefers-color-scheme: dark) {
  .big-card, .ed-card, .trend-list, .info-table, .chart-sec .chart-list { background: #1c1c1e; }
  .review { background: #2c2c2e; }
  .arcade-hero { box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55); }
}
