/* ==========================================================================
   麻雀成績管理 - ポチポチ君  公開サイト共通スタイル
   自己完結・外部CDN/フォント不使用・GitHub Pages配置想定
   カラー: emerald(緑)基調 / slate / 白カード / 角丸
   ========================================================================== */

:root {
  --emerald-50:  #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-800: #065f46;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --bg:        var(--slate-50);
  --card-bg:   #ffffff;
  --ink:       var(--slate-800);
  --ink-soft:  var(--slate-600);
  --ink-faint: var(--slate-400);
  --line:      var(--slate-200);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-card: 0 1px 2px rgba(15, 23, 42, .04),
                 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, .05);

  --maxw: 760px;
}

/* ---- base ---------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
               "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.85;
  font-size: 16px;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--emerald-700); }
a:hover { color: var(--emerald-800); }

img { max-width: 100%; height: auto; display: block; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---- site header (shared) ------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.header-nav {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.header-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.header-nav a:hover { background: var(--slate-100); color: var(--ink); }
.header-nav a[aria-current="page"] {
  background: var(--emerald-50);
  color: var(--emerald-700);
}

/* ---- hero (index) -------------------------------------------------------- */

.hero {
  text-align: center;
  padding: 56px 0 40px;
  background:
    radial-gradient(120% 90% at 50% -10%, var(--emerald-50) 0%, transparent 60%);
}

.hero .app-icon {
  width: 108px;
  height: 108px;
  margin: 0 auto 22px;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(5, 150, 105, .18),
              0 2px 6px rgba(15, 23, 42, .08);
}

.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 800;
  letter-spacing: .01em;
  color: var(--slate-900);
}

.hero .dev {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--emerald-700);
  letter-spacing: .06em;
}

.hero .tagline {
  margin: 0 auto;
  max-width: 34em;
  color: var(--ink-soft);
  font-size: 15.5px;
}

/* store badge / cta */
.cta-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

/* Apple公式App Storeバッジ。アートワーク(SVG)は無改変で表示。
   スケーリングは比率維持のみ。周囲の余白はAppleガイドラインの
   クリアスペース(バッジ高さの約1/10以上)を確保するため margin で付与 */
.store-badge {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
  margin: 8px;                 /* clear space around the badge */
  border-radius: 8px;          /* focus/hover ring follows the badge corners */
  transition: transform .12s ease;
}
.store-badge:hover { transform: translateY(-1px); }
.store-badge:focus-visible { outline: 2px solid var(--emerald-600); outline-offset: 4px; }
.store-badge img {
  display: block;
  width: 181px;                /* height auto keeps official 108.85:40 ratio */
  height: auto;
}

.cta-note {
  font-size: 12px;
  color: var(--ink-faint);
}

/* ---- generic section / cards -------------------------------------------- */

main { padding-bottom: 64px; }

.section { padding: 20px 0; }

.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--emerald-700);
  margin: 32px 0 14px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

/* feature list on index */
.features {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
}

.feature .ic {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--emerald-50);
  color: var(--emerald-600);
}
.feature .ic svg { width: 22px; height: 22px; }

.feature h3 {
  margin: 2px 0 3px;
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-900);
}
.feature p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* doc link cards on index */
.doc-links {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.doc-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.doc-link:hover {
  color: inherit;
  border-color: var(--emerald-200);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}
.doc-link .ic {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--emerald-50);
  color: var(--emerald-600);
}
.doc-link .ic svg { width: 24px; height: 24px; }
.doc-link .txt { flex: 1 1 auto; }
.doc-link .txt strong { display: block; font-size: 15.5px; color: var(--slate-900); }
.doc-link .txt span { font-size: 13px; color: var(--ink-soft); }
.doc-link .chev { color: var(--slate-300); flex: 0 0 auto; }

/* contact block */
.contact {
  text-align: center;
  margin-top: 8px;
}
.contact .card { padding: 28px 24px; }
.contact h3 { margin: 0 0 8px; font-size: 16px; color: var(--slate-900); }
.contact p { margin: 0 0 4px; font-size: 14px; color: var(--ink-soft); }
.contact a.mail {
  display: inline-block;
  margin-top: 6px;
  font-weight: 700;
  font-size: 15px;
  word-break: break-all;
}

/* ---- legal / document pages --------------------------------------------- */

.doc-head {
  padding: 40px 0 8px;
  background:
    radial-gradient(120% 80% at 50% -20%, var(--emerald-50) 0%, transparent 55%);
}
.doc-head h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 800;
  color: var(--slate-900);
}
.doc-head .updated {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.doc-head .updated .dev {
  color: var(--emerald-700);
  font-weight: 700;
}

.doc-body {
  margin-top: 20px;
  padding: 28px 24px;
}

.doc-body .lead {
  margin: 0 0 4px;
  font-size: 14.5px;
  color: var(--ink);
}

.doc-body h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--emerald-800);
  margin: 30px 0 6px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  letter-spacing: .01em;
}
.doc-body h2:first-of-type { border-top: 0; padding-top: 4px; margin-top: 12px; }

.doc-body p {
  margin: 8px 0;
  font-size: 14.5px;
  color: var(--ink);
}

/* legal numbered lists: literal "1. " kept in text, auto-marker suppressed
   so the document text stays character-for-character faithful to the source */
.doc-body ol.numbered {
  list-style: none;
  margin: 8px 0;
  padding-left: 0;
}
.doc-body ol.numbered li {
  margin: 6px 0;
  font-size: 14.5px;
  padding-left: 1.7em;
  text-indent: -1.7em;   /* hanging indent so wrapped lines align under text */
  color: var(--ink);
}

.doc-body .url {
  word-break: break-all;
  font-size: 13.5px;
}

.doc-body .mailbox {
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--emerald-50);
  border: 1px solid var(--emerald-100);
  border-radius: var(--radius-sm);
  font-weight: 700;
  word-break: break-all;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 26px 0 0;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* ---- footer -------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 28px 0 40px;
}
.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
}
.footer-nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
}
.footer-nav a:hover { color: var(--emerald-700); }
.copyright {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: .02em;
}

/* ---- responsive ---------------------------------------------------------- */

@media (min-width: 640px) {
  body { font-size: 16.5px; }
  .features { grid-template-columns: 1fr 1fr; }
  .doc-links { grid-template-columns: 1fr 1fr; }
  .hero { padding: 72px 0 48px; }
  .doc-body { padding: 36px 40px; }
  .cta-row { flex-direction: row; justify-content: center; }
}

@media (min-width: 900px) {
  :root { --maxw: 820px; }
}
