/* 파파게임 웹판. 원본 화면(1024x768)을 그대로 무대에 올리고 창 크기에 맞춰 통째로 확대·축소한다. */
:root {
  --gold: #ffd84a;
  --ink: #e8f2f0;
  --dim: #8fa7a4;
  --felt: #17443f;
  --danger: #ff6b5e;
  --font: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", Dotum, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  height: 100%; margin: 0; background: #000; color: var(--ink);
  font-family: var(--font); font-size: 12px; overflow: hidden;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#viewport { position: fixed; inset: 0; overflow: hidden; }
#stage {
  position: absolute; left: 50%; top: 50%; width: 1024px; height: 768px;
  transform-origin: 0 0; background: #000; overflow: hidden;
}
.screen { position: absolute; inset: 0; }
.screen[hidden] { display: none; }
.spr { position: absolute; background-repeat: no-repeat; image-rendering: auto; }
.abs { position: absolute; }
.btn { cursor: pointer; }
.btn.off { cursor: default; pointer-events: none; }
.num { font-variant-numeric: tabular-nums; }

#rotate-hint {
  display: none; position: fixed; left: 0; right: 0; bottom: max(10px, env(safe-area-inset-bottom));
  text-align: center; color: #9fb4b1; font-size: 13px; pointer-events: none;
}
@media (orientation: portrait) and (max-width: 700px) { #rotate-hint { display: block; } }
#rotate-hint[hidden], #viewport[hidden] { display: none; }

#toast {
  position: absolute; left: 50%; top: 96px; transform: translateX(-50%); z-index: 90;
  max-width: 560px; padding: 10px 18px; border-radius: 6px; font-size: 14px; font-weight: 700;
  background: rgba(8, 14, 18, .94); border: 1px solid #c9a53a; color: #ffe9a6;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .6); text-align: center;
}
#netdown {
  position: absolute; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .72); font-size: 18px; font-weight: 700; color: #fff;
}
#toast[hidden], #netdown[hidden] { display: none; }

/* 별도 게임 창: 창 도구 영역을 뺀 공간에 1024×768 무대를 맞춘다. */
body.game-window #viewport { top: 44px; }
#game-window-tools { position: fixed; inset: 0 0 auto; z-index: 100; height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: #111914; border-bottom: 1px solid #80662e; color: #f5dfab; font: 13px var(--font); }
#game-window-tools[hidden] { display: none; }
#game-window-tools strong { margin-right: auto; font-size: 13px; }
#game-window-tools [role=status] { position: absolute; top: 48px; right: 8px; max-width: calc(100vw - 16px); padding: 10px 12px; border: 1px solid #80662e; background: #111914; color: #fff2ce; font-size: 12px; line-height: 1.4; }
#game-window-tools [role=status]:empty { display: none; }
#game-window-tools button { align-self: stretch; min-width: 56px; padding: 0 12px; border: 0; border-left: 1px solid #4b503b; background: transparent; color: #fff2ce; font: inherit; cursor: pointer; }
#game-window-tools button:hover { background: #2d3828; }
#game-window-tools button:focus-visible { outline: 2px solid #ffe3a4; outline-offset: -4px; }
#game-window-notice { position: fixed; z-index: 200; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: calc(100vw - 24px); width: max-content; padding: 12px 16px; border: 1px solid #b18c41; background: #15221c; color: #fff2ce; font: 14px/1.4 var(--font); }
#game-window-notice button { min-height: 44px; padding: 0 16px; border: 1px solid #c29d51; background: #ead09a; color: #241b0c; font: 700 14px var(--font); cursor: pointer; }
#game-window-notice button:focus-visible { outline: 2px solid #fff2ce; outline-offset: 2px; }

