/*
 * NAGA サイトのデザインシステム。
 * 3D 牌譜解析ビューアー（リッチ表示）と同じ「夜の卓」の世界: 深い紺の空間・ラシャの青・NAGA の紫・点棒の金。
 * 形の決まり: 角はほぼ直角（2〜8px）。ボタンと主な面は 45° に角を落とし（corner-shape: bevel。使えない環境は小さな角丸）、
 * 面の四隅には細い鍵括弧を付ける。影とグラデーションは控えめにして、細い線と面の明るさで階層を分ける。
 * Bootstrap 5.0.2 の部品はここで暗い配色へ上書きする（bootstrap.min.css・common.css の後に読む）。
 */

/* ---- トークン ------------------------------------------------------------ */
:root {
  color-scheme: dark;

  /* 空間（背景）: 下ほど深い */
  --night-0: #02040c;
  --night-1: #040817;
  --night-2: #0a1230;
  --night-3: #111b45;
  /* NAGA のイラストの輪郭と同じ紺。牌の背・白地の上の文字 */
  --navy: #041c5c;
  --navy-ink: #10173a;
  /* 卓のラシャ */
  --felt: #1438a8;
  --felt-deep: #0b2577;
  /* NAGA の紫（標準の体色）。暗い背景の上の文字には明るい方を使う */
  --violet: #8c5cb4;
  --violet-deep: #6c43a8;
  --violet-hi: #b58cff;
  --violet-lo: #7e4fd0;
  --violet-text: #cdb2ff;
  /* 点棒の金と赤 */
  --gold: #fccc2c;
  --gold-text: #ffe39a;
  --crimson: #cc0444;
  --crimson-text: #ff7a93;
  --good: #3ddc97;
  --good-text: #7ff0bf;
  --warn: #ffb547;
  --warn-text: #ffd59a;
  --info: #62c3ff;
  --info-text: #a9dcff;

  --text: #eef2ff;
  --muted: #b9c4e6;
  --faint: #8f9cc6;
  --line: rgba(168, 176, 255, 0.13);
  --line-strong: rgba(184, 190, 255, 0.26);

  --surface: linear-gradient(180deg, rgba(15, 21, 56, 0.8), rgba(9, 13, 36, 0.86));
  --surface-flat: rgba(11, 16, 42, 0.84);
  --surface-sunk: rgba(3, 6, 20, 0.6);
  --glass: rgba(9, 14, 36, 0.78);
  --glass-strong: rgba(7, 11, 30, 0.94);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow: 0 20px 44px -22px rgba(0, 0, 0, 0.75);
  --shadow-lift: 0 28px 56px -24px rgba(0, 0, 0, 0.85);

  --radius-xs: 2px;
  --radius-s: 4px;
  --radius: 6px;
  --radius-l: 8px;
  /* 角落とし（corner-shape: bevel）の大きさ */
  --cut: 10px;
  /* 面の四隅の鍵括弧（左上と右下）。background の先頭に重ねて使う */
  --tick: rgba(205, 178, 255, 0.6);
  --ticks:
    linear-gradient(var(--tick), var(--tick)) 0 0 / 10px 1px no-repeat,
    linear-gradient(var(--tick), var(--tick)) 0 0 / 1px 10px no-repeat,
    linear-gradient(var(--tick), var(--tick)) 100% 100% / 10px 1px no-repeat,
    linear-gradient(var(--tick), var(--tick)) 100% 100% / 1px 10px no-repeat;

  --metal-gold: linear-gradient(180deg, #fffbe8 0%, #ffe7a0 20%, #f5c542 40%, #b47605 54%, #eab52f 66%, #fff1b8 84%, #d39412 100%);
  --metal-silver: linear-gradient(180deg, #ffffff 0%, #eef1fb 30%, #b9c2e6 52%, #f4f6ff 70%, #c9d0ea 100%);
  --metal-platinum: linear-gradient(180deg, #ffffff 0%, #e8edf8 24%, #a9b4cf 50%, #f2f5fc 70%, #bfc8de 100%);
  --metal-diamond: linear-gradient(180deg, #f2fdff 0%, #bdf3ff 26%, #62c3ff 50%, #e3f8ff 70%, #9fd8ff 100%);

  /* NAGA タイプの色（暗い背景用。3D ビューアー naga-3d report/js/types.js と同じ） */
  --t-omega: #FF9898;
  --t-gamma: #66B3FF;
  --t-nishiki: #99FF99;
  --t-hibakari: #FFCC99;
  --t-kagashi: #D6B7FB;
  --t-ananta: #F3F5FA;
  --t-ouroboros: #E3E6EE;
  --t-nu: #7FE3D8;
  --t-sigma: #F7A8E0;

  /* 本文・UI は端末の日本語の書体（Web フォントを読まないので速く、行の高さもずれない）。
     見出しは Murecho、数字・英字の札は Oxanium（数字の幅がそろう） */
  --font-ui: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-display: "Murecho", "M PLUS 1", var(--font-ui); /* M PLUS 1 は Murecho に無い字（牌・鳳・雀）だけ */
  --font-latin: "Oxanium", var(--font-ui);

  --header-h: 64px;
  --header-stick: var(--header-h); /* 上に留まっているヘッダーの高さ（留めない画面では 0） */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- 土台 ---------------------------------------------------------------- */
html { background: var(--night-1); scroll-padding-top: calc(var(--header-stick) + 16px); }
body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.8;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "palt" 0;
  overflow-x: hidden;
}

/* 背景の空間: 上から差す一筋の紫と、下ほど深い紺（ページの長さ全体に敷く） */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1200px 560px at 50% -300px, rgba(124, 78, 228, 0.2), transparent 70%),
    linear-gradient(180deg, #080d24 0, #060a1c 900px, #04060f 100%);
}
/* 上の端だけに鱗紋（三角の連続。NAGA の蛇の鱗）。中央から外へ薄れる */
body::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 820px;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='34.64' viewBox='0 0 40 34.64'%3E%3Cpath d='M0 34.64 L10 17.32 L20 34.64Z M20 34.64 L30 17.32 L40 34.64Z M10 17.32 L20 0 L30 17.32Z' fill='%23a99bff' fill-opacity='.04'/%3E%3Cpath d='M0 34.64 L20 0 L40 34.64 M10 17.32 H30 M0 34.64 H40' fill='none' stroke='%23a99bff' stroke-opacity='.055' stroke-width='.8'/%3E%3C/svg%3E");
  background-position: 50% 0;
  -webkit-mask-image: radial-gradient(900px 520px at 50% 0, #000, transparent 75%);
  mask-image: radial-gradient(900px 520px at 50% 0, #000, transparent 75%);
}

::selection { background: rgba(181, 140, 255, 0.42); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
img, svg, video, canvas { max-width: 100%; }

/* 見出し・ボタン・ラベルは約物を詰める（palt） */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .btn, .nav-link, .badge, .form-label, .n-tile, .modal-title, .dropdown-item, th { font-feature-settings: "palt" 1; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.4;
}
/* 大きな見出しは Murecho（字の形が締まって、端末による差も出ない） */
h1, h2, h3, .h1, .h2, .h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.04em; }
h1, .h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); }
h2, .h2 { font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.75rem); }
h3, .h3 { font-size: clamp(1.15rem, 1.02rem + 0.5vw, 1.35rem); }
h4, .h4 { font-size: 1.1rem; font-weight: 700; }
h5, .h5 { font-size: 1rem; font-weight: 700; }
h6, .h6 { font-size: 0.92rem; font-weight: 700; }
p { margin-bottom: 1rem; }
/* 日本語は文節で折り返す（語の途中で行が切れないように）。長い URL などは枠の中で折り返す */
h1, h2, h3, h4, h5, h6, p, li, dt, dd, td, th, .alert, .n-notice__body, .n-say { word-break: auto-phrase; overflow-wrap: break-word; }
p, li { text-wrap: pretty; }
b, strong { font-weight: 700; color: #fff; }
small, .small { font-size: 0.86em; }
hr { border: 0; border-top: 1px solid var(--line); opacity: 1; color: var(--line); }
ul, ol { padding-left: 1.4em; }
li::marker { color: var(--violet-hi); }
details > summary { cursor: pointer; }

a { color: var(--violet-text); text-decoration-color: rgba(205, 178, 255, 0.45); text-underline-offset: 0.22em; transition: color 0.15s, text-decoration-color 0.15s; }
a:hover { color: #fff; text-decoration-color: currentColor; }

code, kbd, samp { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.88em; }
code { color: var(--info-text); background: rgba(98, 195, 255, 0.08); border: 1px solid rgba(98, 195, 255, 0.16); padding: 0.05em 0.4em; border-radius: var(--radius-xs); }
pre { color: var(--text); background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 1rem; }
pre code { background: none; padding: 0; color: inherit; }
kbd { background: rgba(255, 255, 255, 0.1); color: var(--text); border-radius: var(--radius-xs); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35); }
mark, .mark { background: rgba(252, 204, 44, 0.24); color: #fff; border-radius: var(--radius-xs); padding: 0 0.2em; }
blockquote { border-left: 3px solid var(--violet); padding-left: 1rem; color: var(--muted); }

/* スクロールバー（細く、暗い面に馴染ませる） */
* { scrollbar-width: thin; scrollbar-color: rgba(185, 196, 230, 0.28) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(185, 196, 230, 0.24); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(185, 196, 230, 0.4); }
::-webkit-scrollbar-track { background: transparent; }

/* 数字（点数・NP・料金）は Oxanium（数字の幅がそろう） */
.n-num, .n-latin { font-family: var(--font-latin); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
/* 小さな英字の札（「01 — REPORT」など）。字間を広く取る */
.n-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-family: var(--font-latin); font-weight: 600; font-size: 12px; line-height: 1; letter-spacing: 0.28em; text-transform: uppercase; color: var(--violet-hi); }
.n-eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; opacity: 0.6; }

/* ---- 金属の文字 ------------------------------------------------------------ */
.n-chrome, .n-metal-gold, .n-metal-platinum, .n-metal-diamond {
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.n-chrome { background-image: var(--metal-silver); }
.n-metal-gold { background-image: var(--metal-gold); }
.n-metal-platinum { background-image: var(--metal-platinum); }
.n-metal-diamond { background-image: var(--metal-diamond); }

/* ---- ページの枠 -------------------------------------------------------------- */
/* 中身を組み立てる前にフッターが最初の画面に見えて、組み立てたあとに下へ飛ばないよう、本文の高さを画面の高さ以上にする */
/* ヘッダーは下の線の 1px を足して --header-h + 1px の高さ。その分も引いて、短いページが 1px だけ縦に動かないようにする */
.n-main { flex: 1 0 auto; width: 100%; min-height: calc(100vh - var(--header-h) - 1px); min-height: calc(100dvh - var(--header-h) - 1px); padding-top: 28px; padding-bottom: 64px; }
.n-main > .container, .n-main.container { position: relative; }
@media (max-width: 575.98px) {
  .n-main { padding-top: 16px; padding-bottom: 48px; }
  .container, .container-fluid { padding-left: 16px; padding-right: 16px; }
}

/* 各ページの見出し: 題名と、必要なときだけ 1 行の補足 */
.n-page-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 24px; }
.n-page-head__icon { width: 56px; height: 56px; flex: none; filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.55)) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5)); }
.n-page-head > div { min-width: 0; }
.n-page-head h1 { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); overflow-wrap: anywhere; }
.n-page-head p { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 575.98px) {
  .n-page-head { gap: 12px; margin-bottom: 18px; }
  .n-page-head__icon { width: 44px; height: 44px; }
}

