:root {
  --mg-lac: #0c2f29;
  --mg-lac-deep: #071e19;
  --mg-lac-hi: #155245;
  --mg-lac-panel: #10382f;
  --mg-ivory: #f6edd8;
  --mg-ivory-lo: #eadfc2;
  --mg-ivory-well: #efe3c8;
  --mg-brown: #3f2f16;
  --mg-brown-sub: #7a6644;
  --mg-gold: #f0c75a;
  --mg-gold-hi: #ffe9a8;
  --mg-gold-mid: #c9a24b;
  --mg-gold-deep: #8a6a2f;
  --mg-red: #b8402e;
  --mg-red-hi: #d8543f;
  --mg-jade: #2e9e6b;
  --mg-text-d: #f2ecdc;
  --mg-sub-d: rgba(238, 230, 208, 0.6);
  --mg-line-d: rgba(240, 199, 90, 0.2);
  --mg-disp: 'Black Han Sans', 'Pretendard', 'Malgun Gothic', sans-serif;
  --mg-body-f: 'Pretendard', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --mg-seiga: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='36'%3E%3Cg fill='none' stroke='%23f0c75a' stroke-opacity='.05' stroke-width='1.4'%3E%3Ccircle cx='36' cy='36' r='33'/%3E%3Ccircle cx='36' cy='36' r='24'/%3E%3Ccircle cx='36' cy='36' r='15'/%3E%3Ccircle cx='0' cy='18' r='33'/%3E%3Ccircle cx='0' cy='18' r='24'/%3E%3Ccircle cx='0' cy='18' r='15'/%3E%3Ccircle cx='72' cy='18' r='33'/%3E%3Ccircle cx='72' cy='18' r='24'/%3E%3Ccircle cx='72' cy='18' r='15'/%3E%3C/g%3E%3C/svg%3E");
  --mg-corner: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Cpath d='M5 44 V14 Q5 5 14 5 H44' fill='none' stroke='%23b98f3e' stroke-width='2.6'/%3E%3Cpath d='M11 44 V18 Q11 11 18 11 H44' fill='none' stroke='%23b98f3e' stroke-width='1.1' opacity='.55'/%3E%3Crect x='1.6' y='1.6' width='7' height='7' transform='rotate(45 5.1 5.1)' fill='%23b98f3e'/%3E%3C/svg%3E");
}

#mg-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(3, 12, 10, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--mg-body-f);
  color: var(--mg-text-d);
}
#mg-modal *, #mg-modal *::before, #mg-modal *::after { box-sizing: border-box; }
#mg-modal button { font-family: inherit; cursor: pointer; }
#mg-modal button:disabled { cursor: default; opacity: 0.45; filter: saturate(0.55); }
#mg-modal button:focus-visible, #mg-modal input:focus-visible { outline: 2px solid var(--mg-gold); outline-offset: 2px; }

.mg-shell {
  width: min(1120px, 96vw);
  height: min(92vh, 92dvh, 830px);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid rgba(240, 199, 90, 0.4);
  background:
    var(--mg-seiga),
    radial-gradient(115% 85% at 50% -8%, var(--mg-lac-hi) 0%, var(--mg-lac) 52%, var(--mg-lac-deep) 100%);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(7, 30, 25, 0.9),
    inset 0 0 0 2.5px rgba(240, 199, 90, 0.16);
  overflow: hidden;
}

.mg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 2px solid rgba(240, 199, 90, 0.32);
  background: linear-gradient(180deg, rgba(7, 30, 25, 0.9), rgba(10, 39, 33, 0.75));
  box-shadow: 0 1px 0 rgba(240, 199, 90, 0.1), 0 6px 18px rgba(0, 0, 0, 0.35);
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
}
.mg-head-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mg-disp);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.05em;
  color: var(--mg-gold-hi);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  overflow: hidden;
}
.mg-head-seal {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--mg-red-hi);
  border-radius: 7px;
  color: var(--mg-red-hi);
  background: rgba(184, 64, 46, 0.12);
  flex: 0 0 auto;
}
.mg-head-sp { flex: 1; }
.mg-hbtn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.6px solid rgba(240, 199, 90, 0.4);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(240, 199, 90, 0.14), rgba(240, 199, 90, 0.05));
  color: var(--mg-gold);
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.1s;
  flex: 0 0 auto;
}
.mg-hbtn:hover { color: var(--mg-gold-hi); border-color: var(--mg-gold); background: rgba(240, 199, 90, 0.22); }
.mg-hbtn:active { transform: translateY(1px); }

.mg-body { flex: 1; min-height: 0; position: relative; overflow: hidden; display: flex; flex-direction: column; }

