/* Play immediately on the homepage; shared game pages keep their own layout. */
body.homepage {
  --felt-1: #52873b;
  --felt-2: #346429;
  --gold: #f0dfa0;
  --ink: #fffdf4;
  background: radial-gradient(ellipse at 42% 12%, #52873b 0%, #427930 45%, #346429 100%);
  background-attachment: fixed;
}
.home-game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  height: calc(100vh - var(--home-consent-space, 0px));
  height: calc(100dvh - var(--home-consent-space, 0px));
  min-height: 360px;
  isolation: isolate;
}
.home-game-layout .home-play {
  height: 100%; min-height: 0; min-width: 0; padding: 0;
}
.home-game-layout .home-game-header {
  flex-wrap: nowrap; min-height: 48px; gap: 12px; padding: 7px 18px;
  background: transparent; border: 0; backdrop-filter: none; z-index: 30;
}
.home-game-header .brand {font-size: 18px; letter-spacing: -.3px;}
.home-game-header .brand-logo {width: 26px; height: 27px; margin-right: 7px;}
.home-game-header .brand-accent {color: #fffdf4;}
.home-game-header .draw-toggle {flex: none; border: 1px solid #ffffff30; border-radius: 6px; background: #ffffff12;}
.home-game-header .toggle-btn {min-height: 32px; padding: 0 12px; font: 650 12px system-ui; color: #fff;}
.home-game-header .toggle-btn.active {background: #f4f7e9; color: #345429; box-shadow: none;}
.home-game-header .hud {gap: 13px; margin-left: auto; flex: none;}
.home-game-header .hud-item {display: flex; flex-direction: row; min-width: 0; gap: 4px;}
.home-game-header .hud-label {font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; opacity: .85;}
.home-game-header .hud-value {font-size: 12px;}
.home-game-menu, .home-more-menu {position: relative; flex: none;}
.home-game-menu summary, .home-more-menu summary {list-style: none; cursor: pointer;}
.home-game-menu summary::-webkit-details-marker, .home-more-menu summary::-webkit-details-marker {display: none;}
.home-game-menu summary {display: flex; align-items: center; gap: 9px; min-height: 32px; padding: 0 11px; border-radius: 6px; background: #ffffff24; font-size: 12px; font-weight: 650; white-space: nowrap;}
.home-game-menu summary:hover {background: #ffffff36;}
.home-game-menu nav, .home-more-panel {
  position: absolute; z-index: 50; min-width: 230px; padding: 7px;
  border-radius: 10px; background: #fafbf2; color: #284622;
  border: 1px solid #d4dfc7; box-shadow: 0 12px 40px #17331550;
}
.home-game-menu nav {top: calc(100% + 9px); left: 0;}
.home-game-menu:not([open]) nav, .home-more-menu:not([open]) .home-more-panel {display: none;}
body.homepage .home-game-layout a:any-link {color: inherit; font-weight: inherit; text-decoration: none;}
.home-game-menu nav a, .home-more-panel a {display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 11px; border-radius: 5px; font-size: 13px;}
.home-game-menu nav a:hover, .home-more-panel a:hover {background: #e5ecd9;}
.home-game-menu nav a[aria-current] {background: #e8efd9; font-weight: 700;}
.home-game-menu nav a span {font-size: 10px; opacity: .7;}
.home-game-menu nav .home-menu-all {border-top: 1px solid #dce4d2; margin-top: 5px; padding-top: 13px; font-weight: 700;}
.home-game-layout #board {
  width: min(100%, calc((100dvh - var(--home-consent-space, 0px) - 120px) * 1.65));
  max-width: 1400px; min-height: 0; margin: 0 auto;
}
.home-game-layout .stock-ph, .home-game-layout #ph-waste, .home-game-layout .foundation-ph {
  background: #ffffff21; border: 1px solid #ffffff0a; box-shadow: inset 0 1px 0 #ffffff08;
  border-radius: 7px;
}
.home-game-layout .foundation-ph .suit-mark {fill: #eef4de; opacity: .3; filter: none;}
.home-game-layout .placeholder[id^="ph-t"] {border-color: transparent; background: transparent;}
.home-game-layout .card-face {border-radius: 6px;}
.home-game-layout .home-toolbar {
  display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 18px 13px; z-index: 25;
}
.home-toolbar .controls, .home-secondary-controls {display: flex; align-items: center; flex-wrap: nowrap; gap: 7px; margin: 0;}
.home-toolbar .ctl-btn, .home-toolbar .play-foot-action, .home-toolbar .home-more-menu summary {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: auto; min-width: 0; min-height: 36px; height: auto; padding: 0 12px;
  background: #f9fbf0; color: #35532c; border: 1px solid #e7eddc; border-radius: 6px;
  box-shadow: 0 1px 2px #21481930; font: 650 12px/1.2 system-ui; text-decoration: none;
  white-space: nowrap; cursor: pointer; letter-spacing: 0;
}
.home-toolbar #btn-autoplay {order: 4; min-width: 0; background: #dcebbf; color: #35532c; border-color: #dcebbf;}
.home-toolbar #btn-new {font-weight: 750;}
.home-toolbar .ctl-btn:hover, .home-toolbar .play-foot-action:hover, .home-toolbar .home-more-menu summary:hover {background: #e8f0d9; color: #253f1e; transform: none;}
.home-toolbar .ctl-btn:active, .home-toolbar .play-foot-action:active {transform: translateY(1px);}
.home-toolbar .control-icon, .home-toolbar .play-foot-action svg, .home-toolbar summary svg {width: 16px; height: 16px; flex: none;}
.home-toolbar summary svg {fill: currentColor;}
.home-toolbar .home-secondary-controls .button-wide {display: none;}
.home-toolbar .home-secondary-controls .button-short {display: inline;}
.home-toolbar .bookmark-entry {order: -2;}
.home-toolbar .daily-entry {order: -1;}
.home-more-panel {right: 0; bottom: calc(100% + 10px);}
.home-more-panel .ctl-btn {display: flex; justify-content: flex-start; width: 100%; border: 0; padding: 10px 11px; box-shadow: none; background: transparent; font-size: 13px;}
.home-more-panel .ctl-btn.muted {opacity: 1;}
.home-game-layout :is(button, a, summary):focus-visible {outline: 3px solid #ffdf7a; outline-offset: 3px;}
.home-game-layout .autoplay-status {position: absolute; left: 50%; bottom: 65px; transform: translateX(-50%); width: max-content; max-width: 90%; z-index: 20; pointer-events: none;}
.home-game-layout .home-daily-anchor {display: none;}
.home-ad-rail {display: flex; flex-direction: column; gap: 10px; padding: 8px 10px 12px; min-height: 0; background: #244c1c28; border-left: 1px solid #ffffff0a;}
.home-daily-slot {min-height: 32px; flex: none;}
.home-daily-slot .daily-entry {width: 100%; min-height: 32px; padding: 0 8px; gap: 7px; border: 1px solid #a6c87b35; border-radius: 6px; background: #80ad5266; color: #fff; box-shadow: none; font-size: 12px;}
.home-daily-slot .daily-entry:hover {background: #8ebf5c80; transform: none;}
.home-daily-slot .daily-entry svg {width: 15px; height: 15px;}
.home-ad-slot {width: 300px; flex: none; text-align: center;}
.home-ad-slot > span {display: block; padding: 4px 0 7px; color: #d5e5c1; font: 500 9px/1 system-ui; letter-spacing: 1.7px; text-transform: uppercase;}
.home-ad-placement {width: 300px; height: 250px; background: #ffffff07; border: 1px solid #ffffff0c; border-radius: 2px;}
.home-ad-small {margin-top: auto;}
.home-ad-small .home-ad-placement {height: 100px;}
.homepage .site-header {background: #284f252e; border-top: 1px solid #ffffff1c; backdrop-filter: none;}
.homepage .home-intro {padding-top: 24px;}
.homepage .community-home {background: #234d252e;}
.homepage .home-noscript {position: absolute; top: 80px; left: 10%; width: 80%; background: #f7faed; color: #284622; padding: 20px; border-radius: 8px; text-align: center;}
@media (max-width: 1250px) and (min-width: 1100px) {
  .home-game-header .brand-accent {display: none;}
  .home-game-header .hud {gap: 8px;}
  .home-game-layout .home-game-header {gap: 9px; padding-inline: 12px;}
  .home-toolbar .ctl-btn, .home-toolbar .play-foot-action, .home-toolbar .home-more-menu summary {padding-inline: 9px;}
}
@media (min-width: 1100px) and (max-height: 760px) {
  .home-ad-small {display: none;}
  .home-ad-rail {overflow-y: auto;}
}
@media (max-width: 1099px) {
  .home-game-layout {height: auto; min-height: 0; grid-template-columns: minmax(0, 1fr);}
  .home-game-layout .home-play {height: calc(100vh - var(--home-consent-space, 0px)); height: calc(100dvh - var(--home-consent-space, 0px)); min-height: 290px;}
  .home-ad-rail {align-items: center; padding: 18px 12px; border: 0; border-block: 1px solid #ffffff12;}
  .home-ad-rail .home-daily-slot, .home-ad-slot:not(:nth-child(2)) {display: none;}
}
@media (max-width: 700px) {
  .home-game-layout .home-game-header {display: grid; grid-template-columns: auto auto auto; justify-content: space-between; gap: 4px 8px; padding: 6px 12px 2px; min-height: 76px;}
  .home-game-header .brand {font-size: 17px;}
  .home-game-header .brand-logo {display: block; width: 24px; height: 25px; margin-right: 5px;}
  .home-game-header .brand-accent {display: none;}
  .home-game-header .toggle-btn {min-height: 38px; padding-inline: 11px; font-size: 12px;}
  .home-game-menu summary {min-height: 38px; padding-inline: 9px;}
  .home-game-menu nav {left: auto; right: 0;}
  .home-game-header .hud {grid-column: 1 / -1; justify-content: center; gap: 22px; margin: 0; padding: 4px 0 2px;}
  .home-game-header .hud-label, .home-game-header .hud-value {font-size: 11px;}
  .home-game-layout .home-toolbar {flex-wrap: wrap; justify-content: center; gap: 7px; padding: 8px 9px max(10px, env(safe-area-inset-bottom));}
  .home-toolbar .controls {width: 100%; justify-content: center; gap: 6px;}
  .home-toolbar .ctl-btn, .home-toolbar .play-foot-action, .home-toolbar .home-more-menu summary {min-height: 42px; padding: 0 12px; font-size: 12px;}
  .home-toolbar .controls .ctl-btn {flex: 1 1 0; padding-inline: 5px; gap: 5px;}
  .home-toolbar .home-secondary-controls {width: 100%; justify-content: center;}
  .home-game-layout #board {width: min(100%, calc((100dvh - var(--home-consent-space, 0px) - 190px) * 1.65));}
  .home-game-layout .autoplay-status {bottom: 108px;}
}
@media (max-width: 360px) {
  .home-game-layout .home-game-header {padding-inline: 8px; gap: 4px;}
  .home-game-header .brand {font-size: 15px;}
  .home-game-header .toggle-btn {padding-inline: 8px;}
  .home-game-menu summary {font-size: 11px; padding-inline: 7px; gap: 5px;}
  .home-toolbar .controls .control-icon {display: none;}
}
@media (max-height: 480px) and (orientation: landscape) {
  .home-game-layout .home-game-header {display: flex; min-height: 40px; padding: 4px 12px;}
  .home-game-header .brand-accent {display: none;}
  .home-game-header .hud {margin-left: auto; gap: 8px;}
  .home-game-header .hud-item:first-child {display: none;}
  .home-game-layout .home-toolbar {flex-wrap: nowrap; padding: 5px 10px; gap: 8px;}
  .home-toolbar .controls, .home-toolbar .home-secondary-controls {width: auto; gap: 5px;}
  .home-toolbar .ctl-btn, .home-toolbar .play-foot-action, .home-toolbar .home-more-menu summary {min-height: 34px; padding-inline: 8px; font-size: 11px;}
  .home-toolbar .bookmark-entry {display: none;}
  .home-game-layout #board {width: min(100%, calc((100dvh - var(--home-consent-space, 0px) - 100px) * 1.65));}
}
/* Preserve the back's 3D rotation while the initial deal animates in. */
.home-game-layout .card.dealt:not(.faceup) .card-inner {animation-name: home-deal-back;}
@keyframes home-deal-back {
  from {opacity: .4; transform: translateY(-14px) scale(.94) rotateY(180deg);}
  to {opacity: 1; transform: rotateY(180deg);}
}
@media (prefers-reduced-motion: reduce) {
  .home-game-layout .card.dealt .card-inner {animation: none;}
}
body.homepage .home-game-layout a.brand {font-weight: 750;}
@media (max-width: 700px) {
  .home-toolbar .controls #btn-new {flex-grow: 1.3;}
  .home-toolbar .controls #btn-autoplay {flex-grow: 1.15;}
}
/* Keep raised/dragged cards beneath the header and toolbar menus. */
.home-game-layout #board {z-index: 1;}

/* Site navigation belongs at the end of the page, below the game and guides. */
.homepage .site-footer {
  padding: 42px 5vw 26px; margin-top: 40px; opacity: 1;
  background: #234b2447; border-top: 1px solid #ffffff20;
}
.home-footer-heading {
  max-width: 1100px; margin: 0 auto 30px; padding-bottom: 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  border-bottom: 1px solid #ffffff18; text-align: left;
}
body.homepage .site-footer .home-footer-brand {
  display: inline-flex; align-items: center; gap: 10px; font-size: 22px;
  font-weight: 750; color: #fffdf4; text-decoration: none; letter-spacing: -.4px;
}
.home-footer-brand img {display: block; flex: none;}
.homepage .site-footer .home-footer-description {margin: 9px 0 0; font-size: 12px; color: #d9e6cf;}
body.homepage .site-footer .home-footer-play {
  display: inline-flex; align-items: center; gap: 20px; flex: none;
  min-height: 42px; padding: 0 17px; border: 1px solid #e8eedb; border-radius: 7px;
  background: #f7faed; color: #35532c; font-size: 13px; font-weight: 700; text-decoration: none;
}
.home-footer-play span {font-size: 19px; font-weight: 500;}
body.homepage .site-footer .home-footer-play:hover {background: #e7f0d8;}
.homepage .site-footer .footer-games {max-width: 1100px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; margin-bottom: 28px;}
.homepage .site-footer .footer-col h4 {font-size: 11px; letter-spacing: 1.3px; color: #cbdcbd; margin-bottom: 14px;}
.homepage .site-footer .footer-col li {margin-bottom: 9px;}
body.homepage .site-footer .footer-col a:any-link {font-size: 13px; font-weight: 500; color: #f0f5e7; line-height: 1.55;}
body.homepage .site-footer .footer-col a:hover {color: #fff; text-decoration: underline;}
.home-footer-utilities {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  max-width: 1100px; margin: 0 auto 24px; padding-top: 22px; border-top: 1px solid #ffffff18;
}
.home-footer-utilities .community-tools {width: auto; gap: 22px; flex-wrap: nowrap; text-align: left; font-size: 13px;}
.home-footer-utilities .community-tools [data-account-link] {display: inline-flex; align-items: center; min-height: 38px; padding: 7px 13px; border-color: #ffffff30;}
.home-footer-utilities .language-menu {font-size: 12px;}
.home-footer-utilities .language-menu ul {position: absolute; top: auto; bottom: calc(100% + 8px); right: 0; background: #264e27; border-color: #ffffff30; text-align: left;}
.homepage .site-footer .footer-share {margin-top: 10px;}
.homepage .site-footer .copyright {font-size: 11px; color: #c5d8ba; opacity: 1;}
.homepage .site-footer :is(a, summary):focus-visible {outline: 3px solid #ffdf7a; outline-offset: 4px;}
@media (max-width: 700px) {
  .homepage .site-footer {padding: 30px 22px 22px;}
  .home-footer-heading {align-items: flex-start; flex-direction: column; gap: 18px; padding-bottom: 24px;}
  body.homepage .site-footer .home-footer-brand {font-size: 21px;}
  .homepage .site-footer .footer-games {grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 22px;}
  .home-footer-utilities {flex-wrap: wrap; gap: 16px;}
  .home-footer-utilities .community-tools {gap: 14px; max-width: 100%;}
  .home-footer-utilities .community-tools [data-account-link] {max-width: 160px;}
  .home-footer-utilities .language-menu {margin-left: auto;}
}

/* A little more breathing room around the homepage's seven columns. */
body.homepage .home-game-layout #board {
  width:min(90%,calc((100dvh - var(--home-consent-space,0px) - 120px) * 1.485));
  max-width:1260px;
}
@media(max-width:700px){
  body.homepage .home-game-layout #board {width:min(90%,calc((100dvh - var(--home-consent-space,0px) - 190px) * 1.485));}
}
@media(max-height:480px) and (orientation:landscape){
  body.homepage .home-game-layout #board {width:min(90%,calc((100dvh - var(--home-consent-space,0px) - 100px) * 1.485));}
}