/* ---- ヘッダー ------------------------------------------------------------- */
.n-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(5, 8, 24, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
/* 横向きのスマホなど高さが無い画面では、ヘッダーを上に留めない（本文の高さを空ける） */
@media (max-height: 499.98px) and (max-width: 991.98px) {
  :root { --header-stick: 0px; }
  .n-header { position: relative; }
}
.n-nav { min-height: var(--header-h); padding: 0; }
.n-nav > .container-fluid { gap: 8px; padding-left: clamp(16px, 3vw, 32px); padding-right: clamp(16px, 3vw, 32px); }

.n-brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; color: var(--text); text-decoration: none; margin-right: 24px; padding: 6px 0; }
.n-brand:hover { color: #fff; }
.n-brand__mark { width: 30px; height: 30px; flex: none; }
.n-brand__text { display: grid; gap: 4px; line-height: 1; }
.n-brand__text small { font-size: 9.5px; font-weight: 700; letter-spacing: 0.32em; color: var(--faint); }
/* マークと題字は HTML に直接書いた SVG（templates/brand_logo.html）。題字は字の形の縦横比で、高さだけ決める */
.n-brand__word { display: block; width: auto; height: 18px; aspect-ratio: 431 / 100; }
.n-brand:hover .n-brand__text small { color: var(--muted); }

.n-nav .navbar-nav { gap: 2px; }
.n-nav .nav-link {
  position: relative;
  padding: 8px 12px !important;
  border-radius: var(--radius-s);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}
.n-nav .nav-link:hover, .n-nav .nav-link:focus { color: #fff; background: rgba(255, 255, 255, 0.06); }
.n-nav .nav-link.active { color: #fff; }
.n-nav .nav-link.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--violet-hi);
}
.n-nav .navbar-collapse { justify-content: space-between; }
.n-nav__user { display: flex; align-items: center; gap: 8px; min-width: 0; }
.n-user-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px !important;
  border: 1px solid var(--line) !important; border-radius: var(--radius-s) !important; background: rgba(255, 255, 255, 0.03);
  color: var(--text) !important; font-weight: 700; font-size: 14px;
}
.n-user-btn:hover { background: rgba(255, 255, 255, 0.08); }
.n-user-btn img { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #2a3c8f, #0a1442); object-fit: cover; object-position: 50% 12%; }
.n-user-btn::after { margin-left: 2px; opacity: 0.7; }
.n-login-btn { padding: 7px 16px !important; }
.n-avatar {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-xs); flex: none;
  font-size: 13px; font-weight: 900; color: #fff; line-height: 1;
  background: linear-gradient(135deg, #a57cf2, #6c43c9); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
/* 長い名前は省略記号にする（狭い PC の幅でもメニューの列が画面の外へはみ出さない） */
.n-user-btn__name { max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 992px) and (max-width: 1199.98px) { .n-user-btn__name { max-width: 8em; } }
.n-nav__user .dropdown { min-width: 0; }
.n-user-btn { max-width: 100%; }
.n-dropdown-icon { display: flex; align-items: center; gap: 8px; }

/* お知らせ（info.js が入れる帯）: 左に金の細い線と「NEWS」、日付、本文。点滅はさせない */
.n-notice { position: relative; z-index: 2; border-bottom: 1px solid var(--line); background: rgba(4, 6, 18, 0.72); }
.n-notice__body { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 16px; color: var(--text); font-size: 13px; font-weight: 700; text-decoration: none; line-height: 1.6; }
a.n-notice__body:hover { color: #fff; }
a.n-notice__body:hover .n-notice__text { text-decoration: underline; text-decoration-color: rgba(255, 227, 154, 0.6); text-underline-offset: 0.25em; }
.n-notice__badge { flex: none; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-latin); font-weight: 600; font-size: 11px; line-height: 1; letter-spacing: 0.26em; color: var(--gold-text); }
.n-notice__badge::before { content: ""; width: 3px; height: 14px; background: var(--gold); }
.n-notice__date { flex: none; font-family: var(--font-latin); font-weight: 600; color: var(--muted); letter-spacing: 0.04em; }
.n-notice__go { flex: none; width: 14px; height: 14px; fill: none; stroke: var(--gold-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s var(--ease-out); }
a.n-notice__body:hover .n-notice__go { transform: translateX(3px); }
@media (max-width: 575.98px) {
  .n-notice__body { justify-content: flex-start; gap: 10px; padding: 7px 16px; font-size: 12px; line-height: 1.5; }
  .n-notice__go { display: none; }
}

/* ログアウトの確認 */
.n-logout { display: grid; justify-items: center; gap: 4px; padding-top: 1.6rem; text-align: center; }
.n-logout__naga { width: 120px; height: auto; filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.5)) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45)); }
.n-logout-dialog { max-width: 380px; }
.n-logout + .modal-footer { flex-wrap: nowrap; justify-content: center; gap: 10px; border-top: 0; padding: 0.4rem 1.4rem 1.5rem; }
.n-logout + .modal-footer > .btn { flex: 1 1 0; margin: 0; }

