/* Makaó multiplayer Phase 1 overlay. Kept separate from the legacy single-player CSS. */
:root {
  --mp-bg: rgba(5, 18, 11, .92);
  --mp-card: rgba(8, 30, 18, .92);
  --mp-border: rgba(244, 217, 132, .32);
  --mp-gold: #f4d984;
  --mp-gold-2: #c99a36;
  --mp-text: #fff7d1;
  --mp-muted: rgba(255, 247, 209, .72);
  --mp-danger: #ffb1a8;
}

#makao-mp-overlay,
#makao-mp-lobby,
#makao-mp-root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#makao-mp-overlay,
#makao-mp-lobby {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--mp-text);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 242, 188, .18), transparent 26%),
    radial-gradient(circle at 10% 90%, rgba(18, 98, 61, .45), transparent 34%),
    rgba(3, 10, 6, .92);
  backdrop-filter: blur(8px);
}

.makao-mp-card {
  width: min(760px, 100%);
  max-height: min(92vh, 860px);
  overflow: auto;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--mp-border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(15, 65, 39, .96), rgba(7, 22, 13, .96));
  box-shadow: 0 26px 90px rgba(0, 0, 0, .52), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.makao-mp-card h1,
.makao-mp-card h2,
.makao-mp-card h3 {
  margin: 0 0 12px;
  color: var(--mp-text);
  letter-spacing: -.02em;
}

.makao-mp-card p {
  margin: 0 0 18px;
  color: var(--mp-muted);
  line-height: 1.55;
}

.makao-mp-mode-grid,
.makao-mp-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.makao-mp-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.makao-mp-button,
.makao-mp-input,
.makao-mp-select {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  font: inherit;
}

.makao-mp-button {
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.16);
  color: #1d1305;
  font-weight: 850;
  background: linear-gradient(180deg, #fff0b2 0%, #e4bd55 52%, #a97820 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.46), 0 10px 24px rgba(0,0,0,.30);
}

.makao-mp-button.secondary {
  color: var(--mp-text);
  background: rgba(255,255,255,.07);
  border-color: var(--mp-border);
}

.makao-mp-button.danger {
  color: #320b06;
  background: linear-gradient(180deg, #ffd1cc 0%, #ff9b90 100%);
}

.makao-mp-button:disabled {
  cursor: not-allowed;
  opacity: .55;
  filter: grayscale(.25);
}

.makao-mp-input,
.makao-mp-select {
  border: 1px solid var(--mp-border);
  background: rgba(0,0,0,.28);
  color: var(--mp-text);
  padding: 0 14px;
  outline: none;
}

.makao-mp-field {
  margin: 14px 0;
}

.makao-mp-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--mp-muted);
  font-size: 14px;
  font-weight: 700;
}

.makao-mp-error {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 177, 168, .45);
  border-radius: 14px;
  color: var(--mp-danger);
  background: rgba(80, 12, 8, .30);
}

.makao-mp-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 138px;
  padding: 10px 16px;
  border: 1px solid var(--mp-border);
  border-radius: 14px;
  color: var(--mp-text);
  background: rgba(0,0,0,.28);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .08em;
}

.makao-mp-player-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.makao-mp-player-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(244, 217, 132, .18);
  border-radius: 14px;
  background: rgba(255,255,255,.055);
}

.makao-mp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--mp-text);
  background: rgba(0,0,0,.26);
  font-size: 13px;
}

body.makao-mp-active #fajer-audio-start-overlay { display: none !important; }
body.makao-mp-active #js-makao,
body.makao-mp-active .time-line,
body.makao-mp-active .global-asked-card,
body.makao-mp-active .asked-card,
body.makao-mp-active .szinvalaszto,
body.makao-mp-active .szamvalaszto,
body.makao-mp-active #js-end,
body.makao-mp-active .magy-card,
body.makao-mp-active .name-button,
body.makao-mp-active .speech-bubble-box { display: none !important; }

#makao-mp-root {
  display: none;
  position: relative;
  color: var(--mp-text);
  min-height: calc(var(--fajer-vh, 100vh) - 78px);
  padding: 14px;
}

body.makao-mp-active #makao-mp-root {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.makao-mp-gamebar,
.makao-mp-hand,
.makao-mp-table {
  border: 1px solid rgba(244, 217, 132, .18);
  border-radius: 18px;
  background: rgba(5, 18, 11, .50);
  box-shadow: 0 12px 30px rgba(0,0,0,.20);
}

.makao-mp-gamebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.makao-mp-gamebar strong { color: var(--mp-gold); }

.makao-mp-table {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  min-height: 0;
  padding: 12px;
  background:
    radial-gradient(circle at center, rgba(255,255,255,.10), rgba(255,255,255,.02) 42%, rgba(0,0,0,.18) 100%),
    linear-gradient(180deg, #16613f 0%, #0f5234 52%, #0c452c 100%);
}

.makao-mp-opponents {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.makao-mp-opponent {
  min-width: 160px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(0,0,0,.22);
  text-align: center;
}

.makao-mp-back-stack {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  min-height: 62px;
}

.makao-mp-back-stack img {
  width: 42px;
  margin-left: -22px;
  border-radius: 4px;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.42));
}

.makao-mp-back-stack img:first-child { margin-left: 0; }

.makao-mp-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 6vw, 60px);
}

.makao-mp-pile {
  text-align: center;
  color: var(--mp-muted);
  font-weight: 700;
}

.makao-mp-card-img {
  width: clamp(72px, 11vw, 120px);
  border-radius: 8px;
  filter: drop-shadow(0 12px 14px rgba(0,0,0,.42));
}

.makao-mp-hand {
  padding: 10px;
}

.makao-mp-hand-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--mp-muted);
}

.makao-mp-card-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 12px;
  min-height: 124px;
}

.makao-mp-hand-card {
  flex: 0 0 auto;
  width: clamp(72px, 15vw, 112px);
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition: transform .14s ease, filter .14s ease, opacity .14s ease;
}

.makao-mp-hand-card img {
  width: 100%;
  display: block;
  border-radius: 8px;
  filter: drop-shadow(0 10px 12px rgba(0,0,0,.38));
}

.makao-mp-hand-card:not(.legal) {
  cursor: not-allowed;
  opacity: .48;
  filter: grayscale(.25);
}

.makao-mp-hand-card.legal:hover {
  transform: translateY(-10px);
}

.makao-mp-choice {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.62);
}

.makao-mp-choice-box {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid var(--mp-border);
  border-radius: 22px;
  color: var(--mp-text);
  background: var(--mp-card);
}

.makao-mp-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 720px) {
  .makao-mp-mode-grid,
  .makao-mp-actions,
  .makao-mp-choice-grid { grid-template-columns: 1fr; }
  .makao-mp-gamebar { align-items: flex-start; flex-direction: column; }
  #makao-mp-root { padding: 8px; }
}
