/* ===== Retro Cassette Theme - 复古磁带风 ===== */

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Courier Prime', 'VT323', monospace;
  background: #f8eedb;
  color: #311f15;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ===== Container ===== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 5px;
  width: 100%;
}

/* ===== Site Header - 复古页眉 ===== */
.site-header {
  background: linear-gradient(180deg, #efe0cc 0%, #f8eedb 100%);
  border-bottom: 3px solid #e07c1f;
  padding: 16px 0;
  z-index: 100;
}
/* 首页隐藏页眉 */
body.index-page .site-header {
  display: none;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #311f15;
  font-family: 'VT323', monospace;
  letter-spacing: 1px;
  transition: all 0.25s ease;
}
.logo:hover {
  color: #e07c1f;
}
.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(145deg, #e0a158, #b96f20);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #7a5a4b;
  box-shadow: 0 4px 0 #7a5a4b;
  position: relative;
}
.logo-icon::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #333 30%, #111 70%);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.logo-icon::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  top: 8px;
  left: 8px;
}
.logo span {
  color: #e07c1f;
}

@media (max-width: 480px) {
  .logo { font-size: 1.25rem; }
  .logo-icon { width: 36px; height: 36px; }
}

/* ===== Hero Section - 磁带盘宫格 ===== */
.hero-section {
  padding: 40px 0;
  background: linear-gradient(180deg, #efe0cc 0%, #f8eedb 100%);
  border-bottom: 3px solid #e07c1f;
  margin-bottom: 30px;
  position: relative;
  width: 100%;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.5;
}
.hero-grid {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 0 20px;
  position: relative;
  z-index: 1;
  width: 100%;
}
.hero-card {
  flex: 1;
  background: radial-gradient(circle at 30% 30%, #e0c8a8, #c8aa7a);
  border-radius: 20px 20px 16px 16px;
  box-shadow: 0 4px 0 #7a5a4b, inset 0 1px 2px rgba(255,245,200,0.9);
  text-align: center;
  padding: 0;
  position: relative;
  transition: all 0.25s ease;
  aspect-ratio: 3/2;
  overflow: hidden;
  min-width: 60px;
}
.hero-card::before,
.hero-card::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: radial-gradient(circle, #333, #111);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.hero-card::before { left: -6px; }
.hero-card::after { right: -6px; }
.hero-card:hover {
  transform: rotateZ(2deg) scale(1.02);
  background: radial-gradient(circle at 30% 30%, #f0dbb8, #dbb786);
}
.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-card span {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  z-index: 3;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 平板端 */
@media (max-width: 768px) {
  .hero-section { padding: 30px 0; }
  .hero-grid { padding: 0 15px; gap: 15px; }
  .hero-card::before, .hero-card::after { width: 26px; height: 26px; }
  .hero-card::before { left: -8px; }
  .hero-card::after { right: -8px; }
  .hero-card span { font-size: 0.75rem; }
}

/* 手机端 */
@media (max-width: 480px) {
  .hero-section { padding: 5px 0; }
  .hero-grid { padding: 0 0px; gap: 2px; }
  .hero-card::before, .hero-card::after { width: 20px; height: 20px; }
  .hero-card::before { left: -6px; }
  .hero-card::after { right: -6px; }
  .hero-card span { font-size: 0.65rem; bottom: 6px; }
}

/* ===== Games Section ===== */
.games-section {
  padding: 8px 0 32px;
}
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #e07c1f;
  position: relative;
  display: inline-block;
  padding-left: 16px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: #e07c1f;
  border-radius: 2px;
}
@media (max-width: 768px) {
  .section-title { font-size: 1.25rem; }
}

/* ===== Game Grid (Home) ===== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  padding: 5px 0;
}
@media (max-width: 1024px) { .game-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px)  { .game-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 576px)  { .game-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

/* ===== Game Card - 复古卡片 ===== */
.game-card {
  background: #fff5e8;
  overflow: hidden;
  border: 2px solid #d4a574;
  box-shadow: 0 8px 18px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,200,0.8);
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
  border-radius: 12px;
}
.game-card:hover {
  box-shadow: 0 12px 24px rgba(224,124,31,0.3), inset 0 1px 0 rgba(255,245,200,0.9);
  transform: translateY(-4px) rotateZ(-1deg);
  border-color: #e07c1f;
}
.game-card-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #f0e6d6;
  position: relative;
}
.game-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
  filter: sepia(20%) saturate(90%);
}
.game-card:hover .game-card-thumb img { transform: scale(1.05); filter: sepia(0%) saturate(100%); }
.game-card-title {
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #311f15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #fff5e8;
  font-family: 'VT323', monospace;
  letter-spacing: 0.5px;
}

/* ===== Ad Slot ===== */
.ad-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}

