/* Legacy source CSS and inline GIF decks live in /legacy-game/ (see provenance.json).
   This adapter only bridges semantic buttons, native dialogs and the current auth shell. */
.game-page { background: #0d7d59; color: #fff; }
.game-title { font: inherit; margin: 0; }
.game-shell { padding: 0; }

/* Legacy toolbar controls were divs: remove only native button chrome. */
button.game-button {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  height: auto;
  line-height: normal;
  text-align: left;
  overflow: visible;
  transition: none;
}
button.game-button:hover, button.game-button:active { background: transparent; }
#mainstack {
  padding: 0;
  min-height: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: url(/legacy-game/images/solitare/deck/deck-mainstack.png);
}
#mainstack:hover, #mainstack:active { background-color: transparent; }
.card, .card.game-draggable, .card.pointer-dragging, #mainstack { cursor: pointer; }

[hidden] { display: none !important; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.skip-link:focus { position: fixed; top: 0; left: 0; z-index: 1100; padding: 1rem; background: #363535; }
.staging-notice {
  position: fixed;
  left: 8px;
  bottom: 2px;
  margin: 0;
  color: rgba(255, 255, 255, .65);
  font-size: 10px;
  pointer-events: none;
  z-index: 1;
}
.noscript-notice { position: relative; padding: 1rem; }
#deal-load-error { position: relative; z-index: 1001; }

/* Keep the current auth mount, in the original top-right / mobile-bottom login slot. */
.user_menu_game { z-index: 901; }
.account > summary {
  display: inline-block;
  padding: 0 2em;
  height: 3.33em;
  line-height: calc(3.33em - 4px);
  border-radius: 5px;
  cursor: pointer;
  list-style: none;
  transition: all .3s;
}
.account > summary::-webkit-details-marker { display: none; }
.account > summary:hover { color: #444; }
.account-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100dvh - 80px);
  overflow: auto;
  padding: 1rem;
  background: #fff;
  color: #444;
  border-radius: 2px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, .2);
  line-height: normal;
  z-index: 1000;
}
.game-page .account-panel a, .game-page .portal-dialog a { color: #d43333; }
.account-panel .bubna-auth { font-family: Montserrat, sans-serif; font-size: 13px; padding: 0; }
.account-panel button { height: auto; }

/* Original popup_window geometry, not jQuery UI or the former portal redesign. */
dialog.portal-dialog, dialog.legacy-confirm, dialog#victory_info {
  position: fixed;
  inset: 0;
  transform: none;
  margin: auto;
  width: 500px;
  max-width: 90%;
  max-height: 90%;
  max-height: 90dvh;
  padding: 2rem 1rem;
  border: 0;
  border-radius: 20px;
  overflow: auto;
  background: #fff;
  color: #444;
  box-shadow: 0 15px 40px rgba(0, 0, 0, .5);
}
dialog.portal-dialog:not([open]), dialog.legacy-confirm:not([open]), dialog#victory_info:not([open]) { display: none !important; }
dialog.portal-dialog[open], dialog.legacy-confirm[open], dialog#victory_info[open] { display: block; }
dialog.portal-dialog::backdrop, dialog.legacy-confirm::backdrop { background: rgba(0, 0, 0, .5); }
dialog.legacy-rules { width: 800px; max-width: 100%; max-height: 100dvh; border-radius: 0; padding: 2rem; box-shadow: none; }
.portal-dialog h1, .portal-dialog h2 { padding-right: 2rem; }
.portal-dialog .dialog-close {
  border: 0;
  padding: 0;
  color: #444;
  line-height: 2em;
}
.portal-dialog .dialog-close:hover { background: #ccc; }
.portal-dialog :focus-visible, .legacy-confirm :focus-visible, .account-panel :focus-visible { outline-color: #d43333; }
.option { display: block; margin: 1rem 0; cursor: pointer; }
.option input { accent-color: #0d7d59; }
#sound-status:empty { margin: 0; }
.legacy-confirm-actions, .victory_buttons, .other-games-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.legacy-confirm-actions { margin-top: 2rem; }
.legacy-confirm button { background: #fff; color: #d43333; }
.legacy-confirm button:hover { background: #d43333; color: #fff; }
.victory-score { display: grid; grid-template-columns: 1fr auto; gap: .5rem; width: 83.333%; margin: 2rem auto; font-weight: 700; align-items: center; }
.victory-score dd { display: flex; align-items: center; justify-content: end; gap: .5rem; margin: 0; }
.victory-score img { height: auto; }

@media (max-width: 1000px) {
  .s-vh100 { height: 100dvh; }
  #global-content { min-height: 100dvh; }
  #info-block { visibility: hidden; }
  #info-block.mobile-menu-open { visibility: visible; left: 0; z-index: 900; }
  #info-block.mobile-menu-open ~ #menu_mobile { left: calc(220px - .75em); }
  #menu_mobile, #step_back_mobile {
    padding: 0;
    border: 0;
    height: 1.5em;
    overflow: visible;
  }
  #menu_mobile:hover, #step_back_mobile:hover { background: rgba(0, 0, 0, .2); }
  .account > summary { padding: 0; }
  .account-panel { position: fixed; top: auto; bottom: 4rem; right: 1rem; max-height: calc(100dvh - 5rem); }
  .staging-notice { left: 0; bottom: 0; width: 100%; max-width: none; text-align: center; font-size: 8px; }
}
:root:fullscreen { background: #0d7d59; overflow: auto; }
@media (prefers-reduced-motion: reduce) {
  .animated { transition-duration: 0s; }
  .score_anim, .score-div, .score-div-mobile { transition: none; }
}
