/* Two-player mahjong — original styling. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #43302a; min-height: 100vh; overflow-x: hidden; background: #e9dfc9;
}
button { font: inherit; cursor: pointer; }
#bg { position: fixed; inset: 0; background: url("assets/bg.webp") center/cover no-repeat; opacity: .35; z-index: 0; }
#btn-sound, #btn-lang {
  position: fixed; top: 10px; z-index: 60;
  background: rgba(255,252,247,.94); color: #7a4a21; border: 2px solid #d9a05b;
  border-radius: 999px; padding: 8px 14px; font-weight: 800; font-size: 14px; min-height: 44px;
}
#btn-sound { right: 10px; }
#btn-lang { right: 158px; }
.wrap { position: relative; z-index: 5; max-width: 600px; margin: 0 auto; padding: 58px 10px 44px; }
.title-block { text-align: center; margin-bottom: 10px; }
.kicker { margin: 0; font-size: 13px; letter-spacing: .3em; font-weight: 800; color: #a05c2c; }
.title-block h1 { margin: 4px 0 0; font-size: 31px; color: #5b3a29; text-shadow: 0 2px 0 rgba(255,255,255,.7); }
.subtitle { margin: 2px 0 0; font-weight: 700; color: #8a5a33; }
.panel {
  background: rgba(255,252,247,.95); border: 2px solid #ecd9bd; border-radius: 22px;
  padding: 14px 12px 16px; box-shadow: 0 16px 36px rgba(122,74,33,.18); animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel.center { text-align: center; }
.panel h2 { margin: 10px 0 6px; font-size: 20px; }
.label { font-weight: 800; color: #8a5a33; margin: 14px 0 6px; font-size: 14px; }
.note { font-size: 12.5px; color: #9b7c62; line-height: 1.6; }
.opp-row { display: flex; align-items: flex-end; gap: 10px; }
.opp-row.center-row { align-items: center; }
.char-slot { position: relative; flex: none; line-height: 0; }
.char-img { width: 92px; height: auto; animation: bob 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
.char-img.small { width: 58px; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.kitten-bounce { animation: bounceA .55s ease !important; }
@keyframes bounceA { 30% { transform: translateY(-14px) scale(1.04); } 60% { transform: translateY(0); } }
.kitten-shake { animation: shakeA .45s ease !important; }
@keyframes shakeA { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.accent { position: absolute; font-size: 19px; pointer-events: none; animation: floatUp 1.1s ease-out forwards; }
@keyframes floatUp { from { opacity: 0; transform: translateY(6px) scale(.6); } 25% { opacity: 1; } to { opacity: 0; transform: translateY(-40px) scale(1.15); } }
.bubble {
  position: relative; background: #fff; border: 2px solid #e8cf9f; border-radius: 14px;
  padding: 9px 12px; font-size: 14px; line-height: 1.5; flex: 1; color: #5b4232; font-weight: 600;
}
.bubble::before { content: ""; position: absolute; left: -9px; bottom: 14px; border: 6px solid transparent; border-right-color: #e8cf9f; border-left: 0; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-height: 48px; border-radius: 999px; border: 2px solid #dcc19a;
  background: #fff; color: #7a5230; font-weight: 800; font-size: 14.5px; padding: 8px 6px;
}
.seg button.on { background: #f3b25c; border-color: #c97e1e; color: #572f00; }
.btn {
  border-radius: 999px; border: 2px solid #dcc19a; padding: 11px 18px;
  font-weight: 800; font-size: 15.5px; min-height: 50px; background: #fff; color: #7a5230;
}
.btn.big { font-size: 17.5px; min-height: 58px; width: 100%; margin-top: 18px; }
.btn.primary { background: #f3b25c; border-color: #c97e1e; color: #572f00; box-shadow: 0 4px 0 #c97e1e; }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #c97e1e; }
.btn.ghost { background: transparent; }
.btn.call { background: #7a9a52; border-color: #5d7f3a; color: #fff; min-height: 46px; padding: 8px 16px; }
.btn.call.warn { background: #c9553e; border-color: #9c3a28; }
.row { display: flex; gap: 10px; margin-top: 12px; }
.row .btn { flex: 1; }
.row.col { flex-direction: column; }
.score-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.score-chip { background: #fff; border: 2px solid #e8cf9f; border-radius: 999px; padding: 4px 11px; font-weight: 800; font-size: 13.5px; color: #7a5230; }
.deck-chip { background: #7a9a52; border-color: #5d7f3a; color: #fff; }
.dora-chip { display: inline-flex; align-items: center; gap: 5px; }
.seat-label, .river-label { font-weight: 800; font-size: 13px; color: #8a5a33; margin: 8px 0 3px; }
.riichi-tag { background: #c9553e; color: #fff; border-radius: 6px; padding: 1px 8px; font-size: 12px; margin-left: 6px; }
.tenpai-tag { color: #b3541e; font-size: 12.5px; margin-left: 6px; }
.tile {
  display: inline-block; width: 30px; height: 42px; border-radius: 5px; background: linear-gradient(#fffdf8, #f3ead6);
  border: 1px solid #c9b99a; border-bottom: 3px solid #b8a67f; box-shadow: 0 1px 2px rgba(0,0,0,.18);
  vertical-align: bottom; line-height: 0; flex: none; position: relative;
}
.tile svg { width: 100%; height: 100%; display: block; }
.tile.back { background: linear-gradient(#3f7d4e, #2e5f3a); border-color: #265032; border-bottom-color: #1e4229; }
.tile.red { box-shadow: 0 0 0 2px rgba(201,85,62,.45); }
.tile.called { transform: rotate(90deg); margin: 0 6px; }
.river { display: flex; flex-wrap: wrap; gap: 3px; background: rgba(122,154,82,.18); border-radius: 10px; padding: 5px; min-height: 50px; }
.river .tile { width: 25px; height: 35px; }
.river .tile.last { outline: 2.4px solid #ffb703; }
.opp-hand { display: flex; gap: 2px; flex-wrap: wrap; min-height: 32px; }
.opp-hand .tile { width: 21px; height: 30px; }
.melds { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; min-height: 6px; }
.meld-set { display: inline-flex; gap: 2px; background: rgba(255,255,255,.55); border-radius: 6px; padding: 2px; }
.meld-set .tile { width: 24px; height: 34px; }
.hand { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; margin-top: 4px; min-height: 56px; }
.hand .tile { width: 38px; height: 53px; cursor: pointer; transition: transform .1s ease; }
.hand .tile:hover { transform: translateY(-6px); }
.hand .tile.drawn { margin-left: 10px; outline: 2.4px solid #7a9a52; }
.hand.locked .tile { cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 8px; margin-top: 6px; }
.status { min-height: 24px; text-align: center; font-weight: 700; color: #8a5a33; margin: 10px 0 0; font-size: 14px; }
.result-detail { font-size: 15px; font-weight: 700; color: #5b3a29; line-height: 1.7; white-space: pre-line; }
@media (max-width: 380px) {
  .hand .tile { width: 32px; height: 45px; }
  .river .tile { width: 21px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) { .char-img { animation: none; } }

.video-banner { width: 100%; height: 180px; object-fit: cover; border-radius: 14px; display: block; margin-bottom: 10px; background: #2e2a26; }

/* --- Large play area: use the full smartphone width --- */
.wrap { padding-left: 5px; padding-right: 5px; }
.panel { padding-left: 7px; padding-right: 7px; }
.hand .tile { width: clamp(38px, 11.5vw, 48px); height: clamp(53px, 16.1vw, 67px); }
.river .tile { width: clamp(24px, 6.9vw, 31px); height: clamp(34px, 9.7vw, 44px); }
.opp-hand .tile { width: 24px; height: 34px; }
.meld-set .tile { width: 27px; height: 38px; }
.video-banner { height: 200px; }
@media (max-width: 380px) {
  .hand .tile { width: 11vw; height: 15.4vw; }
  .river .tile { width: 6.6vw; height: 9.2vw; }
}
