/* Gin Rummy styles. Loads AFTER style.css, but is self-sufficient so it also works
   when only style_mobile.css (or nothing) is loaded. */
.hidden { display: none !important; }

#table { position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: center;
         box-sizing: border-box; width: 900px; max-width: 100%; height: 640px; margin: 0 auto; padding: 22px 0 56px;
         background: #06661e; border: 4px solid darkorange; border-radius: 100px; box-shadow: inset 0 0 50px rgba(0,0,0,.5); }
.gin-area, .gin-middle { text-align: center; }
.gin-area .label { color: #fff; font-weight: bold; margin: 4px 0; }

/* cards: explicit sizes (65:95 ratio) so layout never depends on the SVG's intrinsic size */
.gin-hand { display: flex; justify-content: center; align-items: flex-end; min-height: 124px; padding-top: 16px; box-sizing: content-box; }
.gin-hand img { width: 85px; height: 124px; margin-right: -40px; position: relative; display: block; transition: transform .15s ease; border-radius: 9.5px; box-shadow: 1px 2px 2px rgba(60,60,60,.75); }
.gin-hand img:last-child { margin-right: 0; }
#hand-1 { min-height: 111px; padding-top: 0; }
#hand-1 img { width: 76px; height: 111px; margin-right: -44px; }
#hand-1 img:last-child { margin-right: 0; }

.gin-hand img.melded { outline: 3px solid var(--mc, gold); outline-offset: -3px; }
.gin-hand img.drawn { transform: translateY(-14px); filter: drop-shadow(0 0 6px #fff); }
.gin-hand img.pickable:hover { transform: translateY(-14px); cursor: pointer; z-index: 100; filter: drop-shadow(0 0 6px #f1c40f); }

#piles { display: flex; gap: 40px; justify-content: center; }
.pile .label { color: #fff; font-size: .85rem; margin-top: 4px; }
#stock, #discard { width: 85px; height: 124px; border: 2px dashed rgba(255,255,255,.3); border-radius: 9.5px; box-sizing: border-box; position: relative; }
#stock img, #discard img { position: absolute; top: -2px; left: -2px; width: 85px; height: 124px; display: block; border-radius: 9.5px; cursor: pointer; box-shadow: 1px 2px 2px rgba(60,60,60,.75); }
#stock img:hover, #discard img:hover { filter: drop-shadow(0 0 8px #f1c40f); }

#msg { color: gold; font-weight: bold; margin-top: 10px; min-height: 1.4em; padding: 0 12px; text-shadow: 1px 1px 3px rgba(0,0,0,.7); }

.modal-button { background: orange; color: #fff; border: 0; text-align: center; }
#knock-btn { position: absolute; bottom: 14px; left: 28px; margin: 0; padding: 10px 18px; font-weight: bold; border-radius: 5px; cursor: pointer; }
#knock-btn:disabled { opacity: .45; cursor: not-allowed; }
#knock-btn.active { background: #e74c3c; }
#status-bar { position: absolute; bottom: 12px; right: 28px; margin: 0; padding: 6px 10px; display: flex; gap: 10px; background: rgba(0,0,0,.4); border-radius: 8px; }
#status-bar div { margin: 0; }

#game-line { flex-wrap: wrap; row-gap: 4px; }
#game-line span { text-align: left; }
#game-line h2 { margin-left: auto; }
#scores { display: flex; justify-content: center; gap: 40px; }
#scores .score-box { width: auto; }

/* Round result dialog */
#result-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 2000; }
#result-card { color: #000; background: beige; border: 4px solid orange; border-radius: 20px; padding: 14px 20px; max-width: 94vw; max-height: 92vh; overflow: auto; }
#result-card h2 { color: orange; display: block; margin: 0 0 8px; }
.res-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; text-align: left; }
.res-row > b { width: 40px; flex: none; }
.res-row > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.res-meld, .res-dead { display: inline-flex; }
.res-meld { outline: 2px solid orange; border-radius: 6px; padding: 2px; }
.res-row img { width: 38px; height: 55px; margin-right: -14px; border-radius: 4px; box-shadow: 1px 1px 2px rgba(0,0,0,.5); }
.res-row span img:last-child { margin-right: 0; }
#result-card p { margin: 6px 0; font-weight: bold; }
#res-btn { padding: 8px 20px; font-weight: bold; cursor: pointer; border-radius: 5px; }


/* Card in flight (created by fly() in game.js) */
.flying { position: fixed; z-index: 3000; pointer-events: none; transform-origin: center; border-radius: 9.5px; box-shadow: 1px 2px 3px rgba(0,0,0,.45); will-change: transform; }

/* mobile-only navigation (shown by the *_mobile.css sheet) */
#menu-toggle, .hamburger, .flyout-nav, .overlay { display: none; }

/* touch: first tap raises the card, second tap discards it */
.gin-hand img.pending { transform: translateY(-14px); outline: 3px solid #fff; outline-offset: -3px; z-index: 5; }
