/* ============================================================
   NEM イベント予約 フロント用スタイル
   色はここで一括変更できます
   ============================================================ */
:root {
  --nem-accent: #ea5514;      /* メインアクセント（NEMオレンジ） */
  --nem-accent-dark: #c74408;
  --nem-dark: #1a1a1a;        /* ロゴブラック */
  --nem-bg: #ffffff;
  --nem-border: #e3e5ea;
  --nem-text: #22252d;
  --nem-muted: #6b7180;
  --nem-danger: #c0392b;
  --nem-ok: #1e8e5a;
}

/* ---------- イベント一覧 ---------- */
.nem-event-list {
  display: grid;
  gap: 14px;
  margin: 1em 0;
}
.nem-event-card {
  display: block;
  border: 1px solid var(--nem-border);
  border-left: 4px solid var(--nem-accent);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--nem-bg);
  color: var(--nem-text);
  text-decoration: none;
  transition: box-shadow .15s ease, transform .15s ease;
}
.nem-event-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
  transform: translateY(-1px);
}
.nem-event-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.nem-event-date {
  font-weight: 700;
  color: var(--nem-dark);
}
.nem-event-title {
  margin: .4em 0 .3em;
  font-size: 1.1em;
  line-height: 1.4;
}
.nem-event-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .88em;
  color: var(--nem-muted);
}
.nem-remaining { font-weight: 600; color: var(--nem-dark); }

