@import url("../styles.css");

/* Locked full-viewport shell when playing a cartridge */
body.is-stage-active {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.is-stage-active .navbar {
  padding: 6px 0;
  flex-shrink: 0;
}

body.is-stage-active .nav-brand span {
  display: none;
}

body.is-stage-active main.main-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  padding: 8px 14px 12px;
  display: flex;
  flex-direction: column;
}

body.is-stage-active #arcade-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Spotlight Hero */
.spotlight-card {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) 1fr;
  gap: 22px;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(14, 24, 48, 0.95), rgba(10, 14, 28, 0.92));
  border: 1px solid var(--border-glow);
  box-shadow: 0 18px 42px -24px rgba(0, 240, 255, 0.45);
}

.spotlight-media {
  position: relative;
  width: 100%;
  aspect-ratio: 920 / 430;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at 22% 24%, rgba(0, 240, 255, 0.22), rgba(7, 11, 22, 0.98));
  display: flex;
  align-items: center;
  justify-content: center;
}

.spotlight-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.spotlight-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.spotlight-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.spotlight-desc {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* Summary Strip */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-box {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.summary-box .k {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.summary-box .v {
  font-family: var(--font-mono);
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--cyan);
  margin-top: 2px;
}

/* Filter & Sort Controls (compact single-row scroll on wide tags + inline sort) */
.arcade-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.tag-pills {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 4px;
}

.arcade-sort-select {
  flex: 0 0 auto;
  width: auto;
  min-width: 175px;
}

.pill {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.pill:hover,
.pill.is-active {
  border-color: var(--cyan);
  color: var(--text-main);
  background: rgba(0, 240, 255, 0.14);
}

/* Cartridge Grid */
.cartridge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.cartridge-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.cartridge-card:hover {
  border-color: var(--border-glow-hover);
  transform: translateY(-2px);
}

.cartridge-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 920 / 430;
  background: radial-gradient(circle at 25% 25%, rgba(0, 240, 255, 0.18), rgba(12, 18, 34, 0.96));
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cartridge-cover[data-theme="neon"] {
  background: radial-gradient(circle at 20% 25%, rgba(168, 85, 247, 0.36), rgba(8, 12, 26, 0.98));
}

.cartridge-cover[data-theme="solar"] {
  background: radial-gradient(circle at 75% 25%, rgba(251, 191, 36, 0.32), rgba(9, 13, 24, 0.98));
}

.cartridge-cover[data-theme="relic"] {
  background: radial-gradient(circle at 50% 25%, rgba(16, 185, 129, 0.3), rgba(9, 13, 24, 0.98));
}

.cartridge-cover[data-theme="workshop"] {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(56, 189, 248, 0.2), rgba(9, 13, 24, 0.98));
}

.cartridge-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fallback-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 12px;
}

.fallback-mark {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-main);
  text-transform: uppercase;
  padding: 7px 14px;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  background: rgba(6, 9, 17, 0.78);
}

.fallback-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cartridge-hash {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(6, 9, 17, 0.88);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.cartridge-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.cartridge-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.cartridge-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
}

.cartridge-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(6, 9, 17, 0.65);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.metric-item span {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.metric-item strong {
  color: var(--text-main);
  font-size: 0.85rem;
}

/* Embedded Pro Stage */
.stage-shell {
  flex: 1 1 auto;
  min-height: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.stage-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(6, 9, 17, 0.96);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.stage-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.stage-select {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  width: 190px;
  max-width: 220px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.stage-frame-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: #04070e;
  overscroll-behavior: contain;
}

.stage-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.stage-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(4, 7, 14, 0.9);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  z-index: 2;
}

/* Slide-over Daily Leaderboard Overlay (always visible without scrolling page) */
.daily-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(390px, 100%);
  z-index: 5;
  border-left: 1px solid var(--border-glow);
  padding: 16px;
  background: rgba(10, 15, 29, 0.97);
  backdrop-filter: blur(12px);
  box-shadow: -14px 0 36px rgba(0, 0, 0, 0.7);
  overflow-y: auto;
}

.daily-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.daily-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-top: 12px;
}

.daily-table th,
.daily-table td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

@media (max-width: 860px) {
  .spotlight-card {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .arcade-controls {
    flex-wrap: wrap;
  }
  .arcade-sort-select {
    width: 100%;
  }
}
