/* =========================================================
   DIY Bowling Manager — Manual site styles
   Single stylesheet shared by every language / screen page.
   ========================================================= */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f9;
  --text: #1b2330;
  --text-soft: #566076;
  --border: #dde3ee;
  --primary: #1f6feb;
  --primary-ink: #0b2a5b;
  --primary-soft: #e7f0ff;
  --accent: #10a3a3;
  --warn-bg: #fff7e6;
  --warn-border: #f0c36d;
  --note-bg: #eef7ef;
  --note-border: #9ec7a3;
  --shadow: 0 1px 2px rgba(16, 30, 54, .06), 0 8px 24px rgba(16, 30, 54, .06);
  --radius: 14px;
  --sidebar-w: 288px;
  --topbar-h: 60px;
  --maxw: 1080px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  --sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR",
          "Noto Sans JP", "Hiragino Sans", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1420;
    --surface: #151c2b;
    --surface-2: #1c2536;
    --text: #e7ecf5;
    --text-soft: #a4b0c6;
    --border: #29354b;
    --primary: #5b9bff;
    --primary-ink: #cfe0ff;
    --primary-soft: #1a2740;
    --accent: #38c7c7;
    --warn-bg: #2e2712;
    --warn-border: #6d5a24;
    --note-bg: #16281b;
    --note-border: #2f5a37;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--text);
  font-size: 1.02rem;
}
.topbar .brand .logo {
  width: 30px; height: 30px;
  display: block;
  object-fit: contain;
}
.topbar .spacer { flex: 1; }

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
}

/* Language switch */
.lang-switch { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; }
.lang-switch a {
  font-size: .82rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  color: var(--text-soft);
}
.lang-switch a:hover { text-decoration: none; background: var(--surface); }
.lang-switch a.active { background: var(--primary); color: #fff; }

/* ---------- Layout shell ---------- */
.shell { display: flex; align-items: flex-start; max-width: var(--maxw); margin: 0 auto; }

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  align-self: flex-start;
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 20px 12px 40px;
  border-right: 1px solid var(--border);
}
.sidebar .side-title {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-soft);
  padding: 8px 12px;
  font-weight: 700;
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-soft);
  font-weight: 600;
  font-size: .92rem;
}
.nav-list a .ico {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}
.m-icon {
  display: inline-block;
  fill: currentColor;
}
.asset-icon {
  display: inline-block;
  object-fit: contain;
}
.nav-list a .asset-icon { color: inherit; }
.nav-list a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-list a.active { background: var(--primary-soft); color: var(--primary-ink); }
.nav-list a.active .ico { filter: none; }

.content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 34px clamp(18px, 4vw, 52px) 80px;
}
.content .inner { max-width: 760px; margin: 0 auto; }

/* Breadcrumb */
.crumb { font-size: .85rem; color: var(--text-soft); margin-bottom: 6px; }
.crumb a { color: var(--text-soft); }

/* Headings */
h1.page-title {
  font-size: clamp(1.6rem, 3.4vw, 2.15rem);
  line-height: 1.25;
  margin: 2px 0 6px;
  letter-spacing: -.02em;
}
.page-lead { font-size: 1.08rem; color: var(--text-soft); margin: 0 0 26px; }

h2 {
  font-size: 1.28rem;
  margin: 40px 0 12px;
  padding-top: 10px;
  letter-spacing: -.01em;
}
h2::before {
  content: "";
  display: block;
  width: 34px; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  margin-bottom: 12px;
}
h3 { font-size: 1.06rem; margin: 26px 0 8px; }

p { margin: 10px 0; }

/* Lists */
ul.feature, ol.steps { margin: 12px 0; padding-left: 0; list-style: none; }
ul.feature > li {
  position: relative;
  padding: 4px 0 4px 26px;
}
ul.feature > li::before {
  content: "";
  position: absolute; left: 0; top: 3px;
  width: 18px; height: 18px;
  background: url("brand/ic_bowling_ball.webp") center / contain no-repeat;
}
ol.steps { counter-reset: step; }
ol.steps > li {
  position: relative;
  padding: 4px 0 10px 40px;
  margin: 0;
}
ol.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0; top: 2px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
  border-radius: 50%;
  font-size: .85rem; font-weight: 700;
}

li b, p b { color: var(--text); }

