* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #02030a;
  --color-bg-decor: #111b3a;
  --color-surface: rgba(10, 14, 24, 0.96);
  --color-surface-elevated: rgba(18, 24, 40, 0.98);
  --color-border-subtle: rgba(255, 255, 255, 0.08);
  --color-text-main: #f5f5f5;
  --color-text-muted: rgba(245, 245, 245, 0.7);
  --color-accent: #0a4bff;
  --color-accent-soft: #0a2a80;
}

.app--theme-light {
  --color-bg: #ffffff;
  --color-bg-decor: #ffffff;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-border-subtle: rgba(0, 0, 0, 0.08);
  --color-text-main: #0b1020;
  --color-text-muted: rgba(11, 16, 32, 0.65);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, var(--color-bg-decor) 0, var(--color-bg) 55%);
  color: var(--color-text-main);
  min-height: 100vh;
}


body.is-game-fullscreen {
  overflow: hidden;
}

body.is-game-pseudo-fullscreen {
  overflow: hidden;
}

body.is-game-fullscreen .game-mobile-bottom,
body.is-game-pseudo-fullscreen .game-mobile-bottom {
  display: none;
}

body.is-game-pseudo-fullscreen .game-mobile-card,
body.is-game-pseudo-fullscreen .game-mobile-tabs,
body.is-game-pseudo-fullscreen .game-mobile-panel,
body.is-game-pseudo-fullscreen .game-mobile-more {
  display: none !important;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, #02030a 0, var(--color-bg) 40%);
}

.app.app--theme-light {
  background: var(--color-bg);
}

.app-header {
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #0432b8 0%, #03041a 100%);
}

.app-header-left {
  display: flex;
  align-items: center;
}

.app-logo-icon {
  height: 26px;
  margin-right: 8px;
}

.app-logo-wordmark {
  height: 26px;
  position: relative;
  top: 3px;
}

.app-header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 8px;
  min-width: 0;
}

.app-header-right {
  display: flex;
  align-items: center;
}

.theme-toggle {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.app--theme-light .theme-toggle {
  border-color: rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.9);
}

.theme-toggle::before,
.theme-toggle::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app--theme-dark .theme-toggle::before {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f5f5f5;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

.app--theme-dark .theme-toggle::after {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.85);
  transform: translateX(4px);
}

.app--theme-light .theme-toggle::before {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd76a 0, #ffb326 60%, #f39a18 100%);
  box-shadow: 0 0 0 2px rgba(255, 210, 120, 0.9);
}

.app--theme-light .theme-toggle::after {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: 0 -9px 0 -6px #ffdf91, 0 9px 0 -6px #ffdf91,
    9px 0 0 -6px #ffdf91, -9px 0 0 -6px #ffdf91,
    6px 6px 0 -6px #ffdf91, -6px 6px 0 -6px #ffdf91,
    6px -6px 0 -6px #ffdf91, -6px -6px 0 -6px #ffdf91;
}

.search-bar {
  width: 100%;
  max-width: 360px;
  display: flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(2, 5, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.app--theme-light .search-bar {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 0, 0, 0.14);
}

.search-input {
  flex: 1 1 auto;
  border: none;
  outline: none;
  background: transparent;
  color: var(--color-text-main);
  font-size: 14px;
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.app--theme-light .search-input::placeholder {
  color: rgba(11, 16, 32, 0.5);
}

.search-icon-button {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: transparent;
  position: relative;
  flex-shrink: 0;
}

.search-icon-button::before,
.search-icon-button::after {
  content: '';
  position: absolute;
  transform-origin: center;
}

.search-icon-button::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  top: 3px;
  left: 2px;
}

.search-icon-button::after {
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  bottom: 2px;
  right: 1px;
  transform: rotate(45deg);
}

.app--theme-light .search-icon-button::before {
  border-color: rgba(0, 0, 0, 0.85);
}

.app--theme-light .search-icon-button::after {
  background: rgba(0, 0, 0, 0.85);
}

.app-main {
  flex: 1;
  padding: 16px 12px 12px;
}

.section {
  margin-bottom: 20px;
  position: relative;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--color-text-main);
}

.game-row,
.featured-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.game-row::-webkit-scrollbar,
.featured-row::-webkit-scrollbar {
  display: none;
}

.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 72px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.32));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 5;
}

.app--theme-light .scroll-arrow {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.10));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.scroll-arrow--left {
  left: 4px;
}

.scroll-arrow--right {
  right: 4px;
}

