/* Fallback layout when Tailwind CDN is blocked (e.g. mainland China) */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: "Noto Sans TC", system-ui, -apple-system, sans-serif; line-height: 1.5; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none !important; }
.block { display: block; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-8 { gap: 2rem; }

.max-w-3xl { max-width: 48rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.w-8 { width: 2rem; }
.w-9 { width: 2.25rem; }
.w-10 { width: 2.5rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-12 { margin-top: 3rem; }

.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-extrabold { font-weight: 800; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bg-white { background-color: #fff; }
.text-gray-500 { color: #6b7280; }
.text-gray-900 { color: #111827; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-800 { color: #1e293b; }
.border { border: 1px solid #e5e7eb; }
.border-t { border-top: 1px solid #e5e7eb; }
.border-slate-200 { border-color: #e2e8f0; }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,.1); }
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-50 { z-index: 50; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.antialiased { -webkit-font-smoothing: antialiased; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 768px) {
  .md\:grid-cols-\[1fr_auto_1fr\] { grid-template-columns: 1fr auto 1fr; }
  .md\:justify-start { justify-content: flex-start; }
  .md\:justify-end { justify-content: flex-end; }
  .md\:text-left { text-align: left; }
  .md\:text-right { text-align: right; }
  .md\:hidden { display: none !important; }
  .md\:flex { display: flex !important; }
  .md\:inline { display: inline !important; }
  .md\:min-h-\[9\.5rem\] { min-height: 9.5rem; }
  .md\:w-32 { width: 8rem; }
  .md\:h-32 { height: 8rem; }
  .md\:text-3xl { font-size: 1.875rem; }
  .site-nav { display: flex !important; gap: 1.25rem; }
  .mobile-inline-nav { display: none !important; }
}
@media (max-width: 767px) {
  .site-nav { display: none !important; }
  html body header.site-header,
  html body .site-header {
    margin-bottom: 0.75rem !important;
    background: #f5f3ff !important;
    border-bottom: 1px solid #e9e5ff !important;
    box-shadow: 0 1px 3px rgba(124, 58, 237, 0.06) !important;
    overflow: visible !important;
  }
  .site-header-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.25rem 0.35rem;
    padding-top: 0.375rem !important;
    padding-bottom: 0.375rem !important;
  }
  .site-header-top {
    display: contents;
  }
  .site-header-top > a {
    grid-column: 1;
    grid-row: 1;
  }
  .site-header-top > div {
    grid-column: 3;
    grid-row: 1;
  }
  .mobile-inline-nav {
    grid-column: 2;
    grid-row: 1;
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.1rem;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    margin: 0;
  }
  .mobile-inline-nav::-webkit-scrollbar {
    display: none;
  }
  .mobile-inline-nav a {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.2rem 0.05rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.25;
    color: #374151;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
  }
  .mobile-inline-nav a.active {
    color: #E85D00;
    border-bottom-color: #FF6900;
  }
  .mobile-inline-nav a:last-child:nth-child(5) {
    grid-column: unset;
  }
}
@media (min-width: 768px) {
  .site-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .site-header-top {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
  }
  .site-header .header-brand-text,
  .site-header-top a > span.hidden.md\:inline {
    font-size: 1.375rem !important;
    line-height: 1.3;
    color: #E85D00 !important;
  }
  .site-header-top a:hover .header-brand-text,
  .site-header-top a:hover > span.hidden.md\:inline {
    color: #FF6900 !important;
  }
}

/* 主站手機版字體放大（首頁、情報、工具、遊戲區列表等；不含遊戲內頁） */
@media (max-width: 767px) {
  html:has(.site-header):not(:has(.game-page-shell)) {
    font-size: 18px;
    -webkit-text-size-adjust: 100%;
  }

  html:has(.site-header):not(:has(.game-page-shell)) body {
    line-height: 1.6;
  }

  html:has(.site-header):not(:has(.game-page-shell)) .mobile-inline-nav a {
    font-size: 0.6875rem !important;
    padding: 0.2rem 0.05rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
  }

  html:has(.site-header):not(:has(.game-page-shell)) .mobile-inline-nav a.active {
    color: #E85D00 !important;
    border-bottom-color: #FF6900 !important;
  }

  html:has(.site-header):not(:has(.game-page-shell)) .header-brand-text {
    font-size: 1.0625rem !important;
    letter-spacing: -0.01em;
  }

  html:has(.site-header):not(:has(.game-page-shell)) .text-xs {
    font-size: 0.875rem !important;
  }

  html:has(.site-header):not(:has(.game-page-shell)) .text-sm {
    font-size: 1.0625rem !important;
  }

  html:has(.site-header):not(:has(.game-page-shell)) .site-nav a.nav-link {
    font-size: 1.0625rem !important;
  }

  html:has(.site-header):not(:has(.game-page-shell)) footer,
  html:has(.site-header):not(:has(.game-page-shell)) footer .text-xs {
    font-size: 0.875rem !important;
  }
}
