/* ========================================================
   nanikiru.css — 何切るページ専用（スマホ横画面向けのダークなデザイン）
   ほかのページの style.css には依存しない単独のスタイル。
   ======================================================== */

/* 色はアプリ本体の配色（style.css の先頭の「色（テーマ）」）にそろえている：白・薄いグレー・キャラメル、ダークは黒。標準はダーク（ライトを選んだときだけ nanikiru.html の先頭で <html data-theme="light"> を付ける） */
:root {
  --nk-bg: #0b0b0c;
  --nk-bg-2: #18181b;
  --nk-card: rgba(255,255,255,0.05);
  --nk-card-border: rgba(255,255,255,0.1);
  --nk-text: #f4f4f5;
  --nk-text-2: #a1a1aa;
  --nk-text-3: #71717a;
  --nk-accent: #d4a24c;
  --nk-accent-2: #b8862f;
  --nk-gold: #f59e0b;
  --nk-good: #34d399;
  --nk-panel: #18181b;
  --nk-panel-border: rgba(212,162,76,0.3);
  --nk-panel-2: rgba(24,24,27,0.88);        /* パネルの下のほう（グラデーションの終わり） */
  --nk-inset: rgba(0, 0, 0, 0.28);          /* 一段へこんだ面（モードの切り替え） */
  --nk-inset-2: rgba(0, 0, 0, 0.22);        /* 一段へこんだ面（牌のパッド） */
  --nk-line: rgba(255, 255, 255, 0.1);
  --nk-dash: rgba(255, 255, 255, 0.18);
  --nk-soft: rgba(255, 255, 255, 0.06);
  --nk-warn-text: #fbbf24;
  --nk-maybe-text: #fcd34d;
  --nk-none-bg: rgba(127, 29, 29, 0.45);
  --nk-none-text: #fecaca;
  --nk-banner-bg: #18181b;
  --nk-banner-border: rgba(212,162,76,0.4);
  --nk-banner-sub: #e9c27a;
  --nk-on-good: #022c22;
  --nk-gold-text: #f59e0b;    /* 金色の小さな文字（切る・モード名・鳴きなど）。ライトでは濃くして読みやすく */
  --nk-on-accent: #111113;    /* 緑の地の上の文字（おすすめのバッジ） */
  --nk-check-bg: rgba(255, 255, 255, 0.85); /* おすすめの理由の丸いチェック */
  --nk-check-fg: #000000;
  --nk-radius: 12px;
  color-scheme: dark;
}

/* ライト（アプリ設定でライトを選んだとき。nanikiru.html の先頭で <html data-theme> を付ける）。色はアプリのライトにそろえる */
:root[data-theme="light"] {
  --nk-bg: #ffffff;
  --nk-bg-2: #f5f5f7;
  --nk-card: rgba(0,0,0,0.04);
  --nk-card-border: rgba(0,0,0,0.08);
  --nk-text: #1d1d1f;
  --nk-text-2: #6e6e73;
  --nk-text-3: #86868b;
  --nk-accent: #a8591a;
  --nk-accent-2: #8a4813;
  --nk-gold: #d9a441;
  --nk-good: #1f8a55;
  --nk-panel: #f5f5f7;
  --nk-panel-border: rgba(168,89,26,0.25);
  --nk-panel-2: rgba(245,245,247,0.9);
  --nk-inset: rgba(0,0,0,0.05);
  --nk-inset-2: rgba(0,0,0,0.04);
  --nk-line: rgba(0,0,0,0.08);
  --nk-dash: rgba(0,0,0,0.2);
  --nk-soft: rgba(0,0,0,0.03);
  --nk-warn-text: #a86b0c;
  --nk-maybe-text: #8a5a08;
  --nk-none-bg: rgba(220, 38, 38, 0.1);
  --nk-none-text: #b42318;
  --nk-banner-bg: #fbefe3;
  --nk-banner-border: rgba(168,89,26,0.35);
  --nk-banner-sub: #8a4813;
  --nk-on-good: #fff;
  --nk-gold-text: #946200;
  --nk-on-accent: #fff;
  --nk-check-bg: #a8591a;
  --nk-check-fg: #fff;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body.nk-body {
  background: radial-gradient(ellipse at 30% 0%, var(--nk-bg-2), var(--nk-bg) 70%) fixed, var(--nk-bg);
  color: var(--nk-text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

button { font-family: inherit; color: inherit; }

/* ---------- 全体レイアウト（横画面） ---------- */
.nk-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 27%);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "header header"
    "main   panel";
  gap: 10px 14px;
  height: 100vh;
  height: 100dvh;
  padding: max(8px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.nk-header { grid-area: header; display: flex; align-items: center; gap: 12px; min-width: 0; }
.nk-main { grid-area: main; display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; padding-top: 6px; }
/* 手牌の下（打牌候補＋牌パッド）だけをスクロールさせる。手牌は常に見えたまま */
.nk-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 3px 4px;
}
.nk-panel { grid-area: panel; min-height: 0; }

/* ---------- ヘッダー ---------- */
.nk-back { color: var(--nk-text-2); text-decoration: none; font-size: 13px; white-space: nowrap; }
.nk-title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 0.05em; white-space: nowrap; }
.nk-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.nk-btn {
  border: 1px solid var(--nk-card-border);
  background: var(--nk-card);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.nk-btn:disabled { opacity: 0.4; cursor: default; }
.nk-btn-primary { background: linear-gradient(135deg, var(--nk-accent), var(--nk-accent-2)); border-color: transparent; }
.nk-btn-ghost { background: transparent; }

/* ---------- モード切り替え・ドラ表示 ---------- */
.nk-modes {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--nk-inset);
  border: 1px solid var(--nk-card-border);
}
.nk-mode {
  border: 0;
  background: none;
  color: var(--nk-text-2);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.nk-mode.active { background: linear-gradient(135deg, var(--nk-accent), var(--nk-accent-2)); color: var(--nk-on-accent); }

.nk-dora-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--nk-card-border);
  background: var(--nk-card);
  border-radius: 999px;
  padding: 3px 10px 3px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.nk-dora-btn em { font-style: normal; color: var(--nk-text-3); }
