/* =============================================
   四ツ目のダルマ  見た目（縁日の夜・漆と金）
   ============================================= */
:root {
  --bg: #07060c;
  --card: #151016;
  --lacq: #0e0b10;
  --ink: #f3e7cf;
  --muted: #b5a585;
  --gold: #e3bb5c;
  --gold2: #f6dc8b;
  --gold-d: #9a7226;
  --red: #d2232d;
  --red2: #ee4a3c;
  --red-d: #7d0a12;
  --indigo: #2c4bb8;
  --indigo2: #4a6fd6;
  --indigo-d: #142466;
  --line: rgba(227, 187, 92, 0.38);
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
  --font: "Shippori Mincho B1", "Noto Serif TC", "Gowun Batang", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --display: "Kaisei Tokumin", "Noto Serif TC", "Gowun Batang", "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --brush: "Yuji Syuku", "Song Myung", "Noto Serif TC", "Kaisei Tokumin", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --goldtext: linear-gradient(180deg, #fff6cf 0%, #f6dc8b 26%, #d9a441 54%, #9a6a1e 76%, #efcf7a 100%);
  --shippo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke='%23e3bb5c' stroke-opacity='.11'%3E%3Ccircle cx='0' cy='0' r='22'/%3E%3Ccircle cx='44' cy='0' r='22'/%3E%3Ccircle cx='0' cy='44' r='22'/%3E%3Ccircle cx='44' cy='44' r='22'/%3E%3Ccircle cx='22' cy='22' r='22'/%3E%3C/g%3E%3C/svg%3E");
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-weight: 500;
  background-image: linear-gradient(180deg, #04050f 0%, #0a0d26 35%, #1b1230 70%, #3a1620 92%, #4a1a16 100%);
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}
button, a.btn { font-family: inherit; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.no3d #gl { display: none; }
.vignette { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%); }
#app { position: fixed; inset: 0; z-index: 1; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: flex; }

/* ---------- ボタン（漆の板に金のふち） ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer;
  border: 1px solid #c79b3f; border-radius: 11px; padding: 13px 18px; min-height: 48px;
  font-family: var(--display); font-size: 17px; font-weight: 800; letter-spacing: 0.08em; line-height: 1.2; color: var(--gold2);
  background: linear-gradient(180deg, #2c212b 0%, #150f15 46%, #0a070a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 236, 170, 0.4), inset 0 0 0 3px #0c090c, inset 0 0 0 4px rgba(227, 187, 92, 0.5), 0 6px 14px rgba(0, 0, 0, 0.55);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.08s, filter 0.12s;
}
.btn::before { content: ""; position: absolute; inset: 1px 1px 52% 1px; border-radius: 10px 10px 40% 40% / 10px 10px 18px 18px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.02)); pointer-events: none; }
.btn:active { transform: translateY(2px) scale(0.985); filter: brightness(1.2); }
.btn.wide { width: 100%; }
.btn.red { color: #fff3cf; background: linear-gradient(180deg, #ee4a3c 0%, #c4161f 46%, #8d0d15 100%); box-shadow: inset 0 1px 0 rgba(255, 220, 190, 0.55), inset 0 0 0 3px #8d0d15, inset 0 0 0 4px rgba(246, 220, 139, 0.6), 0 6px 16px rgba(120, 8, 16, 0.55), 0 0 22px rgba(255, 90, 50, 0.16); }
.btn.indigo { color: #eef2ff; background: linear-gradient(180deg, #4a6fd6 0%, #24409f 46%, #16296e 100%); box-shadow: inset 0 1px 0 rgba(210, 225, 255, 0.5), inset 0 0 0 3px #16296e, inset 0 0 0 4px rgba(230, 236, 245, 0.5), 0 6px 16px rgba(10, 20, 80, 0.6); }
.btn.sub { color: var(--ink); font-size: 15px; background: linear-gradient(180deg, rgba(34, 26, 34, 0.86), rgba(12, 9, 12, 0.86)); border-color: rgba(227, 187, 92, 0.5); box-shadow: inset 0 1px 0 rgba(255, 236, 170, 0.16), 0 4px 10px rgba(0, 0, 0, 0.45); }
.btn.sub::before { opacity: 0.45; }
.btn.xpost { color: #fff; font-size: 15px; background: linear-gradient(180deg, #2a2a2e, #050506); border-color: rgba(255, 255, 255, 0.35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 10px rgba(0, 0, 0, 0.5); }
.btn:disabled { opacity: 0.5; }

/* ---------- タイトル ---------- */
#title { align-items: center; justify-content: center; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.title-box { width: min(420px, 92vw); text-align: center; padding: calc(92px + env(safe-area-inset-top)) 0 26px; margin: auto; }
#logo-canvas { width: 100%; height: clamp(70px, 11.5vh, 104px); display: block; margin: 0 auto 16px; }
.logo-wrap { position: relative; display: inline-block; }
.logo {
  margin: 0; font-family: var(--brush); font-weight: 400; font-size: clamp(66px, 20vw, 92px); line-height: 1; letter-spacing: 0.04em;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.95) 50%, transparent 58%) 130% 0 / 260% 100% no-repeat, var(--goldtext);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1.2px rgba(255, 236, 170, 0.5); animation: sheen 5.5s ease-in-out infinite;
  filter: drop-shadow(0 2px 0 #5a0b10) drop-shadow(0 0 22px rgba(255, 150, 60, 0.35)) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.8));
}
.logo small {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px;
  font-family: var(--display); font-weight: 800; font-size: 0.25em; letter-spacing: 0.5em; text-indent: 0.5em;
  -webkit-text-fill-color: var(--ink); color: var(--ink); -webkit-text-stroke: 0;
}
.logo small::before, .logo small::after { content: ""; flex: 0 0 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.logo small::after { transform: scaleX(-1); }
.seal {
  position: absolute; right: -30px; bottom: 6px; width: 30px; height: 30px; display: grid; place-items: center;
  font-family: var(--brush); font-size: 20px; line-height: 1; color: #fff3e0; background: #c8102e; border-radius: 5px; transform: rotate(7deg);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.4), 0 2px 6px rgba(0, 0, 0, 0.6);
}
.tagline { margin: 16px 0 20px; font-size: 14px; color: #dccfb2; line-height: 1.9; letter-spacing: 0.04em; text-shadow: 0 1px 8px #000, 0 0 2px #000; }
.tagline b { color: var(--gold2); font-weight: 800; }
.menu { display: flex; flex-direction: column; gap: 12px; }
.menu-card {
  position: relative; padding: 12px 12px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 17, 24, 0.82), rgba(9, 6, 9, 0.84)), var(--shippo);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 236, 170, 0.12);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
}
.menu-card::before, .menu-card::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--gold); pointer-events: none; }
.menu-card::before { left: 5px; top: 5px; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.menu-card::after { right: 5px; bottom: 5px; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }
.menu-label { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.2em; color: var(--gold); }
.menu-label::before, .menu-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(227, 187, 92, 0.6)); }
.menu-label::after { transform: scaleX(-1); }
.level-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.btn.lv { padding: 12px 0; font-size: 16px; letter-spacing: 0.04em; }
.menu-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-sub .btn { font-size: 14px; padding: 10px 8px; min-height: 42px; letter-spacing: 0.04em; }

