:root {
  --bg: #05070d;
  --text: #e8ecf4;
  --muted: #8a93a8;
  --accent: #7cd6ff;
  --accent-2: #b98bff;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.09);
  --danger: #ff6b81;
  --ok: #4ade80;
  --u-r: #e5484d;
  --u-y: #f2c230;
  --u-g: #30a46c;
  --u-b: #3e8ef7;
  --u-w: #1b1f2c;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  overflow-x: hidden;
}

body::before, body::after {
  content: "";
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.16;
  z-index: -1;
  pointer-events: none;
}

body::before { background: var(--accent); top: -180px; left: -160px; }
body::after { background: var(--accent-2); bottom: -200px; right: -160px; }

button, input, select { font: inherit; color: inherit; }

button {
  cursor: pointer;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 9px 16px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.2); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.4; cursor: default; }

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0d16;
  border: none;
  font-weight: 600;
}

.primary:hover:not(:disabled) { background: linear-gradient(135deg, #9ee2ff, #c9a4ff); }

.ghost { background: transparent; }
.danger { color: var(--danger); }
.small { padding: 4px 10px; font-size: 13px; border-radius: 8px; }

input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.3);
  outline: none;
}

input[type="text"]:focus { border-color: var(--accent); }

.wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; }

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.brand { color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand span {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.top .spacer { flex: 1; }

.langs { display: inline-flex; gap: 6px; align-items: center; }
.flag {
  padding: 0;
  width: 30px;
  height: 20px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: none;
  opacity: 0.4;
  filter: grayscale(0.6);
  transition: opacity 0.15s, filter 0.15s, box-shadow 0.15s;
}
.flag svg { display: block; width: 100%; height: 100%; }
.flag:hover:not(:disabled) { opacity: 0.85; filter: none; background: none; }
.flag.on { opacity: 1; filter: none; box-shadow: 0 0 0 2px var(--accent); cursor: default; }

.status { font-size: 13px; color: var(--muted); }
.status.warn { color: #ffcf6b; }

.panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.panel h2 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }

.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: 34px; margin: 0 0 8px; letter-spacing: -0.02em; }
.hero p { color: var(--muted); margin: 0; }

.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > input { flex: 1; }
.or { text-align: center; color: var(--muted); font-size: 13px; margin: 6px 0; }

.code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.code { font-size: 38px; font-weight: 800; letter-spacing: 0.18em; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.players li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.players .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players .pts { color: var(--muted); font-size: 13px; }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 8px var(--ok); }
.dot.off { background: #555c6e; box-shadow: none; }

.tag { font-size: 11px; padding: 2px 7px; border-radius: 99px; background: rgba(124, 214, 255, 0.14); color: var(--accent); white-space: nowrap; }
.tag.v { background: rgba(185, 139, 255, 0.16); color: var(--accent-2); }
.tag.muted { background: rgba(255, 255, 255, 0.06); color: var(--muted); }

.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.game-tile {
  text-align: left;
  padding: 14px;
  border-radius: 12px;
  display: grid;
  gap: 2px;
}
.game-tile b { font-size: 16px; }
.game-tile small { color: var(--muted); }
.game-tile.sel { border-color: var(--accent); background: rgba(124, 214, 255, 0.08); }

.opts { display: grid; gap: 10px; margin-bottom: 16px; }
.opts label { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.opts select { background: rgba(0, 0, 0, 0.3); border: 1px solid var(--card-border); border-radius: 8px; padding: 5px 8px; }
.opts input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.center-msg { text-align: center; padding: 60px 16px; }
.center-msg p { color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1a1f2e;
  border: 1px solid var(--card-border);
  padding: 10px 18px;
  border-radius: 12px;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: calc(100vw - 32px);
}

.game { max-width: 1000px; margin: 0 auto; padding: 14px 16px 24px; display: flex; flex-direction: column; min-height: 100dvh; }

.opps { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; }
.opp {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 110px;
  display: grid;
  gap: 4px;
  justify-items: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.opp.turn { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(124, 214, 255, 0.25); }
.opp.off { opacity: 0.55; }
.opp .nm { display: flex; align-items: center; gap: 6px; font-weight: 600; max-width: 140px; }
.opp .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp .cnt { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.backs { display: flex; }
.backs i {
  width: 12px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 1px solid rgba(0, 0, 0, 0.4);
  margin-left: -6px;
}
.backs i:first-child { margin-left: 0; }

.turnbar { text-align: center; margin: 4px 0 10px; min-height: 24px; font-weight: 600; }
.turnbar.mine { color: var(--accent); }
.turnbar .sub { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }

.table { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 10px 0 14px; flex: 1; min-height: 170px; }
.pile { display: grid; justify-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.deckbtn {
  width: 92px;
  height: 136px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0 38%, transparent 39%),
    linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.15), 6px 6px 0 rgba(255, 255, 255, 0.07);
}
.deckbtn.go { animation: pulse 1.4s infinite; }
.colorinfo { display: flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.dir { font-size: 26px; color: var(--muted); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 214, 255, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(124, 214, 255, 0); }
}

.card {
  --cc: var(--u-w);
  position: relative;
  width: 72px;
  height: 108px;
  flex: none;
  border-radius: 10px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: var(--cc);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.card::before {
  content: "";
  position: absolute;
  inset: 10px 7px;
  border-radius: 50% / 40%;
  background: rgba(255, 255, 255, 0.92);
  transform: rotate(-24deg);
}
.card .mid { position: relative; font-size: 28px; color: var(--cc); text-shadow: none; }
.card .cor { position: absolute; top: 4px; left: 7px; font-size: 13px; }
.card .cor.b { top: auto; left: auto; bottom: 4px; right: 7px; transform: rotate(180deg); }
.card.c-r { --cc: var(--u-r); }
.card.c-y { --cc: var(--u-y); }
.card.c-g { --cc: var(--u-g); }
.card.c-b { --cc: var(--u-b); }
.card.c-w::before { background: conic-gradient(var(--u-r) 0 25%, var(--u-y) 0 50%, var(--u-g) 0 75%, var(--u-b) 0); }
.card.c-w .mid { color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }
.card.big { width: 92px; height: 136px; }
.card.big .mid { font-size: 36px; }
.card.big.chosen { box-shadow: 0 0 0 4px var(--chosen), 0 4px 18px rgba(0, 0, 0, 0.5); }

.hand {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 4px;
}
.hand .card { transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s; }
.hand.active .card:not(.ok) { opacity: 0.45; cursor: default; }
.hand.active .card.ok:hover { transform: translateY(-8px); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5); }
.hand.active .card.ok { box-shadow: 0 0 0 2px var(--accent), 0 4px 12px rgba(0, 0, 0, 0.4); }
.hand .card.fresh { transform: translateY(-8px); }

.actions { display: flex; justify-content: center; gap: 10px; min-height: 40px; flex-wrap: wrap; }
.unobtn { background: linear-gradient(135deg, var(--u-r), #ff8a3d); border: none; color: #fff; font-weight: 800; letter-spacing: 0.05em; }

.log { margin-top: 14px; font-size: 13px; color: var(--muted); display: grid; gap: 2px; justify-items: center; }
.log div:last-child { color: var(--text); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 16px;
}
.modal {
  background: #0d111c;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 22px;
  width: min(420px, 100%);
  text-align: center;
}
.modal h3 { margin: 0 0 14px; font-size: 20px; }
.colors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.colors button { height: 70px; border: none; border-radius: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.colors .r { background: var(--u-r); }
.colors .y { background: var(--u-y); }
.colors .g { background: var(--u-g); }
.colors .b { background: var(--u-b); }
.modal .players { text-align: left; margin: 14px 0; }
.modal .row { justify-content: center; }

.gamehead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.gamehead .codebadge { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.12em; color: var(--muted); }

@media (max-width: 600px) {
  .card { width: 54px; height: 82px; border-radius: 8px; }
  .card .mid { font-size: 21px; }
  .card .cor { font-size: 11px; top: 3px; left: 5px; }
  .card .cor.b { bottom: 3px; right: 5px; }
  .card.big, .deckbtn { width: 76px; height: 112px; }
  .hand { gap: 4px; }
  .opp { min-width: 92px; padding: 6px 8px; }
  .table { gap: 18px; min-height: 140px; }
  .code { font-size: 30px; }
}

.pc {
  --ink: #1b1f2c;
  position: relative;
  width: 66px;
  height: 94px;
  flex: none;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(0, 0, 0, 0.28);
  background: linear-gradient(180deg, #ffffff, #eceef4);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.pc:hover:not(:disabled) { background: linear-gradient(180deg, #ffffff, #f1f3f8); border-color: rgba(0, 0, 0, 0.35); }
.pc.s-s { --ink: #161a26; }
.pc.s-h { --ink: #d62c2c; }
.pc.s-d { --ink: #1f6fe0; }
.pc.s-c { --ink: #138a4a; }
.pc .pc-c { position: absolute; top: 4px; left: 5px; display: grid; justify-items: center; line-height: 0.95; }
.pc .pc-c b { font-size: 16px; }
.pc .pc-c i { font-style: normal; font-size: 14px; }
.pc .pc-c.b { top: auto; left: auto; bottom: 4px; right: 5px; transform: rotate(180deg); }
.pc .pc-m { font-size: 34px; line-height: 1; }
.pc.ace .pc-m { font-size: 48px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.15)); }
.pc.face { background: linear-gradient(160deg, #fff8e1, #f3ddb0); border-color: rgba(160, 110, 20, 0.55); }
.pc.face:hover:not(:disabled) { background: linear-gradient(160deg, #fffbea, #f6e3bc); }
.pc .pc-f {
  display: grid;
  place-items: center;
  width: 60%;
  height: 52%;
  border-radius: 8px;
  border: 2px solid var(--ink);
  background: rgba(255, 255, 255, 0.55);
  font-size: 26px;
  line-height: 1;
  position: relative;
}
.pc .pc-f i { font-style: normal; font-size: 13px; position: absolute; bottom: 2px; right: 4px; }
.pc .pc-f::before { content: "♛"; position: absolute; top: -13px; font-size: 13px; color: #b8860b; }
.pc.joker { background: linear-gradient(160deg, #2a1f4a, #5a35a0); color: #ffd36b; border-color: rgba(255, 255, 255, 0.45); }
.pc.joker:hover:not(:disabled) { background: linear-gradient(160deg, #33265a, #6a3fb8); }
.pc.joker .pc-m { font-size: 34px; text-shadow: 0 0 12px rgba(255, 211, 107, 0.7); }
.pc.joker .pc-c b { font-size: 13px; }
.pc .pc-j { position: absolute; bottom: 6px; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: #e9ddff; }
.pc .pc-as { position: absolute; top: 3px; right: 3px; font-size: 10px; background: #fff; border-radius: 4px; padding: 0 3px; font-weight: 800; }
.pc .pc-as.s-s { color: #161a26; }
.pc .pc-as.s-h { color: #d62c2c; }
.pc .pc-as.s-d { color: #1f6fe0; }
.pc .pc-as.s-c { color: #138a4a; }
.pc.big { width: 76px; height: 108px; }
.pc.big .pc-m { font-size: 40px; }
.pc.big.ace .pc-m { font-size: 54px; }
.pc.empty { border: 2px dashed var(--card-border); background: none; box-shadow: none; width: 76px; height: 108px; }

.pc.mini { width: 36px; height: 52px; border-radius: 5px; cursor: inherit; pointer-events: none; }
.pc.mini .pc-c { top: 3px; left: 4px; }
.pc.mini .pc-c b { font-size: 13px; }
.pc.mini .pc-c i { font-size: 12px; }
.pc.mini .pc-c.b, .pc.mini .pc-m, .pc.mini .pc-j, .pc.mini .pc-f { display: none; }
.pc.mini.joker .pc-c b { font-size: 14px; }
.pc.mini .pc-as { top: auto; bottom: 2px; right: 2px; font-size: 9px; }
.pc.mini.foreign { outline: 2px dashed rgba(124, 214, 255, 0.55); outline-offset: -3px; }

.pc.target { box-shadow: 0 0 0 3px var(--accent), 0 4px 14px rgba(0, 0, 0, 0.4); cursor: pointer; }

.rhand {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-end;
  padding: 26px 0 12px;
  gap: 0;
  min-height: 140px;
  border-radius: 18px;
  transition: box-shadow 0.3s, background 0.3s;
}
.pc.inhand {
  transform-origin: 50% 120%;
  transform: translateY(var(--lift, 0px)) rotate(var(--rot, 0deg));
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: grab;
}
.pc.inhand:hover { transform: translateY(calc(var(--lift, 0px) - 10px)) rotate(var(--rot, 0deg)); z-index: 50 !important; }
.pc.inhand.sel { transform: translateY(calc(var(--lift, 0px) - 22px)) rotate(var(--rot, 0deg)); box-shadow: 0 0 0 3px var(--accent), 0 12px 22px rgba(0, 0, 0, 0.5); }
.pc.inhand.took:not(.sel) { box-shadow: 0 0 0 3px var(--accent-2), 0 3px 10px rgba(0, 0, 0, 0.35); }
.pc.inhand.dragging { z-index: 100 !important; cursor: grabbing; transition: none; box-shadow: 0 16px 30px rgba(0, 0, 0, 0.6); opacity: 0.95; }
.pc.inhand.ins-before { box-shadow: -6px 0 0 -2px var(--accent), 0 3px 10px rgba(0, 0, 0, 0.35); }
.pc.inhand.ins-after { box-shadow: 6px 0 0 -2px var(--accent), 0 3px 10px rgba(0, 0, 0, 0.35); }
.pc.inhand.fresh { animation: cardIn 2.6s ease-out both; }
@keyframes cardIn {
  0% { translate: 0 -160px; scale: 0.6; opacity: 0; box-shadow: 0 0 0 4px #ffd36b, 0 0 40px #ffd36b; }
  18% { translate: 0 -30px; scale: 1.18; opacity: 1; box-shadow: 0 0 0 4px #ffd36b, 0 0 40px #ffd36b; }
  30% { translate: 0 0; scale: 1; }
  100% { box-shadow: 0 0 0 3px rgba(255, 211, 107, 0.9), 0 0 16px rgba(255, 211, 107, 0.5); }
}

.deckbtn.small-deck { width: 76px; height: 108px; }

.rtable { flex: 0 0 auto; min-height: 0; margin: 6px 0 10px; }

.melds { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 4px 0 12px; flex: 1; align-content: flex-start; min-height: 60px; }
.mgroup { background: rgba(255, 255, 255, 0.025); border: 1px solid var(--card-border); border-radius: 14px; padding: 8px 10px 10px; }
.mgroup.own { border-color: rgba(124, 214, 255, 0.35); background: rgba(124, 214, 255, 0.04); }
.mowner { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.mgroup.own .mowner { color: var(--accent); }
.mlist { display: flex; flex-wrap: wrap; gap: 8px; }
.meld {
  display: flex;
  gap: 2px;
  padding: 5px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  align-items: center;
}
.meld.target { border-color: var(--accent); cursor: pointer; box-shadow: 0 0 12px rgba(124, 214, 255, 0.2); }
.meld.target:hover { background: rgba(124, 214, 255, 0.08); }
.meld.swap { border-color: #ffd36b; box-shadow: 0 0 16px rgba(255, 211, 107, 0.45); }
.meld.staged { border-style: dashed; border-color: var(--accent-2); }

.staging { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-bottom: 10px; }
.rhint { text-align: center; min-height: 20px; margin: 6px 0 0; }

.yourturn {
  display: inline-block;
  margin-right: 10px;
  padding: 3px 12px;
  border-radius: 99px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0d16;
  font-weight: 800;
  letter-spacing: 0.02em;
  animation: badgePulse 1.6s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 214, 255, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(124, 214, 255, 0); }
}
.game.mine .hand.active {
  background: radial-gradient(ellipse at 50% 100%, rgba(124, 214, 255, 0.14), transparent 70%);
  animation: handGlow 2.4s ease-in-out infinite;
  border-radius: 18px;
}
@keyframes handGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(124, 214, 255, 0.35), 0 0 24px rgba(124, 214, 255, 0.15); }
  50% { box-shadow: 0 0 0 1px rgba(185, 139, 255, 0.6), 0 0 42px rgba(185, 139, 255, 0.3); }
}
body.myturn::before, body.myturn::after { animation: glowBreath 3s ease-in-out infinite; }
@keyframes glowBreath { 0%, 100% { opacity: 0.18; } 50% { opacity: 0.4; } }

.opp { position: relative; }
.opp.turn { animation: oppGlow 1.8s ease-in-out infinite; border-color: var(--accent); }
@keyframes oppGlow {
  0%, 100% { box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(124, 214, 255, 0.35); }
  50% { box-shadow: 0 0 0 2px var(--accent-2), 0 0 30px rgba(185, 139, 255, 0.55); }
}
.turn-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1px 8px;
  border-radius: 99px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0d16;
  white-space: nowrap;
}

.scores { width: 100%; border-collapse: collapse; margin: 12px 0 16px; text-align: left; }
.scores th { font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 6px; text-align: right; }
.scores td { padding: 6px; border-top: 1px solid var(--card-border); text-align: right; }
.scores td:first-child, .scores th:first-child { text-align: left; }
.scores tr.me td { color: var(--accent); }
.scores .pos { color: var(--ok); }
.scores .neg { color: var(--danger); }

@media (max-width: 600px) {
  .pc { width: 46px; height: 68px; border-radius: 7px; }
  .pc .pc-c b { font-size: 12px; }
  .pc .pc-c i { font-size: 11px; }
  .pc .pc-m { font-size: 22px; }
  .pc.ace .pc-m { font-size: 30px; }
  .pc .pc-f { font-size: 17px; border-width: 1.5px; }
  .pc .pc-f i { display: none; }
  .pc .pc-f::before { font-size: 10px; top: -10px; }
  .pc .pc-j { font-size: 7px; bottom: 3px; }
  .pc.big, .pc.empty, .deckbtn.small-deck { width: 58px; height: 84px; }
  .pc.mini { width: 28px; height: 40px; }
  .pc.mini .pc-c b { font-size: 11px; }
  .pc.mini .pc-c i { font-size: 10px; }
  .rhand { min-height: 110px; padding-top: 20px; }
}

.flag.on { cursor: pointer; box-shadow: none; }
.flag.on:hover { box-shadow: 0 0 0 2px var(--accent); }

.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}
.iconbtn.leave { color: #ff5b6e; border-color: rgba(255, 91, 110, 0.35); }
.iconbtn.leave:hover:not(:disabled) { background: rgba(255, 91, 110, 0.14); border-color: rgba(255, 91, 110, 0.6); }

.code-row { justify-content: flex-start; gap: 10px; }
button.code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  cursor: copy;
}
button.code:hover:not(:disabled) { background: none; color: var(--accent); }

.games { grid-template-columns: repeat(4, 1fr); margin-bottom: 8px; }
.game-tile { display: grid; place-items: center; height: 84px; padding: 8px; }
.gamename { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.gamename b { color: var(--text); }

.logo { position: relative; display: block; width: 64px; height: 56px; }
.logo.emoji { display: grid; place-items: center; font-size: 34px; }
.logo .lc {
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 28px;
  height: 40px;
  margin-left: -14px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-weight: 800;
  font-size: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transform-origin: 50% 110%;
}
.logo .lc:nth-child(1) { transform: translateX(-13px) rotate(-16deg); }
.logo .lc:nth-child(3) { transform: translateX(13px) rotate(16deg); }
.logo .lc.u-r { background: var(--u-r); color: #fff; }
.logo .lc.u-y { background: var(--u-y); color: #fff; }
.logo .lc.u-b { background: var(--u-b); color: #fff; }
.logo .lc.w { background: #fff; border-color: rgba(0, 0, 0, 0.2); }
.logo .lc.s-s { color: #161a26; }
.logo .lc.s-h { color: #d62c2c; }
.logo .lc.jk { background: linear-gradient(160deg, #2a1f4a, #5a35a0); color: #ffd36b; font-size: 14px; }
.game-tile:disabled .logo { filter: grayscale(1); }

.opts { gap: 6px; }
.opt {
  display: grid;
  grid-template-columns: 28px 1fr auto 120px;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.opt .oi { font-size: 18px; text-align: center; }
.opt .ol { font-size: 14px; }
.opt > select, .opt > input { justify-self: end; }
.info {
  position: relative;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  color: var(--muted);
  background: transparent;
}
.info:hover:not(:disabled), .info:focus { color: var(--accent); border-color: var(--accent); background: transparent; }
.info::after {
  content: attr(data-tip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(260px, 70vw);
  padding: 8px 10px;
  border-radius: 10px;
  background: #1a1f2e;
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color: var(--text);
  font: 400 13px/1.4 Inter, "Segoe UI", system-ui, sans-serif;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 30;
}
.info:hover::after, .info:focus::after { opacity: 1; transform: none; }

@media (max-width: 600px) {
  .game-tile { height: 70px; }
  .logo { transform: scale(0.85); }
}