.nk-dora-btn.is-picking { border-color: var(--nk-gold); box-shadow: 0 0 0 1px var(--nk-gold); }
/* .nk-tile-img（幅100%）より後でも負けないよう、ボタン配下に限定して指定する */
.nk-dora-btn .nk-dora-img { width: 16px; height: auto; flex-shrink: 0; }

.nk-mode-tag {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: var(--nk-gold-text);
}
.nk-thinking { color: var(--nk-gold-text); animation: nk-blink 1.2s ease-in-out infinite; }
@keyframes nk-blink { 50% { opacity: 0.45; } }
.nk-cands.is-provisional { opacity: 0.6; }
.nk-pad-section.is-picking .nk-pad { box-shadow: 0 0 0 2px var(--nk-gold); }
.nk-small { font-size: 10.5px; color: var(--nk-text-3); }

/* ---------- セクション見出し ---------- */
.nk-section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  padding-left: 8px;
  border-left: 3px solid var(--nk-accent);
  line-height: 1.2;
}
.nk-section-hint { font-size: 11px; font-weight: 500; color: var(--nk-text-3); }

/* ---------- 牌画像 ---------- */
.nk-tile-img { display: block; width: 100%; height: auto; pointer-events: none; }

/* ---------- 手牌 ---------- */
.nk-hand { display: flex; align-items: flex-end; gap: 2px; }

.nk-hand-tile {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 56px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  transition: transform 0.12s ease;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}
.nk-hand-tile:active { transform: translateY(-6px); }
.nk-hand-tile:disabled { opacity: 0.35; cursor: default; transform: none; }
.nk-hand-tile.is-picked { transform: translateY(-8px); }
.nk-hand-tile.is-picked img { border-radius: 6px; box-shadow: 0 0 0 2px var(--nk-gold), 0 0 12px rgba(242, 193, 78, 0.7); }
.nk-hand-tile.is-tsumo { margin-left: 10px; }
.nk-hand-tile.is-empty {
  aspect-ratio: 64 / 86;
  border: 1.5px dashed var(--nk-dash);
  filter: none;
  cursor: default;
}
.nk-hand-tile.is-best { transform: translateY(-5px); }
.nk-hand-tile.is-best img { border-radius: 6px; box-shadow: 0 0 0 2px var(--nk-gold), 0 0 14px rgba(242, 193, 78, 0.7); }
.nk-best-mark {
  position: absolute;
  left: 50%;
  bottom: -15px;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--nk-gold-text);
  white-space: nowrap;
}
.nk-hand-section { padding-bottom: 12px; }