/* ---------- buttons ---------- */
.mg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 800;
  border: 1px solid transparent;
  transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
  white-space: nowrap;
}
.mg-btn:not(:disabled):active { transform: translateY(1.5px); }
.mg-btn-gold {
  background: linear-gradient(180deg, #ffe193 0%, var(--mg-gold) 45%, #cfa143 88%, #b98f3e 100%);
  color: #4a3410;
  border: 1px solid #8a6a2f;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2.5px 0 rgba(122, 88, 28, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.mg-btn-gold:not(:disabled):hover { filter: brightness(1.07); box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.65), inset 0 -2.5px 0 rgba(122, 88, 28, 0.5), 0 6px 18px rgba(240, 199, 90, 0.35); }
.mg-btn-red {
  background: linear-gradient(180deg, #e06b52 0%, var(--mg-red) 55%, #93301f 100%);
  color: #ffe9dd;
  border: 1px solid #7c2517;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.3), inset 0 -2.5px 0 rgba(90, 26, 14, 0.6), 0 4px 12px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 2px rgba(90, 26, 14, 0.6);
}
.mg-btn-red:not(:disabled):hover { filter: brightness(1.08); }
.mg-btn-ghost {
  background: linear-gradient(180deg, rgba(240, 199, 90, 0.16), rgba(240, 199, 90, 0.06));
  color: var(--mg-gold);
  border: 1.6px solid rgba(240, 199, 90, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 233, 168, 0.2);
}
.mg-btn-ghost:not(:disabled):hover { background: rgba(240, 199, 90, 0.24); color: var(--mg-gold-hi); }
.mg-btn-dim {
  background: linear-gradient(180deg, rgba(16, 56, 47, 0.9), rgba(9, 34, 28, 0.9));
  color: var(--mg-sub-d);
  border: 1px solid rgba(240, 199, 90, 0.25);
}
.mg-btn-dim:not(:disabled):hover { color: var(--mg-text-d); border-color: rgba(240, 199, 90, 0.5); }
.mg-btn-big { padding: 13px 26px; font-size: 16px; border-radius: 12px; font-family: var(--mg-disp); font-weight: 400; letter-spacing: 0.06em; }

/* ivory-context buttons */
.mg-dlg .mg-btn-dim, .mg-card .mg-btn-dim {
  background: linear-gradient(180deg, #e7dabb, #d9c9a4);
  color: #6b5636;
  border: 1px solid #bfa678;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.mg-dlg .mg-btn-dim:not(:disabled):hover, .mg-card .mg-btn-dim:not(:disabled):hover { color: var(--mg-brown); border-color: #8a6a2f; }
.mg-dlg .mg-btn-ghost, .mg-card .mg-btn-ghost {
  background: linear-gradient(180deg, #fdf6e4, #f0e4c6);
  color: #8a6a2f;
  border: 1.6px solid #c9a24b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.mg-dlg .mg-btn-ghost:not(:disabled):hover, .mg-card .mg-btn-ghost:not(:disabled):hover { color: #6b4f1e; background: #fff7e2; }

.mg-input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1.6px solid #c3ab7c;
  background: #fffaf0;
  color: var(--mg-brown);
  font-size: 13.5px;
  font-family: inherit;
  box-shadow: inset 0 2px 5px rgba(122, 96, 46, 0.16);
}
.mg-input::placeholder { color: #b3a179; }

/* ---------- ivory panel + ribbon ---------- */
.mg-card {
  position: relative;
  background: linear-gradient(180deg, var(--mg-ivory) 0%, var(--mg-ivory-lo) 100%);
  border: 2px solid var(--mg-gold-mid);
  border-radius: 13px;
  padding: 26px 18px 18px;
  color: var(--mg-brown);
  box-shadow:
    inset 0 0 0 1px rgba(255, 251, 238, 0.8),
    inset 0 0 26px rgba(160, 128, 62, 0.12),
    0 10px 28px rgba(0, 0, 0, 0.4);
}
.mg-card::before, .mg-card::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  background: var(--mg-corner) no-repeat center / contain;
  opacity: 0.75;
  pointer-events: none;
}
.mg-card::before { top: 5px; left: 5px; }
.mg-card::after { bottom: 5px; right: 5px; transform: rotate(180deg); }
.mg-card-t {
  position: absolute;
  top: -13px;
  left: 16px;
  padding: 5px 16px 6px;
  background: linear-gradient(180deg, #17493d, var(--mg-lac-panel));
  border: 1.6px solid var(--mg-gold-mid);
  border-radius: 8px;
  font-family: var(--mg-disp);
  font-weight: 400;
  font-size: 14.5px;
  letter-spacing: 0.06em;
  color: var(--mg-gold-hi);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(240, 199, 90, 0.25);
  z-index: 2;
  margin: 0;
}
.mg-card-sub { font-size: 12px; color: var(--mg-brown-sub); margin: -6px 0 12px; }

.mg-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #6b4f1e;
  background: linear-gradient(180deg, #fbf1d7, #eee0bb);
  border: 1px solid #c9a24b;
  white-space: nowrap;
}
.mg-chip-live { color: #1e7a4e; border-color: #57a87e; background: #e2f2e6; }

.mg-empty { padding: 28px 10px; text-align: center; color: var(--mg-brown-sub); font-size: 13px; }
.mg-dim2 { color: var(--mg-brown-sub); }
.mg-spin {
  width: 26px; height: 26px;
  margin: 26px auto;
  border-radius: 50%;
  border: 3px solid rgba(138, 106, 47, 0.25);
  border-top-color: var(--mg-gold-deep);
  animation: mg-rot 0.9s linear infinite;
}
@keyframes mg-rot { to { transform: rotate(360deg); } }

.mg-link { background: none; border: none; color: var(--mg-brown-sub); font-size: 12.5px; font-weight: 800; padding: 4px 6px; text-decoration: underline dotted rgba(138, 106, 47, 0.5); text-underline-offset: 3px; }
.mg-link:hover { color: var(--mg-red); }
.mg-link-sep { width: 1px; height: 12px; background: #c9a24b; display: inline-block; }

.mg-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mg-brown); margin: 12px 0 4px; cursor: pointer; font-weight: 600; }
.mg-check input { accent-color: var(--mg-red); width: 15px; height: 15px; }

.mg-seg { display: flex; gap: 7px; flex-wrap: wrap; }
.mg-seg-b {
  flex: 1;
  min-width: 92px;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1.6px solid #c3ab7c;
  background: linear-gradient(180deg, #efe3c6, #e4d5b0);
  color: #7a6644;
  font-size: 13.5px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.mg-seg-b span { font-size: 10.5px; font-weight: 500; color: #9c8a63; line-height: 1.35; }
.mg-seg-on {
  border-color: #8a6a2f;
  color: #4a3410;
  background: linear-gradient(180deg, #ffe193, #ecc35c);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 rgba(122, 88, 28, 0.35), 0 2px 8px rgba(201, 162, 75, 0.4);
}
.mg-seg-on span { color: #6b4f1e; }

/* ---------- toast / dialog ---------- */
.mg-toast { position: absolute; top: 62px; left: 50%; transform: translateX(-50%); z-index: 10060; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.mg-toast-item {
  padding: 10px 20px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fdf4de, #f0e4c6);
  border: 1.6px solid var(--mg-gold-mid);
  color: var(--mg-brown);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: mg-toast-in 0.25s ease;
}
.mg-toast-bad { border-color: var(--mg-red); color: var(--mg-red); }
.mg-toast-out { opacity: 0; transition: opacity 0.35s; }
@keyframes mg-toast-in { from { opacity: 0; transform: translateY(-8px); } }

.mg-dialog { position: absolute; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; }
.mg-dlg-back { position: absolute; inset: 0; background: rgba(3, 14, 11, 0.66); backdrop-filter: blur(3px); }
.mg-dlg {
  position: relative;
  width: min(440px, 92%);
  max-height: 86%;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--mg-ivory) 0%, var(--mg-ivory-lo) 100%);
  border: 2px solid var(--mg-gold-mid);
  border-radius: 14px;
  padding: 20px;
  color: var(--mg-brown);
  box-shadow: inset 0 0 0 1px rgba(255, 251, 238, 0.8), inset 0 0 30px rgba(160, 128, 62, 0.1), 0 28px 80px rgba(0, 0, 0, 0.65);
  animation: mg-dlg-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes mg-dlg-in { from { opacity: 0; transform: scale(0.94) translateY(8px); } }
.mg-dlg-t {
  font-family: var(--mg-disp);
  font-weight: 400;
  font-size: 19px;
  color: var(--mg-brown);
  margin-bottom: 14px;
  letter-spacing: 0.04em;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(201, 162, 75, 0.5);
}
.mg-dlg-l { font-size: 12.5px; font-weight: 800; color: var(--mg-brown-sub); margin: 14px 0 7px; }
.mg-dlg-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.mg-pts-wrap { margin-top: 2px; }
.mg-neural-note { margin-top: 12px; font-size: 11.5px; color: var(--mg-brown-sub); background: rgba(201, 162, 75, 0.14); border: 1px dashed #b99a55; border-radius: 8px; padding: 9px 11px; }

/* ---------- red seal stamps ---------- */
.mg-stampfx { position: absolute; inset: 0; z-index: 10055; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.mg-stampfx-in { position: relative; display: flex; align-items: center; justify-content: center; animation: mg-stamp-fade 1.3s ease forwards; }
.mg-stampfx-ring {
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  border: 5px solid rgba(216, 84, 63, 0.9);
  box-shadow: 0 0 46px rgba(216, 84, 63, 0.4), inset 0 0 34px rgba(216, 84, 63, 0.2);
  animation: mg-ring-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.mg-stampfx-txt {
  font-family: var(--mg-disp);
  font-weight: 400;
  font-size: 46px;
  color: #ff6a50;
  letter-spacing: 0.1em;
  text-shadow: 0 0 30px rgba(216, 84, 63, 0.65), 0 2px 4px rgba(0, 0, 0, 0.5);
  transform: rotate(-6deg);
  animation: mg-stamp-in 0.4s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes mg-ring-in { from { transform: scale(1.7); opacity: 0; } }
@keyframes mg-stamp-in { from { transform: rotate(-6deg) scale(2.2); opacity: 0; } }
@keyframes mg-stamp-fade { 0%, 68% { opacity: 1; } 100% { opacity: 0; } }

.mg-res-card {
  position: relative;
  width: min(410px, 92%);
  background: linear-gradient(180deg, var(--mg-ivory) 0%, var(--mg-ivory-lo) 100%);
  border: 2px solid var(--mg-gold-mid);
  border-radius: 16px;
  padding: 28px 22px 22px;
  text-align: center;
  color: var(--mg-brown);
  box-shadow: inset 0 0 0 1px rgba(255, 251, 238, 0.8), 0 28px 80px rgba(0, 0, 0, 0.65);
  animation: mg-dlg-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.mg-stamp {
  position: absolute;
  top: -24px;
  right: 16px;
  width: 78px; height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--mg-red-hi);
  border-radius: 50%;
  color: var(--mg-red-hi);
  font-family: var(--mg-disp);
  font-weight: 400;
  font-size: 21px;
  letter-spacing: 0.02em;
  background: radial-gradient(circle at 50% 42%, #fff7e6, #f3e6c8);
  transform: rotate(10deg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 0 10px rgba(216, 84, 63, 0.2);
  animation: mg-stamp-drop 0.45s cubic-bezier(0.2, 1.5, 0.4, 1);
}
.mg-stamp-win { border-color: var(--mg-red-hi); color: var(--mg-red-hi); }
.mg-stamp-lose { border-color: #6a7c92; color: #6a7c92; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
@keyframes mg-stamp-drop { from { transform: rotate(10deg) scale(2); opacity: 0; } }
.mg-res-title { font-family: var(--mg-disp); font-weight: 400; font-size: 21px; color: var(--mg-brown); margin-bottom: 16px; letter-spacing: 0.06em; }
.mg-res-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.mg-res-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 9px;
  background: rgba(201, 162, 75, 0.12);
  border: 1px solid rgba(195, 171, 124, 0.6);
  font-size: 13.5px;
}
.mg-res-me { border: 1.8px solid var(--mg-gold-deep); background: linear-gradient(180deg, #ffe9b3, #f3d98e); }
.mg-res-name { flex: 1; text-align: left; font-weight: 800; }
.mg-res-oc { font-weight: 900; color: var(--mg-red); }
.mg-res-back { width: 100%; }

/* ---------- hub ---------- */
.mg-hub { flex: 1; overflow-y: auto; padding: clamp(18px, 4vh, 42px) clamp(16px, 4vw, 50px); display: flex; flex-direction: column; justify-content: safe center; }
.mg-hub-head, .mg-hub-cards { width: 100%; }
.mg-hub-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.mg-hub-t {
  font-family: var(--mg-disp);
  font-weight: 400;
  font-size: clamp(22px, 3vw, 30px);
  color: var(--mg-gold-hi);
  letter-spacing: 0.08em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55), 0 0 26px rgba(240, 199, 90, 0.25);
}
.mg-hub-rule { flex: 1; height: 2px; background: linear-gradient(90deg, rgba(240, 199, 90, 0.55), rgba(240, 199, 90, 0.06)); border-radius: 2px; }
.mg-hub-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 26px; max-width: 920px; margin: 0 auto; }
.mg-hub-card {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  border: 2.5px solid var(--mg-gold-mid);
  background: var(--mg-lac-panel);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: inset 0 0 0 1.5px rgba(7, 30, 25, 0.8), 0 14px 36px rgba(0, 0, 0, 0.45);
}
.mg-hub-card:hover {
  transform: translateY(-5px);
  border-color: var(--mg-gold);
  box-shadow: inset 0 0 0 1.5px rgba(7, 30, 25, 0.8), 0 22px 50px rgba(0, 0, 0, 0.55), 0 0 30px rgba(240, 199, 90, 0.25);
}
.mg-hub-art { height: 172px; position: relative; }
.mg-hub-art svg { width: 100%; height: 100%; display: block; }
.mg-hub-info {
  padding: 14px 18px 16px;
  background: linear-gradient(180deg, var(--mg-ivory), var(--mg-ivory-lo));
  border-top: 2px solid var(--mg-gold-mid);
  color: var(--mg-brown);
}
.mg-hub-name { font-family: var(--mg-disp); font-weight: 400; font-size: 21px; letter-spacing: 0.05em; }
.mg-hub-desc { font-size: 12.5px; color: var(--mg-brown-sub); margin-top: 5px; line-height: 1.55; }
.mg-hub-seal {
  position: absolute;
  top: 12px; right: 12px;
  padding: 6px 10px;
  border: 2px solid rgba(216, 84, 63, 0);
  border-radius: 9px;
  color: transparent;
  font-family: var(--mg-disp);
  font-size: 13px;
  transform: rotate(7deg);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.mg-hub-card:hover .mg-hub-seal { color: #ff8a70; border-color: rgba(216, 84, 63, 0.85); background: rgba(7, 30, 25, 0.75); }

/* ---------- lobby ---------- */
.mg-lobby { flex: 1; overflow-y: auto; padding: clamp(22px, 3vh, 30px) clamp(14px, 3vw, 32px) 22px; display: flex; flex-direction: column; gap: 26px; }
.mg-lb-grid { display: grid; grid-template-columns: minmax(290px, 350px) 1fr; gap: 22px; align-items: start; }
.mg-lb-grid-gof { grid-template-columns: 1fr; max-width: 600px; margin: 0 auto; width: 100%; }
.mg-league-body { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.mg-league-top { display: flex; align-items: center; gap: 14px; }
.mg-tier-e { flex: 0 0 auto; filter: drop-shadow(0 3px 6px rgba(90, 66, 20, 0.35)); }
.mg-league-me { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mg-league-me > b { font-family: var(--mg-disp); font-weight: 400; font-size: 17px; color: var(--mg-brown); letter-spacing: 0.03em; }
.mg-league-rp { font-size: 14px; font-weight: 900; color: var(--mg-red); font-variant-numeric: tabular-nums; }
.mg-league-rec { font-size: 11.5px; color: var(--mg-brown-sub); }
.mg-form { display: flex; gap: 3px; margin-top: 4px; }
.mg-fdot { width: 9px; height: 9px; border-radius: 50%; background: #cbbb95; border: 1px solid #af9c72; }
.mg-fdot-w { background: var(--mg-jade); border-color: #1e7a4e; }
.mg-fdot-l { background: var(--mg-red-hi); border-color: #93301f; }
.mg-league-links { display: flex; align-items: center; justify-content: center; gap: 6px; }

.mg-diffs { display: flex; flex-direction: column; gap: 8px; }
.mg-diff {
  display: grid;
  grid-template-columns: 66px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 13px;
  text-align: left;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1.6px solid #c3ab7c;
  background: linear-gradient(180deg, #fbf3de, #efe3c6);
  color: var(--mg-brown);
  transition: border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.15s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 6px rgba(90, 66, 20, 0.12);
}
.mg-diff:hover { border-color: var(--mg-gold-deep); background: linear-gradient(180deg, #fff7e0, #f6e9c8); transform: translateX(4px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 4px 12px rgba(138, 106, 47, 0.3); }
.mg-diff-lv { grid-row: 1 / 3; display: flex; gap: 3px; align-items: center; color: var(--mg-gold-deep); }
.mg-diff > b { font-size: 14px; font-weight: 800; }
.mg-diff-d { font-size: 11px; color: var(--mg-brown-sub); }
.mg-star { width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg); background: #d9c9a4; border: 1px solid #bfa678; }
.mg-star-on { background: linear-gradient(135deg, #ffdf8a, #dca93f); border-color: #8a6a2f; box-shadow: 0 0 5px rgba(220, 169, 63, 0.6); }
.mg-diff-neural { border-color: #a06bc9; background: linear-gradient(180deg, #f7effe, #ebdff7); }
.mg-diff-neural .mg-diff-lv { color: #8a4fc0; }
.mg-diff-neural:hover { border-color: #8a4fc0; background: linear-gradient(180deg, #fbf6ff, #f0e5fb); }

.mg-quick-card { text-align: center; }
.mg-quick-art { height: 130px; border-radius: 10px; overflow: hidden; margin-bottom: 14px; border: 2px solid var(--mg-gold-mid); box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.35); }
.mg-quick-art svg { width: 100%; height: 100%; display: block; }
.mg-quick-card .mg-btn-big { width: 100%; }

.mg-rooms-card { display: flex; flex-direction: column; min-height: 150px; }
.mg-rooms-head { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: -6px 0 12px; }
.mg-roomlist { display: flex; flex-direction: column; gap: 8px; }
.mg-room-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 11px;
  background: linear-gradient(180deg, #fbf3de, #efe3c6);
  border: 1.6px solid #c3ab7c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.mg-room-info { flex: 1; min-width: 0; }
.mg-room-name { font-size: 14px; font-weight: 800; color: var(--mg-brown); display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-lock { color: var(--mg-red); flex: 0 0 auto; }
.mg-room-meta { display: flex; align-items: center; gap: 7px; margin-top: 5px; flex-wrap: wrap; }
.mg-room-host { font-size: 11.5px; color: var(--mg-brown-sub); }
.mg-room-n { font-size: 12px; font-weight: 900; color: var(--mg-gold-deep); font-variant-numeric: tabular-nums; }
.mg-room-acts { display: flex; gap: 6px; flex: 0 0 auto; }

/* leaderboard / history / rp */
.mg-lb-list { display: flex; flex-direction: column; gap: 5px; max-height: 46vh; overflow-y: auto; }
.mg-lb-row, .mg-hist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(201, 162, 75, 0.1);
  border: 1px solid rgba(195, 171, 124, 0.55);
  font-size: 12.5px;
  color: var(--mg-brown);
}
.mg-lb-me { border: 1.8px solid var(--mg-gold-deep); background: linear-gradient(180deg, #ffe9b3, #f3d98e); }
.mg-lb-rank { width: 26px; text-align: center; font-weight: 900; color: var(--mg-brown-sub); font-variant-numeric: tabular-nums; }
.mg-lb-row .mg-tier-e { width: 26px; height: 26px; }
.mg-lb-name { flex: 1; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-lb-wr { color: var(--mg-brown-sub); font-variant-numeric: tabular-nums; }
.mg-lb-rp { font-weight: 900; color: var(--mg-red); font-variant-numeric: tabular-nums; }
.mg-hist-oc { font-weight: 900; width: 34px; }
.mg-hist-w { color: #1e7a4e; }
.mg-hist-l { color: var(--mg-red); }
.mg-hist-d { font-weight: 800; font-variant-numeric: tabular-nums; }
.mg-rp-body { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 4px; }
.mg-rp-delta { font-family: var(--mg-disp); font-weight: 400; font-size: 32px; }
.mg-rp-now { font-size: 14px; color: var(--mg-brown-sub); font-variant-numeric: tabular-nums; }
.mg-rp-tier { font-weight: 800; font-size: 13px; padding: 5px 13px; border-radius: 999px; }
.mg-rp-up { color: #6b4f1e; background: linear-gradient(180deg, #ffe9b3, #f3d98e); border: 1.6px solid var(--mg-gold-deep); }
.mg-rp-down { color: var(--mg-red); background: rgba(184, 64, 46, 0.1); border: 1.6px solid rgba(184, 64, 46, 0.5); }

/* queue */
.mg-queue { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mg-queue .mg-dlg-t { margin-bottom: 0; border-bottom: none; }
.mg-queue-ring { position: relative; width: 78px; height: 78px; margin-bottom: 4px; }
.mg-queue-ring::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 4px solid rgba(138, 106, 47, 0.2); }
.mg-queue-ring-i { position: absolute; inset: 0; border-radius: 50%; border: 4px solid transparent; border-top-color: var(--mg-red-hi); animation: mg-rot 1.1s linear infinite; }
.mg-queue-meta { font-size: 13.5px; color: var(--mg-brown-sub); font-variant-numeric: tabular-nums; font-weight: 700; }
.mg-queue .mg-dlg-acts { justify-content: center; width: 100%; }

/* ---------- waiting room ---------- */
.mg-roomv, .mg-gamev { flex: 1; min-height: 0; display: flex; }
.mg-roomv-main { flex: 1; min-width: 0; overflow-y: auto; padding: clamp(16px, 2.5vh, 28px) clamp(14px, 3vw, 30px); display: flex; flex-direction: column; gap: 20px; }
.mg-roomv-head { display: flex; gap: 8px; flex-wrap: wrap; }
.mg-roomv-head .mg-chip {
  color: var(--mg-gold-hi);
  background: linear-gradient(180deg, #17493d, var(--mg-lac-panel));
  border: 1.4px solid rgba(240, 199, 90, 0.5);
  padding: 5px 13px;
  font-size: 12px;
}
.mg-seats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; max-width: 760px; }
.mg-seatc {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 20px 12px 15px;
  border-radius: 13px;
  background: linear-gradient(180deg, var(--mg-ivory), var(--mg-ivory-lo));
  border: 2px solid #c3ab7c;
  color: var(--mg-brown);
  min-height: 142px;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 251, 238, 0.7), 0 6px 18px rgba(0, 0, 0, 0.3);
}
.mg-seatc-rdy { border-color: var(--mg-jade); box-shadow: inset 0 0 0 1px rgba(255, 251, 238, 0.7), 0 0 18px rgba(46, 158, 107, 0.25); }
.mg-seatc-empty { border-style: dashed; opacity: 0.55; background: rgba(246, 237, 216, 0.35); color: var(--mg-sub-d); }
.mg-seatc-ava {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mg-disp);
  font-weight: 400;
  font-size: 21px;
  color: #fff7e6;
  background: radial-gradient(circle at 38% 30%, #1d5f4f, var(--mg-lac-panel));
  border: 2px solid var(--mg-gold-mid);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}
.mg-seatc-nm { font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 5px; max-width: 100%; overflow: hidden; }
.mg-crown { flex: 0 0 auto; }
.mg-seatc-sub { font-size: 11px; color: var(--mg-brown-sub); }
.mg-seatc-st { font-size: 11.5px; font-weight: 900; color: var(--mg-jade); letter-spacing: 0.06em; }
.mg-seatc:not(.mg-seatc-rdy) .mg-seatc-st { color: #b3a179; }
.mg-kick {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(184, 64, 46, 0.6);
  background: rgba(184, 64, 46, 0.08);
  color: var(--mg-red);
  font-weight: 800;
}
.mg-ctl-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mg-ctl-l { font-size: 13px; font-weight: 900; color: var(--mg-gold); min-width: 56px; }
.mg-ctl-row .mg-seg { flex: 0 1 320px; }
.mg-ctl-row .mg-seg-b { min-width: 72px; padding: 8px 8px; }
.mg-botrow { display: flex; gap: 6px; flex-wrap: wrap; }
.mg-botbtn {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  border: 1.4px solid rgba(240, 199, 90, 0.45);
  background: linear-gradient(180deg, rgba(240, 199, 90, 0.14), rgba(240, 199, 90, 0.04));
  color: var(--mg-gold);
}
.mg-botbtn:hover { color: var(--mg-gold-hi); border-color: var(--mg-gold); background: rgba(240, 199, 90, 0.22); }
.mg-ctl-acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mg-need { font-size: 12px; color: var(--mg-sub-d); }
.mg-spec-note { font-size: 13px; color: var(--mg-gold); padding: 10px 15px; background: rgba(240, 199, 90, 0.08); border: 1.4px dashed rgba(240, 199, 90, 0.45); border-radius: 10px; align-self: flex-start; font-weight: 700; }

/* ---------- game shell + chat ---------- */
.mg-gamev-main { flex: 1; min-width: 0; min-height: 0; position: relative; display: flex; }
.mg-chatd {
  width: 252px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  border-left: 2px solid rgba(240, 199, 90, 0.28);
  background: linear-gradient(180deg, rgba(7, 30, 25, 0.85), rgba(10, 39, 33, 0.8));
}
.mg-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 900;
  font-family: var(--mg-disp);
  letter-spacing: 0.08em;
  color: var(--mg-gold);
  border-bottom: 1.6px solid rgba(240, 199, 90, 0.28);
  cursor: pointer;
  flex: 0 0 auto;
}
.mg-chat-tg { background: none; border: none; color: var(--mg-sub-d); display: none; }
.mg-chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.mg-chat-line { font-size: 12px; line-height: 1.5; word-break: break-word; color: var(--mg-text-d); }
.mg-chat-line b { color: var(--mg-gold); margin-right: 6px; }
.mg-chat-sys { font-size: 11px; color: var(--mg-sub-d); font-style: italic; }
.mg-chat-in { display: flex; gap: 6px; padding: 9px 10px; border-top: 1.6px solid rgba(240, 199, 90, 0.28); flex: 0 0 auto; }
.mg-chat-in .mg-btn { padding: 8px 12px; font-size: 12px; }
.mg-chat-input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 12px; background: rgba(246, 237, 216, 0.94); }

/* ---------- omok ---------- */
.mo-wrap { flex: 1; display: flex; min-width: 0; min-height: 0; }
.mo-root {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: radial-gradient(85% 65% at 50% 40%, rgba(224, 178, 96, 0.13) 0%, transparent 62%);
  padding: 10px 12px 12px;
  gap: 10px;
}
.mo-status {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(23, 73, 61, 0.92), rgba(13, 45, 37, 0.92));
  border: 1.6px solid rgba(240, 199, 90, 0.4);
  box-shadow: inset 0 1px 0 rgba(240, 199, 90, 0.15), 0 4px 14px rgba(0, 0, 0, 0.3);
  flex: 0 0 auto;
  font-size: 13px;
}
.mo-chip {
  font-family: var(--mg-disp);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--mg-gold-hi);
  padding: 3px 11px;
  border-radius: 999px;
  border: 1.4px solid rgba(240, 199, 90, 0.5);
  background: rgba(240, 199, 90, 0.1);
}
.mo-me { display: flex; align-items: center; gap: 5px; color: var(--mg-sub-d); font-weight: 700; }
.mo-turn { display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--mg-sub-d); }
.mo-turn-on { color: var(--mg-gold-hi); text-shadow: 0 0 14px rgba(240, 199, 90, 0.5); }
.mo-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; vertical-align: -1px; }
.mo-dot-b { background: radial-gradient(circle at 35% 30%, #5a5a68, #101016); border: 1px solid #000; }
.mo-dot-w { background: radial-gradient(circle at 35% 30%, #fff, #cdd0da); border: 1px solid #9a9daa; }
.mo-timer { flex: 1; min-width: 70px; height: 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.4); overflow: hidden; border: 1px solid rgba(240, 199, 90, 0.2); }
.mo-timer i { display: block; height: 100%; width: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--mg-gold), var(--mg-gold-hi)); transition: width 0.15s linear; }
.mo-timer i.mo-low { background: linear-gradient(90deg, #e06b52, var(--mg-red-hi)); }
.mo-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.mo-frame { position: relative; border-radius: 12px; box-shadow: 0 20px 54px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(138, 106, 47, 0.65), 0 0 0 3.5px rgba(58, 40, 18, 0.7); }
.mo-board, .mo-layer, .mo-input { position: absolute; inset: 0; }
.mo-board { position: relative; width: 100%; height: 100%; }
.mo-board-svg { width: 100%; height: 100%; display: block; border-radius: 12px; }
.mo-layer { pointer-events: none; }
.mo-input { cursor: pointer; touch-action: none; }
.mo-stone, .mo-mark { position: absolute; }
.mo-stone-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }
.mo-drop { animation: mo-drop 0.18s cubic-bezier(0.2, 1.3, 0.4, 1); }
@keyframes mo-drop { from { transform: scale(1.5); opacity: 0.4; } }
.mo-ghostl { opacity: 0.5; }
.mo-mark svg { width: 100%; height: 100%; display: block; }
.mo-winp { border-radius: 50%; box-shadow: 0 0 16px 4px rgba(240, 199, 90, 0.6); animation: mo-win 1.1s ease-in-out infinite alternate; }
@keyframes mo-win { from { box-shadow: 0 0 10px 2px rgba(240, 199, 90, 0.45); } to { box-shadow: 0 0 20px 6px rgba(240, 199, 90, 0.8); } }
.mo-swap2 {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  padding: 15px 20px;
  border-radius: 13px;
  background: linear-gradient(180deg, var(--mg-ivory), var(--mg-ivory-lo));
  border: 2px solid var(--mg-gold-mid);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 251, 238, 0.7);
  z-index: 5;
  max-width: 92%;
  color: var(--mg-brown);
}
.mo-swap2-q { font-size: 14px; font-weight: 900; color: var(--mg-brown); text-align: center; }
.mo-swap2-q.mo-dim { color: var(--mg-brown-sub); font-weight: 600; }
.mo-swap2-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mo-result { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; background: rgba(3, 14, 11, 0.6); backdrop-filter: blur(3px); }
.mo-neural { position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center; background: rgba(3, 14, 11, 0.62); transition: opacity 0.4s; }
.mo-neural-out { opacity: 0; }
.mo-nl { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 30px; border-radius: 14px; background: linear-gradient(180deg, var(--mg-ivory), var(--mg-ivory-lo)); border: 2px solid var(--mg-gold-mid); color: var(--mg-brown); }
.mo-nl-ring { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(138, 79, 192, 0.3); border-top-color: #8a4fc0; animation: mg-rot 1s linear infinite; }
.mo-nl-txt { font-size: 12.5px; color: var(--mg-brown-sub); font-weight: 700; }
.mo-nl-bar { width: 190px; height: 7px; border-radius: 999px; background: rgba(138, 79, 192, 0.18); overflow: hidden; }
.mo-nl-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8a4fc0, #b895ec); border-radius: 999px; transition: width 0.25s; }
.mo-nl-pct { font-size: 14px; font-weight: 900; color: #8a4fc0; font-variant-numeric: tabular-nums; }

.mo-topbar { display: flex; gap: 9px; align-items: stretch; flex: 0 0 auto; }
.mo-topbar .mo-status { flex: 1; min-width: 0; }
.mo-help-b { padding: 8px 13px; font-size: 12px; flex: 0 0 auto; }

/* ---------- gang of four ---------- */
.gf-wrap { flex: 1; display: flex; min-width: 0; min-height: 0; }
.gf-root {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.gf-top { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 10px 116px 2px; flex-wrap: wrap; }
.gf-hud { position: absolute; top: 9px; right: 10px; z-index: 15; display: flex; gap: 6px; }
.gf-hud-b { padding: 7px 12px; font-size: 12px; }
.gf-modechip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 15px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(23, 73, 61, 0.92), rgba(13, 45, 37, 0.92));
  border: 1.6px solid rgba(240, 199, 90, 0.4);
  font-size: 12px;
  color: var(--mg-sub-d);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}
.gf-modechip b { color: var(--mg-gold-hi); font-family: var(--mg-disp); font-weight: 400; letter-spacing: 0.04em; }
.gf-roundchip { font-weight: 900; color: var(--mg-gold-hi); }
.gf-mid { flex: 1; min-height: 0; display: flex; align-items: stretch; gap: 6px; padding: 4px 10px; }
.gf-side { flex: 0 0 auto; width: 136px; display: flex; align-items: center; justify-content: center; }
.gf-side:empty { width: 0; }
.gf-table-zone { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 6px; }
.gf-table {
  width: 100%;
  max-width: 580px;
  min-height: 158px;
  border-radius: 999px;
  background: radial-gradient(80% 80% at 50% 40%, #2a7350 0%, #17442e 68%, #0f3020 100%);
  border: 3px solid var(--mg-gold-mid);
  box-shadow:
    inset 0 0 50px rgba(0, 0, 0, 0.5),
    inset 0 0 0 2.5px rgba(255, 233, 168, 0.14),
    0 16px 44px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
}
.gf-table-empty { font-size: 13px; font-weight: 700; color: rgba(238, 240, 246, 0.55); text-align: center; }
.gf-table-mono { display: inline-flex; color: rgba(240, 199, 90, 0.35); }
.gf-table-cards { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.gf-tcard { width: 54px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)); }
.gf-land .gf-tcard { animation: gf-land 0.28s cubic-bezier(0.2, 1.2, 0.4, 1); }
@keyframes gf-land { from { transform: translateY(-26px) scale(1.12); opacity: 0.3; } }
.gf-card-svg { width: 100%; height: auto; display: block; }
.gf-table-info { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: center; }
.gf-combo-name { font-family: var(--mg-disp); font-weight: 400; font-size: 15px; color: var(--mg-gold-hi); letter-spacing: 0.06em; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.gf-cn-gang { color: #ff7a5c; text-shadow: 0 0 16px rgba(216, 84, 63, 0.6); }
.gf-cn-straightflush, .gf-cn-fullhouse { color: var(--mg-gold-hi); text-shadow: 0 0 13px rgba(240, 199, 90, 0.55); }
.gf-table-by { font-size: 12px; color: rgba(238, 240, 246, 0.7); font-weight: 700; }
.gf-passes { font-size: 11px; font-weight: 900; color: var(--mg-gold-hi); padding: 2px 9px; border-radius: 999px; border: 1.4px solid rgba(240, 199, 90, 0.45); background: rgba(0, 0, 0, 0.25); }

.gf-seat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(23, 73, 61, 0.94), rgba(13, 45, 37, 0.94));
  border: 1.8px solid rgba(240, 199, 90, 0.35);
  min-width: 122px;
  max-width: 164px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.35);
}
.gf-seat-turn { border-color: var(--mg-gold); box-shadow: 0 0 22px rgba(240, 199, 90, 0.28), 0 5px 16px rgba(0, 0, 0, 0.35); }
.gf-seat-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gf-seat-name { font-size: 12.5px; font-weight: 800; color: var(--mg-text-d); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.gf-bot-i { font-style: normal; font-size: 9px; font-weight: 900; color: #4a3410; background: linear-gradient(180deg, #ffe193, #dca93f); border-radius: 4px; padding: 1.5px 5px; vertical-align: 1px; }
.gf-tag { font-size: 9.5px; font-weight: 900; padding: 2px 7px; border-radius: 5px; }
.gf-tag-fin { color: #4a3410; background: linear-gradient(180deg, #ffe193, #dca93f); border: 1px solid #8a6a2f; }
.gf-tag-pass { color: var(--mg-sub-d); background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(238, 230, 208, 0.25); }
.gf-tag-dc { color: #ff9a85; background: rgba(184, 64, 46, 0.18); border: 1px solid rgba(216, 84, 63, 0.5); }
.gf-seat-cards { display: flex; align-items: center; }
.gf-mini-back { width: 26px; }
.gf-seat-count { margin-left: 10px; font-family: var(--mg-disp); font-weight: 400; font-size: 18px; color: var(--mg-gold-hi); }
.gf-seat-timer { height: 5px; border-radius: 999px; background: rgba(0, 0, 0, 0.4); overflow: hidden; border: 1px solid rgba(240, 199, 90, 0.18); }
.gf-seat-timer i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--mg-gold), var(--mg-gold-hi)); transition: width 0.2s linear; }
.gf-seat-timer i.gf-low { background: linear-gradient(90deg, #e06b52, var(--mg-red-hi)); }

.gf-me { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; padding: 6px 12px 10px; background: linear-gradient(180deg, transparent, rgba(4, 18, 15, 0.88) 34%); border-top: 1px solid rgba(240, 199, 90, 0.14); }
.gf-mybar { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; font-size: 12.5px; }
.gf-myname { font-weight: 900; color: var(--mg-gold-hi); font-family: var(--mg-disp); font-size: 13.5px; letter-spacing: 0.04em; }
.gf-mycount { color: var(--mg-sub-d); font-variant-numeric: tabular-nums; font-weight: 700; }
.gf-judge { font-weight: 800; }
.gf-judge-ok { color: #62d99b; }
.gf-judge-no { color: #ff9a85; }
.gf-judge-hint { color: var(--mg-sub-d); font-weight: 600; }
.gf-mytimer { flex: 1; min-width: 60px; height: 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.4); overflow: hidden; opacity: 0.35; border: 1px solid rgba(240, 199, 90, 0.18); }
.gf-mt-on { opacity: 1; }
.gf-mytimer i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--mg-gold), var(--mg-gold-hi)); transition: width 0.2s linear; }
.gf-mytimer i.gf-low { background: linear-gradient(90deg, #e06b52, var(--mg-red-hi)); }

.gf-hand { min-height: 118px; display: flex; justify-content: center; align-items: flex-end; padding: 14px 6px 2px; }
.gf-hand-in { position: relative; height: 112px; }
.gf-hcard { position: absolute; bottom: 0; width: 84px; transition: transform 0.15s, filter 0.15s; transform-origin: 50% 90%; }
.gf-hcard .gf-card-svg { filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55)); }
.gf-hand-wrap { min-height: 0; }
.gf-hand-wrap .gf-hand-in { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-height: 132px; overflow-y: auto; }
.gf-hand-wrap .gf-hcard { position: static; width: 42px; }
.gf-hsel { transform: translateY(-16px) !important; }
.gf-hsel .gf-card-svg { filter: drop-shadow(0 0 11px rgba(255, 223, 138, 0.85)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55)); }
.gf-hand-wrap .gf-hsel { transform: translateY(-8px) !important; }
.gf-hdim { opacity: 0.42; }
.gf-hcan:hover { transform: translateY(-8px); }
.gf-deal .gf-hcard { animation: gf-deal-in 0.4s cubic-bezier(0.2, 1.1, 0.4, 1) backwards; }
.gf-deal .gf-hcard:nth-child(2n) { animation-delay: 0.05s; }
.gf-deal .gf-hcard:nth-child(3n) { animation-delay: 0.1s; }
.gf-deal .gf-hcard:nth-child(5n) { animation-delay: 0.16s; }
@keyframes gf-deal-in { from { transform: translateY(40px) scale(0.7); opacity: 0; } }

.gf-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.gf-act-l, .gf-act-r { display: flex; gap: 7px; flex-wrap: wrap; }
.gf-actions .mg-btn { padding: 9px 15px; }

.gf-spec-band { text-align: center; font-size: 13.5px; font-weight: 800; color: var(--mg-gold); padding: 13px; font-family: var(--mg-disp); letter-spacing: 0.06em; }

.gf-panel {
  position: absolute;
  right: 10px;
  top: 52px;
  width: min(368px, calc(100% - 20px));
  max-height: min(460px, calc(100% - 200px));
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--mg-ivory), var(--mg-ivory-lo));
  border: 2px solid var(--mg-gold-mid);
  border-radius: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 251, 238, 0.75), 0 22px 60px rgba(0, 0, 0, 0.6);
  z-index: 60;
  animation: mg-dlg-in 0.2s ease;
  overflow: hidden;
  color: var(--mg-brown);
}
.gf-p-head { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-bottom: 2px solid rgba(201, 162, 75, 0.5); flex: 0 0 auto; }
.gf-p-head b { font-family: var(--mg-disp); font-weight: 400; font-size: 15px; color: var(--mg-brown); flex: 1; letter-spacing: 0.04em; }
.gf-p-x { background: none; border: none; color: var(--mg-brown-sub); font-size: 19px; line-height: 1; padding: 2px 6px; }
.gf-p-x:hover { color: var(--mg-red); }
.gf-p-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 15px; }
.gf-g-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed rgba(138, 106, 47, 0.3); }
.gf-g-cards { display: flex; gap: 3px; flex: 0 0 auto; }
.gf-card-mini { width: 26px; }
.gf-g-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gf-g-txt b { font-size: 13px; color: var(--mg-brown); }
.gf-g-txt span { font-size: 11px; color: var(--mg-brown-sub); line-height: 1.45; }
.gf-g-special { margin-top: 10px; }
.gf-g-special > b { font-size: 13px; color: var(--mg-red); }
.gf-g-note { margin-top: 10px; font-size: 11.5px; color: var(--mg-brown-sub); line-height: 1.55; background: rgba(201, 162, 75, 0.14); border-radius: 8px; padding: 9px 11px; }
.gf-sc-target { font-size: 11.5px; color: var(--mg-brown-sub); font-weight: 700; }
.gf-sc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.gf-sc-table th, .gf-sc-table td { padding: 8px 8px; text-align: center; border-bottom: 1px solid rgba(138, 106, 47, 0.22); }
.gf-sc-table th { color: var(--mg-red); font-size: 12px; font-weight: 900; border-bottom: 2px solid rgba(184, 64, 46, 0.4); }
.gf-sc-table td { font-variant-numeric: tabular-nums; color: var(--mg-brown); }
.gf-sc-table td b { color: var(--mg-brown); }
.gf-sc-table td i { display: block; font-style: normal; font-size: 10px; color: var(--mg-brown-sub); }
.gf-sc-total td { border-top: 2.5px solid rgba(138, 106, 47, 0.55); font-weight: 900; color: var(--mg-brown); font-size: 14px; }
.gf-sc-lead { color: #1e7a4e !important; }
.gf-sc-empty { color: var(--mg-brown-sub); }

.gf-overlay { position: absolute; inset: 0; z-index: 11; display: flex; align-items: center; justify-content: center; background: rgba(3, 14, 11, 0.6); backdrop-filter: blur(3px); }
.gf-band-card {
  position: relative;
  width: min(430px, 92%);
  max-height: 88%;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--mg-ivory), var(--mg-ivory-lo));
  border: 2px solid var(--mg-gold-mid);
  border-radius: 16px;
  padding: 26px 22px 20px;
  text-align: center;
  color: var(--mg-brown);
  box-shadow: inset 0 0 0 1px rgba(255, 251, 238, 0.8), 0 28px 80px rgba(0, 0, 0, 0.65);
  animation: mg-dlg-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.gf-rb-stamp { font-size: 23px; }
.gf-rb-title { font-family: var(--mg-disp); font-weight: 400; font-size: 19px; color: var(--mg-brown); margin-bottom: 14px; letter-spacing: 0.04em; }
.gf-rb-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.gf-rb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border-radius: 9px;
  background: rgba(201, 162, 75, 0.12);
  border: 1px solid rgba(195, 171, 124, 0.6);
  font-size: 13px;
}
.gf-rb-row span { flex: 1; text-align: left; font-weight: 800; }
.gf-rb-row em { font-style: normal; font-weight: 900; color: var(--mg-red); }
.gf-rb-row i { font-style: normal; color: var(--mg-brown-sub); font-variant-numeric: tabular-nums; }
.gf-rb-win { border: 1.8px solid var(--mg-gold-deep); background: linear-gradient(180deg, #ffe9b3, #f3d98e); }
.gf-rb-win em { color: #1e7a4e; }
.gf-rb-next { font-size: 12.5px; color: var(--mg-brown-sub); font-weight: 700; }
.gf-ex-recv { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--mg-brown-sub); font-weight: 700; }
.gf-ex-rcard { width: 64px; }
.gf-ex-give-t { font-size: 13.5px; font-weight: 900; color: var(--mg-red); margin-bottom: 10px; }
.gf-ex-hand { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-bottom: 14px; }
.gf-ex-card-s { width: 42px; cursor: pointer; transition: transform 0.13s; }
.gf-ex-card-s:hover { transform: translateY(-4px); }
.gf-ex-card-s.gf-hsel { transform: translateY(-6px) !important; }
.gf-ex-card-s.gf-hsel .gf-card-svg { filter: drop-shadow(0 0 9px rgba(220, 169, 63, 0.9)); }
.gf-res-rank { width: 28px; font-family: var(--mg-disp); font-weight: 400; font-size: 18px; color: var(--mg-red); }

.gf-boom { position: absolute; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.gf-boom-ring {
  position: absolute;
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 5px solid rgba(216, 84, 63, 0.85);
  animation: gf-boom-ring 0.8s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}
@keyframes gf-boom-ring { from { transform: scale(0.3); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
.gf-boom-txt {
  font-family: var(--mg-disp);
  font-weight: 400;
  font-size: 44px;
  color: #ff6a50;
  text-shadow: 0 0 34px rgba(216, 84, 63, 0.85), 0 2px 4px rgba(0, 0, 0, 0.6);
  animation: gf-boom-txt 0.9s ease forwards;
}
@keyframes gf-boom-txt { 0% { transform: scale(2.4); opacity: 0; } 22% { transform: scale(1); opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
.gf-shake { animation: gf-shake 0.45s ease; }
@keyframes gf-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 3px); }
  40% { transform: translate(5px, -3px); }
  60% { transform: translate(-4px, -2px); }
  80% { transform: translate(3px, 2px); }
}

/* ---------- help dialog ---------- */
.mg-help-sec { margin-bottom: 14px; }
.mg-help-sec > b { display: block; font-size: 13.5px; font-weight: 900; color: var(--mg-red); margin-bottom: 5px; }
.mg-help-sec p { margin: 0 0 6px; font-size: 12.5px; line-height: 1.6; color: var(--mg-brown); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .mg-lb-grid { grid-template-columns: 1fr; }
  .gf-side { width: auto; }
  .gf-mid { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .mg-shell { width: 100vw; height: 100dvh; border-radius: 0; border: none; }
  .mg-roomv, .mg-gamev { flex-direction: column; position: relative; }
  .mg-chatd {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 20;
    width: auto;
    border-left: none;
    border-bottom: 2px solid rgba(240, 199, 90, 0.3);
    background: linear-gradient(180deg, rgba(6, 24, 20, 0.97), rgba(9, 33, 27, 0.95));
    max-height: 200px;
  }
  .mg-chat-tg { display: block; }
  .mg-chat-min .mg-chat-list, .mg-chat-min .mg-chat-in { display: none; }
  .mg-chat-list { max-height: 110px; }
  .mg-gamev-main, .mg-roomv-main { padding-top: 48px; }
  .mo-root { padding: 6px 6px 8px; }
  .mo-status { font-size: 11.5px; gap: 7px; padding: 8px 10px; }
  .gf-mid { padding: 2px 6px; gap: 4px; }
  .gf-side { width: auto; }
  .gf-seat { min-width: 102px; padding: 8px 10px; }
  .gf-mini-back { width: 20px; }
  .gf-tcard { width: 42px; }
  .gf-table { min-height: 118px; padding: 12px 14px; }
  .gf-hcard { width: 68px; }
  .gf-hand { min-height: 96px; }
  .gf-hand-in { height: 92px; }
  .gf-actions { justify-content: center; }
  .gf-panel { top: 96px; right: 6px; }
  .gf-hud { top: 52px; }
  .mg-hub-cards { grid-template-columns: 1fr; }
  .mg-seats { grid-template-columns: repeat(auto-fit, minmax(134px, 1fr)); }
  .mg-stampfx-txt { font-size: 34px; }
  .mg-stampfx-ring { width: 156px; height: 156px; }
  .mg-card { padding: 24px 14px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  #mg-modal *, #mg-modal *::before, #mg-modal *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