/* ===== Detail Page ===== */
.detail-wrap {
  display: flex;
  gap: 28px;
  padding: 32px 0;
  flex: 1;
}
.detail-main {
  flex: 7;
  min-width: 0;
}
.detail-sidebar {
  flex: 3;
  min-width: 280px;
  max-width: 360px;
}
@media (max-width: 900px) {
  .detail-wrap { flex-direction: column; }
  .detail-sidebar { max-width: 100%; min-width: 0; }
}

/* Game Frame Area - 复古游戏框 */
.game-frame-wrap {
  background: #fff5e8;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  border: 3px solid #d4a574;
  box-shadow: 0 8px 18px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,245,200,0.8);
  border-radius: 16px;
}
.game-frame-wrap:fullscreen,
.game-frame-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  aspect-ratio: unset;
  border-radius: 0;
}
.game-frame-wrap.mobile-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  z-index: 9999;
  aspect-ratio: unset;
  border-radius: 0;
}
.game-frame-wrap.mobile-fullscreen .fullscreen-btn {
  display: block;
  z-index: 10;
}
.game-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  position: relative;
  z-index: 1;
}
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(248, 238, 219, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 3;
}
.game-overlay.hidden { opacity: 0; pointer-events: none; }
.game-overlay-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 0;
  filter: sepia(30%) brightness(0.95);
}
.play-btn {
  position: relative;
  z-index: 1;
  background: linear-gradient(145deg, #e0a158, #b96f20);
  color: #ffffff;
  border: 3px solid #7a5a4b;
  padding: 18px 36px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s ease;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 8px;
  box-shadow: 0 4px 0 #7a5a4b;
  font-family: 'VT323', monospace;
}
.play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #7a5a4b;
}
.play-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #7a5a4b;
}

.fullscreen-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: linear-gradient(145deg, #e0a158, #b96f20);
  color: #ffffff;
  border: 2px solid #7a5a4b;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: none;
  transition: all 0.25s ease;
  border-radius: 8px;
  box-shadow: 0 3px 0 #7a5a4b;
  font-family: 'VT323', monospace;
}
.fullscreen-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #7a5a4b;
}
.game-frame-wrap.playing .fullscreen-btn { display: block; }
.game-frame-wrap.playing .game-overlay { display: none; }
.game-frame-wrap.playing .game-overlay-thumb { display: none; }

/* 移动端隐藏全屏按钮 */
@media (max-width: 768px) {
  .game-frame-wrap .fullscreen-btn {
    display: none !important;
  }
}

/* PC端（大于768px）游戏开始后显示全屏按钮 */
@media (min-width: 769px) {
  .game-frame-wrap.playing .fullscreen-btn {
    display: block;
  }
}

/* 全屏模式下隐藏按钮 */
.game-frame-wrap:fullscreen .fullscreen-btn,
.game-frame-wrap:-webkit-full-screen .fullscreen-btn {
  display: none !important;
}

