/* logi.tim945.com｜Logitech G 遊戲大廳
   沿用一拍即合的配色：深藍標題列＋置中 Logo、青色強調、圓角卡片。 */

:root {
  --brand: #156082;
  --brand-dark: #0f4c69;
  --cyan: #00b8fc;
  --cyan-soft: #e3f6fe;
  --ink: #12171c;
  --ink-2: #3c4852;
  --muted: #6c7a86;
  --line: #dbe2e8;
  --page: #eef2f5;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --font: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.6 var(--font);
  -webkit-tap-highlight-color: transparent;
}
main { flex: 1; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.icon {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- 標題列 ---------- */
.topbar {
  height: calc(52px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  display: grid;
  place-items: center;
  background: var(--brand);
  border-bottom: 1px solid var(--brand-dark);
}
.brand { display: block; line-height: 0; border-radius: 4px; }
.brand img { height: 30px; width: auto; }

/* ---------- 主視覺 ---------- */
.hero {
  position: relative;
  padding: 56px 20px 112px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(ellipse 70% 90% at 50% 0%, rgba(0, 184, 252, .28), transparent 70%),
    linear-gradient(180deg, #0b2a3b 0%, #0a1820 100%);
  overflow: hidden;
}
.hero::after { /* 細格線，呼應取景框 */
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  pointer-events: none;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .22em;
}
.hero h1 {
  margin: 0;
  font-size: clamp(40px, 9vw, 68px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: .06em;
}
.hero h1 span { color: var(--cyan); }
.lead { margin: 14px auto 0; max-width: 32em; color: rgba(255, 255, 255, .72); font-size: 16px; }

.hero-play { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 12px; margin-top: 20px; min-height: 48px; padding: 12px 24px; border-radius: 999px; background: var(--cyan); color: #0a1820; font-weight: 800; text-decoration: none; box-shadow: 0 6px 22px rgba(0,184,252,.22); }
.hero-play:hover { background: #72d8ff; }

/* ---------- 分享 ---------- */
.share {
  position: relative; z-index: 1;
  margin-top: 22px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
}
.share-label { width: 100%; color: rgba(255, 255, 255, .6); font-size: 13px; letter-spacing: .08em; }
.share-btn {
  width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.share-btn:hover { background: var(--cyan); border-color: var(--cyan); color: #0a1820; transform: translateY(-2px); }
.brand-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-icon .fill { fill: currentColor; stroke: none; }
.brand-icon .knock { fill: #0c2431; stroke: none; letter-spacing: -.2px; }
.share-btn:hover .knock { fill: var(--cyan); }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 10;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  margin: 0; padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink); color: #fff;
  font-size: 14px; text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

.clip { position: fixed; top: 0; left: -9999px; opacity: 0; }

/* Facebook 分享：FB 不能預填文字，先複製文案再前往 */
.fb-sheet {
  width: min(440px, calc(100% - 32px)); padding: 22px 20px 20px;
  border: 0; border-radius: 18px; color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.fb-sheet::backdrop { background: rgba(6, 16, 22, .6); }
.fb-sheet h2 { margin: 0 32px 8px 0; font-size: 18px; }
.fb-step { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.fb-step b { color: var(--brand); }
.fb-text {
  margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--page);
  font-size: 14px; line-height: 1.6; white-space: pre-line; word-break: break-word;
  user-select: all; -webkit-user-select: all;
}
.fb-actions { display: flex; gap: 10px; margin-top: 16px; }
.fb-btn {
  flex: 1; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 999px; background: #1877f2; color: #fff;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.fb-btn.ghost { background: var(--page); color: var(--ink); }
.fb-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted);
  font-size: 24px; line-height: 1; cursor: pointer;
}

.ig-sheet { max-height: calc(100dvh - 32px); overflow: auto; }
.ig-preview { display: block; width: 120px; height: auto; margin: 0 auto 12px; border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.ig-steps { margin: 0; padding-left: 1.3em; color: var(--ink-2); font-size: 14px; }
.ig-steps b { color: var(--ink); }
.fb-btn.ig { background: linear-gradient(45deg, #f58529, #dd2a7b 50%, #8134af); }
.ig-download { display: block; margin-top: 12px; text-align: center; color: var(--brand); font-size: 14px; }
.share { gap: 10px 8px; }

.img-pick { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; margin-bottom: 4px; }
.img-opt {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px; border: 2px solid var(--line); border-radius: 12px; background: #fff;
  font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.img-opt img { width: 100%; height: 120px; object-fit: contain; border-radius: 6px; background: var(--page); }
.img-opt[aria-checked="true"] { border-color: var(--cyan); color: var(--ink); font-weight: 700; box-shadow: 0 0 0 3px var(--cyan-soft); }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.more-link {
  display: grid; place-items: center; min-height: 44px; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.more-link:hover { border-color: var(--cyan); }
#moreCopy { grid-column: span 3; }
.more-system { width: 100%; margin-top: 12px; }

.notice {
  margin: 0 0 10px; padding: 10px 12px; border-radius: 10px;
  background: #fff4e5; color: #6b4300; font-size: 14px; border-left: 4px solid #f5a623;
}
#photoPreview { width: auto; max-width: 100%; max-height: 200px; margin-top: 12px; -webkit-touch-callout: default; }
.notice br + * { display: inline; }

/* FB／LINE／IG 分享視窗（依 tim 參考圖：提示已複製文案、圖片、文案、分享／下載、關閉） */
.done { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #e8f7ee; border: 1px solid #9ed7b2; color: #155c33; font-size: 14px; }
.sheet-img { display: block; width: auto; max-width: 100%; max-height: 42vh; margin: 0 auto 12px; border-radius: 12px; box-shadow: 0 8px 22px rgba(0, 0, 0, .22); -webkit-touch-callout: default; }
.sheet-copy { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.7; white-space: pre-line; word-break: break-word; user-select: all; -webkit-user-select: all; }
.fb-btn.share-go { background: var(--brand); }
.sheet-close { display: block; margin: 16px auto 0; min-width: 96px; height: 40px; padding: 0 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }

/* ---------- 遊戲卡片 ---------- */
.games {
  position: relative;
  z-index: 1;
  width: min(1120px, 100% - 32px);
  margin: -72px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* 六個入口：桌機三欄、平板兩欄、手機單欄 */
  gap: 20px;
}
.game {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(10, 30, 45, .12), 0 1px 0 var(--line);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.game:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(10, 30, 45, .18), 0 0 0 2px var(--cyan); }
.game:active { transform: translateY(-1px); }
.cover { display: block; aspect-ratio: 16 / 10; background: #0a1820; overflow: hidden; }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.game:hover .cover img { transform: scale(1.04); }
.body { flex: 1; display: flex; flex-direction: column; padding: 18px 20px 20px; }
.tag {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--cyan-soft);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 700;
}
.title { margin-top: 10px; font-size: 22px; font-weight: 800; line-height: 1.3; }
.sub { color: var(--muted); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; }
.desc { margin-top: 8px; color: var(--ink-2); flex: 1; }
.cta {
  margin-top: 16px;
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  height: 42px; padding: 0 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  transition: background .2s;
}
.game:hover .cta { background: var(--brand); }

/* ---------- 優惠碼 ---------- */
.promo {
  width: min(1120px, 100% - 32px);
  margin: 28px auto 0;
  padding: 16px 20px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  text-align: center;
}
.promo p { margin: 0; }
.promo strong { color: var(--cyan); letter-spacing: .08em; }
.promo-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: #fff; font-weight: 700; text-decoration: none;
  border-bottom: 2px solid rgba(255, 255, 255, .5);
}
.promo-link:hover { border-color: var(--cyan); }

.footer { padding: 28px 16px calc(28px + env(safe-area-inset-bottom, 0px)); text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- 窄螢幕 ---------- */
@media (max-width: 1100px) {
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .hero { padding: 40px 16px 92px; }
  .games { grid-template-columns: 1fr; gap: 16px; margin-top: -60px; }
  .title { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .game, .cover img, .cta { transition: none; }
  .game:hover { transform: none; }
  .game:hover .cover img { transform: none; }
}