@keyframes sheen { 0%, 62% { background-position: 130% 0, 0 0; } 100% { background-position: -30% 0, 0 0; } }

/* ---------- ゲーム ---------- */
#game { flex-direction: column; align-items: center; justify-content: flex-start; }
.hud {
  width: 100%; max-width: 720px; display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top)) 12px 4px;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--gold2);
  border: 1px solid #c79b3f; background: linear-gradient(180deg, #2c212b, #0a070a);
  box-shadow: inset 0 1px 0 rgba(255, 236, 170, 0.35), 0 4px 10px rgba(0, 0, 0, 0.55);
}
.icon-btn:active { filter: brightness(1.3); }
.icon-btn.off { opacity: 0.4; }
.hud-title {
  font-family: var(--brush); font-size: 20px; letter-spacing: 0.14em;
  background: var(--goldtext); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
}
.stage { flex: 1; width: 100%; max-width: 720px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 0 10px calc(10px + env(safe-area-inset-bottom)); min-height: 0; }
.players { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.vs { font-family: var(--brush); color: var(--gold); font-size: 17px; letter-spacing: 0.06em; text-shadow: 0 2px 6px #000; }
.pcard {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 7px 10px; min-width: 0; border-radius: 12px;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(30, 22, 30, 0.9), rgba(10, 7, 10, 0.92));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 236, 170, 0.14); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.pcard::after { content: ""; position: absolute; top: 7px; bottom: 7px; width: 3px; border-radius: 2px; }
.pcard.p1::after { left: 4px; background: linear-gradient(180deg, var(--red2), var(--red-d)); }
.pcard.p2::after { right: 4px; background: linear-gradient(180deg, var(--indigo2), var(--indigo-d)); }
.pcard.p1 { padding-left: 13px; }
.pcard.p2 { justify-content: flex-end; text-align: right; padding-right: 13px; }
.pcard > div { display: flex; flex-direction: column; min-width: 0; }
.pname { font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pwins { font-size: 12px; color: var(--muted); font-weight: 700; }
.pwins b { font-family: var(--display); font-size: 18px; color: var(--gold2); margin-right: 1px; }
.pface { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.7)); }
.pcard.turn { transform: scale(1.045); border-color: var(--gold2); box-shadow: 0 0 0 1px rgba(246, 220, 139, 0.6), 0 0 26px rgba(255, 170, 70, 0.5), var(--shadow); }
.pcard.turn .pface { animation: rock 1.1s ease-in-out infinite; transform-origin: 50% 92%; }
@keyframes rock { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
.status {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; min-height: 28px;
  font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: 0.1em; text-shadow: 0 2px 8px #000, 0 0 2px #000;
}
.status::before, .status::after { content: ""; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); box-shadow: 0 0 8px rgba(255, 190, 90, 0.8); flex: none; }
.status .t { color: var(--gold2); font-size: 14px; margin-left: 2px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.board-area { flex: 0 1 auto; display: flex; align-items: center; justify-content: center; width: 100%; touch-action: none; }
#board { display: block; cursor: pointer; }
.hammer-bar {
  display: flex; align-items: center; gap: 8px; padding: 7px 16px 7px 10px; max-width: 100%; white-space: nowrap; border-radius: 999px;
  font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; color: var(--ink);
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(30, 22, 30, 0.92), rgba(10, 7, 10, 0.94)); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 236, 170, 0.14);
}
.hb-icon { display: grid; place-items: center; flex: none; filter: drop-shadow(0 1px 2px #000); }
#hammer-text { overflow: hidden; text-overflow: ellipsis; }
.hammer-bar.soon { border-color: #ff7a4a; color: #ffd9b0; box-shadow: 0 0 0 1px rgba(255, 120, 70, 0.7), 0 0 24px rgba(255, 80, 40, 0.55), var(--shadow); animation: pulse 0.9s ease-in-out infinite; }
.hammer-bar.soon .hb-icon { animation: knock 0.45s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.045); } }
@keyframes knock { 50% { transform: rotate(-18deg); } }
/* あと何ターンかを、小さな提灯の灯りで見せる */
.hb-dots { display: inline-flex; gap: 5px; flex: none; }
.hb-dots i { width: 9px; height: 12px; border-radius: 45%; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(227, 187, 92, 0.4); }
.hb-dots i.on { background: radial-gradient(circle at 50% 40%, #fff0c0, #ff9a3a 60%, #d2401c); border-color: #ffcf8a; box-shadow: 0 0 9px #ff9a3a, 0 0 2px #fff; }
.hint-line { margin: 0; font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: 0.08em; text-shadow: 0 1px 6px #000; min-height: 1.3em; }
.eyes { position: absolute; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--muted); font-weight: 700; text-shadow: 0 1px 6px #000; }
.pl { display: none; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }
/* 盤の上に出る大きな文字（スタート・だるま落とし・サドンデス） */
#fx-label { position: fixed; left: 50%; top: 50%; z-index: 30; pointer-events: none; opacity: 0; transform: translate(-50%, -50%); white-space: nowrap; }
#fx-label span {
  position: relative; display: inline-block; padding: 0 0.3em; font-family: var(--brush); font-weight: 400; line-height: 1.25; letter-spacing: 0.04em;
  color: var(--lc, #ffd46b); -webkit-text-stroke: 0.1em #1a0704; paint-order: stroke fill;
  text-shadow: 0 0 0.35em rgba(255, 150, 50, 0.9), 0 0.06em 0 #000;
}
#fx-label span::before {
  content: ""; position: absolute; left: -0.5em; right: -0.5em; top: 0.08em; bottom: 0.02em; z-index: -1; transform: skewX(-14deg);
  background: linear-gradient(90deg, transparent, rgba(141, 13, 21, 0.92) 14%, rgba(20, 5, 8, 0.94) 50%, rgba(141, 13, 21, 0.92) 86%, transparent);
  border-top: 2px solid rgba(246, 220, 139, 0.85); border-bottom: 2px solid rgba(246, 220, 139, 0.85);
}
#fx-label.on span { animation: slam 0.34s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
#fx-label.on span::before { animation: sweep 0.3s ease-out both; }
@keyframes slam { 0% { transform: scale(2.4) rotate(-6deg); filter: blur(4px); } 100% { transform: scale(1) rotate(-3deg); filter: blur(0); } }
@keyframes sweep { 0% { transform: skewX(-14deg) scaleX(0); } 100% { transform: skewX(-14deg) scaleX(1); } }

/* ---------- ダイアログ ---------- */
.overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(4, 3, 8, 0.66); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 10; padding: 16px; }
.overlay.show { display: flex; animation: fade 0.2s ease-out; }
#ov-result { background: radial-gradient(90% 70% at 50% 50%, rgba(4, 3, 8, 0.6), rgba(4, 3, 8, 0.2)); -webkit-backdrop-filter: none; backdrop-filter: none; }
@keyframes fade { from { opacity: 0; } }
.modal { z-index: 20; }
.dialog {
  position: relative; width: min(380px, 100%); max-height: 94vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 24px 20px 20px;
  border: 1px solid #c79b3f; border-radius: 16px;
  background: linear-gradient(180deg, rgba(34, 25, 34, 0.97), rgba(12, 8, 12, 0.98)), var(--shippo);
  box-shadow: inset 0 0 0 4px #0c090c, inset 0 0 0 5px rgba(227, 187, 92, 0.45), 0 30px 70px rgba(0, 0, 0, 0.75), 0 0 60px rgba(255, 150, 60, 0.12);
}
.overlay.show .dialog { animation: rise 0.28s cubic-bezier(0.2, 1.2, 0.4, 1); }
@keyframes rise { from { transform: translateY(18px) scale(0.96); opacity: 0; } }
.dialog h2 {
  margin: 0 0 4px; text-align: center; font-family: var(--brush); font-weight: 400; font-size: 30px; letter-spacing: 0.08em; line-height: 1.3;
  background: var(--goldtext); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(90, 11, 16, 0.9));
}
.result-top { position: relative; height: 128px; display: grid; place-items: center; margin-top: -4px; }
.result-top::before { content: ""; position: absolute; width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 200, 110, 0.5), rgba(255, 150, 60, 0.12) 45%, transparent 68%); }
.result-top::after {
  content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; opacity: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255, 226, 150, 0.22) 0deg 7deg, transparent 7deg 22.5deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%);
}
#ov-result[data-r="win"] .result-top::after { opacity: 1; animation: spin 14s linear infinite; }
#ov-result[data-r="lose"] .result-top::before { background: radial-gradient(circle, rgba(120, 140, 220, 0.25), transparent 62%); }
#ov-result[data-r="lose"] .dialog h2 { background: linear-gradient(180deg, #e9e2d2, #9c93a6); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.9)); }
@keyframes spin { to { transform: rotate(360deg); } }
#result-daruma { position: relative; z-index: 1; width: 124px; height: 124px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.7)); }
#ov-result[data-r="win"] #result-daruma { animation: rock 1.2s ease-in-out infinite; transform-origin: 50% 90%; }
.result-sub { margin: 0 0 6px; text-align: center; color: var(--muted); font-size: 14px; }
.result-sub:empty { display: none; }
.hint { margin: 0; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.7; }
.hint:empty { display: none; }
.err { margin: 0; min-height: 1em; font-size: 13px; color: #ff7a6a; text-align: center; font-weight: 800; }
.field-l { display: flex; flex-direction: column; gap: 6px; font-family: var(--display); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 6px; }
.field-l input {
  font: inherit; font-family: var(--font); font-size: 18px; font-weight: 700; letter-spacing: 0.02em; color: var(--ink); padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #0a070a; outline: none; -webkit-user-select: text; user-select: text; box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
}
.field-l input::placeholder { color: rgba(181, 165, 133, 0.5); }
.field-l input:focus { border-color: var(--gold2); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 0 3px rgba(227, 187, 92, 0.22); }
.wait-code { margin: 0; text-align: center; color: var(--muted); }
.wait-code b { color: var(--gold2); font-size: 20px; }
.wait-msg { margin: 4px 0 8px; text-align: center; font-weight: 800; }
.howto { width: min(460px, 100%); }
.howto ol { margin: 0; padding-left: 22px; font-size: 14px; line-height: 1.8; }
.howto li { margin-bottom: 6px; }
.howto li::marker { color: var(--gold); font-family: var(--display); font-weight: 800; }
.howto b { color: var(--gold2); font-weight: 800; }
.howto-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.howto-keys div { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(227, 187, 92, 0.22); border-radius: 10px; padding: 8px 10px; font-size: 12px; }
.howto-keys h3 { margin: 0 0 4px; font-family: var(--display); font-size: 13px; color: var(--gold); letter-spacing: 0.1em; }
.howto-keys p { margin: 0; line-height: 1.7; color: var(--muted); }
body.watching #btn-again, body.watching #btn-x { display: none; }
body.watching .hint-line { visibility: hidden; }

/* 背の低い画面ではカードを小さく */
@media (max-height: 640px) {
  .pface { width: 32px; height: 32px; } .pcard { padding-top: 4px; padding-bottom: 4px; } .hammer-bar { padding: 5px 12px 5px 8px; font-size: 13px; } .hint-line { display: none; }
  .result-top { height: 96px; } #result-daruma { width: 92px; height: 92px; } .dialog { padding: 16px 16px 14px; gap: 8px; }
}
@media (max-height: 700px) { .title-box { padding-top: calc(78px + env(safe-area-inset-top)); } .tagline { margin: 10px 0 14px; } }
@media (max-height: 720px) { .result-top { height: 76px; margin-top: 0; } .result-top::before { width: 170px; height: 170px; } .result-top::after { width: 190px; height: 190px; } #result-daruma { width: 78px; height: 78px; } .dialog.result { padding: 12px 16px 12px; gap: 7px; } .dialog.result h2 { font-size: 25px; margin: 0; } .dialog.result .btn { min-height: 40px; padding: 8px 16px; font-size: 15px; } }

@media (max-width: 380px) { .pname { font-size: 13.5px; letter-spacing: 0; } .pface { width: 40px; height: 40px; } .pcard { gap: 6px; } }

/* ことばの切りかえ */
.langs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.langs button { font: 700 13px var(--font); background: rgba(10, 7, 10, 0.6); color: var(--muted); border: 1px solid rgba(227, 187, 92, 0.4); border-radius: 999px; padding: 5px 13px; cursor: pointer; }
.langs button[aria-pressed="true"] { background: linear-gradient(180deg, #f6dc8b, #c79b3f); color: #1a1008; border-color: #f6dc8b; font-weight: 800; }
html[data-lang="en"] .logo { font-size: clamp(46px, 14.5vw, 68px); letter-spacing: 0.02em; }
html[data-lang="en"] .logo small { letter-spacing: 0.34em; text-indent: 0.34em; font-size: 0.3em; }
html[data-lang="en"] .btn { letter-spacing: 0.03em; }
html[data-lang="en"] .hud-title, html[data-lang="en"] .status { letter-spacing: 0.04em; }

/* ---------- だれかと対戦（共通部品）の見た目を合わせる ---------- */
.qm-ov { background: rgba(4, 3, 8, 0.7) !important; }
.qm-card {
  font-family: var(--font); color: var(--ink) !important; border: 1px solid #c79b3f; border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(34, 25, 34, 0.98), rgba(12, 8, 12, 0.99)), var(--shippo) !important;
  box-shadow: inset 0 0 0 4px #0c090c, inset 0 0 0 5px rgba(227, 187, 92, 0.45), 0 30px 70px rgba(0, 0, 0, 0.75) !important;
}
.qm-card h3 { font-family: var(--brush); font-weight: 400 !important; font-size: 26px !important; letter-spacing: 0.08em !important; color: var(--gold2); }
.qm-b { font-family: var(--display) !important; letter-spacing: 0.06em; border: 1px solid #c79b3f !important; border-radius: 11px !important; color: #fff3cf !important; background: linear-gradient(180deg, #ee4a3c, #c4161f 46%, #8d0d15) !important; box-shadow: inset 0 1px 0 rgba(255, 220, 190, 0.5), 0 5px 12px rgba(0, 0, 0, 0.5) !important; }
.qm-b.alt { background: linear-gradient(180deg, #4a6fd6, #24409f 46%, #16296e) !important; }
.qm-b.sub { color: var(--ink) !important; background: linear-gradient(180deg, rgba(40, 31, 40, 0.9), rgba(14, 10, 14, 0.9)) !important; border-color: rgba(227, 187, 92, 0.45) !important; }
.qm-fld input { background: #0a070a !important; color: var(--ink) !important; border: 1px solid var(--line) !important; border-radius: 10px !important; font-family: var(--font) !important; }
.qm-dots i { background: var(--gold) !important; box-shadow: 0 0 8px rgba(255, 170, 70, 0.8); }
.qm-big { font-family: var(--display); color: var(--gold2); }
.qm-err { color: #ff7a6a !important; }
.qm-prime { color: var(--muted); background: rgba(10, 7, 10, 0.66) !important; border: 1px solid rgba(227, 187, 92, 0.3); }
.qm-prime.hot { background: linear-gradient(180deg, #f6dc8b, #c79b3f) !important; color: #1a1008 !important; }
.qm-cnt { color: var(--muted); text-shadow: 0 1px 6px #000; }
.qm-cnt b { color: var(--gold2); }
.qm-bar { font-family: var(--display); border: 1px solid #c79b3f; background: linear-gradient(180deg, #2c212b, #0a070a) !important; color: var(--ink) !important; }
.qm-bar.found { background: linear-gradient(180deg, #ee4a3c, #8d0d15) !important; }