.n-nav .navbar-toggler { place-items: center; min-width: 44px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 8px 10px; color: var(--text); }
.n-nav .navbar-toggler:focus { box-shadow: none; }
.n-burger { display: block; width: 20px; height: 14px; position: relative; }
.n-burger::before, .n-burger::after, .n-burger span { content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.25s var(--ease-out), opacity 0.2s; }
.n-burger::before { top: 0; }
.n-burger span { top: 6px; }
.n-burger::after { bottom: 0; }
.navbar-toggler[aria-expanded="true"] .n-burger::before { transform: translateY(6px) rotate(45deg); }
.navbar-toggler[aria-expanded="true"] .n-burger span { opacity: 0; }
.navbar-toggler[aria-expanded="true"] .n-burger::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 991.98px) {
  .n-nav .navbar-toggler { display: inline-grid; }
  /* 1 段目（ロゴとボタン）の高さをヘッダーの高さに固定する（メニューを開いて段が増えても、ロゴとボタンが上に跳ねない） */
  .n-nav .n-brand { min-height: var(--header-h); padding: 0; }
  /* 開いたメニューは画面の高さに収め、はみ出す分はメニューの中でスクロールする（横向きのスマホでも下まで届く） */
  .n-nav .navbar-collapse { padding: 8px 0 16px; max-height: calc(100dvh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain; }
  body.n-menu-open .n-header { background: #050a20; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .n-nav .navbar-nav { gap: 4px; }
  .n-nav .nav-link { padding: 12px 14px !important; font-size: 15px; }
  .n-nav .nav-link.active { background: rgba(181, 140, 255, 0.1); }
  .n-nav .nav-link.active::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 2px; height: auto; }
  .n-nav__user { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); align-items: stretch; }
  .n-nav__account { display: grid; gap: 4px; }
  .n-nav__who { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; padding: 6px 14px; color: var(--muted); font-weight: 700; font-size: 14px; }
  /* メニューの中のログインは、ほかの項目と同じ高さで幅いっぱいに */
  .n-nav__user .n-login-btn { align-self: stretch; display: flex; align-items: center; justify-content: center; min-height: 51px; font-size: 15px; }
}

