/* Gin Rummy phone styles (phones, portrait tablets, and landscape touch tablets). Loaded after the desktop sheet.
   Self-contained: it does not need style.css or style_mobile.css. Colors follow the other mobile sheet. */
html { overflow-y: scroll; -webkit-text-size-adjust: 100%; }
body { font-family: system-ui, sans-serif; background: linear-gradient(lightblue, white); background-attachment: fixed; margin: 0; color: #fff; -webkit-tap-highlight-color: transparent; }
#game { width: 100%; max-width: none; margin: 0 auto; padding: 0; text-align: center; box-sizing: border-box; }
#game-line { display: none; }
h1 { font-family: 'Bagel Fat One'; font-size: 1.7em; margin: 14px 0 8px; line-height: 1; }
img { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
button, #table { touch-action: manipulation; }

/* scores: white chips like .mobile-score-box */
#scores { display: flex; justify-content: center; gap: 6px; margin: 0 6px 6px; padding: 5px 6px; border-radius: 8px; font-size: .9rem; }
#scores .score-box { width: auto; color: #000; background: #fff; border-radius: 4px; padding: 3px 9px; }

.modal-button { min-height: 44px; }
.about { width: 92%; margin: 8px auto 0; color: #000; font-size: 1em; text-align: left; }
.about h2 { font-family: 'Bagel Fat One'; color: #228B22; display: block; text-align: center; }
.footer { margin: 0 auto; color: #000; width: 100%; text-align: center; padding-bottom: 10px; }
.footer h5 { margin: 0 auto; font-family: courier; color: #000; font-size: 1em; }
#result-card { width: 92vw; max-width: 460px; box-sizing: border-box; padding: 12px; }

/* hamburger + flyout menu (same as the other mobile sheet) */
#menu-toggle { display: none; }
.hamburger { display: flex; flex-direction: column; justify-content: space-between; width: 40px; height: 21px; cursor: pointer; gap: 5px; position: fixed; top: 20px; left: 20px; z-index: 2015; }
.hamburger span { display: block; height: 12px; width: 100%; background-color: white; border-radius: 3px; transition: all .1s linear; }
#menu-toggle:checked + .hamburger span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
#menu-toggle:checked + .hamburger span:nth-child(2) { opacity: 0; transform: translateX(-20px); }
#menu-toggle:checked + .hamburger span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
.flyout-nav { display: block; position: fixed; top: 0; left: -100%; width: 100%; height: 100%; background: darkgreen; transition: left .1s cubic-bezier(.77, 0, .175, 1); z-index: 2011; padding-top: 80px; overflow-y: auto; box-sizing: border-box; }
#menu-toggle:checked ~ .flyout-nav { left: 0; }
.flyout-nav ul { list-style: none; padding: 0; margin: 0; }
.flyout-nav ul li { text-align: center; }
.flyout-nav a { display: block; padding: 10px 40px; color: white; text-decoration: none; transition: background .1s; }
.flyout-nav a:hover { background: #333; }
.flyout-nav h1 { font-size: 1.6rem; margin: 0; }
.overlay { display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.2); opacity: 0; visibility: hidden; transition: .1s; z-index: 2010; }
#menu-toggle:checked ~ .overlay { opacity: 1; visibility: visible; }

/* phones held sideways: ask for portrait */
@media (orientation: landscape) and (max-height: 500px) {
  #game::before { content: 'Please rotate your phone to portrait to play'; display: block; padding: 8px; color: #000; background: #ffe9a8; font-weight: bold; }
}

/* ---- Gin Rummy table: card size scales with the screen so 11 cards always fit ---- */
:root { --cw: min(100px, calc((100vw - 28px) / 5.4), calc((100vh - 250px) / 4)); --ch: calc(var(--cw) * 1.4615); }
#table { width: auto; margin: 0 6px; height: calc(100vh - 118px); height: calc(100dvh - 118px); min-height: 560px; max-height: 820px;
         border-radius: 26px; border-width: 3px; padding: 10px 0 64px; }
.gin-hand { min-height: calc(var(--ch) + 6px); padding-top: 0; }
.gin-hand img { width: var(--cw); height: var(--ch); margin-right: calc(var(--cw) * -.55); border-radius: 7px; }
.gin-hand img:last-child { margin-right: 0; }
#hand-1 { min-height: calc(var(--ch) * .72); }
#hand-1 img { width: calc(var(--cw) * .72); height: calc(var(--ch) * .72); margin-right: calc(var(--cw) * -.4); border-radius: 5px; }
.gin-hand img.pending, .gin-hand img.drawn { transform: translateY(-12px); }
.gin-hand img.pickable:hover { transform: none; filter: none; } /* no sticky hover on touch */
#stock, #discard, #stock img, #discard img { width: calc(var(--cw) * 1.15); height: calc(var(--ch) * 1.15); }
#piles { gap: 28px; }
#msg { font-size: .9rem; min-height: 2.6em; }
#knock-btn { left: 10px; bottom: 12px; padding: 0 16px; font-size: .95rem; }
#status-bar { right: 10px; bottom: 14px; font-size: .85rem; }