/* ---------- 鳴き ---------- */
.nk-btn.is-on { border-color: var(--nk-gold); box-shadow: 0 0 0 1px var(--nk-gold); }
.nk-naki-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.nk-naki-title { font-size: 12px; font-weight: 700; color: var(--nk-gold-text); margin-right: 2px; }
.nk-naki-type {
  border: 1px solid var(--nk-card-border);
  background: var(--nk-card);
  color: var(--nk-text);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.nk-naki-type.active { background: var(--nk-gold); border-color: var(--nk-gold); color: #1a1000; }
.nk-naki-type:disabled { opacity: 0.4; cursor: default; }
.nk-naki-note { font-size: 11px; color: var(--nk-text-3); }
.nk-naki-note b { color: var(--nk-warn-text); font-weight: 700; }
.nk-naki-guide { flex-basis: 100%; font-size: 13px; font-weight: 700; color: var(--nk-text); }
.nk-naki-choices { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.nk-naki-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--nk-gold);
  border-radius: 10px;
  background: var(--nk-card);
  color: var(--nk-text);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.nk-naki-choice-tiles { display: flex; gap: 1px; }
.nk-naki-choice-tiles .nk-tile-img { width: 26px; }
.nk-pad-tile.is-picked img { border-radius: 6px; box-shadow: 0 0 0 2px var(--nk-gold); }
.nk-dora-chip { width: 26px; padding: 0; border: 0; background: none; cursor: pointer; }
/* 鳴いた面子: 手牌の牌と同じ大きさに見えるよう、枚数ぶん伸びる */
.nk-meld {
  flex: 3 1 0;
  min-width: 0;
  max-width: calc(56px * 4 + 6px);
  margin-left: 10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  font-family: inherit;
}
.nk-meld-tiles { display: flex; gap: 1px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); }
.nk-meld-tile { flex: 1 1 0; min-width: 0; }
.nk-tile-back {
  display: block;
  aspect-ratio: 64 / 86;
  border-radius: 5px;
  background: linear-gradient(160deg, #f2c14e, #d99a1e);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}
.nk-meld-label { margin-top: 2px; font-size: 9.5px; font-weight: 700; color: var(--nk-gold-text); text-align: center; }
.nk-yaku-tag {
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 9.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.4;
}
.nk-yaku-tag.is-none { background: #7f1d1d; color: #fecaca; }
.nk-yaku-tag.is-maybe { background: rgba(245, 158, 11, 0.2); color: var(--nk-maybe-text); }
.nk-yaku-line { font-size: 12px; margin: 0 0 8px; padding: 6px 10px; border-radius: 10px; background: var(--nk-card); }
.nk-yaku-line.is-none { background: var(--nk-none-bg); color: var(--nk-none-text); }

/* ---------- 打牌候補 ---------- */
/* 候補カードやパッドが押しつぶされて重ならないよう、縮ませない（収まらない分は .nk-scroll がスクロールする） */
.nk-cand-section { flex-shrink: 0; }
.nk-hand-section { flex-shrink: 0; }
.nk-pad-section { flex-shrink: 0; }
.nk-cands { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }

.nk-cand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 7px;
  border: 1px solid var(--nk-card-border);
  border-radius: var(--nk-radius);
  background: var(--nk-card);
  cursor: pointer;
  min-width: 0;
}
.nk-cand.is-best {
  border-color: var(--nk-accent);
  background: linear-gradient(180deg, rgba(76,196,124, 0.2), rgba(76,196,124, 0.05));
  box-shadow: 0 0 0 1px var(--nk-accent), 0 0 18px rgba(76,196,124, 0.35);
}
.nk-cand-img { width: 32px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); margin-bottom: 2px; }
.nk-cand-name { font-size: 13px; font-weight: 700; }
.nk-cand-line { font-size: 10.5px; color: var(--nk-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nk-cand-line.is-wrap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.nk-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--nk-accent-2);
  color: var(--nk-on-accent);
  border-radius: 999px;
  padding: 1px 8px;
  margin: 1px 0 2px;
}
.nk-crown {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.85);
  color: var(--nk-accent-2);
}
.nk-cand-empty {
  border: 1px dashed var(--nk-card-border);
  border-radius: var(--nk-radius);
  padding: 18px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--nk-text-3);
}

/* ---------- 牌パッド ---------- */
.nk-pad-section { margin-top: auto; }
.nk-pad {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 8px;
  border-radius: var(--nk-radius);
  background: var(--nk-inset-2);
}
.nk-pad-row { display: flex; gap: 2px; }
.nk-pad-tile {
  flex: 1 1 0;
  min-width: 0;
  max-width: 48px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 4px;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
.nk-pad-tile.has-gap { margin-left: 8px; }
.nk-pad-tile:active:not(:disabled) { transform: scale(0.92); }
.nk-pad-tile:disabled { opacity: 0.28; cursor: default; }
.nk-pad-section.is-full .nk-pad-tile:disabled { opacity: 0.5; }
.nk-pad-tile.is-good img { border-radius: 4px; box-shadow: 0 0 0 2px var(--nk-good), 0 0 10px rgba(79, 209, 139, 0.75); }
.nk-pad-legend { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--nk-text-2); margin-top: 4px; padding-left: 4px; }
.nk-good-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--nk-good); box-shadow: 0 0 6px var(--nk-good); }