/* ---------- バッジ ---------- */
.nem-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .78em;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.nem-badge-open   { background: var(--nem-ok); }
.nem-badge-few    { background: #d97706; }
.nem-badge-wait   { background: #7c3aed; }
.nem-badge-closed { background: #8a8f9c; }

/* ---------- 開催概要 ---------- */
.nem-h {
  border-left: 5px solid var(--nem-accent);
  padding-left: .5em;
  margin: 1.6em 0 .7em;
  font-size: 1.25em;
}
.nem-info-table {
  width: 100%;
  border-collapse: collapse;
  margin: .5em 0 1em;
}
.nem-info-table th,
.nem-info-table td {
  border: 1px solid var(--nem-border);
  padding: 9px 12px;
  text-align: left;
}
.nem-info-table th {
  width: 8em;
  background: #f6f7f9;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- フォーム ---------- */
.nem-form-wrap { margin: 1.5em 0; }
.nem-form {
  border: 1px solid var(--nem-border);
  border-radius: 10px;
  padding: 18px;
  background: #fafbfc;
}
.nem-label {
  display: block;
  font-weight: 700;
  margin-bottom: .3em;
}
.nem-req {
  display: inline-block;
  background: var(--nem-danger);
  color: #fff;
  font-size: .7em;
  padding: 1px 7px;
  border-radius: 4px;
  margin-left: .4em;
  vertical-align: middle;
}
.nem-input {
  width: 100%;
  max-width: 420px;
  padding: 9px 12px;
  border: 1px solid var(--nem-border);
  border-radius: 8px;
  font-size: 1em;
  box-sizing: border-box;
}
.nem-input:focus {
  outline: 2px solid var(--nem-accent);
  border-color: var(--nem-accent);
}
.nem-form-note { color: var(--nem-muted); font-size: .88em; }
.nem-btn {
  box-sizing: border-box;
  max-width: 100%;
  display: inline-block;
  background: var(--nem-dark);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 26px;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease;
}
.nem-btn:hover { background: var(--nem-accent-dark); color:#fff; }
.nem-btn-danger { background: var(--nem-danger); }
.nem-btn-danger:hover { background: #96281b; }
.nem-hp {
  position: absolute !important;
  left: -9999px !important;
  height: 1px; overflow: hidden;
}

/* ---------- 通知 ---------- */
.nem-notice {
  border-radius: 8px;
  padding: 12px 16px;
  margin: 1em 0;
  font-weight: 600;
}
.nem-notice-ok   { background: #e8f7ef; color: var(--nem-ok); border: 1px solid #bfe8d2; }
.nem-notice-wait { background: #f1ebfe; color: #6d28d9; border: 1px solid #ddd0fb; }
.nem-notice-err  { background: #fdeeec; color: var(--nem-danger); border: 1px solid #f6cdc7; }

/* ---------- キャンセルページ ---------- */
.nem-cancel-page {
  max-width: 640px;
  margin: 2em auto 4em;
  padding: 0 16px;
}

/* ---------- トーナメント ---------- */
.nem-tournament { margin: 2em 0; }
.nem-round-h { margin: 1.2em 0 .4em; font-size: 1.05em; }
.nem-bracket {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 8px 0 14px;
}
.nem-bracket-round {
  min-width: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 12px;
}
.nem-bracket-round-title {
  text-align: center;
  font-weight: 700;
  color: var(--nem-muted);
  font-size: .85em;
}
.nem-match {
  border: 1px solid var(--nem-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--nem-bg);
}
.nem-match-p {
  padding: 7px 12px;
  border-bottom: 1px solid var(--nem-border);
  font-size: .92em;
}
.nem-match-p:last-child { border-bottom: none; }
.nem-match-win {
  background: var(--nem-dark);
  color: var(--nem-accent);
  font-weight: 700;
}
.nem-match-lose { color: var(--nem-muted); }
.nem-match-bye  { color: var(--nem-muted); font-style: italic; }
.nem-champion {
  font-size: 1.2em;
  font-weight: 800;
  color: var(--nem-accent-dark);
}
.nem-standings {
  width: 100%;
  border-collapse: collapse;
  margin: .4em 0 1em;
  font-size: .93em;
}
.nem-standings th, .nem-standings td {
  border: 1px solid var(--nem-border);
  padding: 7px 10px;
  text-align: left;
}
.nem-standings thead th {
  background: var(--nem-dark);
  color: #fff;
  font-weight: 700;
}
.nem-empty { color: var(--nem-muted); }

@media (max-width: 600px) {
  .nem-info-table th { width: 6.5em; }
  .nem-btn { width: 100%; text-align: center; }
}

/* ---------- サイト全体レイアウト ---------- */
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  color: var(--nem-text);
  background: #f4f5f7;
  line-height: 1.7;
}
.site-topbar {
  background: var(--nem-accent);
  text-align: center;
  padding: 6px 12px;
  font-size: .82em;
  font-weight: 700;
}
.site-topbar a { color: #fff; text-decoration: none; }
.site-topbar a:hover { text-decoration: underline; }
.site-header {
  background: #fff;
  border-bottom: 2px solid var(--nem-dark);
}
.site-header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.site-logo {
  color: var(--nem-dark);
  font-weight: 800;
  font-size: 1.15em;
  text-decoration: none;
}
.site-logo span {
  color: var(--nem-accent);
  font-size: .85em;
  margin-left: .5em;
}
.site-nav a {
  color: var(--nem-dark);
  text-decoration: none;
  font-size: .9em;
  font-weight: 700;
  margin-left: 18px;
}
.site-nav a:hover { color: var(--nem-accent); }
.site-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  background: #fff;
  min-height: 60vh;
}
.site-footer {
  background: var(--nem-dark);
  color: #d9d9d9;
  font-size: .88em;
  padding: 32px 16px 20px;
  margin-top: 32px;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--nem-accent); }
.site-footer-grid {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.site-footer-col h3 {
  color: var(--nem-accent);
  font-size: 1em;
  margin: 1em 0 .5em;
}
.site-footer-col h3:first-child { margin-top: 0; }
.site-footer-shops, .site-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer-shops li { margin-bottom: .9em; line-height: 1.6; }
.site-footer-shops strong { color: #fff; }
.site-footer-links li { margin-bottom: .4em; }
.site-footer-sns a { margin-right: 14px; font-weight: 700; }
.site-copyright {
  text-align: center;
  color: #8a8f9c;
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid #333;
}
.nem-venue { font-weight: 600; color: var(--nem-accent-dark); }
.nem-breadcrumb { font-size: .85em; color: var(--nem-muted); }
.nem-breadcrumb a { color: var(--nem-muted); }
.nem-event-head { margin: .3em 0 1em; }
.nem-event-page-title { margin: .3em 0 0; font-size: 1.5em; line-height: 1.4; }
.nem-body { margin: 1em 0; }
.nem-past-list { padding-left: 1.2em; }
.nem-past-list li { margin: .3em 0; }

/* ---------- 結果報告ページ ---------- */
.nem-btn-lose {
  background: #fff;
  color: var(--nem-text);
  border: 1px solid var(--nem-border);
}
.nem-btn-lose:hover { background: #f2f2f2; color: var(--nem-text); }

/* ---------- LINE問い合わせ浮動ボタン ---------- */
.nem-line-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  background: #06c755;
  color: #fff;
  font-weight: 700;
  font-size: .9em;
  padding: 12px 18px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  transition: transform .12s ease;
}
.nem-line-fab:hover { transform: translateY(-2px); color: #fff; }

/* ---------- QR結果報告ページ ---------- */
.nem-report-row {
  border: 1px solid var(--nem-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--nem-bg);
}
.nem-report-head { margin-bottom: 8px; }
.nem-report-table {
  display: inline-block;
  background: var(--nem-dark);
  color: var(--nem-accent);
  font-weight: 700;
  font-size: .8em;
  border-radius: 6px;
  padding: 2px 9px;
  margin-right: 6px;
}
.nem-report-done { color: var(--nem-muted); background: #f6f7f9; }
.nem-report-form { display: flex; flex-wrap: wrap; gap: 8px; }
.nem-report-form .nem-btn { width: auto; }
.nem-btn-sm { padding: 8px 14px; font-size: .9em; }
@media (max-width: 600px) {
  .nem-report-form .nem-btn { width: auto; flex: 1; min-width: 40%; text-align: center; }
}

/* ============================================================
   モバイル最適化
   ============================================================ */
.nem-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nem-scroll table { min-width: 100%; }

@media (max-width: 600px) {
  body { padding-bottom: 76px; } /* LINEボタンと重ならない余白 */
  .site-main { padding: 14px 12px 40px; }
  .site-header-inner { padding: 10px 12px; }
  .site-logo { font-size: 1.02em; }
  .site-logo span { display: block; margin-left: 0; font-size: .78em; }
  .site-nav { width: 100%; display: flex; gap: 4px; }
  .site-nav a {
    margin: 0;
    flex: 1;
    text-align: center;
    font-size: .82em;
    padding: 7px 2px;
    border: 1px solid var(--nem-border);
    border-radius: 8px;
  }
  .site-topbar { font-size: .78em; padding: 5px 8px; }

  .nem-h { font-size: 1.12em; }
  .nem-event-page-title { font-size: 1.25em; }
  .nem-event-title { font-size: 1em; }

  /* 表: 横スクロール + 折り返し防止 */
  .nem-standings { display: block; overflow-x: auto; white-space: nowrap; }
  .nem-standings th, .nem-standings td { padding: 8px 10px; font-size: .9em; }
  .nem-info-table th, .nem-info-table td { padding: 8px 10px; font-size: .95em; }

  /* 入力はフォーカス時のiOS自動ズームを防ぐため16px以上 */
  .nem-input { font-size: 16px; max-width: none; }
  .nem-btn { padding: 14px 20px; }

  /* LINEボタンはコンパクトに */
  .nem-line-fab {
    right: 12px;
    bottom: 12px;
    padding: 12px 14px;
    font-size: .85em;
  }

  .nem-report-form .nem-btn { padding: 12px 10px; font-size: .92em; }
  .site-footer { font-size: .84em; }
  .site-footer-grid { gap: 18px; }
}

/* ---------- 月次カレンダー ---------- */
.nem-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: .6em 0 1em;
}
.nem-cal-title { margin: 0; font-size: 1.4em; }
.nem-cal-nav {
  border: 1px solid var(--nem-border);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--nem-text);
  text-decoration: none;
  font-weight: 700;
  font-size: .9em;
}
.nem-cal-nav:hover { border-color: var(--nem-accent); color: var(--nem-accent); }
.nem-cal {
  border: 1px solid var(--nem-border);
  border-radius: 10px;
  overflow: hidden;
}
.nem-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.nem-cal-wday {
  background: var(--nem-dark);
  color: #fff;
  text-align: center;
  font-size: .8em;
  font-weight: 700;
  padding: 7px 0;
}
.nem-cal-wday.is-sun { color: #ff9d9d; }
.nem-cal-wday.is-sat { color: #9dc4ff; }
.nem-cal-day {
  min-height: 86px;
  border-top: 1px solid var(--nem-border);
  border-left: 1px solid var(--nem-border);
  padding: 4px;
  background: #fff;
}
.nem-cal-grid .nem-cal-day:nth-child(7n+1) { border-left: none; }
.nem-cal-day.is-empty { background: #f7f7f8; }
.nem-cal-day.is-today { background: #fdf1e8; }
.nem-cal-num { font-size: .8em; font-weight: 700; color: var(--nem-muted); }
.nem-cal-day.is-sun .nem-cal-num { color: #d24a4a; }
.nem-cal-day.is-sat .nem-cal-num { color: #3b7ad9; }
.nem-cal-day.is-today .nem-cal-num {
  color: #fff;
  background: var(--nem-accent);
  border-radius: 999px;
  padding: 1px 7px;
}
.nem-cal-ev {
  display: block;
  background: var(--nem-accent);
  color: #fff;
  border-radius: 6px;
  padding: 3px 6px;
  margin-top: 4px;
  font-size: .72em;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.nem-cal-ev:hover { background: var(--nem-accent-dark); color: #fff; }
.nem-cal-ev.is-closed { background: #9a9fa8; }
.nem-cal-ev-time { display: block; font-weight: 400; font-size: .92em; opacity: .9; }

@media (max-width: 600px) {
  .nem-cal-day { min-height: 72px; padding: 3px; }
  .nem-cal-ev { font-size: .6em; padding: 2px 4px; border-radius: 5px; }
  .nem-cal-title { font-size: 1.15em; }
}

/* ---------- X告知用ポスター ---------- */
.nem-poster-stage {
  position: absolute;
  left: -12000px;
  top: 0;
}
#nem-poster {
  width: 1080px;
  min-height: 1080px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
}
.nem-poster-head {
  background: #1a1a1a;
  padding: 44px 60px 38px;
}
.nem-poster-shop {
  color: #ea5514;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
}
.nem-poster-title {
  color: #ffffff;
  font-size: 64px;
  font-weight: 900;
  margin-top: 6px;
  line-height: 1.25;
}
.nem-poster-title span { color: #ea5514; font-size: 76px; }
.nem-poster-body { flex: 1; padding: 34px 60px 10px; }
.nem-poster-row {
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 2px solid #eeeeee;
  padding: 20px 0;
}
.nem-poster-date {
  flex-shrink: 0;
  width: 130px;
  text-align: center;
}
.nem-poster-date .d {
  font-size: 54px;
  font-weight: 900;
  color: #1a1a1a;
  line-height: 1;
}
.nem-poster-date .w {
  display: inline-block;
  font-size: 22px;
  font-weight: 700;
  color: #666;
  margin-left: 6px;
}
.nem-poster-date .w0 { color: #d24a4a; }
.nem-poster-date .w6 { color: #3b7ad9; }
.nem-poster-info { min-width: 0; }
.nem-poster-info .t {
  font-size: 34px;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1.35;
}
.nem-poster-info .m { font-size: 24px; color: #666; margin-top: 6px; }
.nem-poster-more {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: #ea5514;
  padding: 22px 0 8px;
}
.nem-poster-foot {
  background: #ea5514;
  color: #ffffff;
  font-size: 30px;
  font-weight: 800;
  text-align: center;
  padding: 26px 20px;
}

/* ---------- イベント説明画像 ---------- */
.nem-desc-imgs { margin: 1em 0 1.5em; }
.nem-desc-fig { margin: 0 0 16px; }
.nem-desc-fig img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--nem-border);
  border-radius: 10px;
  display: block;
}
.nem-desc-fig figcaption {
  font-size: .85em;
  color: var(--nem-muted);
  margin-top: 5px;
}

/* 告知画像のプレビュー（スマホは長押し保存） */
.nem-poster-preview {
  max-width: 100%;
  width: 480px;
  height: auto;
  border: 1px solid var(--nem-border);
  border-radius: 10px;
  margin: 8px 0;
  display: block;
}

/* ---------- 長いURL・文字列のはみ出し防止 ---------- */
.nem-body {
  overflow-wrap: break-word;
  word-break: break-word;
}
.nem-body a, .nem-autolink {
  word-break: break-all;
  color: var(--nem-accent-dark);
}
.site-main { overflow-x: hidden; }

/* ---------- エントリー一覧チップ ---------- */
.nem-entry-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: .5em 0 1.2em;
}
.nem-entry-chip {
  background: #f6f7f9;
  border: 1px solid var(--nem-border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .9em;
  font-weight: 600;
  color: var(--nem-text);
}

/* ---------- 公式大会 ---------- */
.nem-badge-official { background: #2563eb; }
.nem-card-official { border-left-color: #2563eb; }
.nem-cal-ev.is-official { background: #2563eb; }
.nem-cal-ev.is-official:hover { background: #1d4ed8; }
.nem-btn-official {
  background: #2563eb;
  font-size: 1.05em;
}
.nem-btn-official:hover { background: #1d4ed8; }

/* ---------- 限定公開・下書きバッジ ---------- */
.nem-badge-unlisted { background: #6b7280; }

/* 会員ナビリンク */
.site-nav-member { color: var(--nem-accent) !important; }

/* ---------- デッキリスト ---------- */
.nem-deck-section { margin-bottom: 2.2em; }
.nem-deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: .6em 0 1.2em;
}
.nem-deck-card {
  margin: 0;
  background: #fff;
  border: 1px solid var(--nem-border);
  border-radius: 10px;
  overflow: hidden;
}
.nem-deck-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.nem-deck-card figcaption {
  padding: 9px 12px;
  font-size: .92em;
  font-weight: 700;
}
.nem-deck-rank {
  display: inline-block;
  color: #fff;
  font-size: .8em;
  border-radius: 6px;
  padding: 2px 9px;
  margin-right: 6px;
  background: #6b7280;
}
.nem-deck-rank.r-優勝   { background: var(--nem-accent); }
.nem-deck-rank.r-準優勝 { background: #64748b; }
.nem-deck-rank.r-ベスト4 { background: #a16207; }
.nem-result { color: var(--nem-accent-dark); font-weight: 700; }
@media (max-width: 600px) {
  .nem-deck-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .nem-deck-card img { height: 130px; }
}

/* ---------- 参加スタンプ ---------- */
.nem-stamp-card {
  background: #fff;
  border: 2px solid var(--nem-accent);
  border-radius: 14px;
  padding: 18px 16px;
  margin: 12px 0 24px;
}
.nem-stamp-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  max-width: 560px;
}
.nem-stamp-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 2px dashed #d8d8d8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #b5b5b5;
  font-size: .95em;
  background: #fafafa;
}
.nem-stamp-cell.nem-stamp-goal { border-style: solid; border-color: var(--nem-accent); color: var(--nem-accent-dark); }
.nem-stamp-cell.nem-stamp-on { background: #fff1ea; border: 2px solid var(--nem-accent); color: inherit; }
.nem-stamp-goal-label {
  position: absolute;
  bottom: -1.45em;
  left: 50%;
  transform: translateX(-50%);
  font-size: .62em;
  font-weight: 800;
  color: var(--nem-accent-dark);
  white-space: nowrap;
}
.nem-stamp-msg { margin: 1.8em 0 .4em; line-height: 1.9; }
.nem-coupon {
  display: inline-block;
  color: #fff;
  font-weight: 800;
  border-radius: 8px;
  padding: 4px 14px;
}
.nem-coupon-free { background: #dc2626; }
.nem-coupon-half { background: var(--nem-accent); }
.nem-stamp-rules h2 { margin-top: 1.6em; }
@media (max-width: 600px) {
  .nem-stamp-grid { grid-template-columns: repeat(5, 1fr); gap: 7px; row-gap: 22px; }
  .nem-stamp-cell { font-size: .88em; }
}