.scroll-arrow::before {
  content: '';
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.scroll-arrow--left::before {
  border-right: 10px solid rgba(255, 255, 255, 0.95);
}

.scroll-arrow--right::before {
  border-left: 10px solid rgba(255, 255, 255, 0.95);
}

.app--theme-light .scroll-arrow--left::before {
  border-right-color: rgba(0, 0, 0, 1);
}

.app--theme-light .scroll-arrow--right::before {
  border-left-color: rgba(0, 0, 0, 1);
}

@media (hover: hover) and (pointer: fine) {
  .section:hover .scroll-arrow {
    opacity: 1;
    pointer-events: auto;
  }
}

.scroll-arrow--hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

.scroll-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  pointer-events: none;
  z-index: 4;
}

.scroll-fade--left {
  left: 0;
  background: linear-gradient(to right, var(--color-bg) 0%, transparent 100%);
}

.scroll-fade--right {
  right: 0;
  background: linear-gradient(to left, var(--color-bg) 0%, transparent 100%);
}

.app--theme-light .scroll-fade--left {
  background: linear-gradient(to right, #ffffff 0%, transparent 100%);
}

.app--theme-light .scroll-fade--right {
  background: linear-gradient(to left, #ffffff 0%, transparent 100%);
}

.scroll-fade--hidden {
  opacity: 0;
}

.game-card {
  border: 1px solid var(--color-border-subtle);
  background: transparent;
  border-radius: 16px;
  padding: 6px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, background 0.15s ease-out;
  position: relative;
  z-index: 0;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  background: var(--color-surface-elevated);
  z-index: 2;
}

.game-card--category:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  background: var(--color-surface-elevated);
  z-index: 2;
}

.game-thumb {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #d9d9d9;
}

.game-thumb picture,
.search-result-thumb picture,
.game-sidebar-thumb picture,
.game-mobile-more-thumb picture,
.game-mobile-icon picture {
  display: block;
  width: 100%;
  height: 100%;
}

.game-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-main);
}

.game-card--continue {
  min-width: 200px;
  max-width: 200px;
}

.game-card--continue .game-thumb {
  aspect-ratio: 1 / 1;
}

.game-card--featured {
  min-width: 280px;
  max-width: 100%;
}

.game-card--featured .game-thumb {
  aspect-ratio: 16 / 9;
}

.game-card--category {
  min-width: 140px;
  max-width: 280px;
}

.game-card--category .game-thumb {
  aspect-ratio: 1 / 1;
}

.app-footer {
  padding: 10px 0 18px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
}

.footer-link {
  color: inherit;
  text-decoration: none;
}

.footer-separator {
  margin: 0 6px;
}

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  display: none;
  flex-direction: column;
  z-index: 20;
}

.search-overlay--visible {
  display: flex;
}

.search-overlay-header {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: linear-gradient(90deg, #0432b8 0%, #03041a 100%);
}

.back-button {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  margin-right: 10px;
  cursor: pointer;
  position: relative;
}

.back-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 6px;
  width: 10px;
  height: 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.9);
  border-top: 2px solid rgba(255, 255, 255, 0.9);
  transform: translateY(-50%) rotate(-45deg);
}

.search-overlay-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(2, 5, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.24);
  position: relative;
}

.search-input--overlay {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--color-text-main);
}

.search-overlay-input-wrapper::after {
  content: '';
  position: absolute;
  right: 12px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.search-overlay-input-wrapper::before {
  content: '';
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  transform: rotate(45deg);
}

.search-results {
  flex: 1;
  padding: 12px 16px 16px;
  overflow-y: auto;
}

.search-result-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
  cursor: pointer;
  margin-bottom: 8px;
}

.search-result-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  background: #d9d9d9;
}

.search-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-title {
  font-size: 14px;
  color: var(--color-text-main);
}

@media (max-width: 480px) {
  .app-header {
    flex-wrap: wrap;
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .app-header-left {
    margin-bottom: 6px;
  }

  .app-header-center {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    padding: 0;
  }

  .search-bar {
    max-width: 100%;
    padding: 3px 8px;
  }

  .app-header-right {
    margin-left: 8px;
  }
}

@media (min-width: 768px) {
  .app-main {
    padding: 20px 40px 24px;
  }

  .section-title {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .game-card--continue {
    min-width: 150px;
    max-width: 150px;
  }

  .game-card--featured {
    min-width: 530px;
    max-width: 530px;
  }

  .game-card--category {
    min-width: 320px;
    max-width: 320px;
  }

  .search-overlay {
    position: fixed;
    height: auto;
    max-height: 420px;
    border-radius: 12px;
    border: 1px solid var(--color-border-subtle);
    background: var(--color-surface-elevated);
    backdrop-filter: none;
  }

  .search-overlay-header {
    display: none;
  }

  .back-button {
    display: none;
  }
}

.app-main--game {
  padding: 16px 12px 16px;
}

.game-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1.7fr) minmax(260px, 0.9fr);
  gap: 16px;
}

