:root {
  --ink: #092a54;
  --ink-soft: #58718e;
  --line: #dce7f2;
  --paper: #ffffff;
  --paper-soft: #f7faff;
  --wash: #f3f7fb;
  --accent: #ed4e29;
  --accent-deep: #c93920;
  --accent-soft: #fff0e9;
  --navy: #0b376b;
  --navy-deep: #06264e;
  --shadow: 0 10px 30px rgba(19, 57, 94, .09);
  --card-shadow: 0 5px 14px rgba(26,75,126,.05);
  --radius: 18px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #e7f1ff;
  --ink-soft: #aabbd0;
  --line: #27476a;
  --paper: #0d1d30;
  --paper-soft: #10243b;
  --wash: #071522;
  --accent: #ff6b45;
  --accent-deep: #ff8a6f;
  --accent-soft: #3b211d;
  --navy: #153e70;
  --navy-deep: #06192e;
  --shadow: 0 12px 32px rgba(0,0,0,.28);
  --card-shadow: 0 6px 18px rgba(0,0,0,.2);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--wash); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--wash); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.48; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(237, 78, 41, .48); outline-offset: 3px; }
a { color: inherit; }
.app { width: min(100%, 720px); min-height: 100vh; margin: 0 auto; overflow: hidden; background: var(--paper); box-shadow: 0 0 0 1px rgba(214,227,240,.55); }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 68px; padding: max(12px, env(safe-area-inset-top)) 18px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: color-mix(in srgb, var(--paper) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; }
.brand img { width: 38px; height: 48px; flex: 0 0 auto; object-fit: cover; border-radius: 8px; box-shadow: 0 4px 12px rgba(65,40,10,.16); }
.brand strong { display: block; font-size: 17px; line-height: 1.12; letter-spacing: -.02em; }
.brand em { color: var(--accent); font-size: 14px; font-style: normal; }
.brand small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 11px; }
.theme-toggle { min-height: 36px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; color: var(--navy); font-size: 12px; font-weight: 800; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-soft); }
:root[data-theme="dark"] .theme-toggle { color: #d7e9ff; }
.theme-icon { font-size: 17px; line-height: 1; }
.hero { position: relative; min-height: 315px; overflow: hidden; background: var(--navy-deep); }
.hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3,25,55,.08) 5%, rgba(4,31,63,.86) 83%), linear-gradient(90deg, rgba(4,31,63,.88), transparent 72%); }
.hero-content { position: relative; max-width: 485px; padding: 34px 22px 104px; color: #fff; }
.eyebrow { margin: 0 0 6px; color: #6b83a1; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.hero .eyebrow { color: rgba(227,240,255,.78); }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 410px; margin-bottom: 10px; font-size: clamp(32px, 8vw, 48px); line-height: 1.06; letter-spacing: -.045em; }
h2 { margin-bottom: 8px; font-size: 23px; line-height: 1.15; letter-spacing: -.03em; }
h3 { margin: 0 0 5px; font-size: 17px; line-height: 1.2; letter-spacing: -.02em; }
.hero-copy { max-width: 365px; margin-bottom: 0; color: rgba(241,247,255,.9); font-size: 15px; }
.alliance-stats { position: absolute; right: 14px; bottom: 14px; left: 14px; display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 12px 4px; color: #fff; border: 1px solid rgba(194,225,255,.23); border-radius: 15px; background: rgba(4,28,59,.57); backdrop-filter: blur(10px); }
.alliance-stats div { min-width: 0; padding: 0 10px; border-right: 1px solid rgba(213,232,255,.2); }
.alliance-stats div:last-child { border-right: 0; }
.alliance-stats dt { margin: 0 0 2px; color: rgba(221,236,255,.72); font-size: 10px; }
.alliance-stats dd { margin: 0; overflow: hidden; color: #fff; font-size: 14px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.leader-note { display: flex; align-items: center; gap: 7px; padding: 12px 20px; color: var(--ink-soft); border-bottom: 1px solid var(--line); background: var(--paper-soft); font-size: 12px; }
.leader-note b { color: var(--ink); }
.leader-avatar { display: inline-grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; color: #fff; font-weight: 800; border-radius: 50%; background: var(--accent); }
.dot { color: color-mix(in srgb, var(--ink-soft) 60%, transparent); }
.content-section { padding: 28px 18px; border-bottom: 1px solid var(--line); }
.featured-feed { display: grid; gap: 11px; margin-top: 16px; }
.featured-card { position: relative; min-height: 118px; width: 100%; padding: 0; display: grid; grid-template-columns: 110px minmax(0,1fr); overflow: hidden; color: var(--ink); text-align: left; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: var(--card-shadow); }
.featured-card:hover { border-color: color-mix(in srgb, var(--navy) 38%, var(--line)); transform: translateY(-1px); }
.featured-card img { width: 100%; height: 100%; object-fit: cover; }
.featured-card-body { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; padding: 14px 14px 13px; }
.featured-card-body p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink-soft); font-size: 12px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.featured-card .go { margin-top: auto; padding-top: 7px; color: var(--accent-deep); font-size: 12px; font-weight: 800; }
.section-title-row { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.counter { flex: 0 0 auto; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.search-box { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; padding: 0 13px; border: 1px solid color-mix(in srgb, var(--line) 76%, var(--navy)); border-radius: 13px; background: var(--paper); box-shadow: 0 3px 11px rgba(31,75,123,.04); }
.search-box > span { color: var(--ink-soft); font-size: 23px; line-height: 1; transform: rotate(-20deg); }
.search-box input { width: 100%; height: 46px; padding: 0; color: var(--ink); border: 0; outline: 0; background: transparent; }
.search-box input::placeholder { color: color-mix(in srgb, var(--ink-soft) 66%, transparent); }
.search-box button { width: 28px; height: 28px; padding: 0; color: var(--ink-soft); font-size: 22px; line-height: 1; border: 0; background: transparent; }
.filter-scroller { display: flex; gap: 8px; margin: 0 -18px; padding: 0 18px 6px; overflow-x: auto; scrollbar-width: none; flex-flow: wrap; }
.filter-scroller::-webkit-scrollbar { display: none; }
.filter-chip { min-height: 34px; flex: 0 0 auto; padding: 0 13px; color: var(--ink-soft); font-size: 12px; font-weight: 750; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.filter-chip.active { color: #fff; border-color: var(--accent); background: var(--accent); }
.guide-feed { display: grid; gap: 11px; margin-top: 16px; }
.guide-card { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 13px; width: 100%; min-height: 119px; padding: 0; overflow: hidden; color: var(--ink); text-align: left; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: var(--card-shadow); }
.guide-card:hover { border-color: color-mix(in srgb, var(--navy) 38%, var(--line)); transform: translateY(-1px); }
.guide-image { width: 100%; height: 100%; object-fit: cover; }
.guide-body { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; padding: 13px 14px 12px 0; }
.guide-body p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink-soft); font-size: 12px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.guide-meta { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 9px; color: color-mix(in srgb, var(--ink-soft) 80%, transparent); font-size: 11px; }
.tag { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 7px; color: #265b96; font-size: 10px; font-weight: 800; line-height: 1; border-radius: 6px; background: #eaf3fe; }
:root[data-theme="dark"] .tag { color: #b9d7ff; background: #1b3a61; }
.tag.rules { color: #9b481b; background: #fff0e8; }
.tag.events { color: #67558e; background: #f0edf9; }
.tag.diamonds { color: #93600b; background: #fff7d7; }
.tag.errors { color: #a4473b; background: #ffeceb; }
:root[data-theme="dark"] .tag.rules { color: #ffb188; background: #4a2b25; }
:root[data-theme="dark"] .tag.events { color: #d2c7ff; background: #322c55; }
:root[data-theme="dark"] .tag.diamonds { color: #ffe085; background: #473c18; }
:root[data-theme="dark"] .tag.errors { color: #ffb0a6; background: #4a2727; }
.difficulty { font-weight: 700; }
.difficulty.easy { color: #498b62; }
.difficulty.medium { color: #d18011; }
.difficulty.hard { color: #bc4731; }
:root[data-theme="dark"] .difficulty.easy { color: #8edba7; }
:root[data-theme="dark"] .difficulty.medium { color: #ffd47e; }
:root[data-theme="dark"] .difficulty.hard { color: #ff9a87; }
.load-more { width: 100%; min-height: 47px; margin-top: 14px; color: var(--navy); font-size: 14px; font-weight: 800; border: 1px solid color-mix(in srgb, var(--line) 80%, var(--navy)); border-radius: 12px; background: var(--paper); }
:root[data-theme="dark"] .load-more { color: #badaff; }
.load-more[hidden] { display: none; }
.source-note { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 14px; align-items: stretch; background: var(--paper-soft); }
.source-note > img { width: 100%; height: 100%; min-height: 174px; object-fit: cover; border-radius: 14px; }
.source-note p:not(.eyebrow) { margin-bottom: 10px; color: var(--ink-soft); font-size: 13px; }
.text-action { padding: 0; color: var(--accent-deep); font-size: 13px; font-weight: 800; border: 0; background: transparent; }
.text-action span { font-size: 18px; vertical-align: -1px; }
.contacts { background: var(--paper); }
.contacts > p:not(.eyebrow) { margin: 0 0 15px; color: var(--ink-soft); font-size: 14px; }
.outline-button { width: 100%; min-height: 44px; color: var(--navy); font-size: 13px; font-weight: 800; border: 1px solid color-mix(in srgb, var(--line) 78%, var(--navy)); border-radius: 12px; background: var(--paper); }
:root[data-theme="dark"] .outline-button { color: #badaff; }
footer { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 2px 10px; align-items: center; padding: 24px 18px max(24px, env(safe-area-inset-bottom)); color: rgba(226,240,255,.72); font-size: 11px; background: var(--navy-deep); }
footer img { width: 32px; height: 40px; grid-row: span 2; object-fit: cover; border-radius: 6px; }
footer span:last-child { color: rgba(226,240,255,.52); }
.guide-dialog { width: min(100%, 720px); height: 100%; max-width: none; max-height: none; margin: 0 auto; padding: 0; color: var(--ink); border: 0; background: transparent; }
.guide-dialog::backdrop { background: rgba(4,18,38,.7); backdrop-filter: blur(3px); }
.dialog-shell { position: relative; min-height: 100%; overflow: hidden auto; background: var(--paper); }
.dialog-close { position: fixed; z-index: 30; top: max(15px, env(safe-area-inset-top)); right: max(15px, calc((100vw - 720px)/2 + 15px)); display: grid; width: 41px; height: 41px; place-items: center; color: #fff; font-size: 29px; line-height: 1; border: 1px solid rgba(255,255,255,.38); border-radius: 50%; background: rgba(5,25,50,.64); backdrop-filter: blur(8px); }
.dialog-cover { height: 255px; background: var(--navy-deep) center / cover no-repeat; }
.dialog-cover::after { display: block; height: 100%; content: ""; background: linear-gradient(180deg, rgba(4,29,59,.04), rgba(4,29,59,.7)); }
.dialog-article { padding: 24px 18px max(36px, env(safe-area-inset-bottom)); }
.dialog-meta { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 12px; }
.dialog-article h2 { margin-top: 12px; font-size: 31px; line-height: 1.07; }
.dialog-date { margin-bottom: 22px; color: var(--ink-soft); font-size: 12px; }
.guide-content { color: color-mix(in srgb, var(--ink) 91%, var(--ink-soft)); }
.guide-content h3 { margin: 24px 0 9px; font-size: 19px; }
.guide-content h4 { margin: 18px 0 7px; font-size: 15px; }
.guide-content p, .guide-content li { font-size: 15px; }
.guide-content p { margin-bottom: 12px; }
.guide-content ul, .guide-content ol { margin: 0 0 15px; padding-left: 21px; }
.guide-content li { margin-bottom: 7px; }
.guide-content strong { color: var(--ink); }
.guide-content a { color: var(--accent-deep); font-weight: 800; }
.notice { padding: 13px 14px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--accent-soft); }
.link-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.link-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; text-decoration: none; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-soft); }
.link-list a span:last-child { font-size: 17px; }
.coverage-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.coverage-list li { padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper-soft); }
.coverage-list b { display: block; margin-bottom: 2px; color: var(--ink); }
.empty-state { margin: 6px 0 0; padding: 25px 12px; color: var(--ink-soft); text-align: center; border: 1px dashed var(--line); border-radius: 14px; }
.toast { position: fixed; z-index: 50; bottom: max(22px, env(safe-area-inset-bottom)); left: 50%; max-width: calc(100% - 32px); padding: 11px 15px; color: #fff; font-size: 13px; font-weight: 700; text-align: center; border-radius: 999px; background: var(--navy-deep); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(-50%, 18px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 721px) {
  body { padding: 18px 0; }
  .app { border-radius: 22px; }
  .topbar { border-radius: 22px 22px 0 0; }
  .guide-dialog { height: calc(100% - 36px); margin: 18px auto; border-radius: 20px; }
  .dialog-shell { border-radius: 20px; }
}