/* Callouts */
.callout {
  border: 1px solid var(--border);
  border-left-width: 4px;
  background: var(--surface);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: .96rem;
}
.callout .c-title { font-weight: 700; margin-right: 6px; }
.callout.tip { background: var(--note-bg); border-left-color: var(--note-border); }
.callout.note { background: var(--surface-2); border-left-color: var(--primary); }
.callout.warn { background: var(--warn-bg); border-left-color: var(--warn-border); }

/* Inline chips for UI labels */
.ui {
  font-family: var(--sans);
  font-weight: 600;
  font-size: .86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
  white-space: nowrap;
}
code { font-family: var(--mono); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .88em; }

/* Screenshot placeholders */
figure.shot { margin: 20px 0; }
figure.shot .frame {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
figure.shot img { display: block; width: 100%; height: auto; }
figure.shot .frame.missing {
  aspect-ratio: 9 / 16;
  max-width: 300px;
  margin: 0 auto;
  border-style: dashed;
  border-width: 2px;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 12px, var(--surface-2) 12px, var(--surface-2) 24px);
}
figure.shot .frame.missing img { display: none; }
.ph {
  text-align: center;
  color: var(--text-soft);
  padding: 24px;
}
.ph .ph-ico { font-size: 2rem; display: block; margin-bottom: 8px; }
.ph .ph-path { font-family: var(--mono); font-size: .8rem; word-break: break-all; margin-top: 6px; color: var(--text); }
figure.shot figcaption {
  text-align: center;
  font-size: .86rem;
  color: var(--text-soft);
  margin-top: 8px;
}
.shot-row { display: flex; flex-wrap: wrap; gap: 18px; }
.shot-row figure.shot { flex: 1 1 260px; margin: 8px 0; }

/* Tables */
table.man {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: .94rem;
  overflow: hidden;
  border-radius: 10px;
}
table.man th, table.man td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}
table.man th { background: var(--surface-2); font-weight: 700; }
table.man tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }

/* Prev / next */
.pager {
  display: flex;
  gap: 14px;
  margin-top: 54px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.pager a {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface);
  color: var(--text);
}
.pager a:hover { border-color: var(--primary); text-decoration: none; }
.pager .dir { font-size: .76rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: .06em; }
.pager .ttl { font-weight: 700; margin-top: 2px; }
.pager a.next { text-align: right; }

/* Home / landing */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 18px;
  padding: 34px 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 4vw, 2.3rem); }
.hero p { margin: 0; opacity: .95; font-size: 1.05rem; }
.hero .badges { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.hero .badge { background: rgba(255,255,255,.2); border-radius: 999px; padding: 4px 12px; font-size: .82rem; font-weight: 600; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.scard {
  display: block;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: var(--surface);
  color: var(--text);
  transition: transform .12s ease, border-color .12s ease;
}
.scard:hover { transform: translateY(-2px); border-color: var(--primary); text-decoration: none; }
.scard .ico {
  width: 30px;
  height: 30px;
  color: var(--primary);
}
.scard .t { font-weight: 700; margin-top: 8px; }
.scard .d { font-size: .88rem; color: var(--text-soft); margin-top: 3px; }

/* Language picker (root index) */
.picker-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.picker {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: var(--shadow);
  max-width: 460px;
  width: 100%;
}
.picker .logo-lg {
  width: 64px; height: 64px; margin: 0 auto 14px;
  display: block;
  object-fit: contain;
}
.picker h1 { margin: 0 0 4px; font-size: 1.5rem; }
.picker p { color: var(--text-soft); margin: 0 0 22px; }
.picker .langs { display: grid; gap: 10px; }
.picker .langs a {
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font-weight: 700;
  color: var(--text);
}
.picker .langs a:hover { background: var(--primary); color: #fff; text-decoration: none; border-color: var(--primary); }
.picker .langs a span { display: block; font-size: .8rem; font-weight: 500; color: var(--text-soft); }
.picker .langs a:hover span { color: rgba(255,255,255,.85); }

/* Footer */
.foot { margin-top: 40px; font-size: .82rem; color: var(--text-soft); }

/* Scrim for mobile drawer */
.scrim { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .menu-toggle { display: inline-grid; place-items: center; }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    z-index: 45;
    background: var(--surface);
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim {
    display: block;
    position: fixed; inset: var(--topbar-h) 0 0 0;
    background: rgba(0,0,0,.4);
    z-index: 44;
  }
  .content { padding: 24px 18px 70px; }
}