.game-sidebar {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 10px 10px;
  border: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

.game-sidebar-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.app--theme-light .game-sidebar-title {
  color: rgba(11, 16, 32, 0.55);
}

.game-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.game-sidebar-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 4px 4px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.game-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.app--theme-light .game-sidebar-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.game-sidebar-item--active {
  background: rgba(10, 75, 255, 0.18);
}

.app--theme-light .game-sidebar-item--active {
  background: rgba(10, 75, 255, 0.12);
}

.game-sidebar-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: #d9d9d9;
  flex-shrink: 0;
}

.game-sidebar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-sidebar-title-text {
  font-size: 12px;
  color: var(--color-text-main);
  text-align: left;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.game-content {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 12px 12px 14px;
  border: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-frame-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.game-frame-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.game-frame-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-main);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-frame-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-fullscreen-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 8px;
}

.game-fullscreen-button svg {
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

.game-fullscreen-button__text {
  display: none;
}

.game-fullscreen-button:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.1);
}

.game-fullscreen-button:hover svg {
  transform: scale(1.1);
}

.app--theme-light .game-fullscreen-button {
  background: rgba(255, 255, 255, 0.8);
  color: #333;
  border-color: rgba(0, 0, 0, 0.1);
}

.game-fullscreen-button--overlay {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 2147483647;
}

.game-exit-fullscreen-button {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top));
  left: calc(8px + env(safe-area-inset-left));
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(90deg, rgba(135, 110, 255, 0.95) 0%, rgba(118, 85, 255, 0.95) 40%, rgba(100, 70, 245, 0.95) 100%);
  color: #ffffff;
  cursor: pointer;
  z-index: 2147483647;
  font-size: 12px;
  font-weight: 700;
  line-height: 32px;
  text-align: center;
  box-shadow: 0 10px 18px rgba(8, 12, 26, 0.35);
}

.game-frame-wrapper {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #000000;
  border: 1px solid var(--color-border-subtle);
  aspect-ratio: 16 / 9;
  --game-toolbar-height: 0px;
}

.game-frame-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.game-frame-wrapper--playing .game-frame-overlay {
  opacity: 0;
  pointer-events: none;
}

.game-frame-cover {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 0;
}

.game-frame-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.72) 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.85) 100%);
}

.game-frame-overlay-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 20px;
}

.game-frame-overlay-icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.game-frame-overlay-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.game-frame-play-button {
  min-width: 160px;
  height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(90deg, rgba(135, 110, 255, 0.95) 0%, rgba(118, 85, 255, 0.95) 40%, rgba(100, 70, 245, 0.95) 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(8, 12, 26, 0.4);
  animation: play-button-pulse 0.7s ease-in-out infinite;
  animation-direction: alternate;
}

.game-frame-play-button:hover {
  animation-play-state: paused;
}

@keyframes play-button-pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

.game-frame-wrapper:fullscreen,
.game-frame-wrapper:-webkit-full-screen,
.game-frame-wrapper:-moz-full-screen {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
}

.game-frame-wrapper:fullscreen .game-frame,
.game-frame-wrapper:-webkit-full-screen .game-frame,
.game-frame-wrapper:-moz-full-screen .game-frame {
  width: 100%;
  aspect-ratio: auto;
}

.game-frame-wrapper--pseudo-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
  border: none;
  background: #000;
  z-index: 2147483646;
}

.game-frame-wrapper--pseudo-fullscreen .game-frame {
  width: 100%;
  aspect-ratio: auto;
}

.game-frame {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--game-toolbar-height);
  bottom: 0;
  width: 100%;
  border: none;
  display: block;
}

.game-meta {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 12px 12px 14px;
  border: 1px solid var(--color-border-subtle);
}