/* ---------- わんこのおすすめパネル ---------- */
.nk-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--nk-panel-border);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--nk-panel), var(--nk-panel-2));
  padding: 12px 14px;
  overflow-y: auto;
}
.nk-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--nk-line);
}
/* わんこ（5回タップで隠しボタン）。押した感じが分かるよう少し縮む */
.nk-mascot-btn { padding: 0; border: 0; background: none; cursor: pointer; flex-shrink: 0; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
.nk-mascot-btn:active .nk-mascot { transform: scale(0.9); }
.nk-mascot {
  transition: transform 0.1s ease;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff7e8;
  padding: 3px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}
.nk-panel-title { font-size: 13px; color: var(--nk-text-2); }
.nk-panel-title strong { font-size: 18px; color: var(--nk-good); margin-right: 2px; }
.nk-panel-body { display: flex; flex-direction: column; gap: 10px; flex: 1; }

.nk-reco { display: flex; align-items: center; gap: 14px; padding: 2px 4px; }
.nk-reco-img { width: 54px; flex-shrink: 0; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.4)); }
.nk-reco-text { font-size: 15px; font-weight: 700; line-height: 1.5; }
.nk-reco-name { font-size: 24px; color: var(--nk-good); }

.nk-reason-title { font-size: 12px; font-weight: 700; padding-left: 7px; border-left: 3px solid var(--nk-accent); }
.nk-reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.nk-reasons li { display: flex; gap: 8px; font-size: 12px; line-height: 1.5; color: var(--nk-text); }
.nk-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--nk-check-bg);
  color: var(--nk-check-fg);
}

.nk-say { font-size: 16px; font-weight: 700; line-height: 1.5; }
.nk-say-big { font-size: 20px; color: var(--nk-gold-text); }
.nk-waits { margin: 10px 0; }
.nk-waits-title { margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--nk-text); }
.nk-waits-warn { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--nk-warn-text); }
.nk-wait { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--nk-card-border); }
.nk-wait-tile { flex: none; display: flex; flex-direction: column; align-items: center; width: 30px; }
.nk-wait-tile small { font-size: 10px; color: var(--nk-text-3); }
.nk-wait-yaku { flex: 1; min-width: 0; font-size: 12px; font-weight: 700; color: var(--nk-text); }
.nk-wait-yaku small { display: block; font-weight: 500; color: var(--nk-text-3); }
.nk-wait-points { flex: none; font-size: 14px; font-weight: 800; color: var(--nk-text); }
.nk-wait.is-none .nk-wait-tile { opacity: 0.5; }
.nk-wait.is-none .nk-wait-yaku, .nk-wait.is-none .nk-wait-points { color: var(--nk-warn-text); }
.nk-note { margin: 0; font-size: 12px; line-height: 1.6; color: var(--nk-text-2); }
.nk-learn-link { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--nk-accent); text-decoration: none; }

