:root {
  --ink: #1d2230;
  --ink-soft: #5b6375;
  --bg: #eef1f6;
  --felt: #1d5a47;
  --felt-deep: #164a3a;
  --felt-line: rgba(255, 255, 255, 0.22);
  --card: #ffffff;
  --red: #d63a2f;
  --black: #1d2230;
  --back: #23336b;
  --gold: #f2c14e;
  --primary: #e2412c;
  --primary-dark: #b52f1d;
  --line: #d8dde8;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Zen Kaku Gothic New", system-ui, sans-serif; font-weight: 500; line-height: 1.6; }
.hidden { display: none !important; }
.nb { display: inline-block; }

.g-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; max-width: 640px; margin: 0 auto; font-size: 13px; font-weight: 900; }
.g-brand { color: var(--ink-soft); text-decoration: none; }
.g-title { flex: 1; text-align: center; }
.g-head [data-mg-account] a { color: var(--back); text-decoration: none; }

main { max-width: 640px; margin: 0 auto; padding: 0 8px 24px; }
.play { position: relative; background: radial-gradient(120% 80% at 50% 0%, #237058 0%, var(--felt) 55%, var(--felt-deep) 100%); border-radius: 16px; padding: 8px 8px 6px; color: #fff; user-select: none; -webkit-user-select: none; }
.bar { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 8px; font-size: 14px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 900; }
.badge.free { background: #fff; }
.sub { font-weight: 900; margin-left: 4px; font-size: 13px; }
.bar-right b { font-variant-numeric: tabular-nums; }
.lbl { opacity: 0.75; font-size: 12px; font-weight: 900; }

/* 場 */
.table { position: relative; touch-action: none; }
.slot { position: absolute; border: 2px solid var(--felt-line); border-radius: 8%/6%; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.28); }
.slot svg { width: 46%; height: 46%; }
.slot.stock { cursor: pointer; }
.slot .k { font: 800 clamp(18px, 6vw, 30px)/1 "Big Shoulders Display", sans-serif; }

.c { position: absolute; left: 0; top: 0; border-radius: 9%/6.5%; background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); transition: transform 0.18s ease-out; will-change: transform; cursor: pointer; overflow: hidden; }
.c.red { color: var(--red); }
.c.black { color: var(--black); }
.c .ix { position: absolute; left: 6%; top: 3%; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.c .rk { font: 800 var(--rk, 18px)/1 "Big Shoulders Display", sans-serif; letter-spacing: -0.02em; }
.c .ix svg { width: var(--sm, 11px); height: var(--sm, 11px); margin-top: 1px; }
.c .big { position: absolute; right: 7%; bottom: 6%; width: 44%; height: 44%; }
.c.down { background: var(--back); background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.09) 0 3px, transparent 3px 7px); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85), 0 1px 2px rgba(0, 0, 0, 0.35); }
.c.down > * { display: none; }
.c.drag { transition: none; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4); }
.c.hint { animation: hint 0.9s ease-in-out 2; }
.slot.hint { animation: hintslot 0.9s ease-in-out 2; }
@keyframes hint { 50% { box-shadow: 0 0 0 4px var(--gold), 0 0 18px var(--gold); } }
@keyframes hintslot { 50% { border-color: var(--gold); box-shadow: 0 0 14px var(--gold); } }
.c.shake { animation: shake 0.3s; }
@keyframes shake { 25% { margin-left: -4px; } 75% { margin-left: 4px; } }

/* 操作 */
.tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 8px 0 0; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border: 0; border-radius: 12px; background: transparent; color: #fff; font: 700 11px/1.2 "Zen Kaku Gothic New", system-ui, sans-serif; cursor: pointer; }
.tool:active { background: rgba(255, 255, 255, 0.12); }
.tool:disabled { opacity: 0.35; cursor: default; }
.tool.ready { background: var(--gold); color: var(--ink); }

