 :root {
   color-scheme: dark;
   --bg: #000;
   --panel: rgba(16, 18, 24, 0.96);
   --line: rgba(255, 255, 255, 0.12);
   --text: #f5f7fb;
   --muted: rgba(245, 247, 251, 0.72);
   --soft: rgba(255, 255, 255, 0.08);
   /* --shadow: 0 24px 70px rgba(0, 0, 0, 0.48); */
   --shadow: white;
 }

 * {
   box-sizing: border-box;
 }

 html,
 body {
   width: 100%;
   height: 100%;
   min-height: 100%;
   margin: 0;
   overflow: hidden;
   overscroll-behavior: none;
   background:
     radial-gradient(circle at 20% 12%, rgba(22, 224, 193, 0.14), transparent 24%),
     radial-gradient(circle at 80% 18%, rgba(124, 196, 255, 0.1), transparent 20%),
     linear-gradient(180deg, #050505 0%, #000 35%, #090909 100%);
   color: var(--text);
   font-family:
     Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
     sans-serif;
 }

 body {
   position: relative;
 }

 button {
   appearance: none;
   border: 0;
   background: none;
   color: inherit;
   font: inherit;
   cursor: pointer;
 }

 .screen {
   width: 100%;
   height: 100%;
   min-height: 100vh;
   min-height: 100svh;
   padding:
     calc(env(safe-area-inset-top) + 12px) calc(env(safe-area-inset-right) + 12px) calc(env(safe-area-inset-bottom) + 12px) calc(env(safe-area-inset-left) + 12px);
 }

 .shell {
   height: 100%;
   display: grid;
   grid-template-rows: auto minmax(0, 1fr);
   gap: 12px;
 }

 .top-row {
   display: flex;
   align-items: center;
   gap: 12px;
   flex: none;
 }

 .exit-button {
   width: 56px;
   height: 56px;
   border-radius: 50%;
   background: rgba(255, 255, 255, 0.08);
   border: 1px solid rgba(255, 255, 255, 0.08);
   display: grid;
   place-items: center;
   box-shadow: var(--shadow);
   backdrop-filter: blur(14px);
   transition: transform 120ms ease, filter 120ms ease;
 }

 .exit-button:hover {
   transform: translateY(-1px);
   filter: brightness(1.05);
 }

 .exit-button span {
   font-size: 24px;
   line-height: 1;
   transform: translateY(-2px);
 }

 .status-pill {
   margin-left: auto;
   padding: 10px 14px;
   border-radius: 999px;
   background: rgba(255, 255, 255, 0.06);
   border: 1px solid rgba(255, 255, 255, 0.08);
   color: var(--muted);
   font-size: 13px;
 }

 .feed {
   min-height: 0;
   overflow-y: auto;
   overscroll-behavior: none;
   touch-action: pan-y;
   scroll-snap-type: y mandatory;
   scroll-behavior: smooth;
   -webkit-overflow-scrolling: touch;
   border-radius: 28px;
   background: rgba(0, 0, 0, 0.28);
 }

 .feed::-webkit-scrollbar {
   width: 0;
   height: 0;
 }

 .feed-item {
   position: relative;
   min-height: 100%;
   scroll-snap-align: start;
   scroll-snap-stop: always;
   display: grid;
   grid-template-rows: minmax(0, 1fr) auto;
   gap: 0px;
 }

 .stage-card {
   position: relative;
   border-radius: 28px;
   overflow: hidden;
   background: #0b0b0f;
   box-shadow: var(--shadow);
   min-height: 0;
 }

 .game-frame {
   width: 100%;
   height: 100%;
   border: 0;
   display: block;
   background: #000;
 }

 .game-cache {
   position: fixed;
   width: 1px;
   height: 1px;
   left: -9999px;
   top: -9999px;
   overflow: hidden;
   visibility: hidden;
   pointer-events: none;
 }

 .info-row {
   display: grid;
   grid-template-columns: minmax(0, 1fr);
   gap: 10px;
   align-items: center;
   padding: 0 4px 0 0;
 }

 .info-card {
   display: grid;
   grid-template-columns: auto minmax(0, 1fr) auto;
   gap: 12px;
   padding: 14px;
   align-items: center;
 }

 .avatar-wrap {
   position: relative;
   width: 56px;
   height: 56px;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   flex: none;
 }

 .avatar-main {
   width: 100%;
   height: 100%;
   display: grid;
   place-items: center;
   cursor: pointer;
 }

 .avatar {
   width: 40px;
   height: 40px;
   border-radius: 50%;
   overflow: hidden;
   background:
     radial-gradient(circle at 30% 30%, #7fffd4 0%, #35b7ff 36%, #2459d6 100%);
   border: 2px solid rgba(255, 255, 255, 0.12);
   box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
 }

 .avatar-image {
   width: 100%;
   height: 100%;
   display: block;
   object-fit: cover;
 }

 .avatar-plus {
   position: absolute;
   right: 3px;
   bottom: 3px;
   width: 16px;
   height: 16px;
   display: grid;
   place-items: center;
   background: transparent;
   overflow: hidden;
   padding: 0;
 }

 .avatar-plus svg {
   display: block;
   width: 100%;
   height: 100%;
 }

 .info-main {
   min-width: 0;
   color: white;
 }

 .title {
   margin: 0;
   font-size: clamp(15px, 2vw, 18px);
   line-height: 1.18;
   font-weight: 800;
 }

 .meta-row {
   margin-top: 4px;
   display: flex;
   flex-wrap: wrap;
   gap: 14px;
   align-items: center;
   color: rgba(255, 255, 255, 0.95);
   font-size: 12px;
 }

 .icon-link {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   color: rgba(255, 255, 255, 0.88);
   text-decoration: none;
   white-space: nowrap;
   padding: 0;
 }

 .icon-link .count {
   color: white;
   font-weight: 700;
   font-size: 12px;
 }

 .icon-image {
   width: 18px;
   height: 18px;
   display: block;
   object-fit: contain;
   flex: none;
 }

 .ranking-launcher {
   align-self: center;
   display: inline-flex;
   align-items: center;
   gap: 6px;
   padding: 0 4px;
   color: white;
   font-size: 14px;
   font-weight: 700;
   letter-spacing: 0.04em;
   user-select: none;
   white-space: nowrap;
 }

 .ranking-icon {
   width: 18px;
   height: 18px;
   display: block;
   flex: none;
 }

 .launcher {
   position: absolute;
   inset: 0;
   display: none;
   place-items: center;
   padding: 24px;
   background: rgba(0, 0, 0, 0.74);
   backdrop-filter: blur(12px);
 }

 .launcher.is-visible {
   display: grid;
 }

 .launcher-card {
   width: min(100%, 520px);
   padding: 24px;
   border-radius: 24px;
   background: rgba(18, 18, 22, 0.96);
   border: 1px solid rgba(255, 255, 255, 0.1);
   box-shadow: var(--shadow);
 }

 .launcher-card h1 {
   margin: 0;
   font-size: 28px;
 }

 .launcher-card p {
   margin: 12px 0 0;
   color: var(--muted);
   line-height: 1.6;
 }

 .launcher-links {
   margin-top: 18px;
   display: grid;
   gap: 10px;
 }

 .launcher-link {
   display: block;
   padding: 14px 16px;
   border-radius: 16px;
   background: rgba(255, 255, 255, 0.05);
   border: 1px solid rgba(255, 255, 255, 0.08);
   color: var(--text);
   text-decoration: none;
 }

 .launcher-link strong {
   display: block;
   margin-bottom: 3px;
 }

 .launcher-link span {
   color: var(--muted);
   font-size: 13px;
 }

 @media (max-width: 720px) {
   .screen {
     padding:
       calc(env(safe-area-inset-top) + 12px) calc(env(safe-area-inset-right) + 4px) calc(env(safe-area-inset-bottom) + 12px) calc(env(safe-area-inset-left) + 4px);
   }

   .exit-button {
     width: 30px;
     height: 30px;
   }

   .feed-item {
     min-height: 100%;
   }

   .stage-card {
     border-radius: 22px;
   }

   .info-row {
     gap: 10px;
   }

   .info-card {
     padding: 0px;
   }

   .title {
     font-size: 12px;
   }

   .ranking-launcher {
     font-size: 13px;
   }
 }
