:root {
  color-scheme: dark;
  --bg: #050817;
  --panel: #0b1025;
  --line: rgba(92, 119, 255, .28);
  --text: #f6f8ff;
  --muted: #9ea9c7;
  --blue: #3475ff;
  --purple: #a72cff;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 20% 12%, rgba(34, 95, 255, .13), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(216, 42, 255, .10), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: none;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.solo-app {
  width: min(100%, 820px);
  height: 100dvh;
  margin: 0 auto;
  padding: max(2px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  gap: 5px;
  overflow: hidden;
}
.solo-topbar {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(92px, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.solo-logo {
  display: block;
  width: clamp(96px, 23vw, 168px);
  height: 46px;
  object-fit: contain;
  object-position: left center;
}
.solo-scores { display: flex; gap: 6px; justify-content: flex-end; }
.solo-score-card {
  min-width: 72px;
  height: 40px;
  display: grid;
  align-content: center;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(8, 13, 34, .88);
}
.solo-score-card span { font-size: 9px; line-height: 1.05; color: #c7d0e8; }
.solo-score-card strong { margin-top: 1px; font-size: 17px; line-height: 1; color: #55a5ff; font-variant-numeric: tabular-nums; transform-origin: center; }
.solo-score-card--best strong { color: #e24dff; }
.solo-board-zone { min-height: 0; display: grid; place-items: center; overflow: hidden; }
.game-shell { min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; aspect-ratio: 1; }
.board-frame {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  padding: 5px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(29, 48, 105, .92), rgba(8, 16, 45, .96));
  border: 1px solid rgba(52, 117, 255, .55);
  box-shadow: 0 10px 30px rgba(0,0,0,.26), 0 0 22px rgba(38, 111, 255, .08);
}
#game-canvas { width: 100%; height: 100%; display: block; border-radius: 13px; }
.piece-tray {
  width: 100%;
  height: clamp(78px, 12dvh, 112px);
  min-height: 72px;
  overflow: hidden;
  border-radius: 16px;
  background: #190adf;
  border: 1px solid #190adf;
}
#pieces-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.solo-controls { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) 60px; gap: 8px; }
.primary-button, .options-button, .save-button, .danger-button, .close-button, .sound-toggle {
  border: 0; color: #fff; cursor: pointer;
}
.primary-button {
    min-height: 54px;
    border-radius: 15px;
    background: linear-gradient(100deg, #fcf630, #fcd92c);
    box-shadow: 0 8px 24px rgba(91, 62, 255, .24);
    font-weight: 850;
    font-size: 24px;
    color: #121211;
}
.primary-button b { margin-left: 8px; font-size: 24px; line-height: 0; }
.options-button {
  min-height: 54px;
  border-radius: 15px;
  background: linear-gradient(145deg, #6823e8, #a02df4);
}
.options-button svg { width: 27px; height: 27px; fill: none; stroke: #fff; stroke-width: 1.7; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 180; background: rgba(1,4,14,.72); backdrop-filter: blur(7px);
}
.options-dialog, .game-over-card, .abandon-dialog {
  position: fixed; z-index: 190; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 480px); max-height: min(88dvh, 680px); overflow: auto;
  border: 1px solid rgba(109, 116, 255, .34); border-radius: 22px;
  padding: 18px; background: linear-gradient(180deg, #111731, #090d20); box-shadow: 0 28px 90px rgba(0,0,0,.5);
}
.options-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.options-header h2 { margin: 0; font-size: 22px; }
.close-button { width: 38px; height: 38px; border-radius: 12px; background: #202844; font-size: 27px; }
.option-field { display: grid; gap: 7px; margin-top: 16px; color: #d8def0; font-weight: 700; }
.option-field input { width: 100%; height: 46px; border: 1px solid #303a5e; border-radius: 12px; background: #090e23; color: #fff; padding: 0 12px; outline: none; }
.sound-row { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px; border-radius: 14px; background: #0a1026; border: 1px solid #242d4d; }
.sound-row strong, .sound-row small { display: block; }
.sound-row small { color: var(--muted); margin-top: 2px; }
.sound-toggle { width: 52px; height: 30px; padding: 3px; border-radius: 99px; background: #303a58; transition: .18s; }
.sound-toggle span { display:block; width:24px; height:24px; border-radius:50%; background:#fff; transform:translateX(0); transition:.18s; }
.sound-toggle[aria-pressed="true"] { background: linear-gradient(90deg, #3475ff, #a72cff); }
.sound-toggle[aria-pressed="true"] span { transform: translateX(22px); }
.history-section { margin-top: 17px; }
.history-section h3 { margin: 0 0 10px; }
.history-grid { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:8px; }
.history-grid div { min-height:66px; display:grid; align-content:center; padding:9px 10px; border:1px solid #252f50; border-radius:12px; background:#090f25; }
.history-grid span { color:var(--muted); font-size:12px; }
.history-grid strong { margin-top:4px; font-size:20px; }
.storage-note { color:var(--muted); font-size:12px; margin:12px 2px 0; }
.options-actions { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:15px; }
.save-button, .danger-button { min-height:46px; border-radius:12px; font-weight:800; }
.save-button { background:linear-gradient(90deg,#3475ff,#8b37ff); }
.danger-button { background:#3a1824; color:#ff9cad; border:1px solid #6a263a; }
.game-over-card { text-align:center; width:min(88vw,380px); }
.game-over-card h2 { margin-top:0; }
.game-over-card .primary-button { width:100%; margin-top:10px; }
.game-over-exit-button {
  width:100%;
  min-height:46px;
  margin-top:8px;
  border:1px solid rgba(128,145,190,.34);
  border-radius:12px;
  background:#202945;
  color:#dfe6ff;
  font:inherit;
  font-weight:850;
  cursor:pointer;
  transition:transform 90ms ease, border-color 120ms ease, background 120ms ease;
}
.game-over-exit-button:hover { background:#273252; border-color:rgba(130,173,255,.55); }
.game-over-exit-button:active { transform:scale(.985); }
.game-over-exit-button:focus-visible { outline:2px solid #60c6ff; outline-offset:2px; }
.game-over-exit-button:disabled { opacity:.55; cursor:wait; }
[hidden] { display:none !important; }
html.is-piece-dragging, html.is-piece-dragging body { touch-action:none; overscroll-behavior:none; }
.drag-piece-sprite { will-change: transform; image-rendering:auto; }
@media (max-width: 560px) {
  .solo-app { padding-left:8px; padding-right:8px; gap:6px; }
  .solo-topbar { min-height:38px; }
  .solo-logo { width:104px; height:38px; }
  .solo-score-card { min-width:63px; height:36px; padding:3px 7px; border-radius:9px; }
  .solo-score-card span { font-size:8px; }
  .solo-score-card strong { font-size:16px; }
  .board-frame { padding:4px; border-radius:15px; }
  .piece-tray { height:88px; }
  .solo-controls { grid-template-columns:minmax(0,1fr) 54px; gap:6px; }
  .primary-button, .options-button { min-height:50px; border-radius:14px; }
}
@media (max-height: 650px) {
  .solo-app { gap:5px; padding-top:5px; padding-bottom:5px; }
  .solo-topbar { min-height:34px; }
  .solo-logo { height:34px; width:94px; }
  .solo-score-card { height:34px; }
  .piece-tray { height:76px; min-height:70px; }
  .primary-button, .options-button { min-height:46px; }
}
@media (min-width: 900px) {
  .solo-app { width:min(100%,760px); padding-inline:18px; gap:10px; }
  .solo-logo { width:168px; height:58px; }
  .solo-topbar { min-height:58px; }
  .solo-score-card { min-width:112px; height:50px; padding:6px 12px; }
  .solo-score-card span { font-size:11px; }
  .solo-score-card strong { font-size:22px; }
  .piece-tray { height:116px; }
  .solo-controls { grid-template-columns:minmax(0,1fr) 68px; }
  .primary-button,.options-button { min-height:60px; }
}

/* Layout final compacto: tabuleiro, peças e controlos usam a mesma largura. */
:root {
  --solo-board-size: min(calc(100vw - 14px), calc(100dvh - 282px), 720px);
}
.solo-app {
  grid-template-rows: auto var(--solo-board-size) auto auto auto;
  align-content: start;
  justify-items: center;
}
.solo-topbar,
.solo-board-zone,
.piece-tray,
.solo-controls,
.solo-footer {
  width: var(--solo-board-size);
}
.solo-board-zone,
.game-shell {
  height: var(--solo-board-size);
  min-height: var(--solo-board-size);
  max-height: var(--solo-board-size);
}
.game-shell {
  width: var(--solo-board-size);
}
@media (min-width: 900px) {
  :root {
    --solo-board-size: min(720px, calc(100vw - 36px), calc(100dvh - 389px));
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  :root {
    --solo-board-size: min(calc(100dvh - 12px), calc(55vw - 14px));
  }
  .solo-app {
    width: 100%;
    max-width: none;
    padding: 6px 8px;
    grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 6px;
    align-content: stretch;
    justify-items: stretch;
  }
  .solo-board-zone {
    grid-column: 1;
    grid-row: 1 / 4;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    place-items: center;
  }
  .game-shell {
    width: var(--solo-board-size);
    height: var(--solo-board-size);
    min-height: var(--solo-board-size);
    max-height: var(--solo-board-size);
    justify-self: center;
  }
  .solo-topbar {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-height: 38px;
  }
  .piece-tray {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    height: min(112px, 31dvh);
    align-self: center;
  }
  .solo-controls {
    grid-column: 2;
    grid-row: 3;
    width: 100%;
  }

  .solo-footer {
    position: fixed;
    right: 8px;
    bottom: 5px;
    width: min(42vw, 440px);
    z-index: 20;
  }
}

/* ===== Combo Jackpot — identidade, histórico e ranking ===== */
.solo-controls--three {
  grid-template-columns: minmax(0, 1fr) 56px 56px;
}
.utility-button {
  min-height: 54px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
}
.utility-button svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.history-button {
  background: linear-gradient(145deg, #1557cf, #3475ff);
}
.options-button {
  background: linear-gradient(145deg, #6823e8, #a02df4);
}
.compact-dialog {
  width: min(90vw, 420px);
}
.history-dialog {
  position: fixed;
  z-index: 190;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 480px);
  max-height: min(88dvh, 720px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(109,116,255,.34);
  border-radius: 22px;
  background: linear-gradient(180deg, #111731, #090d20);
  box-shadow: 0 28px 90px rgba(0,0,0,.5);
}
.history-alias {
  margin: 4px 0 0;
  color: #8795be;
  font-size: 13px;
  font-weight: 750;
}
.history-list {
  margin: 18px 0 0;
  display: grid;
  gap: 0;
}
.history-list div {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(110,125,180,.14);
}
.history-list dt {
  color: #a9b3d0;
  font-size: 14px;
}
.history-list dd {
  margin: 0;
  color: #f8f9ff;
  font-size: 19px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.rank-box {
  margin-top: 17px;
  padding: 15px;
  border: 1px solid rgba(75,115,255,.34);
  border-radius: 17px;
  background:
    radial-gradient(circle at 85% 0, rgba(164,45,255,.14), transparent 44%),
    rgba(8,14,36,.82);
}
.rank-numbers {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  gap: 10px;
}
.rank-numbers div {
  display: grid;
  gap: 4px;
}
.rank-numbers div:last-child { text-align: right; }
.rank-numbers span:not(.rank-arrow) {
  color: #919fc4;
  font-size: 11px;
  font-weight: 700;
}
.rank-numbers strong {
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.rank-arrow {
  color: #6d82c7;
  font-size: 25px;
}
.rank-movement {
  margin: 13px 0 4px;
  color: #78efa9;
  font-weight: 900;
}
.rank-movement[data-direction="down"] { color: #ff8da9; }
.rank-movement[data-direction="same"] { color: #aeb9d7; }

.game-over-session,
.game-over-total,
.game-over-rank {
  margin: 8px 0;
  color: #aeb7d0;
}
.game-over-card p strong {
  margin-left: 6px;
  color: #fff;
  font-size: 1.15em;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 18% 12%, rgba(52,117,255,.18), transparent 32%),
    radial-gradient(circle at 84% 18%, rgba(199,46,255,.14), transparent 30%),
    rgba(3,5,17,.97);
}
.login-overlay[hidden] { display: none !important; }
.login-card {
  width: min(92vw, 430px);
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px;
  border: 1px solid rgba(106,123,255,.34);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(16,23,53,.98), rgba(7,10,28,.99));
  box-shadow: 0 28px 90px rgba(0,0,0,.54);
}
.login-logo {
  display: block;
  width: 154px;
  height: 74px;
  margin: -3px auto 5px;
  object-fit: contain;
}
.login-card h1 {
    margin: 0;
    text-align: center;
    font-size: 24px;
    background: linear-gradient(to right, #74fd0c, #a8ef0f, #71ff05);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card > p {
  margin: 9px 0 18px;
  color: #facd00;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}
.login-card form { display: grid; gap: 9px; }
.login-card label { color: #e5e9f6; font-weight: 800; }
.login-card input {
  width: 100%;
  height: 50px;
  padding: 0 13px;
  border: 1px solid #354064;
  border-radius: 13px;
  outline: 0;
  background: #070d22;
  color: #fff;
  font-size: 16px;
}
.login-card input:focus {
  border-color: #547fff;
  box-shadow: 0 0 0 3px rgba(52,117,255,.15);
}
.login-card small {
  color: #7f8bab;
  font-size: 12px;
  line-height: 1.4;
}
.login-card small strong { color: #bbc6e6; }
.login-submit {
  width: 100%;
  margin-top: 8px;
}
.login-submit:disabled { opacity: .62; cursor: wait; }
.login-error {
  min-height: 20px;
  margin: 0 !important;
  color: #ff89a4 !important;
  text-align: left !important;
  font-size: 12px !important;
}

@media (max-width: 560px) {
  .solo-controls--three { grid-template-columns: minmax(0,1fr) 50px 50px; margin-top: 80px; }
  .utility-button { min-height: 50px; border-radius: 14px; }
  .utility-button svg { width: 24px; height: 24px; }
  .history-dialog { padding: 16px; }
  .rank-box { padding: 13px; }
  .rank-numbers strong { font-size: 30px; }
}
@media (max-height: 650px) {
  .utility-button { min-height: 46px; }
  .login-card { padding: 16px 18px; }
  .login-logo { height: 54px; }
  .login-card > p { margin-bottom: 11px; }
}
@media (orientation: landscape) and (max-height: 600px) {
  .solo-controls--three { grid-template-columns: minmax(0,1fr) 52px 52px; }
  .utility-button { min-height: 46px; }
  .login-card {
    width: min(70vw, 520px);
    padding: 12px 18px;
  }
  .login-logo { display: none; }
  .login-card h1 { font-size: 20px; }
  .login-card > p { margin: 5px 0 8px; font-size: 12px; }
  .login-card input { height: 43px; }
}

/* ===== Combo Jackpot — rodapé, patrocínio e contacto ===== */
.solo-footer {
  display: grid;
  gap: 5px;
  align-self: end;
}

.solo-footer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.footer-action-button {
  min-height: 34px;
  border: 1px solid rgba(103, 122, 255, .28);
  border-radius: 10px;
  background: rgba(10, 16, 40, .88);
  color: #dfe6ff;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(0,0,0,.12);
  transition: transform 90ms ease, border-color 120ms ease, background 120ms ease;
}

.footer-support-button {
  border-color: rgba(84, 151, 255, .38);
  background: linear-gradient(145deg, rgba(22, 79, 177, .72), rgba(41, 108, 232, .72));
}

.footer-contact-button {
  border-color: rgba(174, 72, 255, .34);
  background: linear-gradient(145deg, rgba(92, 31, 180, .70), rgba(144, 45, 216, .70));
}

.footer-action-button:active {
  transform: scale(.98);
}

.footer-action-button:focus-visible {
  outline: 2px solid #60c6ff;
  outline-offset: 2px;
}

.solo-copyright {
  margin: 0;
  color: #69779e;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.solo-copyright strong {
  color: #8f9fc9;
  font-weight: 800;
}

@media (max-width: 560px) {
  .solo-footer {
    gap: 4px;
  }

  .footer-action-button {
    min-height: 31px;
    border-radius: 9px;
    font-size: 11px;
  }

  .solo-copyright {
    font-size: 10px;
	margin-top: 10px;
  }
}

@media (max-height: 650px) and (orientation: portrait) {
  :root {
    --solo-board-size: min(calc(100vw - 14px), calc(100dvh - 214px), 720px);
  }

  .footer-action-button {
    min-height: 28px;
  }

  .solo-copyright {
    font-size: 7.5px;
  }
}

.abandon-dialog {
  text-align: center;
  width: min(90vw, 430px);
}

.abandon-dialog h2 {
  margin: 0 0 10px;
  font-size: 23px;
}

.abandon-dialog p {
  margin: 0;
  color: #adb7d2;
  line-height: 1.45;
}

.abandon-dialog p strong {
  color: #ff7897;
  white-space: nowrap;
}

.abandon-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 18px;
}

.abandon-cancel,
.abandon-confirm {
  min-height: 48px;
  border-radius: 13px;
  border: 0;
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.abandon-cancel {
  background: #202945;
}

.abandon-confirm {
  background: linear-gradient(135deg, #98284d, #d43b62);
  box-shadow: 0 8px 24px rgba(190, 48, 86, .18);
}

.abandon-cancel:focus-visible,
.abandon-confirm:focus-visible {
  outline: 2px solid #60c6ff;
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .abandon-actions {
    grid-template-columns: 1fr;
  }

  .abandon-cancel,
  .abandon-confirm {
    min-height: 45px;
  }
}


/* i18n: seletor manual PT-PT / EN / ES / FR; restantes idiomas usam EN */
.language-row { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px; border-radius: 14px; background: #0a1026; border: 1px solid #242d4d; }
.language-row strong, .language-row small { display: block; }
.language-row small { color: var(--muted); margin-top: 2px; max-width: 220px; }
.language-select { min-width: 148px; max-width: 48%; padding: 9px 30px 9px 10px; border-radius: 10px; border: 1px solid #303a58; background: #111936; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.language-select:focus-visible { outline: 2px solid #6f8cff; outline-offset: 2px; }
@media (max-width: 480px) { .language-row { align-items: flex-start; flex-direction: column; } .language-select { width: 100%; max-width: none; } }


/* ===== Combo Jackpot — idioma na entrada, sair e instalação PWA ===== */
.login-language-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: -2px 0 12px;
}
.login-language-row label {
  color: #aeb9d7;
  font-size: 12px;
  font-weight: 800;
}
.login-language-select {
  min-width: 176px;
  max-width: 220px;
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 13px;
}
.options-action-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border-radius: 14px;
  background: #0a1026;
  border: 1px solid #242d4d;
}
.options-action-row strong,
.options-action-row small { display: block; }
.options-action-row small {
  color: var(--muted);
  margin-top: 2px;
  max-width: 220px;
}
.options-action-button,
.login-shortcut-button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(76, 163, 255, .5);
  border-radius: 11px;
  background: linear-gradient(135deg, #164fb8, #246fe1);
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 850;
  cursor: pointer;
}
.login-shortcut-wrap {
  display: grid;
  margin-top: 1px;
}
.login-shortcut-button {
  width: 100%;
  background: rgba(19, 42, 90, .82);
}
.logout-button {
  width: 100%;
  min-height: 45px;
  margin-top: 12px;
  border: 1px solid rgba(255, 91, 126, .4);
  border-radius: 13px;
  background: rgba(87, 22, 42, .55);
  color: #ff9ab1;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.logout-button:disabled { opacity: .6; cursor: wait; }
.options-action-button:focus-visible,
.login-shortcut-button:focus-visible,
.logout-button:focus-visible {
  outline: 2px solid #60c6ff;
  outline-offset: 2px;
}
@media (max-width: 480px) {
  .login-language-row {
    justify-content: space-between;
    margin-bottom: 10px;
  }
  .login-language-select {
    width: auto;
    min-width: 0;
    max-width: 68%;
  }
  .options-action-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .options-action-button { width: 100%; }
}


/* ===== Página principal — idioma com bandeiras + partilha ===== */
.login-toolbar {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: -4px 0 5px;
}

.login-language-picker { position: relative; }

.login-toolbar-button {
  min-height: 38px;
  border: 1px solid rgba(103, 122, 255, .34);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(18, 28, 67, .96), rgba(8, 14, 38, .96));
  color: #edf2ff;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 6px 18px rgba(0,0,0,.16);
  transition: border-color 120ms ease, transform 90ms ease, background 120ms ease;
}
.login-toolbar-button:hover { border-color: rgba(96, 198, 255, .58); }
.login-toolbar-button:active { transform: translateY(1px); }
.login-toolbar-button:focus-visible {
  outline: 2px solid #60c6ff;
  outline-offset: 2px;
}

.language-picker-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
}
.language-picker-button img,
.language-picker-menu img {
  display: block;
  flex: 0 0 auto;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.20), 0 2px 6px rgba(0,0,0,.28);
}
.language-chevron {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .7;
  transition: transform 120ms ease;
}
.login-language-picker.is-open .language-chevron { transform: rotate(180deg); }

.language-picker-menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 50;
  width: 218px;
  padding: 6px;
  border: 1px solid rgba(103, 122, 255, .38);
  border-radius: 13px;
  background: rgba(7, 12, 32, .985);
  box-shadow: 0 18px 44px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(16px);
}
.language-picker-menu[hidden] { display: none !important; }
.language-picker-menu button {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 40px;
  padding: 7px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #e7edff;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}
.language-picker-menu button:hover,
.language-picker-menu button:focus-visible { background: rgba(69, 92, 176, .22); outline: none; }
.language-picker-menu button.is-active { background: rgba(44, 106, 229, .22); color: #fff; }
.language-picker-menu small {
  color: #8090ba;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}
.language-picker-menu button.is-active small { color: #78cbff; }

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 11px;
}
.share-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.share-button.is-success {
  border-color: rgba(70, 225, 151, .55);
  color: #8ff0bd;
}

@media (max-width: 560px) {
  .login-toolbar {
    justify-content: space-between;
    margin: -3px 0 2px;
  }
  .login-toolbar-button { min-height: 36px; }
  .language-picker-menu {
    left: 0;
    width: min(218px, calc(92vw - 36px));
  }
}


/* ===== Combo Jackpot — contacto direto por SMTP ===== */
.contact-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(1, 4, 15, .76);
  backdrop-filter: blur(7px);
}
.contact-backdrop[hidden], .contact-dialog[hidden] { display: none !important; }
.contact-dialog {
  position: fixed;
  z-index: 200;
  left: 50%;
  top: 50%;
  width: min(92vw, 470px);
  max-height: min(88dvh, 720px);
  overflow: auto;
  transform: translate(-50%, -50%);
  padding: 18px;
  border: 1px solid rgba(112, 104, 255, .45);
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(15, 24, 63, .985), rgba(5, 9, 29, .99));
  color: #eef3ff;
  box-shadow: 0 24px 70px rgba(0,0,0,.55), 0 0 34px rgba(92, 50, 255, .16), inset 0 1px 0 rgba(255,255,255,.06);
}
.contact-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}
.contact-kicker {
  display: block;
  margin-bottom: 2px;
  color: #7ecbff;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .16em;
}
.contact-dialog h2 { margin: 0; font-size: 22px; }
.contact-intro {
  margin: 0 0 14px;
  color: #9aa8cf;
  font-size: 12px;
  line-height: 1.45;
}
.contact-form { display: grid; gap: 10px; }
.contact-form label { display: grid; gap: 5px; }
.contact-form label > span {
  color: #c8d2ee;
  font-size: 11px;
  font-weight: 850;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(105, 125, 200, .32);
  border-radius: 11px;
  background: rgba(4, 9, 29, .86);
  color: #f4f7ff;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.contact-form input { min-height: 42px; padding: 0 11px; }
.contact-form textarea { min-height: 116px; padding: 10px 11px; resize: vertical; line-height: 1.45; }
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(79, 190, 255, .72);
  box-shadow: 0 0 0 3px rgba(67, 151, 255, .11);
}
.contact-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}
.contact-status { min-height: 18px; font-size: 11px; font-weight: 750; color: #9caad0; }
.contact-status[data-state="success"] { color: #7be9ad; }
.contact-status[data-state="error"] { color: #ff91a8; }
.contact-submit { width: 100%; }
.contact-submit:disabled { opacity: .62; cursor: wait; }
.contact-email-note { margin: 1px 0 0; color: #7f8eb4; font-size: 10px; text-align: center; }
.contact-email-note a { color: #79c9ff; text-decoration: none; font-weight: 800; }
.contact-email-note a:hover { text-decoration: underline; }
.contact-modal-open { overflow: hidden; }
.noscript-message {
  max-width: 680px;
  margin: 40px auto;
  padding: 24px;
  color: #eef3ff;
  background: #0b1230;
  border: 1px solid #26376f;
  border-radius: 18px;
  font-family: system-ui, sans-serif;
}
.noscript-message h1 { margin-top: 0; font-size: 24px; }
.noscript-message p { color: #b6c0dd; line-height: 1.55; }
@media (max-width: 560px) {
  .contact-dialog { width: min(94vw, 430px); padding: 15px; border-radius: 16px; }
  .contact-dialog h2 { font-size: 20px; }
  .contact-form { gap: 8px; }
  .contact-form input { min-height: 40px; }
  .contact-form textarea { min-height: 102px; }
}



/* ===== Combo Jackpot — marca textual limpa ===== */
.combo-jackpot-logo {
  display:flex; align-items:baseline; gap:.28em; width:auto; height:auto;
  font-weight:950; letter-spacing:-.04em; white-space:nowrap; line-height:1;
}
.combo-jackpot-logo span { color:#f7fbff; }
.combo-jackpot-logo strong { color:#ffe34f; text-shadow:0 0 16px rgba(255,218,50,.24); }
.solo-logo.combo-jackpot-logo { width:auto; max-width:none; height:auto; max-height:none; font-size:clamp(18px,3vw,28px); filter:none; }
.login-logo.combo-jackpot-logo {
  position:static; left:auto; transform:none; justify-content:center; width:100%; max-width:none; height:auto; max-height:none; margin:0 auto 8px; font-size:32px; filter:none;
}
.solo-footer-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }


.logo-banner {
  display:block;
  width:min(100%, 520px);
  height:auto;
  object-fit:contain;
  object-position:left top;
  filter:drop-shadow(0 8px 24px rgba(49, 19, 111, .24));
}
.solo-logo.logo-banner {
  width:min(100%, 310px);
  margin:0;
  justify-self:start;
  align-self:start;
}
.login-logo.logo-banner {
  width:min(100%, 420px);
  margin:0 auto 8px;
}
.solo-footer-links,
.login-legal-links {
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px 16px;
  margin:8px 0 0;
}
.solo-footer-links a,
.login-legal-links a {
  color:#9fd4ff;
  text-decoration:none;
  font-size:12px;
}
.solo-footer-links a:hover,
.login-legal-links a:hover {
  color:#ffffff;
  text-decoration:underline;
}
.login-legal-links {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}


@media (max-width: 560px) {
  .solo-logo.logo-banner { width:min(100%, 250px); }
  .solo-topbar { align-items:start; }
  .solo-scores { gap:5px; align-self:start; }
}
@media (min-width: 900px) {
  .solo-logo.logo-banner { width:min(100%, 340px); }
}


/* ===== Combo Jackpot v1.5 — layout final do jogo ===== */
:root {
  --game-head-h: 40px;
  --solo-board-size: min(calc(100vw - 16px), calc(100dvh - 250px), 720px);
}

/* O jogo já não tem rodapé: topbar, tabuleiro, peças, prémio e controlos. */
.solo-app {
  grid-template-rows: var(--game-head-h) var(--solo-board-size) auto auto auto;
  row-gap: 6px;
  align-content: start;
  padding-top: max(4px, env(safe-area-inset-top));
}

.solo-topbar,
.solo-board-zone,
.piece-tray,
.solo-controls {
  width: var(--solo-board-size);
}

/* Logo e caixas de pontuação têm exatamente a mesma altura. */
.solo-topbar {
  height: var(--game-head-h);
  min-height: var(--game-head-h);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  overflow: visible;
}

.solo-logo.logo-banner {
  display: block;
  width: auto;
  height: var(--game-head-h);
  max-width: 44%;
  margin: 0;
  object-fit: contain;
  object-position: left center;
  align-self: stretch;
  justify-self: auto;
}

.solo-scores {
  height: var(--game-head-h);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.solo-score-card {
  height: var(--game-head-h);
  min-height: var(--game-head-h);
  min-width: 76px;
  padding: 3px 9px;
}

.solo-board-zone {
  margin: 0;
  overflow: visible;
}

.solo-board-zone,
.game-shell {
  width: var(--solo-board-size);
  height: var(--solo-board-size);
  min-height: var(--solo-board-size);
  max-height: var(--solo-board-size);
}

/* O rodapé completo pertence ao index/login, não ao ecrã de jogo. */
.login-footer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.login-copyright {
  margin: 10px 0 0;
  text-align: center;
  color: #8f9db8;
  font-size: 11px;
}

@media (max-width: 560px) {
  :root {
    --game-head-h: 36px;
    --solo-board-size: min(calc(100vw - 16px), calc(100dvh - 236px), 720px);
  }
  .solo-app {
    padding-left: 8px;
    padding-right: 8px;
    row-gap: 5px;
  }
  .solo-logo.logo-banner {
    width: auto;
    height: var(--game-head-h);
    max-width: 39%;
  }
  .solo-scores {
    height: var(--game-head-h);
    gap: 5px;
  }
  .solo-score-card {
    height: var(--game-head-h);
    min-height: var(--game-head-h);
    min-width: 62px;
    padding: 2px 6px;
  }
  .solo-score-card span { font-size: 8px; }
  .solo-score-card strong { font-size: 15px; }
}

@media (min-width: 900px) {
  :root {
    --game-head-h: 50px;
    --solo-board-size: min(720px, calc(100vw - 36px), calc(100dvh - 300px));
  }
  .solo-app {
    width: min(100%, 780px);
    padding-inline: 18px;
    row-gap: 7px;
  }
  .solo-logo.logo-banner {
    width: auto;
    height: var(--game-head-h);
    max-width: 42%;
  }
  .solo-scores {
    height: var(--game-head-h);
    gap: 7px;
  }
  .solo-score-card {
    height: var(--game-head-h);
    min-height: var(--game-head-h);
    min-width: 112px;
    padding: 5px 12px;
  }
  .solo-score-card span { font-size: 11px; }
  .solo-score-card strong { font-size: 21px; }
}

/* Telemóvel deitado: tabuleiro à esquerda; toda a UI de jogo à direita. */
@media (orientation: landscape) and (max-height: 600px) {
  :root {
    --game-head-h: 36px;
    --solo-board-size: min(calc(100dvh - 12px), calc(55vw - 14px));
  }
  .solo-app {
    width: 100%;
    max-width: none;
    padding: 6px 8px;
    grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr);
    grid-template-rows: var(--game-head-h) minmax(0, 1fr) auto auto;
    column-gap: 10px;
    row-gap: 5px;
    align-content: stretch;
    justify-items: stretch;
  }
  .solo-board-zone {
    grid-column: 1;
    grid-row: 1 / 5;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    place-items: center;
  }
  .game-shell {
    width: var(--solo-board-size);
    height: var(--solo-board-size);
    min-height: var(--solo-board-size);
    max-height: var(--solo-board-size);
    justify-self: center;
  }
  .solo-topbar {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    height: var(--game-head-h);
    min-height: var(--game-head-h);
  }
  .piece-tray {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    height: min(112px, 30dvh);
    align-self: center;
  }
  .monthly-prize-compact {
    grid-column: 2;
    grid-row: 3;
    width: 100%;
    margin: 0;
  }
  .solo-controls {
    grid-column: 2;
    grid-row: 4;
    width: 100%;
  }
}


/* ===== Combo Jackpot v1.6 — patrocínio no jogo + prémio compacto no index ===== */
:root {
  --solo-board-size: min(calc(100vw - 16px), calc(100dvh - 292px), 720px);
}
.solo-app {
  grid-template-rows: var(--game-head-h) var(--solo-board-size) auto auto auto auto;
  row-gap: 5px;
}
.solo-footer--game {
  width: var(--solo-board-size);
  display: block;
  margin: 0;
  padding: 0;
  position: static;
  inset: auto;
  z-index: auto;
}
.solo-footer--game .solo-footer-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 7px;
}
.solo-footer--game .footer-action-button {
  min-height: 32px;
  padding: 4px 9px;
  font-size: 11px;
  border-radius: 9px;
}

.login-card {
  scrollbar-width: none;
}
.login-card::-webkit-scrollbar { width: 0; height: 0; display: none; }

@media (max-width: 560px) {
  :root {
    --solo-board-size: min(calc(100vw - 16px), calc(100dvh - 270px), 720px);
  }
  .solo-footer--game .footer-action-button {
    min-height: 30px;
    font-size: 10.5px;
  }
}

@media (max-height: 700px) {
  .login-card {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .login-logo.logo-banner { margin-bottom: 4px; }
  .login-card > p { margin: 4px 0 6px; line-height: 1.25; }
  .login-footer-actions { margin-top: 8px; }
  .login-legal-links { margin-top: 7px; padding-top: 6px; }
  .login-copyright { margin-top: 6px; }
}

/* Landscape baixo: tabuleiro à esquerda, todos os controlos à direita, sem sobreposição. */
@media (orientation: landscape) and (max-height: 600px) {
  :root {
    --solo-board-size: min(calc(100dvh - 12px), calc(55vw - 14px));
  }
  .solo-app {
    width: 100%;
    max-width: none;
    padding: 6px 8px;
    display: grid;
    grid-template-columns: minmax(0,1.08fr) minmax(280px,.92fr);
    grid-template-rows: auto auto auto auto auto;
    column-gap: 10px;
    row-gap: 5px;
    align-content: center;
    justify-items: stretch;
  }
  .solo-board-zone {
    grid-column: 1;
    grid-row: 1 / 6;
    width: 100%;
    height: 100%;
    min-height: 0;
    place-items: center;
  }
  .game-shell {
    width: var(--solo-board-size);
    height: var(--solo-board-size);
    min-height: var(--solo-board-size);
    max-height: var(--solo-board-size);
    justify-self: center;
  }
  .solo-topbar { grid-column: 2; grid-row: 1; width:100%; }
  .piece-tray { grid-column: 2; grid-row: 2; width:100%; height:min(90px,22dvh); min-height:60px; }
  .monthly-prize-compact { grid-column:2; grid-row:3; width:100%; margin:0; }
  .solo-controls { grid-column:2; grid-row:4; width:100%; }
  .solo-footer--game {
    grid-column:2;
    grid-row:5;
    width:100%;
    position:static;
    right:auto;
    bottom:auto;
  }
}

/* ===== Combo Jackpot v1.8 — desktop: tabuleiro com altura segura ===== */
@media (min-width: 900px) and (min-height: 601px) {
  :root {
    /* Reserva espaço real para: cabeçalho, 3 peças, controlos e Contacto. */
    --solo-board-size: min(680px, calc(100vw - 48px), calc(100dvh - 335px));
  }
  .solo-app {
    align-content: start;
    padding-top: max(4px, env(safe-area-inset-top));
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    row-gap: 5px;
  }
}


/* ===== Combo Jackpot v2.0 — nome secreto ===== */
.secret-label-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.secret-label-row label { min-width:0; }
.secret-help-button {
  flex:0 0 auto;
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid rgba(104,146,255,.46);
  border-radius:50%;
  background:rgba(22,34,75,.92);
  color:#aee4ff;
  font-weight:950;
  line-height:1;
  cursor:pointer;
}
.secret-help-button:hover,
.secret-help-button:focus-visible {
  border-color:#67d3ff;
  color:#fff;
  outline:none;
  box-shadow:0 0 0 3px rgba(75,178,255,.13);
}
.secret-help-backdrop {
  position:fixed;
  inset:0;
  z-index:2100;
  background:rgba(1,4,14,.78);
  backdrop-filter:blur(7px);
}
.secret-help-backdrop[hidden],
.secret-help-dialog[hidden] { display:none !important; }
.secret-help-dialog {
  position:fixed;
  z-index:2110;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(92vw,470px);
  max-height:min(88dvh,680px);
  overflow:auto;
  padding:18px;
  border:1px solid rgba(105,132,255,.42);
  border-radius:20px;
  background:linear-gradient(180deg,#111936,#080d21);
  box-shadow:0 28px 90px rgba(0,0,0,.58);
}
.secret-help-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.secret-help-header h2 { margin:0; font-size:21px; }
.secret-help-close {
  width:36px;
  height:36px;
  border:0;
  border-radius:11px;
  background:#202844;
  color:#fff;
  font-size:25px;
  cursor:pointer;
}
.secret-help-dialog p {
  margin:11px 0 0;
  color:#d6e0ef;
  font-size:13px;
  line-height:1.5;
}
.secret-help-examples {
  display:grid;
  gap:7px;
  margin:13px 0 3px;
}
.secret-help-examples > div {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:9px 11px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:11px;
  background:#080f25;
}
.secret-help-examples code {
  color:#fff;
  font-size:14px;
  font-weight:850;
}
.secret-example-bad { color:#ff8aa3; }
.secret-example-good { color:#83efae; }
.secret-help-warning {
  color:#ffe58a !important;
  font-weight:750;
}
.secret-help-ok {
  width:100%;
  min-height:46px;
  margin-top:15px;
  font-size:17px;
}
@media (max-width:560px) {
  .secret-help-dialog { padding:16px; }
  .secret-help-header h2 { font-size:19px; }
  .secret-help-dialog p { font-size:12px; }
}

/* v2.2 — ajuda do nome secreto independente do login/jogo */
.secret-help-backdrop { z-index: 5000; }
.secret-help-dialog { z-index: 5010; }
html.secret-help-open { overflow: hidden; }


/* ===== Combo Jackpot continuous ranking 20260816-continuous30 ===== */
.solo-controls--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.solo-controls--compact .utility-button { min-height: 46px; }
.solo-footer--game .solo-footer-actions { grid-template-columns: 1fr; }
.solo-footer--game .footer-contact-button { width: 100%; }

:root { --solo-board-size: min(calc(100vw - 16px), calc(100dvh - 222px), 720px); }
.solo-app { grid-template-rows: var(--game-head-h) var(--solo-board-size) auto auto auto; }

@media (max-width: 560px) {
  :root { --solo-board-size: min(calc(100vw - 16px), calc(100dvh - 205px), 720px); }
  .solo-controls--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
}

@media (orientation: landscape) and (max-height: 600px) {
  .solo-app { grid-template-rows: auto auto auto auto; }
  .solo-board-zone { grid-row: 1 / 5; }
  .solo-topbar { grid-column: 2; grid-row: 1; }
  .piece-tray { grid-column: 2; grid-row: 2; }
  .solo-controls { grid-column: 2; grid-row: 3; }
  .solo-footer--game { grid-column: 2; grid-row: 4; }
}

@media (min-width: 900px) and (min-height: 601px) {
  :root { --solo-board-size: min(700px, calc(100vw - 48px), calc(100dvh - 265px)); }
}

/* ===== Combo Jackpot v3.1 — mobile: ações no fundo + espaço entre tabuleiro e peças ===== */
@media (max-width: 560px) and (orientation: portrait) {
  .solo-app {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: var(--game-head-h) var(--solo-board-size) auto minmax(8px, 1fr) auto;
    column-gap: 6px;
    row-gap: 4px;
    align-content: stretch;
  }

  .solo-topbar {
    grid-column: 1 / -1;
    grid-row: 1;
    width: var(--solo-board-size);
    justify-self: center;
  }

  .solo-board-zone {
    grid-column: 1 / -1;
    grid-row: 2;
    width: var(--solo-board-size);
    justify-self: center;
  }

  .piece-tray {
    grid-column: 1 / -1;
    grid-row: 3;
    width: var(--solo-board-size);
    justify-self: center;
    margin-top: 6px;
  }

  /* Histórico + Opções ocupam os dois primeiros terços da barra inferior. */
  .solo-controls.solo-controls--compact {
    grid-column: 1 / 3;
    grid-row: 5;
    width: 100%;
    align-self: end;
    gap: 6px;
    margin: 0;
  }

  /* Contacto fica alinhado na mesma barra, no terceiro terço. */
  .solo-footer--game {
    grid-column: 3;
    grid-row: 5;
    width: 100%;
    align-self: end;
    margin: 0;
  }

  .solo-controls--compact .utility-button,
  .solo-footer--game .footer-action-button {
    height: 42px;
    min-height: 42px;
    border-radius: 10px;
  }

  .solo-controls--compact .utility-button svg {
    width: 24px;
    height: 24px;
  }

  .solo-footer--game .solo-footer-actions {
    height: 42px;
  }
}


/* ===== Combo Jackpot v4.0 — entrada imediata + nome apenas no recorde ===== */
.record-name-overlay {
  position: fixed;
  inset: 0;
  z-index: 5200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 8, 20, .84);
  backdrop-filter: blur(9px);
}
.record-name-overlay[hidden] { display: none !important; }
.record-name-card {
  width: min(92vw, 420px);
  border: 1px solid rgba(112, 205, 255, .34);
  border-radius: 22px;
  padding: 22px;
  color: #f7fbff;
  background: linear-gradient(180deg, rgba(21, 31, 58, .98), rgba(9, 15, 34, .98));
  box-shadow: 0 24px 70px rgba(0,0,0,.46), 0 0 34px rgba(31, 181, 255, .10);
}
.record-name-kicker {
  display: inline-flex;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #f9d75d;
}
.record-name-card h2 { margin: 0 0 8px; font-size: 27px; }
.record-name-card > p { margin: 0 0 16px; color: #cbd6ef; line-height: 1.45; }
.record-name-card form { display: grid; gap: 10px; }
.record-name-card label { font-weight: 850; color: #eef6ff; }
.record-name-card input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(150, 190, 255, .34);
  border-radius: 13px;
  padding: 0 14px;
  font: inherit;
  color: #fff;
  background: rgba(5, 11, 28, .78);
  outline: none;
}
.record-name-card input:focus { border-color: #5dccff; box-shadow: 0 0 0 3px rgba(93,204,255,.13); }
.record-name-card small { color: #9eadca; line-height: 1.35; }
.record-name-card .primary-button { width: 100%; margin-top: 3px; }
.record-name-error { min-height: 18px; margin: 0; color: #ff9bad; font-size: 13px; font-weight: 750; }
@media (max-width: 520px) {
  .record-name-overlay { padding: 12px; }
  .record-name-card { padding: 18px; border-radius: 18px; }
  .record-name-card h2 { font-size: 24px; }
}
