:root {
  --bg-main: #0b0e14;
  --bg-card: #131822;
  --bg-card-hover: #19202e;
  --bg-elevated: #1a2232;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(56, 189, 248, 0.4);
  --text-title: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #8492a6;
  --accent-blue: #0284c7;
  --accent-cyan: #38bdf8;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 20px 35px -10px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
}

body {
  background-color: var(--bg-main);
  color: var(--text-body);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */
.site-header {
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-info h1 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: 0.5px;
}

.brand-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-body);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-btn-donate {
  cursor: pointer;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-family: inherit;
}

.nav-btn-donate:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.65);
  color: #fde68a;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.2);
}

/* Hero / Filter Bar */
.control-bar {
  max-width: 1240px;
  margin: 30px auto 20px;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filter-group {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.filter-btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  color: #fff;
}

.filter-btn.active {
  background: var(--bg-elevated);
  color: var(--text-title);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 360px;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

/* Games Grid */
.main-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 26px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s, box-shadow 0.25s;
  box-shadow: var(--shadow-card);
}

.game-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #06090e;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.game-card:hover .card-image {
  transform: scale(1.04);
}

.card-badge-platform {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.badge-android {
  background: rgba(16, 185, 129, 0.85);
  color: #fff;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-pc {
  background: rgba(56, 189, 248, 0.85);
  color: #0b0e14;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.card-badge-version {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(0, 0, 0, 0.75);
  color: #f1f5f9;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-header-row {
  margin-bottom: 8px;
}

.card-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-title);
  line-height: 1.3;
}

.card-category {
  font-size: 12px;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-top: 2px;
}

.card-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.tag-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 4px;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.btn-download {
  flex: 1;
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-download:hover {
  background: linear-gradient(135deg, #0369a1, #0284c7);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
}

.btn-copy {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-body);
  width: 44px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Modal Popup */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: #111622;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-top {
  position: relative;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.modal-thumb {
  width: 120px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.modal-header-text {
  flex: 1;
}

.modal-header-text h2 {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 6px;
}

.modal-submeta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.modal-donate-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  text-align: left;
  font-family: inherit;
}

.modal-donate-mini:hover {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.55);
}

.modal-donate-mini-qr {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
  object-fit: contain;
  flex-shrink: 0;
}

.modal-donate-mini-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}

.modal-donate-mini-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #fbbf24;
}

.modal-donate-mini-note {
  font-size: 10.5px;
  color: #e2e8f0;
  font-weight: 600;
}

.modal-donate-mini-hint {
  font-size: 10px;
  color: var(--text-muted);
}

.donate-modal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.donate-desc {
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.6;
  max-width: 520px;
}

.donate-qr-frame {
  background: #ffffff;
  padding: 12px;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.donate-qr-img {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.donate-info-box {
  width: 100%;
  background: #090d15;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.donate-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: #cbd5e1;
  flex-wrap: wrap;
}

.donate-note-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
}

.modal-inner {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Method Selector Tabs */
.method-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.method-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.method-tab.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.file-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-box {
  background: #090d15;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.file-info-primary {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.file-info-secondary {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-btn-dl {
  background: var(--accent-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
  white-space: nowrap;
}

.file-btn-dl:hover {
  background: #0369a1;
}

.guide-panel {
  background: #090d15;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.guide-heading {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.guide-step {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: #cbd5e1;
  margin-bottom: 10px;
  line-height: 1.5;
}

.guide-step:last-child {
  margin-bottom: 0;
}

.step-badge {
  background: var(--bg-elevated);
  color: var(--accent-cyan);
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
}

.sha-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  background: #06080e;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  word-break: break-all;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.sha-text {
  flex: 1;
}

.sha-copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: #cbd5e1;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.sha-copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s;
  opacity: 0;
  z-index: 200;
  pointer-events: none;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 640px) {
  .header-container {
    padding: 12px 16px;
    gap: 10px;
  }
  .brand {
    gap: 10px;
    min-width: 0;
    flex: 1;
  }
  .brand-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
  .brand-info {
    min-width: 0;
  }
  .brand-info h1 {
    font-size: 16px;
  }
  .brand-info p {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nav-status {
    display: none;
  }
  .nav-btn-donate {
    padding: 7px 12px;
    font-size: 12.5px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .control-bar {
    margin: 18px auto 16px;
    padding: 0 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .filter-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  .filter-btn {
    padding: 8px 6px;
    font-size: 12px;
    white-space: nowrap;
    text-align: center;
  }
  .search-wrap {
    max-width: 100%;
    min-width: 0;
  }
  .main-content {
    padding: 0 16px 40px;
  }
  .games-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .game-card {
    min-width: 0;
  }
  .card-content {
    padding: 16px;
  }
  .card-badge-version {
    max-width: calc(100% - 28px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .modal-backdrop {
    padding: 10px;
  }
  .modal-card {
    max-height: 92vh;
    border-radius: 16px;
  }
  .modal-top {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 12px;
  }
  .modal-thumb {
    width: 84px;
    height: 54px;
    aspect-ratio: auto;
    flex-shrink: 0;
  }
  .modal-header-text {
    flex: 1;
    min-width: 0;
    padding-right: 36px;
  }
  .modal-header-text h2 {
    font-size: 17px;
  }
  .modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
  }
  .modal-donate-mini {
    width: 100%;
    padding: 7px 10px;
  }
  .modal-donate-mini-qr {
    width: 44px;
    height: 44px;
  }
  .modal-inner {
    padding: 14px 16px 18px;
    gap: 14px;
  }
  .method-tabs {
    gap: 6px;
    padding-bottom: 10px;
  }
  .method-tab {
    flex: 1 1 calc(50% - 6px);
    padding: 8px 10px;
    font-size: 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .file-box {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    gap: 10px;
  }
  .file-info-primary {
    font-size: 13.5px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .file-btn-dl {
    width: 100%;
    justify-content: center;
  }
  .guide-panel {
    padding: 14px;
  }
  .sha-display {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .sha-copy-btn {
    align-self: flex-end;
  }
  .donate-qr-img {
    width: 200px;
  }
}

/* Compact game shelf: four desktop columns, two mobile columns. */
.main-content{max-width:1480px}
.games-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}
.games-grid .game-card{min-width:0}
.games-grid .card-content{padding:16px}
.games-grid .card-title{font-size:18px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.games-grid .card-desc{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.games-grid .card-badge-version{max-width:calc(100% - 24px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.games-grid .card-actions{gap:8px}
.games-grid .btn-download{font-size:12px;padding:10px 8px;min-width:0}
.games-grid .btn-copy{flex-shrink:0}
@media(max-width:999px){.games-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){
 .games-grid{gap:12px}.main-content{padding-left:12px;padding-right:12px}
 .games-grid .card-content{padding:10px}.games-grid .card-title{font-size:14px}
 .games-grid .card-category{font-size:10px}.games-grid .card-desc{font-size:11px;line-height:1.5}
 .games-grid .card-tags{gap:4px}.games-grid .tag-pill{font-size:9px;padding:3px 5px}
 .games-grid .card-tags .tag-pill:nth-child(n+3){display:none}
 .games-grid .card-badge-platform{top:7px;left:7px;font-size:8px;padding:3px 5px}
 .games-grid .card-badge-version{bottom:6px;right:6px;font-size:8px;padding:2px 4px}
 .games-grid .card-actions{gap:5px}.games-grid .btn-download{font-size:10px;padding:9px 4px;gap:3px}
 .games-grid .btn-download svg{display:none}.games-grid .btn-copy{width:30px;height:32px;padding:6px}
}
