/* ==========================================
   Max Number Hunt（電子黒板・順番チャレンジ）
   Scope: .mnh-wrap
   ========================================== */

.mnh-wrap{
  /* ベースカラー（70%） */
  --base: #FFFFFF;
  --base-light: #FAFAFA;
  --base-dark: #F5F5F5;
  
  /* メインカラー（25%）- ネイビー */
  --main: #1e3a5f;
  --main-light: #2d5a8f;
  --main-dark: #0f1e3a;
  
  /* アクセントカラー（5%）- ゴールド */
  --accent: #d4af37;
  --accent-light: #f4cf5f;
  --accent-dark: #b8941f;
  
  /* テキストカラー */
  --text: #2C3E50;
  --text-light: #7F8C8D;
  
  /* ボーダー */
  --border: #E8E8E8;
  
  /* 旧変数との互換性 */
  --bg: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 50%, #F0F2F5 100%);
  --card: #ffffff;
  --shadow: 0 4px 20px rgba(30, 58, 95, 0.1);
  --blue: #2563eb;
  --green: #22c55e;
  --radius: 18px;
  
  font-family:"UD Digi Kyokasho N-R","UD デジタル 教科書体 N-R","Noto Sans JP",system-ui,sans-serif;
  color:var(--text);
}

.mnh-wrap, .mnh-wrap *{ box-sizing:border-box; }

.mnh-eb{
  background: var(--bg);
  padding: 14px;
  border-radius: var(--radius);
}

.mnh-top{
  position: relative;
  background: var(--main);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  max-width: 1400px;
  margin: 0 auto 12px;
}

/* ゴールドライン（上下） */
.mnh-top::before,
.mnh-top::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
  z-index: 1;
}
.mnh-top::before { top: 0; }
.mnh-top::after { bottom: 0; }

.mnh-title{
  font-weight: 1000;
  font-size: 22px;
  letter-spacing: .02em;
  margin-bottom: 10px;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mnh-controls{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  justify-content:flex-start;
}

/* 固定ページ側テーマの word-break などで日本語が縦割れする対策 */
.mnh-top, .mnh-top *{
  word-break: normal !important;
  overflow-wrap: normal !important;
}

.mnh-label{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight: 900;
  font-size: 15px;
  white-space: nowrap;
  line-height: 1.1;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.mnh-select{
  font-size: 15px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background:#fff;
  font-weight: 800;
  min-width: 120px;
}

.mnh-btn{
  padding: 10px 14px;
  border-radius: 14px;
  border: 2px solid #1e3a5f;
  background:#fff;
  color:#1e3a5f;
  font-weight: 1000;
  font-size: 15px;
  cursor:pointer;
  box-shadow: 0 2px 10px rgba(30,58,95,.10);
  min-width: 92px;
  height: 44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.mnh-btn:active{ transform: translateY(1px); }
.mnh-primary{
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
  border-color: var(--accent);
  color: var(--main-dark);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}
.mnh-primary:hover {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.mnh-sub{
  margin-top: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.5;
  backdrop-filter: blur(4px);
}

.mnh-sub b {
  color: var(--accent-light);
  font-weight: 900;
}

/* play area */
.mnh-play{
  position:relative;
  max-width: 1400px;
  margin: 0 auto;
  background: rgba(255,255,255,.95);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow:hidden;
}

/* パネル上部アクセントライン */
.mnh-play::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
  z-index: 1;
}

/* fullscreen styling */
.mnh-play:fullscreen{
  background: var(--bg);
  padding: 10px;
  overflow:auto;
}

/* zoom UI (only in fullscreen) */
.mnh-zoom{ display:none; }
.mnh-play:fullscreen .mnh-zoom{
  display:flex;
  position:fixed;
  right:14px;
  bottom:14px;
  z-index:2147483647;
  gap:8px;
  padding:10px;
  border-radius:16px;
  background:rgba(255,255,255,.86);
  border:1px solid rgba(15,23,42,.10);
  box-shadow:0 10px 30px rgba(15,23,42,.20);
  backdrop-filter: blur(6px);
}
.mnh-zlabel{
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:72px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #e5e7eb;
  background:#fff;
  font-weight:1000;
}
.mnh-zbtn{
  padding:10px 12px;
  border-radius:12px;
  border:2px solid #1e3a5f;
  background:#fff;
  color:#1e3a5f;
  font-weight:1000;
  cursor:pointer;
  box-shadow:0 2px 8px rgba(30,58,95,.10);
}
.mnh-zbtn:hover{ background:#1e3a5f; color:#d4af37; }

/* screen */
.mnh-screen{
  position:relative;
  padding: 18px;
  min-height: 520px;
}

/* stage screen */
.mnh-stage{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 10px;
  min-height: 520px;
  text-align:center;
}
.mnh-stage-title{
  font-size: 56px;
  font-weight: 1000;
  letter-spacing: .02em;
}
.mnh-stage-sub{
  font-size: 22px;
  font-weight: 900;
  color: var(--muted);
  line-height: 1.5;
  max-width: 980px;
}
.mnh-stage-actions{ margin-top: 10px; }

/* board */
.mnh-board-wrap{ display:block; }
.mnh-board-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.mnh-now{
  font-size: 28px;
  font-weight: 1000;
}
.mnh-mini{
  display:flex;
  gap: 14px;
  flex-wrap:wrap;
  justify-content:flex-end;
  font-size: 16px;
  font-weight: 900;
  color: var(--muted);
}
.mnh-rt{ color: #0f172a; }

.mnh-board{
  --n: 2;
  display:grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 12px;
}

.mnh-cell{
  min-height: 86px;
  border-radius: 18px;
  border: 3px solid rgba(37,99,235,.25);
  background: #eef6ff;
  font-weight: 1000;
  font-size: clamp(28px, 4.2vw, 54px);
  cursor:pointer;
  user-select:none;
  touch-action: manipulation;
}
.mnh-cell:active{ transform: scale(0.985); }

/* full countdown overlay */
.mnh-count{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,.92);
  z-index: 50;
}
.mnh-count-num{
  font-size: 160px;
  font-weight: 1000;
  color: var(--blue);
  text-shadow: 0 20px 50px rgba(15,23,42,.18);
}
.mnh-count-num.go{ color: #f97316; }

@keyframes mnh-pop{
  0%{ transform: scale(.7); opacity:.25; }
  60%{ transform: scale(1.18); opacity:1; }
  100%{ transform: scale(1); opacity:1; }
}

/* result */
.mnh-result{
  background:#fff;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(15,23,42,.12);
  max-width: 920px;
  margin: 0 auto;
  text-align:left;
}
.mnh-result-title{
  font-size: 22px;
  font-weight: 1000;
  margin-bottom: 10px;
}
.mnh-rank{
  margin: 0;
  padding-left: 22px;
  font-size: 18px;
  font-weight: 900;
}
.mnh-rank li{ margin: 6px 0; }

/* Mobile */
@media (max-width: 720px){
  .mnh-stage-title{ font-size: 40px; }
  .mnh-stage-sub{ font-size: 18px; }
  .mnh-now{ font-size: 22px; }
  .mnh-screen{ min-height: 420px; }
  .mnh-stage{ min-height: 420px; }
  .mnh-count-num{ font-size: 120px; }
}