/* ───── 로그인 ───── */
#screen-login { background: radial-gradient(ellipse at 50% 40%, #12303a 0%, #05090c 70%); }
.login-board { position: absolute; left: 162px; top: 194px; width: 700px; height: 380px; }
.login-board input {
  position: absolute; left: 249px; width: 275px; height: 26px; border: 0; outline: 0; padding: 0 8px;
  background: transparent; color: #101820; font: 700 14px var(--font); -webkit-user-select: text; user-select: text;
}
.login-board input:focus { box-shadow: inset 0 0 0 2px #2f8fd0; }
.login-cover { position: absolute; left: 30px; top: 224px; width: 640px; height: 44px; background: linear-gradient(#10203a, #103152); }
.login-label { position: absolute; left: 150px; top: 232px; width: 88px; text-align: right; font: 700 15px var(--font); color: #fff; letter-spacing: 1px; }
.login-row3 { position: absolute; left: 249px; top: 230px; width: 275px; height: 26px; background: #fffbff; }
.login-msg { position: absolute; left: 30px; top: 270px; width: 640px; text-align: center; font-size: 13px; font-weight: 700; color: var(--danger); min-height: 18px; }
.login-msg.ok { color: #9be3a0; }
.pill {
  position: absolute; top: 308px; width: 142px; height: 46px; border-radius: 12px; border: 1px solid #0a0e12;
  font: 700 16px var(--font); color: #fff; letter-spacing: 3px; cursor: pointer; text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -10px 14px rgba(0, 0, 0, .28), 0 2px 4px rgba(0, 0, 0, .6);
  transition: filter .12s ease-out, transform .08s ease-out;
}
.pill:hover { filter: brightness(1.15); }
.pill:active { transform: scale(.97); }
.pill:disabled { filter: grayscale(.7) brightness(.8); cursor: default; }
.pill.go { left: 168px; background: linear-gradient(#3fb6dc, #0d6f96 55%, #0a4d6c); }
.pill.alt { left: 386px; background: linear-gradient(#b0707d, #6d3440 55%, #4a1f2a); letter-spacing: 1px; font-size: 15px; }
.login-title { position: absolute; left: 32px; top: 36px; width: 196px; height: 62px; background: #0b1118; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.login-title small { font: 700 13px Georgia, serif; color: #b9c2cc; letter-spacing: 1px; }
.login-title b { font-size: 22px; color: #38a8f0; letter-spacing: 4px; }
.login-tab-cover { position: absolute; left: 578px; top: 72px; width: 96px; height: 43px; background: #060b14; }

/* ───── 로비 ───── */
.lobby-text { position: absolute; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-cell { position: absolute; width: 170px; height: 160px; cursor: pointer; color: #1b1f24; }
.room-cell:hover .room-body { background: rgba(255, 216, 74, .28); }
.room-cell.full { cursor: default; }
.room-no { position: absolute; left: 5px; top: 5px; width: 35px; height: 26px; line-height: 26px; text-align: center; font-weight: 700; color: #fff; font-size: 13px; }
.room-name { position: absolute; left: 44px; top: 5px; width: 121px; height: 26px; line-height: 26px; font-weight: 700; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-seed { position: absolute; left: 6px; top: 34px; width: 158px; height: 20px; line-height: 20px; font-size: 12px; font-weight: 700; color: #0d4a8a; }
.room-seed em { font-style: normal; color: #a11616; float: right; }
.room-body { position: absolute; left: 6px; top: 58px; width: 158px; height: 96px; padding: 6px 8px; font-size: 12px; line-height: 17px; overflow: hidden; transition: background .12s; }
.room-body .playing { color: #a11616; font-weight: 700; }
.room-pager { position: absolute; width: 190px; height: 25px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: #1b1f24; font-size: 12px; }
.room-pager[hidden] { display: none; }
.room-pager button { border: 1px solid #667882; border-radius: 3px; background: #263c48; color: #fff; font: inherit; padding: 2px 7px; cursor: pointer; }
.room-pager button:disabled { opacity: .45; cursor: default; }
.room-pager button:focus-visible { outline: 2px solid #ffd84a; outline-offset: 1px; }
.room-cell.npc-room { cursor: default; animation: none; }
.room-cell.joinable { cursor: pointer; }
.room-cell.joinable:focus-visible { outline: 2px solid #ffd84a; outline-offset: -2px; }
.npc-tag { flex: none; font-size: 10px; color: #5c237c; }
.npc-room .room-name { color: #3a246a; }
.npc-room .npc-body { padding: 2px 6px; font-size: 11px; line-height: 15px; }
.npc-phase { font-weight: 700; color: #5c237c; height: 15px; }
.npc-player { display: flex; align-items: center; gap: 4px; height: 15px; white-space: nowrap; }
.npc-player span { overflow: hidden; text-overflow: ellipsis; }
.npc-avatar { width: 13px; height: 13px; border-radius: 50%; object-fit: cover; flex: none; }
.npc-info { margin: 0 0 8px; color: #ebd69b; font-size: 12px; }
.lobby-empty { position: absolute; left: 21px; top: 420px; width: 696px; text-align: center; font-size: 15px; font-weight: 700; color: #50565c; pointer-events: none; }
.user-row { position: absolute; left: 758px; width: 236px; height: 27px; line-height: 27px; color: #1b1f24; font-size: 12px; }
.user-row span { position: absolute; top: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.user-row .n { left: 6px; width: 86px; text-align: center; }
.user-row .b { left: 100px; width: 130px; text-align: right; font-weight: 700; }
.channel-box { position: absolute; left: 770px; top: 468px; width: 228px; height: 280px; overflow: hidden; color: #b8c7c5; font-size: 12px; line-height: 19px; }
/* 토너먼트 테이블: 위쪽 안내 띠 */
.tour-strip { position: absolute; left: 112px; top: 92px; z-index: 30; padding: 5px 16px; border-radius: 14px; border: 1px solid #f1c453; background: rgba(18, 13, 36, .9); color: #ffe7a8; font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; }
.tour-strip[hidden] { display: none; }
/* 상점에서 산 아바타 (테이블 자리) */
.av-img { border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1.5px #f1c453, 0 1px 3px rgba(0, 0, 0, .6); background: #1d1436; }
.channel-box b { color: var(--gold); }
.channel-box > b { display: block; font-size: 13px; }
.channel-box .warn { color: #ff9a8a; }
.channel-box .ch-info { margin: 4px 0 10px; }
.channel-box .ch-row { display: grid; grid-template-columns: 30px repeat(4, minmax(0, 1fr)); gap: 3px; align-items: center; margin-top: 4px; }
.channel-box .ch-row span { font-size: 11px; font-weight: 700; color: #c9d0e6; }
.channel-box .ch-row.gold span { color: var(--gold); }
.channel-box .ch-row button { height: 24px; padding: 0; border-radius: 4px; border: 1px solid #7f8bb5; background: #232a48; color: #e6ebff; font: inherit; font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; overflow: hidden; cursor: pointer; transition: background-color .15s, transform .12s; }
.channel-box .ch-row.gold button { border-color: #b08a2e; background: #3a2a0a; color: #ffe7a8; }
.channel-box .ch-row button:hover { background: #33407a; }
.channel-box .ch-row.gold button:hover { background: #5a4010; }
.channel-box .ch-row button:active { transform: scale(.95); }
.channel-box .ch-row button.on { background: linear-gradient(180deg, #5db8ea, #2c7db6); border-color: #cfe9ff; color: #fff; }
.channel-box .ch-row.gold button.on { background: linear-gradient(180deg, #f8bb3e, #dc7616); border-color: #ffe7a8; color: #fff; }
.channel-box .ch-row button.no { opacity: .45; }

.dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); z-index: 40; }
.dialog { position: absolute; z-index: 41; }
.dialog input[type=text] {
  position: absolute; border: 0; outline: 0; background: transparent; padding: 0 6px; height: 20px;
  font: 700 12px var(--font); color: #1b1f24; -webkit-user-select: text; user-select: text;
}
.seed-list { position: absolute; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.seed-list .spr { position: relative; display: block; margin: 0 auto 2px; }
.hit { position: absolute; cursor: pointer; border-radius: 4px; }
.hit:hover { background: rgba(255, 255, 255, .14); }
.hit:active { background: rgba(0, 0, 0, .18); }
.panel {
  position: absolute; z-index: 41; left: 262px; top: 150px; width: 500px; height: 470px; padding: 18px 20px;
  background: #f1eeea; color: #1b1f24; border: 3px solid #1a0d0d; border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .7);
}
.panel h2 { margin: -18px -20px 12px; padding: 10px 0; text-align: center; font-size: 17px; color: #fff; background: linear-gradient(#e2604a, #b93a2a); letter-spacing: 6px; }
.panel .rows { height: 350px; overflow-y: auto; font-size: 12px; -webkit-user-select: text; user-select: text; }
.panel table { width: 100%; border-collapse: collapse; }
.panel th, .panel td { padding: 5px 6px; border-bottom: 1px solid #d5d0c9; text-align: right; white-space: nowrap; }
.panel th:first-child, .panel td:first-child { text-align: left; }
.panel .plus { color: #0d6b2c; font-weight: 700; }
.panel .minus { color: #a11616; font-weight: 700; }
.panel button { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: 90px; height: 30px; border: 1px solid #3a1c10; border-radius: 3px; background: linear-gradient(#8a4a2a, #5a2a14); color: #fff; font: 700 13px var(--font); letter-spacing: 4px; cursor: pointer; }

/* ───── 테이블 ───── */
.t-text { position: absolute; white-space: nowrap; overflow: hidden; }
.t-right { text-align: right; }
.t-gold { color: var(--gold); font-weight: 700; }
.seat { position: absolute; }
.seat .info {
  position: absolute; left: 0; right: 0; bottom: 0; height: 30px; padding: 0 10px; display: flex; align-items: center; gap: 8px;
  background: linear-gradient(rgba(4, 16, 15, .0), rgba(4, 16, 15, .9) 40%); z-index: 6; pointer-events: none;
}
.seat .nick { font-size: 13px; font-weight: 700; color: #fff; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.participant-badge { display: inline-block; flex: none; padding: 1px 5px; border: 1px solid #927b46; border-radius: 3px; background: #292415; color: #ffe7a8; font-size: 10px; font-weight: 700; line-height: 14px; white-space: nowrap; }
.seat .stack { flex-shrink: 0; }
.seat .stack { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--gold); text-shadow: 0 1px 2px #000; }
.seat .tag { font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: #7a1d1d; color: #fff; }
.seat .tag.away { background: #555; }
.seat .betline { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); padding: 2px 12px; border-radius: 12px; background: rgba(4, 14, 13, .86); border: 1px solid rgba(255, 216, 74, .55); white-space: nowrap; z-index: 7; font-size: 13px; font-weight: 700; color: #fff; pointer-events: none; }
.seat .betline b { color: var(--gold); }
.seat .empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .22); font-size: 14px; font-weight: 700; letter-spacing: 4px; }
.seat .frame { left: -6px; top: -2px; z-index: 5; pointer-events: none; }
.seat.me .frame { left: 0; top: -3px; }
.seat .shade { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); z-index: 4; pointer-events: none; border-radius: 10px; }
.card { position: absolute; z-index: 2; transition: transform .28s cubic-bezier(.2, .8, .2, 1), filter .15s; will-change: transform; }
.card.mine { cursor: default; }
.card.pick { cursor: pointer; }
.card.sel { transform: translateY(-22px); filter: drop-shadow(0 0 6px #ffe36a); }
.card.dim { filter: brightness(.55); }
.card.up { transform: translateY(-12px); }
/* 포커 패 선택 창 */
.choice { position: absolute; z-index: 30; width: 516px; height: 279px; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .7)); }
.choice[hidden] { display: none; }
.choice .card { transition: transform .15s ease-out, filter .15s; }
.choice-prompt {
  position: absolute; left: 50%; top: -36px; transform: translateX(-50%); padding: 4px 18px; border-radius: 16px; white-space: nowrap;
  background: rgba(4, 12, 20, .92); border: 1px solid rgba(255, 216, 74, .7); color: #ffe9a6; font-size: 15px; font-weight: 700;
}
.choice-tag { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 15px; font-weight: 900; color: #fff; text-shadow: 0 0 4px #000, 0 0 8px #000, 0 1px 2px #000; pointer-events: none; }
.card.deal { animation: deal .32s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes deal { from { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.6); } }
.bubble { z-index: 8; pointer-events: none; animation: pop .22s cubic-bezier(.2, .9, .3, 1.3) backwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.hand-name {
  position: absolute; z-index: 9; left: 0; right: 0; text-align: center; font-size: 22px; font-weight: 900; color: #fff; pointer-events: none;
  text-shadow: 0 0 4px #1b4fd0, 0 0 10px #1b4fd0, 0 2px 2px #000; letter-spacing: 2px;
}
.hand-name span, .win-amt span { display: inline-block; padding: 1px 14px; border-radius: 14px; background: rgba(4, 12, 20, .88); }
.hand-name span { border: 1px solid rgba(120, 170, 255, .7); }
.win-amt { position: absolute; z-index: 10; left: 0; right: 0; text-align: center; font-size: 20px; font-weight: 900; color: var(--gold); pointer-events: none; animation: pop .3s backwards; }
.win-amt span { border: 1px solid rgba(255, 216, 74, .7); }
.win-amt.lose { color: #ff9a8f; font-size: 15px; }
.win-amt.lose span { border-color: rgba(255, 154, 143, .5); }
.timer { position: absolute; z-index: 7; left: 10px; right: 10px; height: 11px; bottom: 31px; background: rgba(0, 0, 0, .5); border-radius: 3px; overflow: hidden; pointer-events: none; }
.timer i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; background: linear-gradient(90deg, #e6352a, #ffb347 30%, #ffe9a6); animation: shrink linear forwards; }
@keyframes shrink { from { transform: scaleX(var(--from, 1)); } to { transform: scaleX(0); } }
.slot-n { position: absolute; width: 32px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #cfe6e2; }
.center-msg { position: absolute; left: 362px; top: 300px; width: 300px; text-align: center; font-size: 17px; font-weight: 700; color: #fff; text-shadow: 0 2px 4px #000; pointer-events: none; z-index: 12; }
.chat-log { position: absolute; left: 10px; top: 558px; width: 274px; height: 160px; overflow-y: auto; font-size: 12px; line-height: 17px; color: #d7e6e3; word-break: break-all; -webkit-user-select: text; user-select: text; scrollbar-width: thin; }
.chat-log .sys { color: #ffd98a; }
.chat-log b { color: #9fd3ff; }
.chat-in {
  position: absolute; left: 10px; top: 722px; width: 274px; height: 20px; border: 1px solid #2c5a55; border-radius: 3px; outline: 0;
  background: rgba(0, 0, 0, .45); color: #fff; padding: 0 6px; font: 12px var(--font); -webkit-user-select: text; user-select: text;
}
.chat-in:focus { border-color: #6fd0c4; }
.my-hand { position: absolute; left: 294px; top: 532px; width: 352px; text-align: center; font-size: 15px; font-weight: 900; color: #bfe8ff; text-shadow: 0 0 6px #0b3a8a, 0 1px 2px #000; pointer-events: none; z-index: 9; }
.hint { position: absolute; left: 688px; top: 534px; width: 328px; text-align: center; font-size: 13px; font-weight: 700; color: #ffe9a6; text-shadow: 0 1px 2px #000; pointer-events: none; }
.topbtn { position: absolute; top: 7px; height: 19px; cursor: pointer; }
.topbtn:hover { background: rgba(255, 255, 255, .16); }
.leave-flag { position: absolute; left: 846px; top: 30px; width: 170px; text-align: right; font-size: 12px; font-weight: 700; color: #ffb3a8; }

/* ───── 화면 전환 · 공통 움직임 ───── */
#viewport:not([hidden]) { animation: view-in .4s ease-out; }
@keyframes view-in { from { opacity: 0; } }
.screen:not([hidden]) { animation: screen-in .34s cubic-bezier(.16, 1, .3, 1); }
@keyframes screen-in { from { opacity: 0; transform: scale(1.015); } }
#toast:not([hidden]) { animation: toast-in .28s cubic-bezier(.16, 1, .3, 1); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px); } }
.dialog, .panel { animation: dlg-pop .26s cubic-bezier(.16, 1, .3, 1) backwards; }
@keyframes dlg-pop { from { opacity: 0; transform: translateY(12px) scale(.96); } }
.dim { animation: view-in .2s ease-out; }
.room-cell { transition: transform .2s cubic-bezier(.16, 1, .3, 1); animation: cell-in .35s cubic-bezier(.16, 1, .3, 1) backwards; }
.room-cell:not(.full):hover { transform: translateY(-3px); }
@keyframes cell-in { from { opacity: 0; transform: translateY(10px); } }
.hit, .topbtn { transition: background-color .14s; }
.chat-log > div { animation: line-in .22s ease-out; }
@keyframes line-in { from { opacity: 0; transform: translateX(-6px); } }
.user-row { animation: line-in .25s ease-out backwards; }
.seat .frame, .mg-seat.turn { animation: turn-in .3s ease-out; }
@keyframes turn-in { from { opacity: 0; } }
.center-msg:not(:empty) { animation: toast-in2 .3s cubic-bezier(.16, 1, .3, 1); }
@keyframes toast-in2 { from { opacity: 0; transform: translateY(8px); } }

/* ───── 맞고 ───── */
.mg-card { transition: transform .12s ease-out; }
.mg-playable:hover { transform: translateY(-8px); }
.mg-match { box-shadow: 0 0 0 2px #ffd84a, 0 0 9px #ffd84a; border-radius: 4px; }
.mg-ppuk { filter: drop-shadow(0 0 4px #ff5a3c) drop-shadow(0 0 2px #ff5a3c); }
.mg-seat { position: absolute; width: 112px; height: 168px; border-radius: 8px; }
.mg-seat.turn { box-shadow: 0 0 0 2px #ffd84a, 0 0 14px #ffd84a; }
.mg-seat > div { position: absolute; left: 0; right: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-nick { top: 58px; font-size: 13px; font-weight: 700; color: #fff; }
.mg-seat > .participant-badge { position: absolute; top: 132px; left: 50%; transform: translateX(-50%); }
.mg-stack { top: 80px; font-size: 13px; font-weight: 700; color: var(--gold); }
.mg-tag { top: 104px; font-size: 11px; font-weight: 700; color: #ffb3a8; }
.mg-empty { top: 74px; color: rgba(255, 255, 255, .3); font-weight: 700; letter-spacing: 3px; }
.mg-num { color: #fff; font-size: 15px; font-weight: 700; line-height: 18px; }
.mg-timer { position: absolute; width: 106px; height: 10px; border-radius: 4px; overflow: hidden; }
.mg-timer i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; background: linear-gradient(90deg, #e6352a, #ffb347 30%, #ffe9a6); animation: shrink linear forwards; }
.mg-deck { box-shadow: 2px 2px 0 #7a0a0a, 4px 4px 0 #4f0606; border-radius: 3px; }
.mg-deckn { text-align: center; color: #e4f5cf; font-weight: 700; text-shadow: 0 1px 2px #000; }
.mg-count { position: absolute; min-width: 18px; height: 16px; padding: 0 4px; line-height: 16px; text-align: center; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .78); border-radius: 8px; z-index: 3; }
.mg-info { position: absolute; left: 772px; top: 374px; width: 234px; height: 124px; font-size: 12px; color: #dff0d0; overflow: hidden; }
.mg-info > div { display: flex; justify-content: space-between; padding: 2px 0; }
.mg-info b { color: #fff; }
.mg-info .mg-result { display: block; margin-top: 5px; padding: 5px 8px; text-align: center; font-weight: 700; color: #ffe9a6; background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 216, 74, .7); border-radius: 6px; }
.mg-tags { font-size: 11px; font-weight: 400; color: #fff; white-space: normal; }
.mg-flash { position: absolute; left: 335px; top: 262px; width: 300px; text-align: center; font-size: 46px; font-weight: 900; color: #fff200; text-shadow: 0 0 8px #c40000, 0 3px 0 #7a0000, 0 0 2px #000; z-index: 25; pointer-events: none; animation: pop .25s cubic-bezier(.2, .9, .3, 1.3) backwards; }
.mg-flash[hidden] { display: none; }
.mg-ghost { z-index: 22; pointer-events: none; transform-origin: 0 0; transition: left .23s cubic-bezier(.2, .8, .2, 1), top .23s cubic-bezier(.2, .8, .2, 1), transform .23s ease-out; box-shadow: 0 6px 12px rgba(0, 0, 0, .45); will-change: left, top; }
.mg-ghost.mg-shrink { transform: scale(.78); }
.mg-guk { position: absolute; width: 43px; text-align: center; font-size: 10px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .8); z-index: 3; pointer-events: none; }
.mg-bomb-bonus { position: absolute; width: 55px; height: 84px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.mg-bomb-bonus span { position: absolute; left: 2px; right: 2px; bottom: 4px; padding: 2px 0; color: #fff; background: #37200a; font-size: 11px; font-weight: 700; text-align: center; }
.mg-joker-label { position: absolute; left: 1px; right: 1px; bottom: 2px; padding: 1px 0; color: #fff; background: #37200a; font-size: 10px; font-weight: 700; text-align: center; pointer-events: none; }
.mg-bomb-bonus:disabled { cursor: default; }
.mg-bomb-bonus:not(:disabled):hover { transform: translateY(-6px); }
.mg-bomb-bonus:focus-visible { outline: 3px solid #ffe3a4; outline-offset: 3px; }
.game-result-popup { box-sizing: border-box; position: fixed; inset: auto; left: 50%; top: 50%; width: min(600px, calc(100vw - 24px)); max-width: none; max-height: none; overflow: visible; margin: 0; padding: 0; transform: translate(-50%, -50%) scale(var(--result-scale, 1)); transform-origin: center; border: 64px solid transparent; border-image: url('/assets/results/matgo-result-frame-v1.png') 24% 26% fill / 64px stretch; background: #07331c; background-clip: padding-box; color: #fff7dc; filter: drop-shadow(0 12px 22px #000b); font: 14px/1.35 var(--font); text-align: center; }
.game-result-popup::backdrop { background: #0008; }
.game-result-popup h2 { margin: 0 0 8px; font-size: 34px; line-height: 1.2; font-weight: 900; color: #ffe19b; text-shadow: 0 2px 0 #59360d, 0 3px 5px #000b; }
.game-result-detail { margin: 0 0 4px; overflow-wrap: anywhere; }
.game-result-score { margin: 0; font-size: 17px; font-weight: 700; }
.game-result-tags { margin: 4px 0 0; color: #d3e1bd; font-size: 12px; }
.game-result-money { margin: 12px 0; }
.game-result-money span { display: block; margin-bottom: 2px; color: #e4d3a4; font-size: 13px; }
.game-result-money strong { display: block; font-size: clamp(30px, 7vw, 44px); line-height: 1.1; font-weight: 900; overflow-wrap: anywhere; color: #ffe49e; text-shadow: 0 2px 0 #64400e, 0 3px 5px #000b; }
.game-result-popup[data-outcome=loss] .game-result-money strong { color: #ffc0a9; text-shadow: 0 2px 0 #6b2318, 0 3px 5px #000b; }
.game-result-confirm { display: block; width: min(246px, 100%); height: 54px; margin: 0 auto; padding: 0 30px; border: 0; border-radius: 9px; background: url('/assets/results/matgo-result-confirm-v1.png') center / 100% 170% no-repeat; color: #fff3cd; font: 900 18px var(--font); text-shadow: 0 2px 2px #500600; cursor: pointer; transition: filter .14s ease-out, transform .14s ease-out; }
.game-result-confirm:hover { filter: brightness(1.15); }
.game-result-confirm:active { transform: translateY(1px); filter: brightness(.92); }
.game-result-confirm:focus-visible { outline: 2px solid #fff1bc; outline-offset: 3px; }
.game-result-next { margin: 8px 0 0; color: #d3e1bd; font-size: 11px; }
.game-congratulation-art { position:relative;margin:0 auto;background-repeat:no-repeat; }
.game-result-jackpot { color:#ffe19b;font-size:18px;font-weight:800; }
.game-jackpot { position:absolute;text-align:center;color:#ffe19b;z-index:3;line-height:22px;font-weight:700;white-space:nowrap;overflow:hidden; }
.game-reward-value { position:absolute;z-index:3;background:#101e20;color:#ffdb8d;border:0;text-align:right;padding:0 4px;font:700 12px var(--font);cursor:pointer;white-space:nowrap; }
.game-reward-value:focus-visible { outline:2px solid #ffdb8d;outline-offset:2px; }
.game-log-tabs { position:absolute;display:flex;gap:3px;height:23px;z-index:4; }
.game-log-tabs button { flex:1;border:1px solid #647c83;background:#172f35;color:#c9dddf;cursor:pointer;font:12px var(--font); }
.game-log-tabs button[aria-pressed=true] { background:#31565f;color:#fff2bd;border-color:#c7a45a; }.chat-log[hidden] { display:none; }
.game-next-hand { position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%); z-index: 30; width: 300px; padding: 14px 18px; background: #062716ed; border: 1px solid #ab8139; text-align: center; }
.game-next-hand[hidden] { display: none; }
.game-next-hand p { margin: 0 0 10px; color: #fff3cd; font-size: 14px; overflow-wrap: anywhere; }
.game-next-hand button:disabled { filter: grayscale(.4) brightness(.7); cursor: default; }
.game-next-hand .original-game-start { margin:auto; padding:0; border:0; border-radius:0; background-repeat:no-repeat; background-size:auto; background-color:transparent; color:transparent; text-shadow:none; }
@media (max-width: 480px) {
  .game-result-popup { border-width: 58px 36px; border-image-width: 58px 36px; }
  .game-result-popup h2 { font-size: 28px; }
}
@media (max-height: 500px) {
  .game-result-popup { width: min(560px, calc(100vw - 24px)); border-width: 44px 64px; border-image-width: 44px 64px; }
  .game-result-popup h2 { margin-bottom: 5px; font-size: 29px; }
  .game-result-money { margin: 8px 0; }
  .game-result-money strong { font-size: 36px; }
  .game-result-confirm { height: 48px; }
  .game-result-next { margin-top: 5px; }
}
.mg-info .mg-mission { display: flex; justify-content: flex-start; gap: 3px; padding-top: 4px; height: 44px; }
.mg-mcard { position: relative; flex: none; transform: scale(.6); transform-origin: 0 0; margin-right: -17px; margin-bottom: -26px; opacity: .92; }
.mg-mcard.mine { outline: 3px solid #ffd84a; }
.mg-mcard.lost { opacity: .35; }
.center-msg.mg-big { font-size: 28px; font-weight: 900; color: #fff200; text-shadow: 0 0 8px #000, 0 3px 2px #000; }

@media (prefers-reduced-motion: reduce) {
  #viewport, .screen, #toast, .dialog, .panel, .dim, .room-cell, .chat-log > div, .user-row, .seat .frame, .mg-seat.turn, .center-msg { animation: none !important; transition: none !important; }
  .card, .card.deal, .bubble, .win-amt { animation: none; transition: none; }
}

/* 공지 목록은 축소되는 게임 무대 밖에서 열어 작은 창에서도 본문을 읽을 수 있다. */
.game-notice-link { position:absolute;z-index:3;border:1px solid #808d94;border-radius:2px;background:#26343c;color:#fff;font:700 12px var(--font);cursor:pointer;padding:0; }
.game-notice-link:hover { background:#3b505d; }
.game-notice-link:focus-visible { outline:2px solid #ffd84a;outline-offset:2px; }
dialog.papa-notices { width:min(780px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:0;border:1px solid #bdc2c6;border-radius:5px;background:#fff;color:#252b30;font:14px/1.6 var(--font);box-shadow:0 16px 48px rgba(0,0,0,.35);user-select:text;overflow:hidden; }
dialog.papa-notices[open] { display:flex;flex-direction:column; }
.papa-notices::backdrop { background:rgba(0,0,0,.65); }
.papa-notices .notice-head { display:flex;align-items:center;justify-content:space-between;gap:16px;padding:17px 24px;border-bottom:2px solid #d65517;background:#f8f7f5;flex-shrink:0; }
.papa-notices h2 { margin:0;font-size:21px;color:#24282a; }
.papa-notices button,.papa-notices input { font:inherit; }
.papa-notices button { cursor:pointer;border:1px solid #b6bec3;border-radius:3px;padding:6px 12px;background:#f7f8f9;color:#252b30; }
.papa-notices button:hover { background:#e8edf0; }
.papa-notices button:disabled { opacity:.5;cursor:default; }
.papa-notices :focus-visible { outline:2px solid #c84910;outline-offset:2px; }
.papa-notices ::selection { background:#ffe0bc;color:#252b30; }
.papa-notices .notice-main { padding:20px 24px 24px;overflow:auto;overscroll-behavior:contain;scrollbar-color:#87949c #eef0f2; }
.papa-notices .notice-status { color:#525e66;margin:0 0 12px; }
.papa-notices .notice-search { display:flex;gap:8px;margin-bottom:18px; }
.papa-notices input { width:100%;min-width:0;background:#fff;color:#252b30;border:1px solid #9ca8b0;padding:7px 10px;border-radius:3px; }
.papa-notices input::placeholder { color:#606e77; }
.papa-notices .notice-search button { flex-shrink:0;background:#c94b12;color:#fff;border-color:#c94b12; }
.papa-notices .notice-list { border-collapse:collapse;width:100%;table-layout:fixed; }
.papa-notices th,.papa-notices td { padding:11px 8px;border-bottom:1px solid #dfe3e6;text-align:left;vertical-align:top;overflow-wrap:anywhere; }
.papa-notices th { background:#edf0f2;color:#39464f; }
.papa-notices th:first-child { width:58px; }
.papa-notices th:last-child { width:116px; }
.papa-notices .notice-title { border:0;background:none;text-align:left;padding:0;color:#242b30;line-height:1.6;overflow-wrap:anywhere; }
.papa-notices .notice-title:hover { background:none;color:#a53e0e;text-decoration:underline;text-underline-offset:3px; }
.papa-notices .notice-pinned { color:#a43c0c;font-weight:700; }
.papa-notices time { font-size:12px;color:#56646d; }
.papa-notices .notice-pages { display:flex;gap:20px;align-items:center;justify-content:center;margin-top:24px; }
.papa-notices [hidden] { display:none; }
.papa-notices .notice-detail-title { margin:0 0 16px;font-size:20px;line-height:1.5;overflow-wrap:anywhere; }
.papa-notices .notice-body { white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.85;margin:0; }
.papa-notices .notice-back { display:block;margin-top:26px; }
.papa-notices .notice-empty { text-align:center;padding:36px 8px; }
.member-balances { display:grid;grid-template-columns:1fr auto;gap:8px 24px;margin:0 0 24px; }
.invite-candidate { display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid #dfe3e6; }
.invite-avatar { width:40px;height:40px;display:grid;place-items:center;flex-shrink:0; }.invite-candidate strong { margin-left:auto; }.invite-candidate span { overflow-wrap:anywhere; }
.seat-kick { background:#27343d;border:1px solid #9ba9b3;color:#fff;font:11px var(--font);cursor:pointer; }
.mg-dealer { position:absolute;left:350px;top:210px;width:324px;height:300px;z-index:25;background:#082b1e;border:1px solid #b89342;border-radius:6px; }
.mg-dealer[hidden] { display:none; }.mg-dealer button { padding:0;border:0;background-color:transparent; }.mg-dealer button:hover,.mg-dealer button:focus-visible { outline:3px solid #ffe18d;outline-offset:3px; }.mg-dealer button:disabled { opacity:.6;cursor:default; }
.mg-dealer-note { position:absolute;left:20px;right:20px;top:225px;text-align:center;color:#fff2c8;line-height:1.7;margin:0; }
.mg-dealer-reveal { position:absolute;left:50%;top:48%;transform:translate(-50%,-50%);width:400px;padding:18px 20px;z-index:31;border:1px solid #b89342;border-radius:6px;background:#082b1e;color:#fff2c8;text-align:center;box-shadow:0 10px 24px #0006; }
.mg-dealer-reveal[hidden] { display:none; }.has-dealer-reveal > .game-next-hand { visibility:hidden; }
.mg-dealer-reveal h2 { margin:0 0 12px;font-size:20px;color:#ffe19b; }
.dealer-reveal-columns { display:grid;grid-template-columns:1fr 1fr;gap:16px; }
.dealer-reveal-column { position:relative;height:222px; }
.dealer-reveal-label { left:50%;top:0;transform:translateX(-50%); }
.dealer-reveal-card { left:50%;top:72px;transform:translateX(-50%) scale(1.2);transform-origin:center top; }
.dealer-is-boss .dealer-reveal-card { outline:2px solid #ffe19b;outline-offset:3px; }
.dealer-reveal-boss { transform:scale(.45);transform-origin:0 0; }.dealer-reveal-boss[hidden] { display:none; }
.dealer-reveal-month,.dealer-reveal-nick { position:absolute;left:0;right:0;top:180px;font-size:14px; }.dealer-reveal-nick { top:202px;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.dealer-reveal-message { white-space:pre-line;margin:8px 0 14px;line-height:1.6;font-size:13px; }
.dealer-reveal-start { display:block;position:relative;margin:auto;padding:0;border:0;background-repeat:no-repeat;background-size:auto;background-color:transparent;color:transparent;cursor:pointer; }
.dealer-reveal-start:disabled { filter:grayscale(.4) brightness(.65);cursor:default; }.dealer-reveal-start:focus-visible { outline:2px solid #fff0aa;outline-offset:3px; }
.member-balances dt { color:#52616c; }.member-balances dd { margin:0;font-weight:700; }
.member-money-form label { display:block;margin-bottom:14px; }.member-money-form input { display:block;margin-top:6px; }
.member-history p { display:flex;justify-content:space-between;gap:16px;border-bottom:1px solid #dfe3e6;padding:8px 0; }.member-history span { color:#52616c; }.member-history strong { flex-shrink:0; }
@media(max-width:520px) { dialog.papa-notices { font-size:14px; } .papa-notices .notice-head { padding:12px 16px; } .papa-notices .notice-main { padding:16px; } .papa-notices input { font-size:16px; } .papa-notices th:first-child { width:45px; } .papa-notices th:last-child { width:85px; } .papa-notices th,.papa-notices td { padding:10px 4px; } }
