/* ツートンキューブ — 2色刷りのリソグラフ印刷物のような紙面 */
:root {
  --paper: #e6e6df;      /* 冷たいグレーの更紙 */
  --paper-2: #d9d9d1;
  --ink: #1b1d29;        /* 墨（キューブ本体・文字） */
  --red: #ef3e4a;        /* 赤インク */
  --blue: #2c59d6;       /* 青インク */
  --line: #b4b4ab;
  --font-display: "Dela Gothic One", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  /* レイアウト：上から 得点 → 盤（3D＋展開図）→ メッセージ → 回転ピッカー、決定バーは下に貼り付く */
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  background-image: radial-gradient(rgba(27, 29, 41, 0.05) 0.8px, transparent 1px);
  background-size: 4px 4px;
}
button { font: inherit; color: inherit; }
button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

#app {
  max-width: 460px; margin: 0 auto; min-height: 100%;
  padding: max(10px, env(safe-area-inset-top)) 16px 0;
  display: flex; flex-direction: column; gap: 10px;
}

/* ---- ヘッダー ---- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.logo {
  margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 22px; letter-spacing: 0.02em; line-height: 1;
  display: flex; white-space: nowrap; flex-shrink: 0;
}
.logo span:first-child { color: var(--red); mix-blend-mode: multiply; text-shadow: 2px 1.5px 0 rgba(44, 89, 214, 0.55); }
.logo span:last-child { color: var(--blue); mix-blend-mode: multiply; text-shadow: -1.5px 1px 0 rgba(239, 62, 74, 0.55); }
.top-btns { display: flex; gap: 6px; flex-shrink: 0; }
.top-btns .ghost { white-space: nowrap; padding: 5px 10px; font-size: 12px; }

.ghost {
  background: transparent; border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.ghost:active { background: var(--paper-2); }
.primary {
  background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 11px 18px; font-size: 15px; font-weight: 900; cursor: pointer; letter-spacing: 0.04em;
}
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: 0.35; }

/* ---- 得点 ---- */
.score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; }
.side {
  border: 1.5px solid var(--ink); border-radius: 10px; padding: 7px 10px 6px;
  display: flex; flex-direction: column; gap: 1px; position: relative; background: transparent;
}
.side.blue { text-align: right; }
.side .who { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.side.blue .who { flex-direction: row-reverse; }
.chip { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.red .chip { background: var(--red); }
.blue .chip { background: var(--blue); }
.turnflag {
  font-style: normal; font-size: 11px; font-weight: 900; padding: 1px 7px; border-radius: 999px;
  background: var(--ink); color: var(--paper); visibility: hidden;
}
.side.active .turnflag { visibility: visible; }
.side.active.red { box-shadow: 4px 4px 0 var(--red); }
.side.active.blue { box-shadow: -4px 4px 0 var(--blue); }
.big { font-family: var(--font-display); font-size: 34px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.red .big { color: var(--red); }
.blue .big { color: var(--blue); }
.sub { font-size: 12px; font-variant-numeric: tabular-nums; line-height: 1.4; white-space: nowrap; }
.pips { letter-spacing: 1px; }
.mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; text-align: center; min-width: 64px; }
.turns { font-weight: 900; font-size: 13px; font-variant-numeric: tabular-nums; }
.mode { font-size: 11px; opacity: 0.75; line-height: 1.3; }

/* ---- 表示切替 ---- */
.viewsw { display: flex; gap: 4px; align-items: center; }
.viewsw button {
  border: 1.5px solid var(--ink); background: transparent; border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.viewsw button.on { background: var(--ink); color: var(--paper); }
.viewsw .reset { margin-left: auto; border-style: dashed; }
.viewsw .reset.on { background: var(--ink); color: var(--paper); border-style: solid; }
.viewsw .reset2 { border-style: dashed; }

/* ---- 盤 ---- */
.boards { display: flex; flex-direction: column; gap: 10px; }
.boards.v-3d .net, .boards.v-net .stage { display: none; }
.stage { position: relative; height: min(78vw, 320px); }
.boards.v-3d .stage { height: min(108vw, 460px); }
.viewbtns { position: absolute; right: 2px; bottom: 4px; display: flex; gap: 6px; }
.viewbtns button {
  width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--paper);
  font-size: 19px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.viewbtns button:active { background: var(--ink); color: var(--paper); }
#cv { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }

.net {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px;
  grid-template-areas: ". U . ." "L F R B" ". D . .";
}
.boards.v-net .net { gap: 7px; }
.face {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 2px; min-width: 0;
  background: var(--ink); border-radius: 5px; position: relative;
}
.face.threat-0 { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4.5px var(--red); }
.face.threat-1 { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4.5px var(--blue); }
.face.threat-0.threat-1 { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4.5px var(--red), 0 0 0 7px var(--blue); }
.cell {
  aspect-ratio: 1; border: 0; min-width: 0; border-radius: 3px; padding: 0; position: relative; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; color: #fff;
}
.cell.c0 { background-color: var(--red); }
.cell.c1 { background-color: var(--blue); }
.cell.lk { background-image: radial-gradient(rgba(16, 18, 30, 0.42) 1.1px, transparent 1.3px); background-size: 4px 4px; box-shadow: inset 0 0 0 2px var(--ink); }
.cell.sel { box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 4.5px var(--paper); z-index: 1; }
.cell.flip::before, .cell.dot::before, .cell.pend0::before, .cell.pend1::before {
  content: ""; position: absolute; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.cell.flip::before { width: 52%; height: 52%; border: 2.5px solid var(--paper); box-shadow: 0 0 0 1.5px var(--ink); }
.cell.dot::before { width: 24%; height: 24%; background: var(--paper); box-shadow: 0 0 0 1.5px var(--ink); }
.cell.pend0::before, .cell.pend1::before { width: 56%; height: 56%; border: 3.5px solid var(--red); box-shadow: 0 0 0 1.5px var(--ink), inset 0 0 0 1.5px var(--ink); }
.cell.pend1::before { border-color: var(--blue); }
.mid .round { font-size: 11px; font-weight: 700; line-height: 1.3; }
.cell.inl { outline: 1.5px dashed var(--paper); outline-offset: -4px; }

/* ---- メッセージ ---- */
.msg { display: flex; flex-direction: column; gap: 2px; }
.m1 { font-weight: 900; font-size: 15px; }
.m2 { font-size: 13px; line-height: 1.45; }
.m2 .warn { color: #b3121f; font-weight: 700; }
.m2 .good { color: var(--ink); font-weight: 700; }
.thinking::after { content: "…"; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

/* ---- 回転ピッカー ---- */
.picker { display: flex; flex-direction: column; gap: 6px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.prow { display: grid; grid-template-columns: 30px repeat(3, 1fr); gap: 6px; align-items: center; }
.plabel { font-family: var(--font-display); font-size: 15px; text-align: center; }
.prow button, .dirs button {
  border: 1.5px solid var(--ink); background: transparent; border-radius: 8px; padding: 8px 4px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.prow button.on { background: var(--ink); color: var(--paper); }
.dirs { display: grid; grid-template-columns: 30px repeat(3, 1fr); gap: 6px; min-height: 40px; }
.dirs button { background: var(--paper-2); }
.dirs button.on { background: var(--ink); color: var(--paper); }
.dirs button:disabled, .prow button:disabled { opacity: 0.32; text-decoration: line-through; }
.dirs .hintline { grid-column: 1 / -1; font-size: 12px; opacity: 0.7; align-self: center; }

.confirm { display: none; gap: 8px; }
.confirm.show { display: flex; }
.confirm .primary { flex: 1; }

/* ---- オーバーレイ ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(27, 29, 41, 0.55); display: flex; align-items: flex-end; justify-content: center;
  z-index: 30; padding: 16px;
}
.overlay.light { background: rgba(27, 29, 41, 0.25); }
.overlay[hidden] { display: none; }
.sheet {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; width: 100%; max-width: 460px;
  max-height: calc(100% - 20px); overflow-y: auto; padding: 16px 16px 14px; box-shadow: 6px 6px 0 var(--blue);
}
.sheet.small { box-shadow: 6px 6px 0 var(--red); }
.sheet h2 { font-family: var(--font-display); font-weight: 400; font-size: 21px; margin: 0 0 10px; text-wrap: balance; }
.sheet p { font-size: 14px; line-height: 1.6; margin: 0 0 10px; }
.field { margin-bottom: 12px; }
.flabel { display: block; font-size: 12px; font-weight: 900; margin-bottom: 5px; letter-spacing: 0.04em; }
.seg { display: flex; flex-wrap: wrap; gap: 5px; }
.seg button { border: 1.5px solid var(--ink); background: transparent; border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 700; cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--paper); }
.seg button:disabled { opacity: 0.3; }
.note { font-size: 12px !important; opacity: 0.8; margin: 6px 0 0 !important; line-height: 1.5 !important; }
.sheet-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.rules h3 { font-size: 14px; margin: 12px 0 4px; }
.rules ul { margin: 0; padding-left: 1.2em; font-size: 13.5px; line-height: 1.65; }
.rules p { font-size: 13.5px; }
.redt { color: var(--red); font-weight: 900; }
.bluet { color: var(--blue); font-weight: 900; }

@media (prefers-reduced-motion: reduce) {
  .thinking::after { animation: none; }
}

/* ★・確定の残り・コンボ */
.cell .st { position: absolute; top: 1px; right: 3px; font-size: 10px; line-height: 1; color: #fff; text-shadow: 0 0 2px var(--ink), 0 0 2px var(--ink); font-weight: 900; }
.cell .ln { position: absolute; bottom: 1px; right: 3px; font-size: 9px; line-height: 1; font-weight: 900; color: var(--paper); background: var(--ink); border-radius: 3px; padding: 1px 2px; }
.cell .lab { text-shadow: 0 0 3px rgba(20, 22, 34, 0.7); }
.cell.dot::before { left: 22%; top: 22%; width: 22%; height: 22%; }
.side.bump { animation: bump 0.9s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 25% { transform: scale(1.06); } 100% { transform: scale(1); } }
.mid .komi { font-size: 11px; opacity: 0.8; }
.mid .final { font-size: 11px; font-weight: 900; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 1px 8px; }
@media (prefers-reduced-motion: reduce) { .side.bump { animation: none; } }

/* 回し放題のタイマー */
.timerbar { height: 10px; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: transparent; }
.timerbar[hidden] { display: none; }
.timerbar i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left center; }
.timerbar.low i { background: var(--red); }
.m1 .sec { font-family: var(--font-display); font-size: 22px; font-variant-numeric: tabular-nums; }
.stage.spinning { outline: 2.5px dashed var(--ink); outline-offset: -2px; border-radius: 12px; }
.confirm .ghost { white-space: nowrap; }

/* ---- タイトル ---- */
.title { position: fixed; inset: 0; z-index: 20; background: var(--paper);
  background-image: radial-gradient(rgba(27, 29, 41, 0.05) 0.8px, transparent 1px); background-size: 4px 4px;
  display: flex; align-items: center; justify-content: center; padding: 24px 16px max(24px, env(safe-area-inset-bottom)); }
.title[hidden] { display: none; }
.title-inner { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
#tcv { width: min(78vw, 320px); height: min(78vw, 320px); display: block; }
.logo.big { font-size: clamp(38px, 12vw, 56px); flex-direction: column; align-items: center; line-height: 1.02; letter-spacing: 0.04em; }
.logo.big span:first-child { text-shadow: 4px 3px 0 rgba(44, 89, 214, 0.55); }
.logo.big span:last-child { text-shadow: -3px 2px 0 rgba(239, 62, 74, 0.55); }
.title-btns { width: min(100%, 300px); display: flex; flex-direction: column; gap: 10px; }
.title-btns .primary { padding: 14px 18px; font-size: 17px; }
.title-btns .ghost { padding: 11px 18px; font-size: 15px; }
#app[hidden] { display: none; }

/* ---- チュートリアル ---- */
.coach { border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px; background: var(--paper); box-shadow: 4px 4px 0 var(--red); display: flex; flex-direction: column; gap: 8px; }
.coach[hidden] { display: none; }
.coach p { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.55; }
.coach-btns { display: flex; gap: 8px; }
.coach-btns:empty { display: none; }
.coach-btns .primary { flex: 1; padding: 9px 14px; font-size: 14px; }
.coach-btns .ghost { padding: 9px 14px; }
.cell.tut { animation: tutpulse 1s ease-in-out infinite; z-index: 2; }
@keyframes tutpulse { 0%, 100% { box-shadow: inset 0 0 0 3px var(--paper), 0 0 0 3px var(--ink); } 50% { box-shadow: inset 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); } }

/* ---- 色選び・終局 ---- */
.sheet-btns.row { flex-direction: row; }
.sheet-btns.row button { flex: 1; }
.pick-red { background: var(--red); border-color: var(--red); }
.pick-blue { background: var(--blue); border-color: var(--blue); }
.endscore { font-family: var(--font-display); font-size: 26px !important; margin: 0 0 12px !important; font-variant-numeric: tabular-nums; }
.top .ghost { white-space: nowrap; padding: 5px 12px; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .cell.tut { animation: none; box-shadow: inset 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); } }

/* ---- 画面下の操作バー ---- */
#app { padding-bottom: 150px; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--paper);
  border-top: 2px solid var(--ink); padding: 8px 16px max(10px, env(safe-area-inset-bottom)); }
.dock-inner { max-width: 428px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.dock .m1 { font-size: 15px; }
.dock .m2 { font-size: 13px; min-height: 1.2em; }
.dock .confirm .primary { padding: 12px 18px; }
#app.tutorial .sub, #app.tutorial .turnflag, #app.tutorial .mid { display: none; }
.dock.empty { display: none; }
#app.tutorial .picker { display: none; }
#app.tutorial.tut-rot .picker { display: flex; }
#app.tutorial .side.active { box-shadow: none; }
#app.tutorial .score { grid-template-columns: 1fr 1fr; }

/* ===== 1画面に収めるレイアウト ===== */
html, body { height: 100%; overflow: hidden; }
#app { height: 100dvh; max-height: 100dvh; padding: 8px 12px 0; gap: 8px; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
#app[hidden] { display: none; }
.top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.top .mid { min-width: 0; flex-direction: row; gap: 8px; justify-content: center; }
.top .turns { font-size: 13px; display: flex; gap: 6px; align-items: baseline; }
.top .turns .round { font-size: 11px; font-weight: 700; }
.top .mode { font-size: 11px; }
.viewsw button { padding: 4px 9px; }
.score { grid-template-columns: 1fr 1fr; gap: 8px; }
.side { padding: 5px 10px; flex-direction: row; align-items: center; justify-content: space-between; gap: 6px; }
.side.blue { flex-direction: row-reverse; }
.side .who { flex-direction: column; align-items: flex-start; gap: 2px; font-size: 12px; }
.side.blue .who { align-items: flex-end; flex-direction: column; }
.big { font-size: 30px; }
.sub { font-size: 11px; }
.side .turnflag { padding: 0 6px; font-size: 10px; }
.boards { flex: 1; min-height: 0; position: relative; display: block; }
.stage, .boards.v-3d .stage { height: 100%; }
.boards .net { display: none; }
.boards.v-net .stage { display: none; }
.boards.v-net .net { display: grid; height: 100%; max-width: 100%; aspect-ratio: 4 / 3; margin: 0 auto; align-content: center; }
.picker { display: none !important; }
.coach { padding: 8px 10px; }
.coach p { font-size: 14px; }
.dock { position: static; border-top: 2px solid var(--ink); margin: 0 -12px; padding: 8px 12px max(10px, env(safe-area-inset-bottom)); }
.dock.empty { display: block; }
#app { padding-bottom: 0; }
.dock .msg { min-height: 40px; }
.confirm { display: flex; visibility: hidden; }
.confirm.show { visibility: visible; }
.title-inner { gap: 14px; }
#tcv { width: min(70vw, 280px); height: min(70vw, 280px); }
.top .turns, .top .mode, .side .who, .sub { white-space: nowrap; }
.top .mid { flex-direction: column; gap: 0; align-items: center; }
.top .turns { font-size: 12px; }
.top .mode { font-size: 10px; }
.side { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: end; column-gap: 8px; }
.side .who { grid-column: 1 / -1; flex-direction: row !important; align-items: center !important; }
.side.blue .who { flex-direction: row-reverse !important; }
.side.blue { grid-template-columns: 1fr auto; }
.side.blue .big { order: 2; }
.side .sub { padding-bottom: 4px; }

.title-sub { display: flex; gap: 8px; }
.title-sub .ghost { flex: 1; padding: 10px 6px; font-size: 14px; }
.title-btns .primary { padding: 12px 18px; }
.m1row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ghost.mini { padding: 3px 10px; font-size: 12px; }
.replaybar { display: flex; gap: 6px; }
.replaybar[hidden] { display: none; }
.replaybar button { flex: 1; padding: 10px 4px; font-size: 16px; }
.replaybar #rpClose { flex: 1.3; font-size: 13px; }
.log { margin: 0; padding-left: 1.6em; font-size: 13px; line-height: 1.6; max-height: 55vh; overflow-y: auto; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; font-size: 12px; }
.stats div { border: 1.5px solid var(--ink); border-radius: 8px; padding: 6px; text-align: center; }
.stats b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.records { list-style: none; margin: 0 0 8px; padding: 0; max-height: 50vh; overflow-y: auto; }
.records li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.records li span { flex: 1; }
.records .w { font-weight: 900; }
.records .ghost { padding: 4px 10px; font-size: 12px; }
.joinrow { display: flex; gap: 8px; margin-top: 12px; }
.joinrow input { flex: 1; font: inherit; font-size: 20px; letter-spacing: 0.2em; text-align: center; border: 1.5px solid var(--ink); border-radius: 10px; background: transparent; color: var(--ink); padding: 8px; min-width: 0; }
.onstatus { font-size: 14px !important; min-height: 1.4em; }
.onstatus .code { font-family: var(--font-display); font-size: 34px; letter-spacing: 0.15em; display: block; }
.onstatus { display: flex; flex-direction: column; align-items: stretch; gap: 8px; text-align: center; }
.onstatus .line { background: #06c755; border-color: #06c755; color: #fff; text-decoration: none; display: block; }
.onstatus .wait { font-size: 13px; opacity: 0.8; }

/* ---- 比率バー・スタンプ ---- */
.ratio { height: 8px; border-radius: 999px; background: var(--blue); overflow: hidden; border: 1.5px solid var(--ink); flex: none; }
.ratio i { display: block; height: 100%; width: 50%; background: var(--red); transition: width 0.5s ease; border-right: 2px solid var(--paper); }
.m1btns { display: flex; gap: 6px; align-items: center; }
.stamps { display: flex; gap: 2px; }
.stamps[hidden] { display: none; }
.stamps button { border: 0; background: transparent; font-size: 20px; padding: 0 2px; cursor: pointer; }
.bubble { position: fixed; z-index: 16; font-size: 44px; pointer-events: none; animation: bub 1.6s ease-out forwards; }
.bubble[hidden] { display: none; }
@keyframes bub { 0% { transform: scale(0.3); opacity: 0; } 15% { transform: scale(1.15); opacity: 1; } 70% { transform: scale(1); opacity: 1; } 100% { transform: translateY(-24px); opacity: 0; } }
/* ---- 終局のカウント ---- */
.endcount { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.ec { border: 2px solid var(--ink); border-radius: 12px; padding: 6px 10px; display: flex; align-items: baseline; justify-content: space-between; }
.ec span { font-weight: 900; }
.ec b { font-family: var(--font-display); font-weight: 400; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.ec.red b { color: var(--red); } .ec.blue b { color: var(--blue); }
.ec.win { box-shadow: 4px 4px 0 var(--ink); transform: translateY(-2px); }
.ratio.end { height: 12px; margin-bottom: 10px; }
.ratio.end i { transition: width 0.12s linear; }
.endtitle { font-size: 30px !important; text-align: center; visibility: hidden; }
.endtitle.show { visibility: visible; animation: pop 0.5s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { 0% { transform: scale(0.3) rotate(-8deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.endscore { text-align: center; font-size: 15px !important; font-family: var(--font-body) !important; }
@media (prefers-reduced-motion: reduce) { .endtitle.show, .bubble { animation: none; } }

/* タイトルロゴ画像 */
.title-logo { margin: 0; width: min(92vw, 400px); line-height: 0; }
.title-logo img { width: 100%; height: auto; display: block; mix-blend-mode: multiply; }

/* あそびかた選択・コーチの見出し */
#ovTut .sheet-btns { display: flex; flex-direction: column; gap: 10px; }
#ovTut .primary { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 16px; font-size: 17px; }
#ovTut .primary small { font-size: 12px; font-weight: 500; opacity: .8; }
.coach-title { display: block; font-size: 12px; letter-spacing: .04em; opacity: .7; margin-bottom: 3px; }

/* 塗れるマスの印（展開図） */
.cell.can::after { content: ''; position: absolute; left: 50%; top: 50%; width: 22%; height: 22%; transform: translate(-50%, -50%) rotate(45deg);
  background: var(--red); box-shadow: 0 0 0 1.5px var(--paper); pointer-events: none; }
.cell.can.can1::after { background: var(--blue); }

/* 小さな展開図（3Dのとき左上にいつも出す。押すと展開図を大きく） */
.mininet {
  position: absolute; left: 2px; top: 2px; width: min(32%, 132px); aspect-ratio: 4 / 3; cursor: pointer;
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2px;
  grid-template-areas: ". U . ." "L F R B" ". D . .";
  padding: 4px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 6px; z-index: 2;
}
.mface { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 1px; background: var(--ink); padding: 1px; border-radius: 2px; }
.mface i { display: block; border-radius: 1px; }
.mface i.c0 { background: var(--red); }
.mface i.c1 { background: var(--blue); }
.mininet.rot .mface i { opacity: .4; }
.mininet.rot .mface i.mv { opacity: 1; box-shadow: inset 0 0 0 1.5px var(--paper); }

/* 展開図のとき：キューブを右上に小さく出す（押すと3Dに戻る） */
#boards.v-net .stage {
  display: block; position: absolute; right: 0; top: 0; width: min(28%, 120px); height: auto; aspect-ratio: 1;
  border: 1.5px solid var(--ink); border-radius: 8px; background: var(--paper); z-index: 3; cursor: pointer;
}
#boards.v-net .viewbtns, #boards.v-net .mininet { display: none; }