.game-meta-section {
  background: #050817;
  border-radius: 12px;
  padding: 10px 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.app--theme-light .game-meta-section {
  background: #f5f6fb;
  border-color: rgba(0, 0, 0, 0.06);
}

.game-meta-section + .game-meta-section {
  margin-top: 10px;
}

.game-meta-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.app--theme-light .game-meta-title {
  color: var(--color-text-main);
}

.game-meta-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.app--theme-light .game-meta-text,
.app--theme-light .game-meta-list {
  color: var(--color-text-muted);
}

.game-meta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.game-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.game-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(7, 17, 40, 0.95);
  color: #f3f3ff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.app--theme-light .game-tag {
  background: rgba(7, 17, 40, 0.95);
  border-color: rgba(0, 0, 0, 0.12);
  color: #ffffff;
}

.game-tag--desktop {
  background: rgba(255, 165, 0, 0.3);
  border-color: rgba(255, 165, 0, 0.9);
}

.game-tag--tablet {
  background: rgba(0, 160, 255, 0.28);
  border-color: rgba(0, 190, 255, 0.95);
}

.game-tag--mobile {
  background: rgba(0, 210, 140, 0.28);
  border-color: rgba(0, 230, 150, 0.95);
}

.game-meta-rating {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.game-rating-score {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid #ff9d2a;
  color: #ff9d2a;
  background: transparent;
}

.app--theme-light .game-rating-score {
  border-color: #f59b1a;
  color: #f59b1a;
  background: #fffaf2;
}

.game-rating-stars {
  display: flex;
  gap: 2px;
}

.game-rating-star {
  position: relative;
  font-size: 14px;
  line-height: 1;
  color: #4c4f5d;
}

.game-rating-star::before,
.game-rating-star::after {
  content: '★';
}

.game-rating-star::before {
  color: #4c4f5d;
}

.game-rating-star::after {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  overflow: hidden;
  color: #ff9d2a;
}

.game-rating-star--full::after {
  width: 100%;
}

.game-rating-star--half::after {
  width: 50%;
}

.game-meta-list {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.game-mobile {
  display: none;
}

.game-mobile-bottom {
  display: none;
}

@media (max-width: 1024px) and (pointer: coarse) {
  .game-frame-wrapper {
    aspect-ratio: auto;
  }

  body.is-game-fullscreen .game-frame-wrapper,
  body.is-game-pseudo-fullscreen .game-frame-wrapper {
    --game-toolbar-height: calc(44px + env(safe-area-inset-top));
  }

  .app-main--game {
    padding: 12px 10px calc(16px + 74px + env(safe-area-inset-bottom));
  }

  .game-layout {
    display: none;
  }

  .game-mobile {
    display: block;
  }

  .game-mobile-hero {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    height: min(60vh, calc(100vw * 0.5625));
    min-height: 200px;
    background: radial-gradient(120% 120% at 30% 20%, rgba(120, 90, 255, 0.55) 0%, rgba(5, 8, 23, 0.92) 62%, rgba(3, 4, 26, 0.98) 100%);
    border: 1px solid var(--color-border-subtle);
    touch-action: manipulation;
    z-index: 1;
  }

  .game-mobile-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--game-mobile-hero-image-png, none);
    background-size: cover;
    background-position: center;
    filter: blur(10px);
    transform: scale(1.07);
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
  }

  @supports (background-image: image-set(url("x") type("image/webp"), url("x") type("image/png"))) {
    .game-mobile-hero::before {
      background-image: image-set(
        var(--game-mobile-hero-image-webp) type("image/webp"),
        var(--game-mobile-hero-image-png) type("image/png")
      );
    }
  }

  @supports (background-image: -webkit-image-set(url("x") type("image/webp"), url("x") type("image/png"))) {
    .game-mobile-hero::before {
      background-image: -webkit-image-set(
        var(--game-mobile-hero-image-webp) type("image/webp"),
        var(--game-mobile-hero-image-png) type("image/png")
      );
    }
  }

  .game-mobile-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 4, 16, 0.15) 0%, rgba(2, 4, 16, 0.55) 35%, rgba(2, 4, 16, 0.95) 100%);
    pointer-events: none;
    z-index: 1;
  }

  .game-mobile-hero .game-frame-wrapper {
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: 18px;
    border: none;
    pointer-events: auto;
  }

  .game-mobile-hero .game-frame {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    pointer-events: auto;
    touch-action: manipulation;
  }

  .game-mobile-hero .game-frame-wrapper.game-frame-wrapper--pseudo-fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
    background: #000;
    z-index: 9999;
  }

  .game-mobile-card {
    margin-top: 12px;
    position: relative;
    z-index: 3;
    background: var(--color-surface);
    border-radius: 18px;
    border: 1px solid var(--color-border-subtle);
    padding: 12px 12px 12px;
  }

  .game-mobile-card-top {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
  }

  .game-mobile-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    overflow: hidden;
    background: #d9d9d9;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

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

  .game-mobile-title {
    margin: 2px 0 6px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-main);
  }

  .game-mobile-tags-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
  }

  .game-mobile-rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: #ff9d2a;
    border: 1px solid rgba(255, 157, 42, 0.55);
    background: rgba(255, 157, 42, 0.12);
  }

  .game-mobile-rating-badge:empty {
    display: none;
  }

  .game-mobile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
  }

  .game-mobile-meta {
    display: grid;
    gap: 3px;
  }

  .game-mobile-meta-row {
    display: flex;
    gap: 6px;
    align-items: baseline;
    min-width: 0;
  }

  .game-mobile-meta-label {
    color: var(--color-text-muted);
    font-size: 12px;
    flex: 0 0 auto;
  }

  .game-mobile-meta-value {
    color: var(--color-text-main);
    font-size: 12px;
    opacity: 0.95;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-mobile-rating {
    display: none;
  }

  .game-mobile-tabs {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .app--theme-light .game-mobile-tabs {
    border-top-color: rgba(0, 0, 0, 0.06);
  }

  .game-mobile-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 6px;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
  }

  .game-mobile-tab--active {
    color: var(--color-text-main);
  }

  .game-mobile-tab--active::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 2px;
    height: 3px;
    border-radius: 999px;
    background: rgba(120, 90, 255, 0.95);
  }

  .game-mobile-panel {
    display: none;
    padding-top: 10px;
  }

  .game-mobile-panel--active {
    display: block;
  }

  .game-mobile-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-text-muted);
  }

  .game-mobile-screenshots {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 72%;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .game-mobile-screenshots::-webkit-scrollbar {
    display: none;
  }

  .game-mobile-screenshot {
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    aspect-ratio: 16 / 9;
  }

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

  .game-mobile-more {
    margin-top: 12px;
    background: var(--color-surface);
    border-radius: 18px;
    border: 1px solid var(--color-border-subtle);
    padding: 12px 12px 12px;
  }

  .game-mobile-more-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
  }

  .game-mobile-more-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
  }

  .app--theme-light .game-mobile-more-title {
    color: rgba(11, 16, 32, 0.92);
  }

  .game-mobile-more-link {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    text-decoration: none;
    color: var(--color-text-main);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .app--theme-light .game-mobile-more-link {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.06);
  }

  .game-mobile-more-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 150px;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .game-mobile-more-list::-webkit-scrollbar {
    display: none;
  }

  .game-mobile-more-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 10px;
    cursor: pointer;
    color: inherit;
    text-align: left;
  }

  .app--theme-light .game-mobile-more-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
  }

  .game-mobile-more-thumb {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #d9d9d9;
  }

  .game-mobile-more-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .game-mobile-more-name {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .game-mobile-more-rating {
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .game-mobile-bottom {
    display: flex;
    justify-content: center;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: rgba(3, 4, 26, 0.78);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
  }

  .app--theme-light .game-mobile-bottom {
    background: rgba(255, 255, 255, 0.86);
    border-top-color: rgba(0, 0, 0, 0.08);
  }

  .game-mobile-bottom-play {
    width: min(320px, 92vw);
    height: 46px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(90deg, rgba(135, 110, 255, 0.95) 0%, rgba(118, 85, 255, 0.95) 40%, rgba(100, 70, 245, 0.95) 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
  }

  .app-footer {
    padding-bottom: calc(18px + 74px + env(safe-area-inset-bottom));
  }

  .game-fullscreen-button {
    width: auto;
    height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .game-fullscreen-button svg {
    width: 18px;
    height: 18px;
  }

  .game-fullscreen-button__text {
    display: inline;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
  }

  .game-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .game-frame-overlay-icon {
    width: 70px;
    height: 70px;
  }

  .game-frame-overlay-content {
    max-width: 90%;
    max-height: 90%;
    width: min(320px, 90%);
  }

  .game-frame-overlay-title {
    font-size: 18px;
  }

  .game-frame-play-button {
    display: none;
  }
}

@media (max-width: 1024px) and (pointer: coarse) and (orientation: landscape) {
  .game-mobile-hero {
    height: min(52vh, calc(100vw * 0.5));
  }

  .game-frame-overlay-content {
    gap: 8px;
    padding: 12px;
  }

  .game-frame-overlay-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }

  .game-frame-overlay-title {
    font-size: 16px;
  }
}