/* スマホのメニューを開いている間の幕（押すと閉じる。site.js） */
.n-menu-backdrop { position: fixed; inset: 0; z-index: 1029; background: rgba(1, 3, 11, 0.62); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
body.n-menu-open .n-menu-backdrop { opacity: 1; pointer-events: auto; }
@media (min-width: 992px) { .n-menu-backdrop { display: none; } }

/* ---- フッター ------------------------------------------------------------- */
.n-footer { position: relative; margin-top: auto; padding: 40px 0 32px; border-top: 1px solid var(--line); background: rgba(2, 4, 12, 0.72); color: var(--faint); font-size: 13px; }
.n-footer__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 32px; }
.n-footer__links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.n-footer__links a { color: var(--muted); text-decoration: none; font-weight: 700; }
.n-footer__links a:hover { color: #fff; }
.n-footer__copy { margin: 0; font-family: var(--font-latin); letter-spacing: 0.08em; }
.n-footer .n-brand { margin-right: 0; }
.n-footer .n-brand__mark { width: 24px; height: 24px; }
.n-footer .n-brand__word { height: 15px; }
@media (max-width: 575.98px) {
  .n-footer { padding: 32px 0 calc(28px + env(safe-area-inset-bottom)); }
  .n-footer__inner { flex-direction: column; align-items: flex-start; }
  .n-footer__links { gap: 0 22px; }
  .n-footer__links a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ---- 面（パネル） ------------------------------------------------------------ */
.n-panel, .card {
  position: relative;
  background: var(--ticks), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  box-shadow: var(--highlight), var(--shadow);
  color: var(--text);
}
/* 右上と左下の角を落とす（鍵括弧は左上と右下） */
@supports (corner-shape: bevel) {
  .n-panel, .card { border-radius: 0 var(--cut) 0 var(--cut); corner-shape: bevel; }
}
.n-panel { padding: clamp(18px, 2.4vw, 28px); }
.n-panel--sunk { background: var(--surface-sunk); box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3); }
.card-header, .card-footer { background: rgba(255, 255, 255, 0.03); border-color: var(--line); color: var(--text); }
.card-header:first-child { border-radius: 0; }
.card-footer:last-child { border-radius: 0; }
.card-title { color: #fff; font-weight: 900; }
.card-subtitle, .card-text { color: var(--muted); }
.card-img-top { border-top-left-radius: 0; border-top-right-radius: 0; }

/* ページの中の状態の知らせ（エラーなど）: NAGA・見出し・一文・次にすること */
.n-state {
  display: grid; justify-items: center; gap: 8px;
  max-width: 520px; margin: 24px auto; padding: 32px 28px 30px;
  text-align: center;
  border-radius: var(--radius-s); border: 1px solid var(--line);
  background: var(--ticks), var(--surface); box-shadow: var(--highlight), var(--shadow);
}
.n-state--error {
  --tick: rgba(255, 122, 147, 0.8);
  --ticks:
    linear-gradient(var(--tick), var(--tick)) 0 0 / 10px 1px no-repeat,
    linear-gradient(var(--tick), var(--tick)) 0 0 / 1px 10px no-repeat,
    linear-gradient(var(--tick), var(--tick)) 100% 100% / 10px 1px no-repeat,
    linear-gradient(var(--tick), var(--tick)) 100% 100% / 1px 10px no-repeat;
  border-top-color: rgba(255, 84, 112, 0.5);
}
.n-state__naga { width: 120px; height: auto; margin-bottom: 4px; filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.55)) drop-shadow(0 10px 16px rgba(0, 0, 0, 0.45)); }
.n-state__title { margin: 0; font-size: 1.15rem; font-weight: 900; color: #fff; }
.n-state__text { margin: 0; color: var(--muted); }
.n-state__action { margin-top: 12px; min-width: 160px; }
/* 面の中で使う小さめの形（一覧の中など）。枠と背景は外の面にまかせる */
.n-state--inline { margin: 8px auto; padding: 18px 12px 16px; border: 0; background: none; box-shadow: none; }
.n-state--inline .n-state__naga { width: 84px; }
.n-state--inline .n-state__title { font-size: 1rem; }
.n-state--inline .n-state__action { margin-top: 6px; }

/* NAGA のセリフ（白い吹き出し。3D ビューアーの解説と同じ） */
.n-say {
  position: relative; display: inline-block; max-width: 100%;
  padding: 12px 18px; border-radius: 12px; background: #f7f8fd; color: var(--navy-ink);
  font-weight: 700; line-height: 1.6; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.n-say::before { content: ""; position: absolute; left: -7px; top: 50%; width: 16px; height: 16px; background: inherit; transform: translateY(-50%) rotate(45deg); border-radius: 3px; }
.n-say--top::before { left: 28px; top: auto; bottom: -7px; transform: rotate(45deg); }
.n-say b, .n-say strong { color: var(--navy-ink); box-shadow: inset 0 -0.42em 0 rgba(181, 140, 255, 0.45); }

/* タイプの色の札 */
.n-type { --c: var(--t-kagashi); display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px 1px 8px; border-radius: var(--radius-xs); font-weight: 700; font-size: 0.86em; line-height: 1.7; color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); white-space: nowrap; }
.n-type::before { content: ""; width: 6px; height: 6px; background: var(--c); transform: rotate(45deg); }
.n-type--omega { --c: var(--t-omega); }
.n-type--gamma { --c: var(--t-gamma); }
.n-type--nishiki { --c: var(--t-nishiki); }
.n-type--hibakari { --c: var(--t-hibakari); }
.n-type--kagashi { --c: var(--t-kagashi); }
.n-type--ananta { --c: var(--t-ananta); }
.n-type--ouroboros { --c: var(--t-ouroboros); }
.n-type--ouroboros::before { background: #0c0c11; box-shadow: 0 0 0 1px var(--t-ouroboros); }
.n-type--nu { --c: var(--t-nu); }
.n-type--sigma { --c: var(--t-sigma); }

/* 麻雀牌の形の札（白い表・紺の背）。選ぶもの（サービス・タイプ）にだけ使う */
.n-tile {
  position: relative;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f2f4fb 70%, #e4e8f4 100%);
  color: var(--navy-ink);
  box-shadow: inset 0 -2px 0 rgba(4, 28, 92, 0.08), 0 7px 0 -1px #13235e, 0 8px 0 0 #0a1442, 0 18px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.n-tile a { color: var(--violet-deep); }

/* ---- ボタン --------------------------------------------------------------- */
/* 角は右上と左下を落とす。乗せると明るく、押すと少し沈む（波紋や光る影は付けない） */
.btn {
  --n-btn-glow: transparent;
  --cut: 9px;
  border-radius: var(--radius-s);
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.5rem 1.15rem;
  line-height: 1.6;
  transition: transform 0.12s var(--ease-out), box-shadow 0.2s, background-color 0.18s, border-color 0.18s, color 0.15s, filter 0.2s;
}
@supports (corner-shape: bevel) {
  .btn { border-radius: 0 var(--cut) 0 var(--cut); corner-shape: bevel; }
  .btn-group > .btn:not(:last-child):not(.dropdown-toggle), .btn-group > .btn-group:not(:last-child) > .btn { border-radius: 0 0 0 var(--cut); }
  .btn-group > .btn:nth-child(n+3), .btn-group > :not(.btn-check) + .btn, .btn-group > .btn-group:not(:first-child) > .btn { border-radius: 0 var(--cut) 0 0; }
}
.btn:focus { box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; box-shadow: none; }
/* corner-shape が使えない環境（Safari など）: 角は丸めずに直角に近くし、塗りのボタンだけ clip-path で右上と左下を落とす
   （塗りのボタンは枠の線が目立たないので、斜めの辺に線が無くても切れ目に見えない）。
   キーボードで選んでいる間は、フォーカスの輪が切れないよう落とさない */
@supports not (corner-shape: bevel) {
  .btn, .n-panel, .card, .modal-content, .n-login__btn { border-radius: var(--radius-xs); }
  /* ページの CSS で角を落としている面も、丸めずに直角に近くする（ページの CSS は後から読むので強めに指定する） */
  .o-wallet, .o-actions, .t-plan, .pu-plan, .mp-total, .mp-avatar, .ak-doclink, .ak-doclink__icon, .ak-plain__icon, .ak-main:empty, .sv-cond, button.sv-total, .s-when { border-radius: var(--radius-xs) !important; }
  .btn-primary:not(:focus-visible), .btn-warning:not(:focus-visible), .btn-success:not(:focus-visible), .btn-danger:not(:focus-visible), .btn-info:not(:focus-visible), .n-login__btn:not(:focus-visible) {
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  }
}

.btn:active:not(:disabled):not(.disabled) { transform: translateY(1px); }
.btn-lg { --cut: 12px; padding: 0.75rem 1.6rem; font-size: 1.02rem; }
.btn-sm { --cut: 6px; padding: 0.3rem 0.75rem; font-size: 0.85rem; }
.btn.disabled:not(.is-busy), .btn:disabled:not(.is-busy), fieldset:disabled .btn { opacity: 0.5; box-shadow: none !important; filter: saturate(0.6); }
/* 送信中のボタン（is-busy と aria-busy を付ける）: 見た目はそのまま、回転の印を出して押せなくする */
.btn.is-busy { opacity: 1; filter: none; pointer-events: none; cursor: progress; }
.btn.is-busy::before { content: ""; display: inline-block; flex: none; width: 1.05em; height: 1.05em; margin-right: 0.5em; vertical-align: -0.17em; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: n-spin 0.8s linear infinite; }
@keyframes n-spin { to { transform: rotate(360deg); } }
/* 読み込み中の骨組み（中身が届くまで、同じくらいの大きさの淡い帯を出す） */
.n-skel { display: inline-block; width: 100%; height: 0.9em; border-radius: var(--radius-xs); vertical-align: middle; background: linear-gradient(90deg, rgba(185, 196, 230, 0.06) 0%, rgba(185, 196, 230, 0.14) 50%, rgba(185, 196, 230, 0.06) 100%); background-size: 200% 100%; animation: n-skel 1.4s ease-in-out infinite; }
@keyframes n-skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* 主ボタン: NAGA の紫の平らな面。上に細い光、下に細い影（押せる板の厚み） */
.btn-primary, .btn-primary:focus {
  color: #fff;
  background: #7c4ee4;
  border: 1px solid rgba(214, 196, 255, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -2px 0 rgba(20, 0, 60, 0.28);
  text-shadow: none;
}
.btn-primary:hover, .btn-primary:focus:hover {
  color: #fff;
  background: #8c60f0;
  border-color: rgba(230, 214, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -2px 0 rgba(20, 0, 60, 0.28), 0 10px 26px -12px rgba(124, 78, 228, 0.9);
}
/* タッチ端末では、押したあとに「乗せた」見た目が残らないよう、乗せた見た目をふだんの見た目に戻す
   （押している間と .active には効かせない（:where で詳細度は元の :hover と同じまま）。選んだ状態の :checked はこの後に書くので、そちらが勝つ） */
@media (hover: none) {
  .btn-primary:hover:where(:not(:active, .active)), .btn-primary:focus:hover:where(:not(:active, .active)) { background: #7c4ee4; border-color: rgba(214, 196, 255, 0.3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -2px 0 rgba(20, 0, 60, 0.28); }
}
.btn-primary:active, .btn-primary.active, .btn-check:checked + .btn-primary, .btn-check:active + .btn-primary { color: #fff; background: #6a40cc; border-color: rgba(214, 196, 255, 0.36); box-shadow: inset 0 2px 0 rgba(20, 0, 60, 0.3); }
/* 押せない主ボタン: 文字は読めるまま、点線の枠で「まだ押せない」ことを示す */
.btn-primary.disabled:not(.is-busy), .btn-primary:disabled:not(.is-busy), .btn-primary:disabled:focus:not(.is-busy), .btn-primary.disabled:focus:not(.is-busy) { opacity: 1; filter: none; color: var(--violet-text); background: rgba(181, 140, 255, 0.06); border: 1px dashed rgba(181, 140, 255, 0.5); box-shadow: none !important; text-shadow: none; }

.btn-outline-primary { color: var(--violet-text); border: 1px solid rgba(181, 140, 255, 0.5); background: transparent; }
.btn-outline-primary:hover, .btn-outline-primary:focus:hover { color: #fff; background: rgba(181, 140, 255, 0.12); border-color: var(--violet-hi); }
@media (hover: none) { .btn-outline-primary:hover:where(:not(:active, .active)), .btn-outline-primary:focus:hover:where(:not(:active, .active)) { color: var(--violet-text); background: transparent; border-color: rgba(181, 140, 255, 0.5); } }
.btn-check:checked + .btn-outline-primary, .btn-check:active + .btn-outline-primary, .btn-outline-primary.active, .btn-outline-primary.dropdown-toggle.show, .btn-outline-primary:active {
  color: #fff; background: rgba(124, 78, 228, 0.55); border-color: var(--violet-hi);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn-check:focus-visible + .btn { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-check:focus + .btn-outline-primary, .btn-outline-primary:focus, .btn-check:focus + .btn-outline-secondary, .btn-outline-secondary:focus, .btn-check:focus + .btn-primary, .btn-check:focus + .btn-secondary, .btn-secondary:focus, .btn-check:focus + .btn-light, .btn-light:focus { box-shadow: none; }

/* 二番手のボタン: 薄い面と細い枠（フォーカス中も同じ。Bootstrap の .btn-secondary:focus の灰色を出さない） */
.btn-secondary, .btn-light, .btn-dark, .btn-secondary:focus, .btn-light:focus, .btn-dark:focus {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line-strong);
  box-shadow: var(--highlight);
}
.btn-secondary:hover, .btn-light:hover, .btn-dark:hover, .btn-secondary:focus:hover, .btn-light:focus:hover { color: #fff; background: rgba(255, 255, 255, 0.085); border-color: rgba(205, 178, 255, 0.5); }
@media (hover: none) { :is(.btn-secondary, .btn-light, .btn-dark):hover:where(:not(:active, .active)), :is(.btn-secondary, .btn-light):focus:hover:where(:not(:active, .active)) { color: var(--text); background: rgba(255, 255, 255, 0.045); border-color: var(--line-strong); } }
.btn-secondary:active, .btn-secondary.active, .btn-light:active, .btn-light.active, .btn-check:checked + .btn-secondary, .btn-check:checked + .btn-light { color: #fff; background: rgba(124, 78, 228, 0.4); border-color: var(--violet-hi); }
/* 押している間にフォーカスが付いても、Bootstrap の輪（.btn-*:active:focus の 0 0 0 .25rem）を出さず、押した見た目のままにする */
.btn-primary:active:focus, .btn-primary.active:focus, .btn-check:active + .btn-primary:focus, .btn-check:checked + .btn-primary:focus { box-shadow: inset 0 2px 0 rgba(20, 0, 60, 0.3); }
:is(.btn-secondary, .btn-light, .btn-dark):active:focus, :is(.btn-secondary, .btn-light, .btn-dark).active:focus, .btn-check:active + :is(.btn-secondary, .btn-light):focus, .btn-check:checked + :is(.btn-secondary, .btn-light):focus { box-shadow: var(--highlight); }
.btn-outline-primary:active:focus, .btn-check:active + .btn-outline-primary:focus, .btn-check:checked + .btn-outline-primary:focus { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16); }
:is(.btn-outline-secondary, .btn-outline-light, .btn-outline-dark):active:focus, .btn-check:active + .btn-outline-secondary:focus, .btn-check:checked + .btn-outline-secondary:focus { box-shadow: none; }
:is(.btn-success, .btn-warning, .btn-danger, .btn-info):active:focus, :is(.btn-success, .btn-warning, .btn-danger, .btn-info).active:focus, .btn-check:checked + :is(.btn-success, .btn-warning, .btn-danger, .btn-info):focus { box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.2); }
:is(.btn-outline-success, .btn-outline-warning, .btn-outline-danger, .btn-outline-info):active:focus, .btn-check:active + :is(.btn-outline-success, .btn-outline-warning, .btn-outline-danger, .btn-outline-info):focus, .btn-check:checked + :is(.btn-outline-success, .btn-outline-warning, .btn-outline-danger, .btn-outline-info):focus { box-shadow: none; }
.btn-secondary.disabled, .btn-secondary:disabled, .btn-light.disabled, .btn-light:disabled { color: var(--muted); background: rgba(255, 255, 255, 0.03); border-color: var(--line); }

.btn-outline-secondary, .btn-outline-light, .btn-outline-dark { color: var(--muted); border: 1px solid var(--line-strong); background: transparent; }
.btn-outline-secondary:hover, .btn-outline-light:hover, .btn-outline-dark:hover { color: #fff; background: rgba(255, 255, 255, 0.06); border-color: rgba(205, 178, 255, 0.5); }
@media (hover: none) { :is(.btn-outline-secondary, .btn-outline-light, .btn-outline-dark):hover:where(:not(:active, .active)) { color: var(--muted); background: transparent; border-color: var(--line-strong); } }
.btn-check:checked + .btn-outline-secondary, .btn-check:active + .btn-outline-secondary, .btn-outline-secondary.active, .btn-outline-secondary:active, .btn-outline-secondary.dropdown-toggle.show,
.btn-check:checked + .btn-outline-dark, .btn-outline-dark.active, .btn-check:checked + .btn-outline-light, .btn-outline-light.active {
  color: #fff; background: rgba(124, 78, 228, 0.36); border-color: var(--violet-hi); box-shadow: none;
}

.btn-success { color: #032417; background: #3ddc97; border: 1px solid rgba(160, 255, 210, 0.5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 50, 30, 0.25); }
.btn-success:hover { color: #021a10; background: #5fe6ac; border-color: rgba(190, 255, 225, 0.7); }
.btn-outline-success { color: var(--good-text); border-color: rgba(61, 220, 151, 0.5); }
.btn-outline-success:hover, .btn-check:checked + .btn-outline-success { color: #032417; background: var(--good); border-color: var(--good); }
.btn-danger { color: #fff; background: #d81450; border: 1px solid rgba(255, 150, 170, 0.45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -2px 0 rgba(70, 0, 20, 0.3); }
.btn-danger:hover { color: #fff; background: #e8285f; border-color: rgba(255, 180, 195, 0.6); }
.btn-outline-danger { color: var(--crimson-text); border-color: rgba(255, 84, 112, 0.5); }
.btn-outline-danger:hover, .btn-check:checked + .btn-outline-danger { color: #fff; background: rgba(204, 4, 68, 0.75); border-color: #ff5470; }
.btn-warning { color: #1d1400; background: #f2c94c; border: 1px solid rgba(255, 240, 190, 0.6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 0 rgba(90, 60, 0, 0.25); text-shadow: none; }
.btn-warning:hover { color: #1d1400; background: #f7d466; border-color: rgba(255, 244, 205, 0.85); }
.btn-outline-warning { color: var(--gold-text); border-color: rgba(252, 204, 44, 0.5); }
.btn-outline-warning:hover, .btn-check:checked + .btn-outline-warning { color: #1d1400; background: var(--gold); border-color: var(--gold); }
.btn-info { color: #03202f; background: #7ccdff; border: 1px solid rgba(190, 230, 255, 0.6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 40, 70, 0.25); }
.btn-info:hover { color: #021a28; background: #96d7ff; }
.btn-outline-info { color: var(--info-text); border-color: rgba(98, 195, 255, 0.5); }
.btn-outline-info:hover { color: #04263a; background: var(--info); }
.btn-link { color: var(--violet-text); font-weight: 700; }
.btn-link:hover { color: #fff; }

.btn-group > .btn-check:checked + .btn, .btn-group > .btn.active { z-index: 1; }
.btn-group > .btn:not(:last-child):not(.dropdown-toggle), .btn-group > .btn-group:not(:last-child) > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-group > .btn:nth-child(n+3), .btn-group > :not(.btn-check) + .btn, .btn-group > .btn-group:not(:first-child) > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }

.btn-close { filter: invert(1) grayscale(1) brightness(1.6); opacity: 0.7; border-radius: var(--radius-xs); }
.btn-close:hover { opacity: 1; }
.btn-close:focus { box-shadow: none; }
.btn-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-close-white { filter: none; }

/* ---- フォーム -------------------------------------------------------------- */
.form-label, .col-form-label { color: var(--muted); font-weight: 700; font-size: 0.92rem; }
.form-text { color: var(--faint); }
.form-control, .form-select {
  color: var(--text);
  background-color: rgba(3, 6, 20, 0.6);
  border: 1px solid rgba(168, 176, 255, 0.22);
  border-radius: var(--radius-s);
  padding: 0.55rem 0.85rem;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.form-control::placeholder { color: #6f7ca6; opacity: 1; }
.form-control:hover, .form-select:hover { border-color: rgba(180, 200, 255, 0.4); }
.form-control:focus, .form-select:focus {
  color: #fff;
  background-color: rgba(8, 12, 36, 0.9);
  border-color: var(--violet-hi);
  box-shadow: 0 0 0 1px var(--violet-hi), 0 0 0 4px rgba(181, 140, 255, 0.12);
}
.form-control:disabled, .form-control[readonly], .form-select:disabled { color: var(--faint); background-color: rgba(255, 255, 255, 0.03); border-color: var(--line); opacity: 1; }
.form-control-plaintext { color: var(--text); }
.form-control-sm, .form-select-sm { padding-top: 0.3rem; padding-bottom: 0.3rem; font-size: 0.875rem; border-radius: var(--radius-s); }
.form-control-lg, .form-select-lg { border-radius: var(--radius-s); }
.form-select {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23b9c4e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}
.form-select option, .form-select optgroup, select option { background-color: #0a1230; color: var(--text); }
textarea.form-control { line-height: 1.6; }
.form-control[type="file"]::file-selector-button { color: var(--text); background: rgba(255, 255, 255, 0.08); border-color: var(--line); }
.form-control:hover:not(:disabled):not([readonly])::file-selector-button { background: rgba(255, 255, 255, 0.14); }
.form-control-color { padding: 0.375rem; }

.form-check-input { background-color: rgba(3, 6, 20, 0.6); border: 1px solid rgba(184, 190, 255, 0.45); }
.form-check-input[type="checkbox"] { border-radius: var(--radius-xs); }
.form-check-input:checked { background-color: #7c4ee4; border-color: var(--violet-hi); }
.form-check-input:focus { border-color: var(--violet-hi); box-shadow: 0 0 0 3px rgba(181, 140, 255, 0.2); }
.form-check-input[type="checkbox"]:indeterminate { background-color: var(--violet-lo); border-color: var(--violet-hi); }
.form-check-input:disabled { opacity: 0.4; }
.form-check-label { color: var(--text); }
.form-switch .form-check-input { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28185, 196, 230, 0.7%29'/%3e%3c/svg%3e"); }
.form-switch .form-check-input:focus { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23cdb2ff'/%3e%3c/svg%3e"); }
.form-switch .form-check-input:checked { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); }
.form-range::-webkit-slider-thumb { background: var(--violet-hi); }
.form-range::-moz-range-thumb { background: var(--violet-hi); }
.form-range::-webkit-slider-runnable-track { background: rgba(255, 255, 255, 0.12); }
.form-range::-moz-range-track { background: rgba(255, 255, 255, 0.12); }
.form-floating > label { color: var(--faint); }
.form-floating > .form-control:focus ~ label, .form-floating > .form-control:not(:placeholder-shown) ~ label, .form-floating > .form-select ~ label { color: var(--violet-text); opacity: 0.9; }
.input-group-text { color: var(--muted); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(168, 176, 255, 0.22); border-radius: var(--radius-s); }
.invalid-feedback { color: var(--crimson-text); }
.form-control.is-invalid, .was-validated .form-control:invalid, .form-select.is-invalid { border-color: #ff5470; }
.form-control.is-valid, .was-validated .form-control:valid { border-color: var(--good); }
input[type="date"], input[type="time"], input[type="datetime-local"] { color-scheme: dark; }

/* ---- 表 --------------------------------------------------------------------- */
.table {
  --bs-table-bg: transparent;
  --bs-table-accent-bg: transparent;
  --bs-table-striped-color: var(--text);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.025);
  --bs-table-active-color: var(--text);
  --bs-table-active-bg: rgba(181, 140, 255, 0.12);
  --bs-table-hover-color: #fff;
  --bs-table-hover-bg: rgba(181, 140, 255, 0.08);
  color: var(--text);
  border-color: var(--line);
  vertical-align: middle;
}
.table > :not(caption) > * > * { padding: 0.7rem 0.8rem; border-bottom-color: var(--line); }
/* 見出しの段は地を塗らず、小さめの字と強めの線で分ける */
.table > thead > tr > th, .table > thead > tr > td, .table th { color: var(--faint); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; }
.table > thead { background: none; }
.table > :not(:last-child) > :last-child > * { border-bottom-color: var(--line-strong); }
/* 乗せた行は左端に紫の線（行の文字は動かさない） */
.table-hover > tbody > tr:hover > :first-child { box-shadow: inset 2px 0 0 var(--violet-hi), inset 0 0 0 9999px var(--bs-table-accent-bg); }
.table-bordered > :not(caption) > * { border-color: var(--line); }
.table-sm > :not(caption) > * > * { padding: 0.4rem 0.5rem; }
.thead-dark th, .table-dark { color: var(--muted); background: rgba(3, 8, 28, 0.7); border-color: var(--line); }
.table-light { --bs-table-bg: rgba(255, 255, 255, 0.05); color: var(--text); border-color: var(--line); }
.table-primary { --bs-table-bg: rgba(181, 140, 255, 0.16); color: #fff; border-color: rgba(181, 140, 255, 0.3); }
.table-secondary { --bs-table-bg: rgba(255, 255, 255, 0.06); color: var(--text); border-color: var(--line); }
.table-success { --bs-table-bg: rgba(61, 220, 151, 0.12); color: #fff; border-color: rgba(61, 220, 151, 0.25); }
.table-danger { --bs-table-bg: rgba(255, 84, 112, 0.14); color: #fff; border-color: rgba(255, 84, 112, 0.28); }
.table-warning { --bs-table-bg: rgba(252, 204, 44, 0.12); color: #fff; border-color: rgba(252, 204, 44, 0.25); }
.table-info { --bs-table-bg: rgba(98, 195, 255, 0.12); color: #fff; border-color: rgba(98, 195, 255, 0.25); }
table.report th { background: #0c1538 !important; }
.table-responsive { border-radius: var(--radius-xs); }

/* ---- タブ --------------------------------------------------------------------- */
/* 選んでいるタブは白い字と 2px の下線（中央にひし形）。site.js が下線を 1 本にまとめて、選び直すと幅を変えながら移す */
.nav-tabs { position: relative; border-bottom: 1px solid var(--line); gap: 2px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.nav-tabs .nav-link {
  position: relative;
  margin-bottom: 0;
  padding: 0.75rem 1.1rem;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  background: transparent;
  transition: color 0.15s, background-color 0.15s;
}
.nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus { color: #fff; background: rgba(255, 255, 255, 0.03); border: 0; }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { color: #fff; background: transparent; border: 0; }
.nav-tabs .nav-link.active::after, .n-ink {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  background: var(--violet-hi);
}
.nav-tabs .nav-link.active::before, .n-ink::before { content: ""; position: absolute; left: 50%; bottom: -1px; width: 6px; height: 6px; margin-left: -3px; background: var(--violet-hi); transform: rotate(45deg); }
.nav-tabs .nav-link.active::before { bottom: 0; }
.n-ink::before { bottom: -2px; }
.nav-tabs .nav-link.disabled { color: rgba(185, 196, 230, 0.35); }
/* 動く下線（site.js）がある間は、タブごとの下線を隠す */
.has-ink .nav-link.active::after, .has-ink .nav-link.active::before, .has-ink [aria-selected="true"]::after { opacity: 0; }
@property --ink-l { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --ink-r { syntax: "<length>"; inherits: false; initial-value: 0px; }
.n-ink {
  right: auto; left: var(--ink-l); width: calc(var(--ink-r) - var(--ink-l));
  pointer-events: none; z-index: 2;
  transition: --ink-l 0.18s var(--ease-out), --ink-r 0.12s var(--ease-out), opacity 0.2s;
}
.n-ink.is-back { transition: --ink-l 0.12s var(--ease-out), --ink-r 0.18s var(--ease-out), opacity 0.2s; }
.n-ink.is-still { transition: none; }
/* 板（data-n-ink="plate"）: 選んでいるタブの下に敷く */
.n-ink--plate { bottom: auto; z-index: 0; height: auto; background: rgba(124, 78, 228, 0.22); box-shadow: inset 0 0 0 1px rgba(181, 140, 255, 0.5), inset 0 -2px 0 var(--violet-hi); border-radius: var(--radius-xs); transition: --ink-l 0.18s var(--ease-out), --ink-r 0.12s var(--ease-out), top 0.18s var(--ease-out), height 0.18s var(--ease-out), opacity 0.2s; }
.n-ink--plate::before { display: none; }
.nav-pills .nav-link { color: var(--muted); font-weight: 700; border-radius: var(--radius-s); }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { color: #fff; background: rgba(124, 78, 228, 0.5); box-shadow: inset 0 0 0 1px rgba(181, 140, 255, 0.6); }
.nav-link { color: var(--violet-text); }
.nav-link:hover, .nav-link:focus { color: #fff; }

/* ---- お知らせ --------------------------------------------------------------- */
/* 重要度の色の細い枠と、左上・右下の鍵括弧。面は薄く塗るだけ */
.alert {
  --n-c: 181, 140, 255;
  border: 1px solid rgba(var(--n-c), 0.28);
  border-radius: var(--radius-xs);
  background:
    linear-gradient(rgb(var(--n-c)), rgb(var(--n-c))) 0 0 / 10px 1px no-repeat,
    linear-gradient(rgb(var(--n-c)), rgb(var(--n-c))) 0 0 / 1px 10px no-repeat,
    linear-gradient(rgb(var(--n-c)), rgb(var(--n-c))) 100% 100% / 10px 1px no-repeat,
    linear-gradient(rgb(var(--n-c)), rgb(var(--n-c))) 100% 100% / 1px 10px no-repeat,
    rgba(var(--n-c), 0.06);
  color: var(--text);
  box-shadow: none;
  padding: 0.85rem 1.1rem;
}
.alert a, .alert .alert-link { color: #fff; font-weight: 700; }
.alert-primary { --n-c: 181, 140, 255; }
.alert-secondary, .alert-light, .alert-dark { --n-c: 185, 196, 230; }
.alert-success { --n-c: 61, 220, 151; }
.alert-danger { --n-c: 255, 84, 112; }
.alert-warning { --n-c: 255, 181, 71; }
.alert-info { --n-c: 98, 195, 255; }
.alert-success strong, .alert-success b { color: var(--good-text); }
.alert-danger strong, .alert-danger b { color: #ffb3c0; }
.alert-warning strong, .alert-warning b { color: var(--warn-text); }
.alert-info strong, .alert-info b { color: var(--info-text); }
.alert-heading { color: #fff; }
.alert-dismissible .btn-close { padding: 1.05rem 1rem; }

/* ---- バッジ・色の小物 -------------------------------------------------------- */
.badge { font-weight: 700; letter-spacing: 0.04em; border-radius: var(--radius-xs); padding: 0.36em 0.65em; }
.bg-primary { background-color: var(--violet-lo) !important; }
.bg-secondary { background-color: #39456f !important; }
.bg-success { background-color: #1f9d6b !important; }
.bg-danger { background-color: #c8103f !important; }
.bg-warning { background-color: #f0b429 !important; color: #2a1d00; }
.bg-info { background-color: #2e8fd0 !important; }
.bg-light { background-color: rgba(255, 255, 255, 0.07) !important; color: var(--text); }
.bg-white { background-color: rgba(255, 255, 255, 0.05) !important; color: var(--text); }
.bg-dark { background-color: #070d26 !important; }
.bg-body { background-color: transparent !important; }
.bg-transparent { background-color: transparent !important; }
.text-muted { color: var(--faint) !important; }
.text-secondary { color: var(--muted) !important; }
.text-body, .text-black, .text-reset { color: var(--text) !important; }
.text-dark { color: var(--text) !important; }
.bg-warning.text-dark, .bg-warning .text-dark, .bg-light .text-dark.badge, .n-tile .text-dark { color: #2a1d00 !important; }
.text-white { color: #fff !important; }
.text-primary { color: var(--violet-text) !important; }
.text-success { color: var(--good-text) !important; }
.text-danger { color: var(--crimson-text) !important; }
.text-warning { color: var(--warn-text) !important; }
.text-info { color: var(--info-text) !important; }
.link-primary { color: var(--violet-text) !important; }
.border { border-color: var(--line) !important; }
.border-top, .border-bottom, .border-start, .border-end { border-color: var(--line) !important; }
.border-dark, .border-secondary, .border-light { border-color: var(--line-strong) !important; }
.border-primary { border-color: var(--violet-hi) !important; }
.border-success { border-color: rgba(61, 220, 151, 0.7) !important; }
.border-danger { border-color: rgba(255, 84, 112, 0.7) !important; }
.border-warning { border-color: rgba(252, 204, 44, 0.7) !important; }
.shadow-sm { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.rounded { border-radius: var(--radius-s) !important; }
.rounded-pill { border-radius: var(--radius-xs) !important; }

/* ---- 一覧 ------------------------------------------------------------------- */
.list-group { --n-r: var(--radius-s); }
.list-group-item { color: var(--text); background: rgba(255, 255, 255, 0.03); border-color: var(--line); }
.list-group-item.active { color: #fff; background: rgba(181, 140, 255, 0.24); border-color: var(--violet-hi); }
.list-group-item-action:hover, .list-group-item-action:focus { color: #fff; background: rgba(255, 255, 255, 0.06); }
.list-group-item.disabled, .list-group-item:disabled { color: var(--faint); background: transparent; }

/* ---- 重ねて出すもの（モーダル・ドロップダウン） ------------------------------- */
.modal-backdrop { background-color: #01030b; }
.modal-backdrop.show { opacity: 0.72; }
.modal-content {
  color: var(--text);
  background: var(--ticks), linear-gradient(180deg, #111a46 0%, #0a1132 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 30px 80px rgba(0, 0, 0, 0.6);
}
@supports (corner-shape: bevel) { .modal-content { border-radius: 0 14px 0 14px; corner-shape: bevel; } }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-header { padding: 1.1rem 1.4rem; }
.modal-body { padding: 1.25rem 1.4rem; }
.modal-footer { padding: 0.9rem 1.2rem; gap: 6px; }
.modal-title { font-weight: 900; color: #fff; }
/* 開くときは少し小さいところから（0.96→1）。閉じるときは Bootstrap のフェードだけで素早く消える */
.modal.fade .modal-dialog { transform: scale(0.96); transition: transform 0.26s var(--ease-out); }
.modal.show .modal-dialog { transform: none; }

.dropdown-menu {
  padding: 6px;
  color: var(--text);
  background: rgba(9, 14, 38, 0.97);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.dropdown-item { color: var(--text); border-radius: var(--radius-xs); padding: 0.5rem 0.85rem; font-weight: 700; }
.dropdown-item:hover, .dropdown-item:focus { color: #fff; background: rgba(181, 140, 255, 0.16); }
.dropdown-item.active, .dropdown-item:active { color: #fff; background: rgba(181, 140, 255, 0.3); }
.dropdown-item.disabled, .dropdown-item:disabled { color: var(--faint); }
.dropdown-divider { border-top-color: var(--line); margin: 6px 0; }
.dropdown-header { color: var(--faint); }
.dropdown-toggle::after { vertical-align: 0.18em; }

/* ---- アコーディオン ----------------------------------------------------------- */
.accordion-item { color: var(--text); background: var(--surface-flat); border: 1px solid var(--line); }
.accordion-item:first-of-type { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.accordion-item:last-of-type { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.accordion-item:first-of-type .accordion-button { border-top-left-radius: calc(var(--radius) - 1px); border-top-right-radius: calc(var(--radius) - 1px); }
.accordion-item:last-of-type .accordion-button.collapsed { border-bottom-left-radius: calc(var(--radius) - 1px); border-bottom-right-radius: calc(var(--radius) - 1px); }
.accordion-button { color: var(--text); background: transparent; font-weight: 700; padding: 1rem 1.25rem; line-height: 1.6; }
.accordion-button:not(.collapsed) { color: #fff; background: rgba(181, 140, 255, 0.08); box-shadow: inset 0 -1px 0 var(--line); }
.accordion-button:focus { border-color: transparent; box-shadow: none; }
.accordion-button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.accordion-button::after { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23b9c4e6'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e"); }
.accordion-button:not(.collapsed)::after { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23cdb2ff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e"); }
.accordion-body { color: var(--text); background: transparent; padding: 1.1rem 1.25rem 1.3rem; line-height: 1.85; }
.accordion-flush .accordion-item { background: transparent; }

/* ---- その他の部品 ------------------------------------------------------------- */
.carousel-control-prev-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e") !important; }
.carousel-control-next-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e") !important; }
.carousel-control-prev, .carousel-control-next { opacity: 0.7; }
.carousel-indicators [data-bs-target] { background-color: var(--violet-hi); }
.spinner-border, .spinner-grow { color: var(--violet-hi); }
.progress { background-color: rgba(255, 255, 255, 0.08); border-radius: var(--radius-xs); }
.progress-bar { background: linear-gradient(90deg, var(--violet-lo), var(--violet-hi)); }
.pagination { --n-gap: 4px; gap: 4px; }
.page-link { color: var(--muted); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: var(--radius-xs) !important; font-weight: 700; font-family: var(--font-latin); }
.page-link:hover { color: #fff; background: rgba(255, 255, 255, 0.1); border-color: var(--line-strong); }
.page-item.active .page-link { color: #fff; background: var(--violet-lo); border-color: var(--violet-hi); }
.page-item.disabled .page-link { color: rgba(185, 196, 230, 0.35); background: transparent; border-color: var(--line); }
.tooltip-inner { background: #f7f8fd; color: var(--navy-ink); font-weight: 700; border-radius: var(--radius-xs); }
.toast { color: var(--text); background: var(--glass-strong); border: 1px solid var(--line-strong); border-left: 3px solid var(--violet-hi); border-radius: var(--radius-s); }
.toast-header { color: var(--muted); background: rgba(255, 255, 255, 0.04); border-color: var(--line); }
.popover { background: #0d1640; border: 1px solid var(--line-strong); }
.popover-header { color: #fff; background: rgba(255, 255, 255, 0.05); border-color: var(--line); }
.popover-body { color: var(--text); }
.breadcrumb-item, .breadcrumb-item + .breadcrumb-item::before { color: var(--faint); }
.breadcrumb-item.active { color: var(--muted); }
.figure-caption { color: var(--faint); }
.blockquote-footer { color: var(--faint); }
.close { color: var(--text); text-shadow: none; }

/* ---- 既存の見出し・枠（common.css の部品を新しい見た目に） ------------------------ */
.nagatan { background-image: none !important; }
/* 章の見出し: 左寄せの題と、右へ伸びる細い線（題の側だけ紫） */
.line-title {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.45rem, 1.15rem + 1.2vw, 2rem);
  letter-spacing: 0.05em;
  color: #fff;
}
.line-title > span { word-break: keep-all; overflow-wrap: anywhere; text-wrap: balance; }
@media (max-width: 575.98px) { .line-title::after { min-width: 0; } }
.line-title::before { display: none; }
.line-title::after { content: ""; flex: 1 1 auto; min-width: 16px; height: 1px; margin: 0 !important; background: linear-gradient(90deg, var(--violet-hi) 0 40px, var(--line-strong) 40px, transparent); border-radius: 0; }
.light-line {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 900;
  color: #fff;
}
.light-line::before { content: ""; flex: none; width: 7px; height: 7px; margin: 0 !important; background: var(--violet-hi); transform: rotate(45deg); }
.light-line::after { content: ""; height: 1px; flex: 1 1 auto; margin: 0 !important; background: linear-gradient(90deg, var(--line-strong), transparent); }
.attn-box { position: relative; margin: 2rem 0 1.4rem; padding: 1.4rem 1.2rem 1rem; border: 1px solid rgba(181, 140, 255, 0.4); border-radius: var(--radius-s); background: rgba(181, 140, 255, 0.05); }
.attn-title { position: absolute; left: 18px; top: -0.95em; padding: 0.1em 0.75em; border-radius: var(--radius-xs); font-size: 1rem; font-weight: 900; color: #fff; background: #7c4ee4; }
.top-pad { padding-top: 30px; }

/* ログインのボタン（ニコニコ・Google） */
.button-container .button { border-radius: var(--radius-s); height: 48px; line-height: 48px; font-weight: 700; letter-spacing: 0.03em; padding-left: 48px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 20px rgba(0, 0, 0, 0.35); transition: transform 0.15s, filter 0.2s; }
.button-container .button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button-container .button:before { left: 4px !important; width: 40px; height: 40px; border-radius: var(--radius-xs); background-color: #fff; background-size: 24px; background-position: center; }
.button-container .button:after { display: none; }
.button-container .btn-niconico { background-color: #111214; border: 1px solid rgba(255, 255, 255, 0.18); }
.button-container .btn-google { background-color: #2f6fe0; border: 1px solid rgba(255, 255, 255, 0.22); }

/* ---- ログインの入口（トップ以外でも使う） -------------------------------------- */
.n-login { display: grid; gap: 10px; }
.n-login__btn {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 6px 18px 6px 6px;
  border-radius: var(--radius-s); text-decoration: none; font-weight: 700; letter-spacing: 0.04em; color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.12s var(--ease-out), filter 0.2s, border-color 0.2s;
}
@supports (corner-shape: bevel) { .n-login__btn { border-radius: 0 12px 0 12px; corner-shape: bevel; } }
.n-login__btn:hover { color: #fff; filter: brightness(1.1); border-color: rgba(255, 255, 255, 0.32); }
.n-login__btn:active { transform: translateY(1px); }
.n-login__btn img { width: 40px; height: 40px; padding: 8px; border-radius: var(--radius-xs); background: #fff; flex: none; }
.n-login__btn span { flex: 1; text-align: center; padding-right: 28px; }
.n-login__btn--niconico { background: #1a1b20; }
.n-login__btn--google { background: #3474e6; }