/* タイトル・クリア（場を隠して全体を見せる） */
.play.menu .table, .play.menu .tools, .play.menu .bar { display: none; }
.scr { padding: 6px 0 4px; }
.card-ui { width: 100%; max-width: 400px; margin: 0 auto; background: #fff; color: var(--ink); border-radius: 18px; padding: 18px 16px 14px; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.card-ui, .guide { line-break: strict; }
.logo { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: 0.04em; white-space: nowrap; }
.day { margin: 2px 0 10px; font-size: 13px; color: var(--ink-soft); font-weight: 900; }
.daily-box { border: 2px solid var(--felt); border-radius: 16px; padding: 10px 12px; margin-bottom: 10px; }
.daily-lbl { font-size: 11px; font-weight: 900; color: var(--ink-soft); letter-spacing: 0.1em; }
.daily-no { font: 800 30px/1.1 "Big Shoulders Display", sans-serif; color: var(--felt); }
.daily-note { margin: 2px 0 6px; font-size: 12px; color: var(--ink-soft); }
.done { font-size: 14px; font-weight: 900; margin-top: 4px; }
.free-lbl { font-size: 12px; font-weight: 900; color: var(--ink-soft); margin: 4px 0 2px; }
.free-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stats { font-size: 12px; color: var(--ink-soft); font-weight: 700; margin: 8px 0 0; }

.btn { display: block; width: 100%; margin: 6px 0; padding: 12px 10px; border: 0; border-radius: 14px; font: 900 16px/1.2 "Zen Kaku Gothic New", system-ui, sans-serif; cursor: pointer; background: #eef1f6; color: var(--ink); }
.btn small { display: block; font-size: 11px; font-weight: 700; color: var(--ink-soft); margin-top: 3px; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 4px 0 var(--primary-dark); }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--primary-dark); }
.btn.lv { margin: 0; font-size: 15px; padding: 11px 4px; }
.btn.sub { font-size: 14px; }
.btn.ghost { background: transparent; border: 2px solid var(--line); color: var(--ink-soft); font-size: 14px; }
.btn.x { background: #000; color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn:disabled { opacity: 0.5; cursor: default; }

.clear-lbl { font-size: 13px; font-weight: 900; color: var(--felt); }
.clear-time { font: 800 64px/1 "Big Shoulders Display", sans-serif; font-variant-numeric: tabular-nums; margin: 4px 0; }
.clear-sub { margin: 0; font-size: 14px; font-weight: 700; }
.best { display: inline-block; margin: 6px 0 0; padding: 2px 12px; border-radius: 999px; background: var(--gold); font-weight: 900; font-size: 13px; }
.rank { margin: 10px 0; padding: 8px; background: #eef4f1; border-radius: 14px; }
.rank-lbl { font-size: 11px; font-weight: 900; color: var(--ink-soft); }
.rank-name { font-size: 24px; font-weight: 900; }
.share { margin: 8px 0; }
.c-note { margin: 8px 0; padding: 8px 10px; border-radius: 12px; background: #fff6dd; font-size: 13px; font-weight: 700; text-align: left; }

.toast { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 400; max-width: calc(100% - 24px); padding: 10px 18px; border-radius: 16px; background: rgba(20, 24, 36, 0.92); color: #fff; font-weight: 900; font-size: 14px; text-align: center; pointer-events: none; }

/* 下の解説 */
.guide { margin-top: 24px; background: #fff; border-radius: 18px; padding: 18px 18px 8px; font-size: 15px; }
.guide h2 { font-size: 19px; margin: 18px 0 8px; padding-left: 10px; border-left: 5px solid var(--felt); }
.guide h2:first-child { margin-top: 0; }
.guide h3 { font-size: 16px; margin: 14px 0 4px; }
.guide ul { padding-left: 1.3em; }
.guide .steps { list-style: none; padding: 0; }
.guide .steps li { display: flex; align-items: baseline; gap: 6px; margin: 6px 0; }
.guide .steps .num { flex: none; font-weight: 900; color: var(--felt); }
.guide details { border-top: 1px solid var(--line); padding: 8px 0; }
.guide summary { font-weight: 900; cursor: pointer; }
.guide a { color: var(--felt); }
.g-foot { max-width: 640px; margin: 0 auto; padding: 12px 16px 28px; font-size: 12px; text-align: center; }
.g-foot a { color: var(--ink-soft); }

.card-ui .mg-box { background: #eef4f1; border-color: transparent; }

/* 解説の余白と行間（ポータルと同じ決まり: 行間 1.85・段落の間は1行分・見出しは前を広く後ろを狭く） */
.guide { line-height: 1.85; padding: 22px 20px 12px; }
.guide p { margin: 0 0 1em; }
.guide h2 { margin: 32px 0 12px; line-height: 1.4; }
.guide h2:first-child { margin-top: 0; }
.guide h3 { margin: 22px 0 6px; line-height: 1.5; }
.guide ul, .guide ol { margin: 0 0 1em; }
.guide li { margin: 6px 0; }
.guide details { padding: 12px 0; }
.guide details p { margin: 8px 0 4px; }

