/* ============================================================
   shared.css — PlayHue.games
   Common design tokens, reset, and reusable components.
   Used by: index, contact, terms, and all game pages.
   ============================================================ */

/* ── Design Tokens ── F7F7F5*/
:root {
  --bg:      #FFFFFF;
  --surface: #FFFFFF;
  --fg:      #111111;
  --muted:   #79797A;
  --line:    #E4E4E0;
  --radius:  14px;
  --shadow:  0 2px 16px rgba(0,0,0,.06);
  --font:    'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --ease:    cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }

/* ── Layout ── */
.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 600px) {
  .container { padding: 0 16px; }
}

/* ── Header ── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background .3s var(--ease), border-color .3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(247,247,245,.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
}
.site-logo {
  font-size: 20px; font-weight: 800;
  letter-spacing: -.4px; color: var(--fg);
  text-decoration: none;
}
.site-logo em { color: var(--muted); font-style: normal; font-weight: 400; }

.header-back {
  font-size: 13px; font-weight: 700; color: var(--muted);
  display: flex; align-items: center; gap: 5px;
  transition: color .15s;
}
.header-back:hover { color: var(--fg); }
.header-back svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Footer ── */
.site-footer {
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.site-footer .container {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.footer-copy { font-size: 12px; color: var(--muted); font-weight: 600; }
.footer-links { display: flex; gap: 20px; }
.footer-links a {
  font-size: 12px; font-weight: 600; color: var(--muted);
  transition: color .15s;
  display: inline-flex; align-items: center; gap: 5px;
}
.footer-links a:hover { color: var(--fg); }
.footer-x-icon { width: 13px; height: 13px; fill: currentColor; flex-shrink: 0; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 20px; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  border: 1px solid var(--line);
  transition: opacity .12s var(--ease), transform .06s var(--ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--fg); color: #fff; border-color: var(--fg); }
.btn--ghost   { background: var(--surface); color: var(--fg); }

/* ── Pill ── */
.pill {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); letter-spacing: .04em;
}

/* ── Card ── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px;
}

/* ── Slider (game pages) ── */
input[type="range"] {
  width: 100%; height: 36px; background: transparent;
  -webkit-appearance: none; appearance: none; touch-action: pan-x;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 999px; background: var(--line);
}
input[type="range"]::-moz-range-track {
  height: 8px; border-radius: 999px; background: var(--line);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px;
  border-radius: 50%; border: 2.5px solid var(--fg);
  background: var(--surface); margin-top: -8px;
}
input[type="range"]::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2.5px solid var(--fg); background: var(--surface);
}

/* ── Toast (game pages) ── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: rgba(17,17,17,.92); color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease);
  z-index: 100; white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ── Ad slot (game result / retry screens) ── */
/*
.ad-slot {
  width: 100%; min-height: 100px;
  background: var(--bg); border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--muted);
}
*/

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   Sponsor area
   フッター直上のスポンサーロゴエリア。
   ロゴ画像を <img> で追加するだけで自動的に横並びになります。
   ロゴが0件のときは .sponsors--hidden クラスで非表示にしてください。
   ============================================================ */
.sponsors {
  width: 100%;
  padding: 40px 0;
  border-top: 1px solid var(--line);
}
.sponsors--hidden { display: none !important; }

.sponsors__label {
  text-align: center;
  font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}
.sponsors__logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 32px 40px;
}
.sponsors__logos a,
.sponsors__logos span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: .55;
  transition: opacity .2s;
  filter: grayscale(100%);
}
.sponsors__logos a:hover { opacity: 1; filter: none; }
.sponsors__logos img {
  height: 32px;     /* ロゴの表示高さ。幅は自動 */
  width: auto;
  max-width: 120px;
}
@media (max-width: 600px) {
  .sponsors__logos { gap: 20px 28px; }
  .sponsors__logos img { height: 26px; }
}

/* ============================================================
   Share button pulse animation (game result screens)
   .btn--share クラスを Share ボタンに付与してください。
   ============================================================ */
.btn--share {
  position: relative;
  animation: sharePulse 2.8s ease-in-out 1.2s infinite;
}
@keyframes sharePulse {
  0%,100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(17,17,17,0); }
  40%      { transform: scale(1.04); box-shadow: 0 0 0 6px rgba(17,17,17,.12); }
  70%      { transform: scale(1);    box-shadow: 0 0 0 10px rgba(17,17,17,0); }
}

/* ── Game page header (non-sticky) ── */
.game-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 4px;
}
.game-logo {
  font-size: 20px; font-weight: 800; letter-spacing: -.3px;
  color: var(--fg); line-height: 1.1;
}
.game-logo__by {
  font-size: 12px; font-weight: 400; color: var(--muted);
  display: block; margin-top: 1px;
}
.game-logo__by a {
  color: var(--muted); text-decoration: none;
  transition: color .15s;
}
.game-logo__by a:hover { color: var(--fg); }

/* ── Best score pill (game pages) ── */
.best-pill {
  font-size: 13px; font-weight: 600; color: var(--fg);
  border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}

/* ── How card (game home screens) ── */
.how-card {
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 13px; color: var(--muted); line-height: 1.7;
  display: none;
}
.how-card b { color: var(--fg); }

/* ── Sponsor area: label hidden when no sponsors ── */
.sponsors--hidden .sponsors__label,
.sponsors--hidden .sponsors__logos { display: none; }
