/* 大富豪。枠の大きさ (記事のゲーム枠は 1366×768 で横 780px・縦 540px ほど) に合わせて、--cw (カードの幅) を app.js が決める */
:root {
  --bg: #12233a;
  --bg2: #0c1828;
  --felt: #17345a;
  --line: rgba(255, 255, 255, .12);
  --ink: #eef2f8;
  --dim: #9fb0c8;
  --gold: #f2c14e;
  --red: #e0475b;
  --accent: #4fb3ff;
  --card: #fbfaf6;
  --cw: 54px;
  --ch: calc(var(--cw) * 1.42);
  --font: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg2); color: var(--ink); font-family: var(--font); overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }

.df {
  position: relative; height: 100vh; height: 100dvh; width: 100%;
  display: grid; grid-template-rows: auto 1fr auto auto auto; grid-template-columns: minmax(0, 1fr);
  background: radial-gradient(ellipse at 50% 45%, var(--felt) 0%, var(--bg) 60%, var(--bg2) 100%);
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}

/* ---------- 上の帯 ---------- */
.df-top { display: flex; align-items: center; gap: 8px; padding: 6px 10px; min-height: 38px; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .18); }
.df-brand { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.df-brand b { color: var(--gold); letter-spacing: .08em; font-size: 15px; }
.df-brand b i { font-style: normal; font-size: 11px; letter-spacing: .02em; color: #e86a5a; margin-right: 4px; }
.df-brand span { color: var(--dim); font-size: 12px; }
.df-decree { cursor: pointer; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; overflow: hidden; }
.df-decree .tag { flex: none; background: var(--gold); color: #2a1d00; font-weight: 700; padding: 2px 7px; border-radius: 4px; font-size: 12px; }
.df-decree .nm { font-weight: 700; white-space: nowrap; }
.df-decree .ds { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df-decree .nm.add { color: var(--gold); }
.df-decree .nm.del { color: #fff; background: #c8243a; padding: 1px 6px; border-radius: 4px; text-decoration: line-through; text-decoration-thickness: 2px; }
.df-decree .nm.add { background: rgba(242, 193, 78, .16); padding: 1px 6px; border-radius: 4px; }
.df-chips { display: flex; gap: 4px; margin-left: auto; flex-wrap: nowrap; }
.df-chip { font-size: 12px; padding: 2px 7px; border-radius: 4px; background: rgba(255, 255, 255, .1); white-space: nowrap; }
.df-chip.rev { background: var(--red); color: #fff; font-weight: 700; }
.df-chip.back { background: #b46ad8; color: #fff; }
.df-chip.bind { background: #2f7d5b; color: #fff; }
.df-tools { display: flex; gap: 4px; }
.df-ic { background: rgba(255, 255, 255, .08); border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; font-size: 13px; }
.df-ic:hover { background: rgba(255, 255, 255, .16); }

/* ---------- 卓 (相手は卓を囲む席。三人麻雀と同じく、次の人が右) ---------- */
.df-table { position: relative; min-height: 0; overflow: hidden; --fw: 50px; }
.df-felt { position: absolute; left: 6%; right: 6%; top: 6%; bottom: 2%; border-radius: 50%; background: radial-gradient(ellipse at 50% 45%, #1f4a3c 0%, #173a30 55%, #10291f 100%); box-shadow: inset 0 0 0 6px #3a2a1a, inset 0 0 0 8px rgba(242, 193, 78, .35), 0 8px 30px rgba(0, 0, 0, .45); }
#dfOpps { position: absolute; inset: 0; pointer-events: none; }
.df-opp { position: absolute; transform: translate(-50%, -50%); width: 168px; max-width: 30%; padding: 6px 8px; border-radius: 10px; background: rgba(8, 16, 28, .82); border: 2px solid transparent; transition: border-color .2s, background .2s, box-shadow .2s; pointer-events: auto; z-index: 2; }
.df-opp.turn { border-color: var(--gold); background: rgba(52, 42, 12, .9); box-shadow: 0 0 0 4px rgba(242, 193, 78, .18), 0 0 22px rgba(242, 193, 78, .45); animation: turnGlow 1.4s ease-in-out infinite; }
@keyframes turnGlow { 50% { box-shadow: 0 0 0 4px rgba(242, 193, 78, .08), 0 0 10px rgba(242, 193, 78, .25); } }
.df-opp.done { opacity: .62; }
.df-opp .nm { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.df-opp .nm span:first-child { overflow: hidden; text-overflow: ellipsis; }
.df-title { flex: none; font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: #44516a; color: #fff; }
.df-title.t0 { background: var(--gold); color: #2a1d00; }
.df-title.t1 { background: #c9a35a; color: #2a1d00; }
.df-title.tl { background: #6c4a3c; }
.df-title.tl2 { background: #57606f; }
.df-opp .row { display: flex; align-items: center; gap: 6px; margin-top: 4px; min-height: 26px; }
.df-backs { position: relative; height: 26px; flex: 1 1 auto; min-width: 0; }
.df-backs i, .df-flyback { position: absolute; top: 0; width: 18px; height: 26px; border-radius: 3px; background: linear-gradient(135deg, #a33a4a, #6d1f2e); border: 1px solid rgba(255, 255, 255, .55); }
.df-opp .num { flex: none; font-size: 15px; font-weight: 700; min-width: 2.2em; text-align: right; }
.df-opp .st { position: absolute; right: 6px; top: -12px; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 9px; background: #46536b; white-space: nowrap; }
.df-opp .st.pass { background: #5d6a82; color: #fff; }
.df-opp .st.win { background: var(--gold); color: #2a1d00; }
.df-opp .st.lose { background: var(--red); color: #fff; }
.df-opp .st.cpu { background: #2f7d5b; }
.df-timer { height: 3px; margin-top: 4px; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.df-timer i { display: block; height: 100%; background: var(--gold); transform-origin: left; }

/* ---------- 場 (卓の真ん中。出した人の側に少しずらして重ねる) ---------- */
.df-pile { position: absolute; left: 50%; top: 52%; width: 0; height: 0; --cw: var(--fw); --ch: calc(var(--fw) * 1.42); z-index: 1; }
.df-lay { position: absolute; left: 0; top: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)); }
.df-lay .cards { display: flex; }
.df-lay .cd { margin: 0 1px; }
.df-lay:not(.top) .cards { filter: brightness(.8) saturate(.85); }
.df-lay .cards .cd { box-shadow: 0 2px 6px rgba(0, 0, 0, .45); }
.df-lay .tag { position: absolute; left: 50%; bottom: -17px; transform: translateX(-50%); font-size: 11px; font-weight: 700; white-space: nowrap; color: var(--dim); }
.df-lay.top .tag { color: var(--gold); }
.df-lay:not(.top) .tag { display: none; }
.df-pile.ghost { z-index: 7; pointer-events: none; }
.df-empty { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; color: rgba(255, 255, 255, .55); font-size: 13px; border: 1px dashed rgba(255, 255, 255, .25); border-radius: 10px; padding: 14px 22px; }
.df-who { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 12px; color: var(--dim); white-space: nowrap; z-index: 2; }
.df-who b { color: var(--ink); }
.df-fx { position: fixed; inset: 0; pointer-events: none; z-index: 8; }
.df-fx .df-flycard { position: absolute; left: 0; top: 0; --cw: 46px; --ch: 65px; }
.df-flycard .df-flyback { position: static; width: 46px; height: 65px; border-radius: 5px; }
/* 献上・返すの記録 (卓の真ん中) */
.df-xlog { position: absolute; transform: translate(-50%, -50%); background: rgba(8, 16, 28, .82); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 260px; --cw: 30px; --ch: 42px; }
.df-xlog .row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; white-space: nowrap; }
.df-xlog .row.me { color: var(--gold); }
.df-xlog .kd { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: #44516a; color: #fff; }
.df-xlog .who small { font-size: 10px; color: var(--dim); margin-left: 2px; }
.df-xlog .cs { display: flex; gap: 2px; margin-left: auto; }
.df-xlog .wait { font-size: 11px; color: var(--dim); margin-top: 4px; }
/* ルール改変の大きな札 (追加は金、廃止は赤で打ち消し) */
.df-modbig { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0 4px; padding: 10px; border-radius: 10px; animation: modIn .5s cubic-bezier(.2, 1.5, .4, 1) both; }
.df-modbig .sign { font-size: 15px; font-weight: 900; padding: 3px 10px; border-radius: 6px; }
.df-modbig .nm { font-size: 30px; font-weight: 900; letter-spacing: .06em; position: relative; }
.df-modbig.add { background: rgba(242, 193, 78, .14); border: 2px solid var(--gold); }
.df-modbig.add .sign { background: var(--gold); color: #2a1d00; }
.df-modbig.add .nm { color: var(--gold); }
.df-modbig.del { background: rgba(200, 36, 58, .16); border: 2px solid #e0475b; }
.df-modbig.del .sign { background: #c8243a; color: #fff; }
.df-modbig.del .nm { color: #ffb3bd; }
.df-modbig.del .nm::after { content: ""; position: absolute; left: -6px; right: -6px; top: 52%; height: 4px; background: #ff4d63; border-radius: 2px; transform-origin: left; animation: strike .45s .35s ease-out both; }
@keyframes strike { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes modIn { from { transform: scale(1.4); opacity: 0; } to { transform: none; opacity: 1; } }
.df-box.mod-del { border-color: #c8243a; }

/* ---------- カード ---------- */
.cd {
  position: relative; flex: none; width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * .1);
  background: var(--card); color: #1d2533; border: 1px solid #c9cdd4; box-shadow: 0 2px 5px rgba(0, 0, 0, .35);
  font-weight: 700; line-height: 1;
}
.cd .cr { position: absolute; left: 7%; top: 6%; font-size: calc(var(--cw) * .36); letter-spacing: -.04em; }
.cd .cs { position: absolute; left: 0; right: 0; bottom: 12%; text-align: center; font-size: calc(var(--cw) * .56); }
.cd .cs2 { position: absolute; left: 8%; top: 37%; font-size: calc(var(--cw) * .26); }
.cd.red { color: #c8243a; }
.cd.jk { background: linear-gradient(160deg, #fffbe8, #ffe9a8); color: #6b3d00; }
.cd.jk .cr { font-size: calc(var(--cw) * .2); letter-spacing: .02em; writing-mode: vertical-rl; top: 8%; }
.cd.jk .cs { font-size: calc(var(--cw) * .6); color: #d99a00; }
.cd .as { position: absolute; right: 5%; top: 5%; font-size: calc(var(--cw) * .2); color: #6b3d00; background: #ffe39a; border-radius: 3px; padding: 1px 2px; }

/* ---------- 自分 ---------- */
.df-me { display: flex; align-items: center; gap: 10px; padding: 4px 12px; }
.df-mebox { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; white-space: nowrap; padding: 4px 8px; border-radius: 8px; border: 2px solid transparent; }
.df-mebox.turn { border-color: var(--gold); background: rgba(242, 193, 78, .12); }
.df-msg { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df-msg em { font-style: normal; color: var(--gold); font-weight: 700; }
.df-btns { display: flex; gap: 8px; }
.df-btn { border: 0; border-radius: 9px; padding: 9px 20px; font-size: 15px; font-weight: 700; min-width: 88px; }
.df-btn.main { background: var(--gold); color: #2a1d00; box-shadow: 0 3px 0 #a07a1c; }
.df-btn.main:disabled { background: #4b5568; color: #95a0b4; box-shadow: none; }
.df-btn.ghost { background: rgba(255, 255, 255, .1); border: 1px solid var(--line); }
.df-btn.ghost:disabled { opacity: .35; }
/* パスしかできないとき: パスを光らせる */
.df-btn.ghost.urge { background: var(--gold); color: #2a1d00; border-color: var(--gold); box-shadow: 0 3px 0 #a07a1c, 0 0 0 0 rgba(242, 193, 78, .6); animation: urge 1.1s ease-out infinite; }
@keyframes urge { 0% { box-shadow: 0 3px 0 #a07a1c, 0 0 0 0 rgba(242, 193, 78, .65); } 100% { box-shadow: 0 3px 0 #a07a1c, 0 0 0 14px rgba(242, 193, 78, 0); } }
/* 自分の持ち時間 */
.df-mytimer { position: relative; height: 4px; margin: 0 12px; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.df-mytimer i { display: block; height: 100%; background: var(--gold); transform-origin: left; transition: transform .2s linear; }
.df-mytimer.low i { background: #ff6b7d; }
.df-ic.off { opacity: .55; text-decoration: line-through; }
.df-btn:not(:disabled):active { transform: translateY(2px); box-shadow: none; }

.df-hand { position: relative; display: flex; justify-content: center; align-items: flex-end; padding: 16px 10px 10px; min-height: calc(var(--ch) + 26px); }
.df-hand .cd { margin-left: var(--ov, 0px); transition: transform .12s, filter .12s; cursor: pointer; }
.df-hand .cd:first-child { margin-left: 0; }
.df-hand .cd.sel { transform: translateY(-14px); box-shadow: 0 0 0 3px var(--accent), 0 6px 10px rgba(0, 0, 0, .4); }
.df-hand .cd.off { filter: brightness(.6) saturate(.5); opacity: .55; }
.df-hand .cd.new { box-shadow: 0 0 0 3px #7fe0a0, 0 2px 5px rgba(0, 0, 0, .35); }
.df-hand.idle .cd { cursor: default; }
@media (hover: hover) { .df-hand:not(.idle) .cd:not(.sel):hover { transform: translateY(-6px); } }

/* ---------- 知らせ ---------- */
.df-toast { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); pointer-events: none; text-align: center; z-index: 5; }
.df-toast div { font-size: clamp(22px, 5vw, 44px); font-weight: 800; letter-spacing: .06em; padding: 6px 22px; border-radius: 12px; background: rgba(8, 14, 24, .78); color: var(--gold); animation: toast 1.1s ease-out forwards; white-space: nowrap; }
.df-toast div small { display: block; font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: 0; margin-top: 2px; }
.df-toast div.red { color: #ff8090; }
@keyframes toast { 0% { transform: scale(.7); opacity: 0; } 15% { transform: scale(1.06); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1); } }

/* ---------- 重ねる画面 ---------- */
.df-ov { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(6, 12, 22, .72); overflow: auto; }
.df-ov[hidden] { display: none; }
.df-ov.soft { background: rgba(6, 12, 22, .45); }
.df-box { width: min(560px, 100%); max-height: 100%; overflow: auto; background: #1b2a42; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.df-box h2 { margin: 0 0 4px; font-size: 18px; }
.df-box h2 small { font-size: 12px; color: var(--dim); font-weight: 400; margin-left: 6px; }
.df-box p { margin: 6px 0; font-size: 13px; color: var(--dim); line-height: 1.6; }
.df-box p b { color: var(--ink, #fff); }
.df-link { background: none; border: 0; color: inherit; text-decoration: underline; padding: 0 4px; font: inherit; cursor: pointer; }
.df-box .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.df-box input[type=text], .df-box input[inputmode=numeric] { width: 100%; font: inherit; font-size: 16px; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: #0f1b2c; color: var(--ink); }
.df-err { color: #ff8b98 !important; min-height: 1.2em; }

/* はじめの画面: 卓の上に2つのボタン */
.df-start { text-align: center; width: min(620px, 100%); }
.df-start .logo { font-size: clamp(30px, 6vw, 52px); font-weight: 800; letter-spacing: .14em; color: var(--gold); text-shadow: 0 3px 0 rgba(0, 0, 0, .4); line-height: 1.1; }
.df-start .kicker { display: inline-block; font-size: clamp(15px, 2.6vw, 22px); font-weight: 800; letter-spacing: .12em; color: #fff; background: #c8243a; padding: 3px 14px; border-radius: 6px; transform: rotate(-3deg); box-shadow: 0 3px 0 #7a1020; animation: kick .6s cubic-bezier(.2, 1.6, .4, 1) both; margin-bottom: 6px; }
@keyframes kick { 0% { transform: scale(2.6) rotate(-14deg); opacity: 0; } 60% { transform: scale(.92) rotate(-1deg); opacity: 1; } 100% { transform: rotate(-3deg); } }
.df-start .board { position: relative; min-height: 30px; margin: 10px auto 2px; max-width: 520px; }
.df-start .board .chips { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 5px; }
.df-start .board .lab { font-size: 11px; color: var(--dim); margin-right: 2px; }
.df-start .board .chip { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(242, 193, 78, .14); border: 1px solid rgba(242, 193, 78, .5); color: var(--gold); transition: opacity .3s; }
.df-start .board .chip.in { animation: chipIn .5s cubic-bezier(.2, 1.6, .4, 1); background: var(--gold); color: #2a1d00; }
.df-start .board .chip.out { text-decoration: line-through; color: #ff8090; border-color: #ff8090; background: rgba(200, 36, 58, .18); animation: chipOut .65s ease-in forwards; }
@keyframes chipIn { from { transform: translateY(-18px) scale(1.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes chipOut { 0% { transform: none; } 30% { transform: translateX(-3px) rotate(-4deg); } 60% { transform: translateX(3px) rotate(3deg); opacity: 1; } 100% { transform: translateY(14px) rotate(12deg); opacity: 0; } }
.df-start .board .stamp { position: absolute; z-index: 5; left: 50%; top: 50%; pointer-events: none; font-size: clamp(20px, 4vw, 30px); font-weight: 900; white-space: nowrap; padding: 2px 14px; border-radius: 8px; animation: stamp 1.2s ease-out forwards; }
.df-start .board .stamp.add { color: #2a1d00; background: var(--gold); box-shadow: 0 0 24px rgba(242, 193, 78, .7); }
.df-start .board .stamp.del { color: #fff; background: #c8243a; box-shadow: 0 0 24px rgba(200, 36, 58, .7); }
@keyframes stamp { 0% { transform: translate(-50%, -50%) scale(2.4) rotate(-10deg); opacity: 0; } 16% { transform: translate(-50%, -50%) scale(1) rotate(-4deg); opacity: 1; } 65% { transform: translate(-50%, -50%) scale(1) rotate(-4deg); opacity: 1; } 100% { transform: translate(-50%, -80%) scale(.9) rotate(-4deg); opacity: 0; } }
.df-start .fan.shake .cd { animation: fanShake .45s ease-out; }
.df-start .fan.shake .cd:nth-child(2) { animation-delay: .04s; } .df-start .fan.shake .cd:nth-child(3) { animation-delay: .08s; } .df-start .fan.shake .cd:nth-child(4) { animation-delay: .12s; } .df-start .fan.shake .cd:nth-child(5) { animation-delay: .16s; }
@keyframes fanShake { 0% { transform: none; } 40% { transform: translateY(-10px) rotate(-6deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .df-start .kicker, .df-start .board .chip, .df-start .board .stamp, .df-start .fan.shake .cd { animation: none !important; } }
.df-start .sub { color: var(--dim); font-size: 13px; margin: 2px 0 14px; }
.df-start .fan { display: flex; justify-content: center; margin: 0 0 16px; }
.df-start .fan .cd { --cw: 46px; margin: 0 -8px; }
.df-start .big { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.df-start .big button { border: 0; border-radius: 12px; padding: 14px 10px; font-size: 18px; font-weight: 800; }
.df-start .big button small { display: block; font-size: 12px; font-weight: 500; margin-top: 3px; opacity: .85; }
.df-start .cpu { background: var(--gold); color: #2a1d00; box-shadow: 0 4px 0 #a07a1c; }
.df-start .fr { background: #3a7bd5; color: #fff; box-shadow: 0 4px 0 #22528f; }
.df-start .small { margin-top: 12px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.df-start .small button { background: none; border: 0; color: var(--dim); text-decoration: underline; padding: 2px; }
.df-start .rules-line { margin-top: 10px; font-size: 12px; color: var(--dim); }
/* 説明の文は言葉の切れ目でだけ折る */
.df-start .sub span, .df-start .rules-line span { display: inline-block; }

/* ルール */
.df-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin: 8px 0; }
.df-rules label { display: flex; align-items: flex-start; gap: 7px; font-size: 13px; padding: 5px 4px; border-radius: 6px; cursor: pointer; }
.df-rules label:hover { background: rgba(255, 255, 255, .05); }
.df-rules label b { display: block; }
.df-rules label span { display: block; color: var(--dim); font-size: 11px; line-height: 1.4; }
.df-rules input { margin-top: 3px; }
.df-rules h3 { grid-column: 1 / -1; margin: 6px 0 0; font-size: 12px; color: var(--gold); font-weight: 700; }
.df-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.df-seg button { background: none; border: 0; padding: 4px 12px; font-size: 13px; }
.df-seg button.on { background: var(--gold); color: #2a1d00; font-weight: 700; }

/* いま起きたルールの意味 */
.df-note { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 3; max-width: min(92%, 560px); font-size: 13px; line-height: 1.5; text-align: center; background: rgba(8, 14, 24, .6); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; }
.df-note b { color: var(--gold); margin-right: 6px; }
.df-note span { display: block; color: var(--dim); font-size: 12px; }

/* ルールの例 (demo.js) */
.dm { --cw: 34px; --ch: 48px; height: 168px; display: flex; align-items: stretch; justify-content: center; background: #0f2a22; border: 1px solid #2c5a48; border-radius: 10px; overflow: hidden; }
.dm-f { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 8px; animation: dmIn .35s ease-out; position: relative; }
.dm-pile, .dm-hand { display: flex; align-items: center; gap: 3px; min-height: var(--ch); }
.dm-hand small { color: var(--dim); font-size: 11px; margin-right: 4px; }
.dm .cd.in { animation: dmCard .45s ease-out; }
.dm .cd.hi { box-shadow: 0 0 0 3px var(--gold); transform: translateY(-4px); }
.dm .cd.off { opacity: .4; }
.dm-empty { color: var(--dim); font-size: 12px; }
.dm-seats { display: flex; align-items: center; gap: 6px; font-size: 12px; flex-wrap: wrap; justify-content: center; }
.dm-seats span { padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, .07); position: relative; }
.dm-seats span.turn { background: var(--gold); color: #2a1d00; font-weight: 700; }
.dm-seats span.skip { opacity: .6; }
.dm-seats span i { font-style: normal; font-size: 10px; margin-left: 4px; color: #ff9aa6; }
.dm-seats b { color: var(--gold); }
.dm-strip { font-size: 13px; letter-spacing: .04em; background: rgba(0, 0, 0, .25); padding: 3px 10px; border-radius: 6px; }
.dm-badge { position: absolute; top: 8px; right: 10px; font-weight: 800; color: var(--gold); font-size: 15px; background: rgba(8, 14, 24, .7); padding: 2px 10px; border-radius: 6px; animation: dmCard .4s ease-out; }
.dm-cap { font-size: 13px; text-align: center; line-height: 1.45; }
.dm-dots { display: flex; gap: 4px; }
.dm-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.dm-dots i.on { background: var(--gold); }
@keyframes dmIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dmCard { from { opacity: 0; transform: translateY(-14px) scale(1.12); } to { opacity: 1; transform: none; } }
.df-pick { margin: 8px 0; }
.df-pdesc { font-size: 13px; line-height: 1.5; margin-bottom: 6px; min-height: 2.9em; }
.df-pdesc b { color: var(--gold); margin-right: 8px; font-size: 15px; }
.df-pdesc b.del { color: #e7a3a3; }
.df-box.wide { width: min(720px, 100%); }
.df-ex { flex: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--gold); border-radius: 6px; font-size: 11px; padding: 2px 8px; align-self: center; }
.df-note { cursor: pointer; }

/* ルール改変を選ぶ */
.df-decs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 5px; }
.df-dec { text-align: left; background: #f6ecd2; color: #3a2a08; border: 0; border-radius: 8px; padding: 5px 8px; box-shadow: 0 2px 0 #b49a5c; }
.df-dec b { display: block; font-size: 13px; }
.df-dec i { display: block; font-style: normal; font-size: 11px; color: #6b5420; }
.df-dec.del { background: #e3e7ee; box-shadow: 0 2px 0 #8d97a8; color: #222a36; }
.df-dec.del i { color: #8a2a2a; }
.df-dec.keep { background: #2b3b55; color: #e8ecf2; box-shadow: 0 2px 0 #18233a; }
.df-dec.keep i { color: #b9c3d3; }
.df-dec.on { outline: 3px solid var(--accent); outline-offset: 1px; }
.df-dec:hover { filter: brightness(1.06); }

/* 結果 */
.df-res { list-style: none; padding: 0; margin: 10px 0; }
.df-res li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: 14px; }
.df-res li.me { background: rgba(242, 193, 78, .12); }
.df-res li .pl { width: 1.6em; color: var(--dim); text-align: right; }
.df-res li .nm2 { flex: 1 1 auto; font-weight: 700; }
.df-res li .ch { font-size: 12px; color: var(--dim); }
.df-res li .ch.up { color: #7fe0a0; }
.df-res li .ch.dn { color: #ff8b98; }
.df-stat { font-size: 12px; color: var(--dim); display: flex; gap: 12px; flex-wrap: wrap; }

/* ロビー */
.df-code { font-size: 40px; font-weight: 800; letter-spacing: .25em; color: var(--gold); text-align: center; margin: 4px 0; }
.df-seats { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.df-seats li { padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, .06); font-size: 14px; }
.df-seats li.empty { color: var(--dim); border: 1px dashed var(--line); background: none; }
.df-seats li .host { font-size: 11px; color: var(--gold); margin-left: 6px; }
.df-pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 9px; background: rgba(255, 255, 255, .08); margin: 2px 2px 0 0; }

/* メニュー */
.df-menu { display: grid; gap: 8px; }
.df-menu button { text-align: left; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); font-size: 14px; }
.df-menu button:hover { background: rgba(255, 255, 255, .1); }

/* 狭い・低い枠 */
@media (max-height: 560px) {
  .df-top { min-height: 32px; padding: 3px 8px; }
  .df-opps { padding-top: 4px; }
  .df-opp { padding: 4px 7px; }
  .df-opp .row { margin-top: 2px; }
  .df-hand { padding-top: 14px; padding-bottom: 6px; }
  .df-btn { padding: 7px 16px; }
  .df-start .fan { display: none; }
}
@media (max-width: 640px) {
  .df-decree .ds { display: none; }
  .df-rules { grid-template-columns: 1fr; }
  .df-decs { grid-template-columns: 1fr 1fr; }
  .df-dec { min-height: 0; }
  .df-me { flex-wrap: wrap; gap: 4px 8px; }
  .df-msg { order: 3; flex-basis: 100%; }
  .df-btns { margin-left: auto; }
  .df-btn { min-width: 74px; padding: 8px 14px; }
  .df-opp .nm { font-size: 12px; }
  .df-opp { max-width: 24%; padding: 4px 6px; }
  .df-opp .st { font-size: 10px; padding: 1px 5px; right: 2px; }
  .df-start .big button { font-size: 16px; }
  .df-brand b i { display: none; }
}
@media (max-width: 520px) {
  .df-backs { display: none; }
  .df-opp .row { justify-content: flex-end; min-height: 0; }
  .df-opps { gap: 6px; }
}
/* スマホの縦長: 楕円だと縦に間延びし、はじめの画面の文やボタンが卓からはみ出す。角の丸い卓にして、相手の名札の下から始める */
@media (max-width: 640px) and (orientation: portrait) {
  .df-felt { left: 2.5%; right: 2.5%; top: calc(13% + 34px); bottom: 28px; border-radius: 72px / 60px; }
  .df-start { padding: 0 14px; }
  .df-start .big { gap: 10px; }
  .df-start .fan { margin-bottom: 12px; }
  .df-start .sub { margin-bottom: 12px; line-height: 1.5; }
}