/* Sidebar - 复古侧边栏 */
.detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #e07c1f;
  font-family: 'VT323', monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.detail-desc {
  font-size: 1rem;
  color: #5a4035;
  line-height: 1.8;
  margin-bottom: 20px;
}
.tips-box {
  background: #fff5e8;
  border-left: 4px solid #e07c1f;
  padding: 20px;
  margin-top: 16px;
  border-radius: 0 12px 12px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,245,200,0.8);
}
.tips-box h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e07c1f;
  margin-bottom: 12px;
  font-family: 'VT323', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.tips-box ul {
  list-style: none;
  padding: 0;
}
.tips-box li {
  font-size: 0.9rem;
  color: #5a4035;
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  line-height: 1.6;
}
.tips-box li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #e07c1f;
  font-weight: bold;
}

/* Related Games */
.related-section {
  padding: 32px 0;
}
.related-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #e07c1f;
  position: relative;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: 'VT323', monospace;
}
.related-section h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 60%;
  height: 3px;
  background: #e07c1f;
  border-radius: 2px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 768px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== Footer - 深土棕页脚 ===== */
.site-footer {
  background: #3e2a21;
  padding: 40px 0;
  margin-top: auto;
  border-top: 4px solid #e07c1f;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.footer-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  font-size: 0.9rem;
  color: #f8eedb;
  transition: all 0.25s ease;
  font-weight: 500;
  padding: 8px 16px;
  position: relative;
  font-family: 'VT323', monospace;
  letter-spacing: 0.5px;
}
.footer-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #e07c1f;
  transition: all 0.25s ease;
  transform: translateX(-50%);
}
.footer-links a:hover::after {
  width: 80%;
}
.footer-links a:hover {
  color: #e07c1f;
}
.footer-copy {
  font-size: 0.85rem;
  color: #d4a574;
  margin-top: 8px;
  font-family: 'Courier Prime', monospace;
}

/* ===== Info Pages (Contact/Policy/About) ===== */
.info-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 20px;
  flex: 1;
  background: #fff5e8;
  margin-top: 32px;
  margin-bottom: 32px;
  border: 3px solid #d4a574;
  box-shadow: 0 8px 18px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,245,200,0.8);
  border-radius: 16px;
}
.info-page h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 28px;
  color: #e07c1f;
  font-family: 'VT323', monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.info-page h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 32px 0 16px;
  color: #e07c1f;
  position: relative;
  padding-left: 16px;
  font-family: 'VT323', monospace;
  letter-spacing: 1px;
}
.info-page h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: #e07c1f;
  border-radius: 2px;
}
.info-page p {
  font-size: 1rem;
  color: #5a4035;
  line-height: 1.9;
  margin-bottom: 16px;
}
.info-page a {
  color: #e07c1f;
  font-weight: 600;
  transition: all 0.25s ease;
  border-bottom: 2px solid transparent;
}
.info-page a:hover {
  border-bottom-color: #e07c1f;
}
.info-page ul {
  list-style: none;
  padding: 0;
}
.info-page li {
  padding: 8px 0 8px 24px;
  position: relative;
  color: #5a4035;
  font-size: 1rem;
  line-height: 1.8;
}
.info-page li::before {
  content: '▸';
  position: absolute;
  left: 4px;
  color: #e07c1f;
  font-weight: bold;
}

/* ===== Scrollbar - 复古滚动条 ===== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track {
  background: #f0e6d6;
  border: 1px solid #d4a574;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #e0a158, #b96f20);
  border-radius: 5px;
  border: 2px solid #7a5a4b;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #e07c1f, #d4892a);
}

/* ===== 响应式调整 ===== */
@media (max-width: 768px) {
  .info-page { margin: 20px 16px; padding: 32px 20px; }
  .info-page h1 { font-size: 1.7rem; }
  .play-btn { padding: 14px 28px; font-size: 1rem; }
  .detail-title { font-size: 1.4rem; }
}
