:root { --mj-ink:#14372d; --mj-muted:#65756d; --mj-gold:#d6b875; --mj-paper:#f6f4eb; }
body[data-lobby]:not([data-playing]) .practice-nav,
body[data-lobby]:not([data-playing]) #phone-orientation { display:none!important; }
body[data-lobby]:not([data-playing]) #game-viewport { visibility:hidden; }
#mahjong-lobby[hidden], body[data-playing] #mahjong-lobby { display:none!important; }
#mahjong-lobby { position:fixed; inset:0; z-index:20; overflow:auto; color:var(--mj-paper); background:#0b2821;
  font-family: "Hiragino Kaku Gothic ProN","Yu Gothic",system-ui,sans-serif; -webkit-font-smoothing:antialiased;
  background-image:radial-gradient(ellipse at 12% 24%,#22534488,transparent 55%),radial-gradient(ellipse at 95% 90%,#0c1716aa,transparent 60%);
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#mahjong-lobby *, #mahjong-lobby *::before, #mahjong-lobby *::after { box-sizing:border-box; }
#mahjong-lobby::before { content:""; position:fixed; inset:0; pointer-events:none; opacity:.12;
  background-image:repeating-linear-gradient(0deg,transparent,transparent 3px,#b9d3be11 4px),repeating-linear-gradient(90deg,transparent,transparent 3px,#b9d3be11 4px); }
.mj-shell { position:relative; max-width:1220px; margin:auto; padding:32px 44px 24px; }
.mj-header { display:flex; align-items:center; justify-content:space-between; gap:20px; padding-bottom:25px; border-bottom:1px solid #ffffff20; }
.mj-brand { display:flex; align-items:center; gap:14px; text-decoration:none; color:inherit; }
.mj-brand-mark { display:grid; place-items:center; width:43px; height:53px; border:1px solid #dec9969c; border-radius:7px; color:var(--mj-gold); font:26px "Yu Mincho",serif; box-shadow:0 3px 0 #94794066; }
.mj-brand-name { font-size:21px; letter-spacing:.12em; font-weight:700; }
.mj-brand-name small { display:block; margin-top:5px; font-size:9px; font-weight:500; letter-spacing:.24em; color:#c5cbbd; }
.mj-header-right { display:flex; align-items:center; gap:22px; }
.mj-profile { display:flex; align-items:center; gap:9px; font-size:13px; color:#e4e9df; }
.mj-profile:before { content:""; display:block; width:7px; height:7px; border-radius:50%; background:#b7c6b5; }
.mj-profile[data-online=true]:before { background:#8ed7ae; box-shadow:0 0 0 4px #8ed7ae13; }
.mj-score-link { color:#e0dfce; font-size:12px; text-underline-offset:5px; white-space:nowrap; }
.mj-content { display:grid; grid-template-columns:minmax(300px,1fr) minmax(390px,470px); align-items:center; gap:70px; min-height:calc(100dvh - 162px); padding:44px 0 30px; }
.mj-hero h1 { margin:0; font-family:"Yu Mincho","Hiragino Mincho ProN",serif; font-weight:500; font-size:clamp(38px,4.4vw,58px); letter-spacing:.04em; line-height:1.5; }
.mj-hero-copy { margin:22px 0 0; font-size:14px; color:#bccfc2; line-height:2; }
.mj-rule-tags { display:flex; flex-wrap:wrap; gap:9px; margin-top:25px; }
.mj-rule-tags span { border:1px solid #b7c9b62f; border-radius:4px; padding:7px 11px; font-size:11px; color:#d8e0d1; letter-spacing:.04em; }
.mj-tiles { position:relative; height:207px; margin-top:36px; display:flex; align-items:center; justify-content:flex-start; padding-left:26px; gap:13px; perspective:700px; }
.mj-tile { width:89px; height:130px; position:relative; border-radius:9px; background:linear-gradient(115deg,#fffef7,#e7e7de); border:1px solid #ffffffb5;
  box-shadow:1px 6px 0 #c69b43,2px 9px 0 #80662d,4px 22px 24px #0005,inset -3px -3px 4px #a4a89b55; transform:rotate(-11deg); }
.mj-tile:nth-child(2) { transform:translateY(-14px) rotate(-2deg); }
.mj-tile:nth-child(3) { transform:translateY(-1px) rotate(10deg); }
.mj-tile img { width:100%; height:100%; padding:10px 9px; object-fit:contain; }
.mj-stack { display:grid; gap:16px; }
.mj-card { color:var(--mj-ink); background:var(--mj-paper); padding:30px; border:1px solid #e6e2d1; border-radius:16px; box-shadow:0 18px 50px #0003; }
.mj-card h2 { font-size:25px; line-height:1.5; margin:0; letter-spacing:.015em; }
.mj-card-copy { color:var(--mj-muted); font-size:13px; line-height:1.85; margin:12px 0 22px; }
#mahjong-lobby button { font:inherit; cursor:pointer; touch-action:manipulation; transition:background .15s,box-shadow .15s; }
#mahjong-lobby button:disabled { opacity:.48; cursor:default; }
#mahjong-lobby button:focus-visible, #mahjong-lobby a:focus-visible, #mahjong-lobby input:focus-visible { outline:3px solid #d0a64e; outline-offset:4px; }
.mj-button { width:100%; min-height:52px; border:1px solid transparent; border-radius:8px; display:flex; align-items:center; justify-content:center; gap:12px; font-size:15px!important; font-weight:700!important; }
.mj-button svg { width:19px; height:19px; flex:none; }
.mj-primary { color:#f9f6e8; background:#1b5440; box-shadow:0 3px 0 #113d2d; }
.mj-primary:hover:not(:disabled) { background:#256a52; }
.mj-google { background:white; color:#27362e; border-color:#c8cfc5; box-shadow:0 2px 4px #142b2110; }
.mj-google:hover:not(:disabled) { background:#f2f5ef; }
.mj-google b { font-family:Arial,sans-serif; font-size:21px; color:#376ecb; }
.mj-divider { display:flex; align-items:center; gap:13px; margin:26px 0 22px; color:#879085; font-size:11px; }
.mj-divider:before,.mj-divider:after { content:""; flex:1; height:1px; background:#d8ddd1; }
.mj-input-label { display:block; font-size:13px; font-weight:700; margin-bottom:9px; }
.mj-code-form { display:flex; gap:10px; }
#mj-code-input { min-width:0; width:100%; height:54px; background:#fffef8; color:#193f30; border:1px solid #b7c5b5; border-radius:8px; padding:0 14px; font:500 20px ui-monospace,monospace; letter-spacing:.13em; }
#mj-code-input::placeholder { font:14px system-ui,sans-serif; letter-spacing:0; color:#8b948b; }
.mj-code-form .mj-button { width:96px; flex:none; }
.mj-caption { color:#7a867c; margin:10px 0 0; font-size:11px; line-height:1.7; }
.mj-practice { display:flex; gap:15px; align-items:center; padding:19px 21px; border:1px solid #91b29a3b; border-radius:12px; text-decoration:none; color:#f0f2e8; background:#061c1652; }
.mj-practice:hover { background:#244d3d; }
.mj-practice-icon { width:34px; height:34px; color:#d7c896; flex:none; }
.mj-practice strong { display:block; font-size:13px; font-weight:600; }
.mj-practice small { display:block; color:#9eb4a5; font-size:11px; line-height:1.7; margin-top:4px; }
.mj-practice .mj-arrow { margin-left:auto; color:#c2caaf; font-size:19px; }
.mj-room-code { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:17px 18px; background:#e9ede2; border:1px solid #d0d9c8; border-radius:9px; margin:21px 0 10px; }
.mj-room-code small { display:block; color:#667666; font-size:10px; margin-bottom:5px; }
#mj-room-number { font:600 30px ui-monospace,monospace; letter-spacing:.12em; overflow-wrap:anywhere; }
#mj-copy { border:1px solid #bccab8; padding:10px 12px; border-radius:7px; background:#fffef8; color:#204831; display:flex; align-items:center; gap:7px; font-size:12px!important; flex:none; min-height:44px; }
#mj-copy svg { width:17px; height:17px; }
.mj-members-title { display:flex; align-items:center; justify-content:space-between; margin:25px 0 12px; font-size:12px; }
.mj-members-title strong { font-size:14px; }
.mj-members-title span { color:#7a8778; font-size:11px; }
.mj-members { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.mj-member { min-width:0; background:#fffef8; border:1px solid #e0e4d9; border-radius:8px; padding:12px 10px; display:flex; gap:10px; align-items:center; }
.mj-member-no { width:30px; height:34px; border:1px solid #d4dcca; border-bottom:3px solid #d1b672; background:#f2f2e9; border-radius:4px; display:grid; place-items:center; color:#8c957f; font:13px ui-monospace,monospace; flex:none; }
.mj-member-name { font-size:12px; font-weight:700; overflow-wrap:anywhere; line-height:1.4; }
.mj-member-status { font-size:10px; color:#81907c; margin-top:3px; }
.mj-member[data-online=true] .mj-member-status { color:#34805a; }
.mj-member[data-empty=true] { background:transparent; border-style:dashed; }
.mj-member[data-empty=true] .mj-member-name { color:#899581; font-weight:400; }
.mj-start { margin-top:22px; }
.mj-start-help { min-height:18px; text-align:center; font-size:11px; color:#73816e; margin:12px 0 0; }
.mj-room-tools { display:flex; justify-content:space-between; gap:12px; border-top:1px solid #dce1d3; padding-top:18px; margin-top:20px; }
.mj-text-button { padding:5px 0; border:0; background:none; color:#6c7967; font-size:11px!important; text-decoration:underline; text-underline-offset:4px; }
.mj-feedback { color:#f1ead5; font-size:12px; line-height:1.75; margin:0; padding:0 4px; min-height:18px; }
.mj-busy { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.mj-busy button { color:#dfd9b8; }
.mj-phone-tip { display:none; }
@media(min-width:881px) and (max-height:800px) { .mj-content { padding:28px 0; gap:50px; } .mj-tiles { height:155px; margin-top:20px; } .mj-tile { width:78px; height:114px; } .mj-hero h1 { font-size:46px; } .mj-shell { padding-top:23px; } }
@media(max-width:880px) { .mj-shell { padding:21px 21px 22px; } .mj-header { padding-bottom:19px; } .mj-header-right { gap:12px; } .mj-profile { max-width:118px; font-size:11px; overflow-wrap:anywhere; } .mj-score-link { font-size:10px; } .mj-brand-name { font-size:17px; } .mj-brand-mark { width:34px; height:43px; font-size:23px; } .mj-brand { gap:10px; } .mj-brand-name small { font-size:7px; }
  .mj-content { display:block; padding:29px 0 24px; min-height:0; } .mj-hero { position:relative; padding-right:70px; margin-bottom:27px; } .mj-hero h1 { font-size:32px; line-height:1.5; } .mj-hero-copy { font-size:12px; margin-top:13px; } .mj-rule-tags { gap:6px; margin-top:17px; } .mj-rule-tags span { font-size:9px; padding:6px 8px; } .mj-tiles { position:absolute; right:-4px; top:17px; width:70px; padding:0; margin:0; height:100px; gap:0; } .mj-tile { width:45px; height:68px; position:absolute; right:18px; border-radius:5px; opacity:.95; } .mj-tile:nth-child(2) { right:0; top:26px; } .mj-tile:nth-child(3) { display:none; } .mj-tile img { padding:5px; }
  .mj-card { padding:23px 22px; border-radius:13px; } .mj-card h2 { font-size:23px; } .mj-card-copy { font-size:12px; margin:10px 0 20px; } .mj-button { min-height:54px; } .mj-practice { padding:17px 19px; } .mj-members { gap:8px; } .mj-member { gap:7px; padding:11px 8px; } .mj-member-no { width:25px; }
  .mj-phone-tip { display:block; padding:12px 14px; border:1px solid #7a9b8133; border-radius:8px; color:#b4c8b7; font-size:11px; line-height:1.8; margin-top:15px; }
}
@media(prefers-reduced-motion:reduce) { #mahjong-lobby * { transition:none!important; } }

#mahjong-lobby [hidden] { display:none!important; }

.mj-room-code > div { min-width:0; }
#mj-room-number[data-long=true] { font-size:16px; letter-spacing:.02em; line-height:1.5; }

@media (min-width:600px) and (max-width:880px) { .mj-hero,.mj-stack { max-width:520px; margin-left:auto; margin-right:auto; } }

@media(max-width:480px) {
  .mj-hero { padding-right:72px; }
  .mj-hero-copy { line-height:1.65; }
  .mj-tiles { top:0; }
  .mj-code-form .mj-button { width:84px; }
}