.nk-tilebox {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #064e3b;
}
.nk-tilebox-title { font-size: 11px; font-weight: 700; writing-mode: horizontal-tb; white-space: nowrap; }
.nk-tilebox-tiles { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; min-width: 0; }
.nk-tilebox-img { width: 22px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)); }
.nk-tilebox-total { font-size: 22px; font-weight: 800; white-space: nowrap; }
.nk-tilebox-total span { font-size: 14px; font-weight: 600; margin-right: 2px; color: #047857; }
.nk-tilebox-total small { font-size: 12px; margin-left: 1px; }

/* ---------- 縦画面のときは縦積みにしてスクロールさせる ---------- */
.nk-rotate-hint { display: none; }

@media (orientation: portrait) {
  /* 縦画面はページ全体がスクロールするので、内側のスクロールは使わない */
  .nk-scroll { overflow: visible; }
  body.nk-body { overflow-x: hidden; }
  /* ヘッダーは3段: 戻る・タイトル・ドラ表示 / モード切り替え / 操作ボタン */
  .nk-header { flex-wrap: wrap; gap: 8px; }
  .nk-dora-btn { margin-left: auto; }
  .nk-modes { order: 3; width: 100%; }
  .nk-mode { flex: 1; }
  /* 縦画面：ボタンは入りきらなければ2段にする（「ランダ…」のように文字を切らない） */
  .nk-actions { order: 4; width: 100%; margin-left: 0; flex-wrap: wrap; }
  .nk-actions .nk-btn { flex: 1 1 auto; padding: 7px 10px; white-space: nowrap; }
  .nk-section-title { flex-wrap: wrap; row-gap: 2px; }
  .nk-hand-tile.is-tsumo { margin-left: 6px; }
  .nk-app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas: "header" "hint" "main" "panel";
    height: auto;
    min-height: 100dvh;
  }
  .nk-rotate-hint {
    display: block;
    grid-area: hint;
    text-align: center;
    font-size: 12px;
    color: var(--nk-text-2);
    padding: 6px;
    border-radius: 999px;
    background: var(--nk-soft);
  }
  .nk-cands { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nk-pad-row { flex-wrap: wrap; }
  .nk-pad-tile { flex: 0 0 calc((100% - 8 * 2px) / 9); }
  .nk-pad-tile.has-gap { margin-left: 0; }
  .nk-tilebox { margin-top: 4px; }
}

/* ---------- 背の低い横画面（スマホ横持ち）では全体を詰める ---------- */
@media (orientation: landscape) and (max-height: 430px) {
  .nk-app { gap: 6px 10px; grid-template-columns: minmax(0, 1fr) minmax(180px, 26%); }
  .nk-header { gap: 8px; }
  .nk-title { font-size: 14px; }
  .nk-mode { padding: 4px 9px; font-size: 11px; }
  .nk-btn { padding: 5px 9px; font-size: 11px; }
  .nk-main { gap: 6px; }
  .nk-scroll { gap: 6px; }
  .nk-section-title { margin-bottom: 4px; font-size: 12px; }
  .nk-hand-tile { max-width: 42px; }
  .nk-hand-section { padding-bottom: 10px; }
  /* 候補カードは「牌を左・文字を右」の横並びにして高さを抑える */
  .nk-cands { gap: 6px; }
  .nk-cand {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    grid-auto-rows: auto;
    column-gap: 6px;
    row-gap: 0;
    align-items: center;
    justify-items: start;
    text-align: left;
    padding: 5px 6px;
  }
  /* 1段目は「牌＋名前」、2段目以降の数字はカードの幅いっぱいを使う（省略されないように） */
  .nk-cand-img { grid-column: 1; grid-row: 1; width: 22px; margin: 0 0 3px; }
  .nk-cand-name { grid-column: 2; grid-row: 1; font-size: 12px; line-height: 1.3; }
  .nk-cand-line { grid-column: 1 / -1; font-size: 10px; line-height: 1.35; letter-spacing: -0.02em; }
  .nk-cand.lines-3 .nk-cand-line.is-shanten { display: none; }
  .nk-badge { display: none; }
  .nk-cand-empty { padding: 10px; }
  .nk-crown { width: 16px; height: 16px; top: 3px; right: 3px; }
  .nk-crown svg { width: 11px; height: 11px; }
  .nk-pad { padding: 4px 6px; gap: 3px; }
  .nk-pad-tile { max-width: 44px; }
  .nk-pad-row { gap: 3px; }
  .nk-pad-legend { display: none; }
  .nk-panel { padding: 8px 10px; }
  .nk-panel-head { padding-bottom: 6px; margin-bottom: 6px; }
  .nk-mascot { width: 38px; height: 38px; }
  .nk-panel-title strong { font-size: 15px; }
  .nk-panel-body { gap: 6px; }
  .nk-reco-img { width: 40px; }
  .nk-reco-name { font-size: 19px; }
  .nk-reco-text { font-size: 13px; line-height: 1.35; }
  .nk-reasons { gap: 4px; }
  .nk-reasons li { font-size: 11px; line-height: 1.4; }
  .nk-check { width: 15px; height: 15px; }
  .nk-tilebox { padding: 6px 8px; gap: 6px; }
  .nk-tilebox-img { width: 17px; }
  .nk-tilebox-total { font-size: 18px; }
}

/* 写真読み込み: 写真から入力した直後のお知らせ帯 */
.nk-photo-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--nk-banner-bg);
  border: 1px solid var(--nk-banner-border);
  font-size: 12px;
  line-height: 1.5;
  flex-shrink: 0;
}
.nk-photo-banner small { color: var(--nk-banner-sub); margin-left: 4px; }
.nk-photo-check { width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%; background: var(--nk-good); color: var(--nk-on-good); display: grid; place-items: center; font-weight: 900; font-size: 12px; }
.nk-photo-banner span:nth-child(2) { flex: 1; }
.nk-photo-banner button { border: 0; background: none; color: var(--nk-good); font-weight: 700; font-size: 12px; cursor: pointer; min-height: 32px; font-family: inherit; }
