:root {
  --red: #8c1420; --red2: #5e0b14; --ink: #0d0b0b; --ivory: #f5ecd9; --line: #d9c9a3; --gold: #f2c14e;
  --cw0: min(84px, 8vh); --cw: var(--cw0); --ch: calc(var(--cw) * 1.45);
}
* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100%; }
body {
  font-family: Georgia, 'Times New Roman', serif; color: var(--ivory);
  background: radial-gradient(ellipse at center, var(--red) 0%, var(--red2) 60%, #2a0509 100%) fixed;
}
body:before {
  content: ""; position: fixed; inset: 0; opacity: .07; pointer-events: none;
  background: repeating-linear-gradient(45deg, #fff 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, #fff 0 2px, transparent 2px 14px);
}
[hidden] { display: none !important; }

/* a moldura e os naipes dos cantos acompanham a página inteira (não só a tela), para o conteúdo nunca ficar fora da linha */
body { position: relative; }
.frame { position: absolute; inset: 14px; border: 2px solid var(--line); border-radius: 6px; pointer-events: none; z-index: 1; }
.frame:after { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(217,201,163,.5); border-radius: 3px; }
.cpip { position: absolute; font-size: 64px; line-height: 1; text-align: center; opacity: .9; pointer-events: none; z-index: 1; }
.cpip small { display: block; font-size: 24px; font-weight: 700; margin-bottom: -4px; }
.cpip.dark { color: var(--ink); }
.tl { left: 34px; top: 30px; } .tr { right: 34px; top: 30px; }
.bl { left: 34px; bottom: 30px; transform: rotate(180deg); } .br { right: 34px; bottom: 30px; transform: rotate(180deg); }

main { position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; padding: 28px 24px 40px; min-height: 100vh; min-height: 100dvh; }
.screen { text-align: center; padding-top: 24px; }
.crest { font-size: 22px; letter-spacing: 14px; color: var(--line); }
h1 { font-size: clamp(56px, 11vw, 112px); letter-spacing: .18em; margin: 4px 0 0 .18em; text-shadow: 0 4px 0 #000, 0 0 40px rgba(0,0,0,.5); }
h1.mid { font-size: clamp(44px, 8vw, 80px); }
.sub { font-style: italic; font-size: 22px; color: var(--line); margin: 2px 0 28px; display: flex; align-items: center; justify-content: center; gap: 16px; }
.sub:before, .sub:after { content: ""; width: 80px; height: 1px; background: var(--line); }
.row { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.row.wide { gap: 44px; }

.panel {
  width: 290px; padding: 24px 20px; background: var(--ivory); color: var(--ink); border-radius: 10px;
  border: 2px solid var(--ink); box-shadow: 0 10px 0 #000, 0 20px 40px rgba(0,0,0,.5); position: relative; text-align: center;
}
.panel.big { width: 340px; }
.panel h2 { font-size: 28px; margin-bottom: 2px; }
.panel p { font-style: italic; color: #555; font-size: 15px; margin-bottom: 8px; }
.panel .ic { font-size: 40px; color: var(--red); margin-bottom: 6px; }
.panel.off { background: #1a1414; color: #8d8272; border-color: #3b3030; box-shadow: 0 10px 0 #000; }
.panel.off .ic { color: #4c3b3b; } .panel.off p { color: #7b6f60; }
.tag { position: absolute; top: -13px; right: 16px; background: var(--ink); color: var(--line); border: 1px solid var(--line); font-size: 12px; letter-spacing: 3px; padding: 3px 10px; text-transform: uppercase; }
.lbl { font-size: 12px; letter-spacing: 4px; text-transform: uppercase; color: #777; margin: 14px 0 -2px; }

.btn {
  display: block; width: 100%; padding: 14px 0; margin-top: 12px; border: 2px solid var(--ink); border-radius: 6px;
  font: 700 18px Georgia, serif; letter-spacing: 2px; text-transform: uppercase; text-align: center; cursor: pointer;
  background: var(--ivory); color: var(--ink);
}
.btn.red { background: var(--red); color: var(--ivory); }
.btn.ghost { background: transparent; }
.btn.dis { background: #241b1b; color: #6b5f52; border-color: #3b3030; cursor: default; }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn.glow { box-shadow: 0 0 0 3px var(--gold), 0 0 22px 6px rgba(242,193,78,.7); }
.btn .sm { display: block; font-size: 12px; letter-spacing: 2px; font-weight: 400; text-transform: none; font-style: italic; margin-top: 3px; opacity: .85; }
.panel input {
  width: 100%; padding: 12px 14px; margin: 10px 0 0; font: 18px Georgia, serif; border: 2px solid var(--ink);
  border-radius: 6px; background: #fff; color: var(--ink); text-align: center;
}
.panel input.code { letter-spacing: 10px; font-variant-numeric: tabular-nums; }
button.back { position: fixed; left: 92px; top: 24px; z-index: 20; height: 38px; padding: 0 18px; background: rgba(0,0,0,.45); border: 1px solid var(--line); border-radius: 30px; color: var(--ivory); font: 14px Georgia, serif; letter-spacing: 3px; text-transform: uppercase; cursor: pointer; transition: background .15s, border-color .15s; }
button.back:hover { background: rgba(0,0,0,.65); border-color: var(--gold); color: var(--gold); }
.screen { position: relative; }

.side-tab {
  position: fixed; right: 0; top: 38%; z-index: 20; writing-mode: vertical-rl; transform: rotate(180deg);
  background: var(--ivory); color: var(--ink); border: 2px solid var(--ink); border-left: 0; border-radius: 0 10px 10px 0;
  padding: 18px 10px; font: 700 15px Georgia, serif; letter-spacing: 4px; text-transform: uppercase; cursor: pointer;
  box-shadow: 4px 4px 0 #000;
}
/* aba da loja, na borda esquerda (a do Tutorial fica na direita) */
.side-tab.left { right: auto; left: 0; transform: none; background: var(--gold); border-color: #6b4a0a; display: flex; align-items: center; gap: 10px; padding: 16px 10px; box-shadow: 4px 4px 0 #000; }
.side-tab.left .coin-icon { width: 20px; height: 20px; font-size: 16px; transform: rotate(90deg); }
body.wide .shop-tab, body.on-shop .shop-tab { display: none; }
.btn.gold { background: linear-gradient(#f6d46a, #d9a62e); color: #2e1d00; border-color: #6b4a0a; }
.shop-btn { width: auto; display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin: 28px auto 0; padding: 14px 34px; }
.shop-btn .coin-icon { width: 22px; height: 22px; font-size: 16px; }
.sound-btn { position: fixed; right: 26px; top: 24px; z-index: 20; background: rgba(0,0,0,.45); border: 1px solid var(--line); color: var(--ivory); border-radius: 50%; width: 38px; height: 38px; font-size: 18px; cursor: pointer; }
.mini { background: rgba(0,0,0,.45); border: 1px solid var(--line); color: var(--ivory); border-radius: 20px; padding: 6px 14px; font: 14px Georgia, serif; cursor: pointer; }

/* mesa */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding-right: 50px; }
.topbar > span:first-child { background: rgba(0,0,0,.5); border: 1px solid var(--line); border-radius: 30px; padding: 7px 18px; }
.score { background: var(--ivory); color: var(--ink); border: 2px solid #000; border-radius: 8px; padding: 6px 18px; box-shadow: 0 4px 0 #000; }
.score i { display: block; font-size: 11px; letter-spacing: 3px; font-style: normal; color: #666; }
.score b { font-size: 20px; }
.badge { display: inline-block; background: var(--red); color: var(--ivory); border: 2px solid var(--line); border-radius: 30px; padding: 6px 20px; letter-spacing: 3px; font-size: 13px; text-transform: uppercase; margin-bottom: 10px; }
.layout { display: flex; gap: 20px; align-items: flex-start; justify-content: center; }
.felt {
  position: relative; flex: 1; min-width: 0; max-width: 1020px; border-radius: 140px / 90px; padding: 14px 16px 16px;
  background: radial-gradient(ellipse, #a11c29, #6d0f19 70%); border: 10px solid #1a0a0a;
  box-shadow: inset 0 0 60px rgba(0,0,0,.6), 0 0 0 3px var(--line);
}
.waiting { padding: 90px 20px; font-size: 22px; font-style: italic; }
.waiting b { font-style: normal; font-size: 44px; letter-spacing: 12px; display: block; margin-top: 10px; color: var(--ivory); }
.waiting .invite { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; font-style: normal; }
.waiting .invite .btn { width: auto; margin: 0; padding: 12px 24px; font-size: 16px; }
.turn-clock { margin: -12px 0 12px; font-size: 16px; letter-spacing: 1px; color: var(--line); font-variant-numeric: tabular-nums; }
.turn-clock.mine { color: var(--gold); }
.turn-clock.urgent { color: #ff7b7b; animation: clockPulse .8s ease-in-out infinite; }
@keyframes clockPulse { 50% { opacity: .55; } }
.waiting ul { list-style: none; padding: 0; margin-top: 14px; font-size: 18px; font-style: normal; }
.waiting li { margin: 4px 0; } .waiting li.free { opacity: .45; font-style: italic; }
/* mesa: 1x1 e 2x2 usam o mesmo desenho. Cada jogador joga na frente do seu lugar; a vira fica de lado. */
body.wide { --cw0: min(84px, 7.6vh); --cw: var(--cw0); --ch: calc(var(--cw) * 1.45); }
body.wide main { max-width: 1160px; }
.hand { display: flex; justify-content: center; gap: 14px; min-height: var(--ch); }
.middle { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mid-area { position: relative; flex: 1; height: calc(var(--ch) * 2.35); margin: 8px 0 4px; }
.zone { position: absolute; display: flex; align-items: center; }
.zone .card + .card { margin-left: calc(var(--cw) * -.62); }
.zone.top { left: 50%; top: 0; transform: translateX(-50%); }
.zone.bottom { left: 50%; bottom: 0; transform: translateX(-50%); }
.zone.left { right: calc(50% + var(--cw) * 1.03); top: 50%; transform: translateY(-50%); }
.zone.right { left: calc(50% + var(--cw) * 1.03); top: 50%; transform: translateY(-50%); }
.rounds { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 9px; }
.rp { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(245,236,217,.55); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; line-height: 1; color: #fff; }
.rp.win { background: #2e9b4f; border-color: #c4f3d0; }
.rp.lose { background: #c62828; border-color: #ffcaca; }
.rp.tie { background: #6f6a60; border-color: #d4cfc4; }
.seat { text-align: center; }
.seat .label { display: inline-block; background: rgba(0,0,0,.5); border: 1px solid var(--line); border-radius: 30px; padding: 3px 14px; font-size: 14px; margin-bottom: 6px; }
.seat.turn .label { border-color: var(--gold); box-shadow: 0 0 10px rgba(242,193,78,.7); }
.seat .label .off { background: #b3261e; color: #fff; border-radius: 12px; padding: 1px 9px; margin-left: 6px; font-style: normal; font-weight: 700; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.seat.left .hand, .seat.right .hand { flex-direction: column; gap: 0; min-height: 0; align-items: center; }
.seat.left .card, .seat.right .card { --cw: calc(var(--cw0) * .78); --ch: calc(var(--cw) * 1.45); margin-top: calc(var(--ch) * -.62); }
.seat.left .card:first-child, .seat.right .card:first-child { margin-top: 0; }
.seat.top .hand { min-height: 0; }
.seat.bottom.has-pick .label { margin-bottom: 14px; }
.seat.bottom.has-pick + .actions { margin-top: 26px; }
.vira { position: absolute; left: 72px; top: 14px; z-index: 1; text-align: center; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--line); }
.vira .card { margin: 4px auto; }
.info { min-height: 28px; margin: 2px 0 20px; font-size: 18px; }
.actions { margin-top: 12px; min-height: 52px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.actions .btn { width: auto; min-width: 150px; padding: 12px 22px; margin: 0; }

.card {
  width: var(--cw); height: var(--ch); background: var(--card-face, var(--ivory)); color: var(--card-ink, var(--ink)); border-radius: 9px; border: var(--card-bw, 2px) solid var(--card-border, #222);
  box-shadow: 0 5px 12px rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center;
  padding: 0; font-weight: 700; font-size: calc(var(--cw) * .24); position: relative; flex: none; user-select: none; transition: transform .15s;
}
.card b { font-size: calc(var(--cw) * .5); line-height: 1; position: relative; z-index: 1; }
/* naipes e figuras no meio da carta */
.card .art { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.card .pip { position: absolute; transform: translate(-50%, -50%); font-size: calc(var(--cw) * .27); line-height: 1; font-weight: 400; }
.card .pip.flip { transform: translate(-50%, -50%) rotate(180deg); }
.card .pip.ace { font-size: calc(var(--cw) * .6); }
.card .court { position: absolute; left: 50%; top: 50%; height: 70%; width: auto; transform: translate(-50%, -50%); }
/* moldura fina por dentro da carta (cada baralho escolhe a cor da linha) e, no verso, uma moldura em volta da treliça */
.card { isolation: isolate; }
.card::before { content: ""; position: absolute; inset: 3px; border: 1px solid var(--card-line, transparent); border-radius: 6px; pointer-events: none; z-index: 0; }
.card::after { content: ""; position: absolute; inset: calc(var(--card-bw, 2px) * -1); padding: var(--card-bw, 2px); border-radius: 9px; background: var(--card-ring, none); pointer-events: none; z-index: 3;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.card.back::before { inset: 5px; border: 2px solid var(--card-back-line, transparent); border-radius: 5px; }
.card .corner { position: absolute; z-index: 1; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.card .corner em { font-style: normal; font-size: .8em; }
.card .corner.top { top: 4px; left: 5px; }
.card .corner.bot { bottom: 4px; right: 5px; transform: rotate(180deg); }
.card.mini .corner.top { top: 3px; left: 4px; }
.card.red { color: var(--card-red, var(--red)); }
.card.back { background: var(--card-back, repeating-linear-gradient(45deg, #111 0 7px, #2b0a0e 7px 14px)); border-color: var(--card-back-border, var(--ivory)); }
.card.manilha { box-shadow: 0 0 0 3px #fff, 0 5px 12px rgba(0,0,0,.5); }
.card.zap { box-shadow: 0 0 0 3px var(--gold), 0 0 16px 4px rgba(242,193,78,.6), 0 5px 12px rgba(0,0,0,.5); }
.card .zap-tag { z-index: 4; position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); background: var(--ink); color: var(--gold); font-size: 11px; letter-spacing: 2px; padding: 1px 8px; border: 1px solid var(--gold); border-radius: 10px; font-style: normal; }
.card.clickable { cursor: pointer; }
.card.clickable:hover { transform: translateY(-8px); }
.card.glow { z-index: 2; transform: translateY(-8px); box-shadow: 0 0 0 4px var(--gold), 0 0 28px 10px rgba(242,193,78,.75), 0 5px 12px rgba(0,0,0,.5); }
.card .pick { position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%); color: var(--gold); font-size: 13px; letter-spacing: 3px; text-transform: uppercase; white-space: nowrap; text-shadow: 0 2px 0 #000; font-weight: 700; }

.mentor {
  width: 270px; flex: none; text-align: left; background: var(--ivory); color: var(--ink); border: 2px solid #000;
  border-radius: 10px; padding: 14px 16px; box-shadow: 0 6px 0 #000;
}
.mentor .hd { font-size: 12px; letter-spacing: 4px; color: var(--red); font-weight: 700; text-transform: uppercase; margin-bottom: 8px; }
.mentor ul { list-style: none; padding: 0; }
.mentor li { font-size: 16px; line-height: 1.35; margin-bottom: 7px; display: flex; gap: 6px; align-items: flex-start; }
.mentor li span { flex: 1; }
.more { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--red); background: none; color: var(--red); font: italic 700 13px Georgia, serif; cursor: pointer; }
.more-link { background: none; border: 0; color: var(--red); font: italic 14px Georgia, serif; text-decoration: underline; cursor: pointer; margin-top: 4px; }
.chance { font-size: 13px; color: #666; letter-spacing: 1px; margin-top: 4px; }

/* modais */
.dim { position: fixed; inset: 0; background: rgba(10,2,4,.72); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; }
.dim > .modal { margin: auto; } /* centralizado quando cabe; em tela baixa rola em vez de cortar */
.modal {
  position: relative; width: min(660px, 100%); padding: 40px 44px 34px; text-align: center; background: var(--ivory); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 0 0 6px var(--red2), 0 0 0 8px var(--line), 0 30px 60px rgba(0,0,0,.7);
}
.modal:before { content: ""; position: absolute; inset: 8px; border: 1px solid #b9a77e; border-radius: 6px; pointer-events: none; }
.modal .orn { color: var(--red); letter-spacing: 16px; font-size: 20px; }
.modal h2 { font-size: 38px; margin: 8px 0 4px; }
.modal .q { font-style: italic; font-size: 25px; color: #3a3030; margin: 10px 0 6px; }
.modal p { color: #5b5048; font-size: 17px; line-height: 1.45; margin: 6px 24px 20px; }
.modal .two { display: flex; gap: 16px; margin-top: 8px; }
.modal .two .btn { margin: 0; flex: 1; padding: 16px 6px; }
.modal .snd { position: absolute; right: 18px; top: 14px; font-size: 22px; background: none; border: 0; cursor: pointer; }

.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(400px, 92vw); z-index: 40; background: var(--ivory); color: var(--ink); border-left: 3px solid var(--ink); box-shadow: -10px 0 40px rgba(0,0,0,.6); overflow-y: auto; padding: 18px 22px 40px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 26px; }
.drawer .mini { color: var(--ink); border-color: var(--ink); background: none; }
.tut { margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid #cdbf9c; border-radius: 6px; }
.tut h3 { font-size: 20px; color: var(--red); margin-bottom: 6px; }
.tut ul { padding-left: 20px; } .tut li { font-size: 16px; line-height: 1.45; margin-bottom: 3px; }
.tut.flash { animation: flash 1.6s; }
@keyframes flash { 0%, 60% { background: rgba(242,193,78,.55); } 100% { background: transparent; } }
.pills { display: flex; gap: 4px; margin: 6px 0; flex-wrap: wrap; }
.pills span { background: var(--ink); color: var(--ivory); padding: 4px 9px; border-radius: 5px; font-weight: 700; }
.pillsNote { font-size: 13px; font-style: italic; color: #555; margin-bottom: 4px; }

.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 60; background: #000; color: #fff; border: 1px solid var(--line); border-radius: 30px; padding: 10px 22px; max-width: 90vw; }

/* moedas e loja de baralhos */
.coin-chip { position: fixed; right: 74px; top: 24px; z-index: 20; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px 0 8px; background: linear-gradient(rgba(0,0,0,.6), rgba(45,24,0,.6)); border: 1px solid var(--gold); color: var(--gold); border-radius: 30px; font: inherit; font-size: 17px; cursor: pointer; box-shadow: 0 0 14px rgba(242,193,78,.22); transition: box-shadow .15s; }
.coin-chip:hover { box-shadow: 0 0 20px rgba(242,193,78,.5); }
.coin-chip .coin-icon { width: 24px; height: 24px; }
/* moeda desenhada em CSS (o emoji de moeda não aparece em todos os computadores) */
.coin-icon { display: inline-block; position: relative; flex: none; width: 1.15em; height: 1.15em; vertical-align: -.22em; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff6bd 0, #f6cf5a 34%, #c8921f 78%, #9a6c12 100%);
  box-shadow: inset 0 0 0 1.5px #8a6212, inset 0 0 0 3px rgba(255,238,170,.75), 0 1px 3px rgba(0,0,0,.55); }
.coin-icon:after { content: "♠"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .62em; line-height: 1; color: #7a5410; text-shadow: 0 1px 0 rgba(255,240,180,.7); }
.coin-chip b { color: var(--ivory); font-weight: 700; letter-spacing: 1px; }
body.wide .coin-chip { display: none; }
.wallet { margin: 4px 0 18px; font-size: 18px; text-align: center; }
.wallet b { color: var(--gold); }
.wallet .mini { margin-left: 6px; }
.shop-login { width: auto; display: inline-block; margin: 10px 0 0; padding: 12px 28px; }
.coin-chip.guest { padding-left: 16px; }
.coin-chip.guest .coin-icon { display: none; }
.coin-chip[hidden] { display: none; }
.modal.auth { max-width: 420px; }
.modal.auth .field { display: block; width: 100%; margin: 10px 0 0; padding: 13px 14px; font: 17px Georgia, serif; background: #fffaf0; color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; }
.modal.auth .two { margin-top: 14px; }
.modal.auth .two .btn { padding: 14px 6px; font-size: 16px; letter-spacing: 1px; }
.modal.auth .btn.ghost { margin-top: 10px; }
.auth-error { min-height: 22px; margin-top: 10px; color: #8c1420; font-size: 15px; font-weight: 700; }
.auth-note { font-size: 13px; font-style: italic; margin-top: 14px; opacity: .8; }
.reward { min-height: 26px; margin: 4px 0 0; font-size: 20px; font-weight: 700; }
.reward.up { color: #1d6b2f; }
.reward.down { color: #8c1420; }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; width: min(1000px, 100%); margin: 0 auto 30px; }
.deck { background: rgba(0,0,0,.4); border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 18px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.deck.equipped { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.deck h3 { font-size: 22px; }
.deck p { font-size: 14px; font-style: italic; opacity: .85; min-height: 36px; }
.deck .preview { display: flex; justify-content: center; gap: 8px; --cw: 52px; --ch: calc(var(--cw) * 1.45); padding: 6px 0; }
.deck .price { font-size: 18px; color: var(--gold); }
.deck .btn { margin: 0; width: 100%; }

@media (max-width: 640px) {
  button.back { left: 62px; padding: 0 12px; font-size: 12px; letter-spacing: 2px; }
  .coin-chip { right: 72px; padding-right: 12px; }
  /* as abas laterais ficam estreitas e as telas ganham margem, para as abas nunca cobrirem os cartões */
  body:not(.wide) main { padding-left: 38px; padding-right: 38px; }
  .side-tab { padding: 12px 6px; font-size: 12px; letter-spacing: 3px; border-width: 2px; }
  .side-tab.left .coin-icon { width: 16px; height: 16px; font-size: 12px; }
  .shop-btn { padding: 14px 18px; font-size: 15px; letter-spacing: 1px; white-space: nowrap; }
}

@media (max-width: 900px) {
  body:not(.wide) main { padding: 70px 42px 40px; } /* topo livre para voltar/moeda/som, e margens para as abas das bordas */
  .cpip { display: none; }
  .layout { flex-direction: column-reverse; align-items: stretch; }
  .mentor { width: auto; }
  .felt { border-radius: 40px; max-width: none; }
  :root { --cw0: 64px; }
  .modal { padding: 34px 20px 26px; } .modal .two { flex-direction: column; }
  .side-tab { top: 30%; padding: 14px 8px; }
  .topbar { padding-right: 46px; }

  /* mesa no celular: tudo cabe na tela (cartas calculadas pela largura e pela altura), a vira vira uma faixa no topo e nada fica fora da moldura */
  body.wide { --cw0: min(60px, 15.5vw, 7.4vh); --cw0: min(60px, 15.5vw, 7.4dvh); --cw: var(--cw0); --ch: calc(var(--cw) * 1.45); }
  body.wide main { padding: 10px 24px 14px; }
  body.wide .side-tab { display: none; }
  body.wide .topbar { gap: 6px; margin-bottom: 6px; padding-right: 44px; }
  body.wide .topbar > span:first-child { padding: 5px 10px; font-size: 12px; text-align: center; }
  body.wide .score { padding: 4px 10px; }
  body.wide .score i { font-size: 9px; letter-spacing: 2px; }
  body.wide .score b { font-size: 15px; }
  body.wide .mini { padding: 5px 10px; font-size: 12px; }
  body.wide .badge { font-size: 10px; letter-spacing: 2px; padding: 4px 12px; margin-bottom: 6px; }
  body.wide .felt { padding: 8px 6px 10px; border-width: 6px; border-radius: 34px; }
  body.wide .vira { position: static; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11px; letter-spacing: 1px; margin-bottom: 4px; }
  body.wide .vira .card { --cw: calc(var(--cw0) * .62); --ch: calc(var(--cw) * 1.45); margin: 0; }
  body.wide .sound-btn { top: 10px; right: 10px; width: 32px; height: 32px; font-size: 15px; }
  body.wide .seat .label { font-size: 12px; padding: 2px 10px; margin-bottom: 4px; max-width: 92%; }
  body.wide .hand { gap: 8px; }
  body.wide .mid-area { height: calc(var(--ch) * 2.1); margin: 4px 0 2px; }
  body.wide .info { font-size: 15px; min-height: 22px; margin: 0 0 10px; }
  body.wide .turn-clock { font-size: 13px; margin: -6px 0 6px; }
  body.wide .actions { margin-top: 6px; min-height: 44px; gap: 8px; }
  body.wide .actions .btn { min-width: 0; padding: 10px 16px; font-size: 14px; }
  body.wide .seat.bottom.has-pick .label { margin-bottom: 10px; }
  body.wide .seat.bottom.has-pick + .actions { margin-top: 20px; }
}

.conn-banner { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 70; background: #7a1111; color: #fff; border: 2px solid var(--gold); border-radius: 30px; padding: 10px 24px; max-width: 90vw; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.6); }
.offline-note { display: inline-block; background: rgba(0,0,0,.6); border: 1px solid var(--gold); color: var(--ivory); border-radius: 30px; padding: 6px 20px; margin: 0 0 10px 8px; font-size: 14px; }

/* abertura da mão: a vira sai do baralho, vem para o centro e (com o Mentor) explica a manilha */
.intro { position: fixed; inset: 0; z-index: 45; background: rgba(10,2,4,.62); perspective: 1400px; }
body.dealing #mine .card, body.dealing [id^=seat-] .card { opacity: 0; }
.shuffle-card { position: fixed; margin: 0; will-change: transform; }
.flyer { position: fixed; transform-style: preserve-3d; will-change: transform; }
.flyer .face { position: absolute; inset: 0; width: 100% !important; height: 100% !important; backface-visibility: hidden; -webkit-backface-visibility: hidden; margin: 0; }
.flyer .back-face { transform: rotateY(180deg); }
.intro-tag { position: fixed; left: 50%; top: calc(50% + 190px); transform: translateX(-50%); background: rgba(0,0,0,.65); border: 1px solid var(--line); border-radius: 30px; padding: 8px 22px; font-size: 18px; white-space: nowrap; }
.intro-panel {
  position: fixed; left: calc(50% - 150px); top: 50%; transform: translateY(-50%); width: min(400px, 46vw);
  background: var(--ivory); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; padding: 14px 20px 16px; text-align: left;
  box-shadow: 0 0 0 5px var(--red2), 0 0 0 7px var(--line), 0 24px 50px rgba(0,0,0,.7);
}
.intro-panel h3 { font-size: 24px; color: var(--red); margin-bottom: 2px; }
.intro-panel p { font-size: 15px; line-height: 1.35; margin: 4px 0; }
.intro-panel .small { font-size: 14px; color: #5b5048; font-style: italic; }
.intro-panel .strength { display: flex; gap: 12px; justify-content: center; margin: 8px 0 6px; }
.intro-panel .strength div { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; text-align: center; }
.intro-panel .strength .card { --cw: 44px; --ch: calc(var(--cw) * 1.45); }
.intro-panel .arrow { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--red); font-weight: 700; border-top: 2px solid var(--red); padding-top: 3px; margin-bottom: 8px; }
@media (max-width: 800px) {
  .intro-panel { left: 5%; top: auto; bottom: 8%; transform: none; width: 90%; padding: 14px 16px; }
  .intro-panel .strength .card { --cw: 40px; }
  .intro-tag { top: calc(50% + 150px); }
}

/* frases prontas: botão no canto da mesa, menu e balões na frente de quem falou */
.emote-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.emote-btn, .tip-btn { position: absolute; bottom: 16px; z-index: 6; background: rgba(0,0,0,.55); border: 1px solid var(--gold); color: var(--gold); border-radius: 30px; padding: 8px 16px; font: 700 13px Georgia, serif; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; }
.emote-btn { right: 18px; }
.emote-btn:hover, .tip-btn:hover { background: rgba(0,0,0,.75); }
.emote-btn.cool { opacity: .45; pointer-events: none; }
.emote-menu { position: absolute; right: 14px; bottom: 60px; z-index: 7; display: grid; gap: 8px; background: rgba(10,2,4,.92); border: 1px solid var(--gold); border-radius: 14px; padding: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.6); }
.emote-menu .btn { margin: 0; padding: 9px 18px; font-size: 15px; letter-spacing: 1px; text-transform: none; white-space: nowrap; }
.bubble { position: absolute; transform: translate(-50%, -50%); background: var(--ivory); color: var(--ink); border: 2px solid #000; border-radius: 16px; padding: 7px 14px; font: 700 17px Georgia, serif; white-space: nowrap; box-shadow: 0 3px 0 #000; animation: bubbleIn .22s ease-out, bubbleOut .3s ease-in 2.7s forwards; }
.bubble.top { left: 50%; top: 24%; } .bubble.bottom { left: 50%; top: 62%; } .bubble.left { left: 22%; top: 46%; } .bubble.right { left: 78%; top: 46%; }
@keyframes bubbleIn { from { opacity: 0; transform: translate(-50%, -30%) scale(.8); } }
@keyframes bubbleOut { to { opacity: 0; } }
.tip-btn { display: none; left: 18px; }
.tip-btn.new { animation: pulse 1s ease-in-out infinite; background: rgba(60,40,0,.8); }
.mentor-close { display: none; }

/* o painel do Mentor segura o lugar enquanto não há dica, para a mesa não pular de lado */
.mentor.empty { visibility: hidden; }
@media (max-width: 900px) {
  .mentor.empty { display: none; }
  /* no celular a dica vira um cartão que abre ao tocar em "Dica" e não ocupa lugar embaixo da mesa */
  body.mentor-on .tip-btn { display: block; }
  .mentor { position: fixed; left: 12px; right: 12px; top: 112px; z-index: 40; max-height: 46vh; overflow-y: auto; display: none; }
  .mentor.open { display: block; }
  .mentor .hd { display: flex; justify-content: space-between; align-items: center; }
  .mentor-close { display: inline-block; background: none; border: 1px solid var(--ink); border-radius: 14px; padding: 2px 10px; font: 700 11px Georgia, serif; letter-spacing: 1px; cursor: pointer; }
}

/* botões de resposta ao truco: cada um com a sua cor e uma entrada com animação */
.btn { transition: transform .12s, filter .12s, box-shadow .2s, opacity .2s; }
.btn:active:not(:disabled) { transform: translateY(2px) scale(.96); }
.actions .btn { animation: popIn .3s cubic-bezier(.2, .9, .3, 1.3) both; }
.actions .btn:nth-child(2) { animation-delay: .06s; }
.actions .btn:nth-child(3) { animation-delay: .12s; }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.85); } to { opacity: 1; transform: none; } }
.btn.call { background: var(--red); color: var(--ivory); }
.btn.accept { background: #2e9b4f; color: #fff; border-color: #14532d; }
.btn.raise { background: linear-gradient(#f9d976, #e2a622); color: #2a1700; border-color: #7a5200; }
.btn.run { background: #7a1111; color: #fff; border-color: #3b0a0a; }
.actions.sent .btn:not(.chosen) { opacity: .25; pointer-events: none; }
.btn.chosen { animation: chosen .4s ease both; pointer-events: none; }
@keyframes chosen { 40% { transform: scale(1.12); filter: brightness(1.25); } 100% { transform: scale(1); } }
.card.sent { opacity: .45; transform: translateY(-20px) scale(.94) !important; pointer-events: none; }
.seat .label.caller { border-color: var(--gold); background: rgba(120, 20, 20, .85); animation: callerPulse 1s ease-in-out infinite; }
@keyframes callerPulse { 50% { box-shadow: 0 0 14px 4px rgba(242, 193, 78, .8); } }

/* pergunta para quem precisa responder */
.info.asking { font-size: 24px; animation: askIn .35s cubic-bezier(.2, .9, .3, 1.2) both; }
.info.asking .ask-who { color: var(--gold); font-weight: 700; }
.info.asking .ask-word { display: inline-block; font-weight: 700; font-size: 1.25em; color: #fff; letter-spacing: .04em; text-shadow: 0 2px 0 #000, 0 0 14px var(--tone); animation: askPulse .9s ease-in-out infinite; }
.info.asking .ask-q { opacity: .9; }
@keyframes askIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes askPulse { 50% { transform: scale(1.12); } }

/* faixa grande: TRUCO!, SEIS!, NOVE!, DOZE!, aceitou, correu, resultado da mão */
.call-banner { position: fixed; inset: 0; z-index: 44; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.cb-flash { position: absolute; inset: 0; background: radial-gradient(ellipse at center, var(--tone) 0%, transparent 62%); opacity: 0; }
.cb-ring { position: absolute; left: 50%; top: 50%; width: 240px; height: 240px; margin: -120px 0 0 -120px; border-radius: 50%; border: 7px solid var(--tone); opacity: 0; }
.cb-who { position: relative; font-size: clamp(18px, 2.4vw, 28px); background: var(--ivory); color: var(--ink); padding: 6px 24px; border-radius: 30px; border: 2px solid var(--ink); box-shadow: 0 4px 0 #000; letter-spacing: 1px; }
.cb-word { position: relative; font-weight: 700; color: #fff; font-size: clamp(64px, 13vw, 150px); letter-spacing: .05em; line-height: 1; text-shadow: 0 6px 0 #000, 0 0 28px var(--tone), 0 0 64px var(--tone); }
.call-banner.mid .cb-word { font-size: clamp(44px, 8vw, 96px); }
