/* Rummy styles. Loads AFTER style.css but is self-sufficient (works with style_mobile.css or nothing). */
.hidden { display: none !important; }

#table { position: relative; display: grid; box-sizing: border-box; width: 900px; max-width: 100%; height: 730px; margin: 0 auto; padding: 8px 10px;
         grid-template-columns: 92px 1fr 92px; grid-template-rows: 124px 1fr 196px;
         grid-template-areas: "north north north" "west center east" "south south south";
         background: #06661e; border: 4px solid darkorange; border-radius: 100px; box-shadow: inset 0 0 50px rgba(0,0,0,.5); }
.seat { display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; min-width: 0; }
.north { grid-area: north; } .west { grid-area: west; } .east { grid-area: east; } .south { grid-area: south; justify-content: flex-end; }
.center { grid-area: center; display: flex; flex-direction: column; align-items: center; min-height: 0; min-width: 0; }
.label { color: #fff; font-weight: bold; margin: 3px 0; }
.count { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 10px; background: rgba(0,0,0,.45); font-size: .8rem; }
.seat.turn .label { color: gold; text-shadow: 0 0 8px gold; }

/* card sizes use a 65:95 ratio so layout never depends on the SVG's own dimensions */
.cpu-hand { display: flex; }
.cpu-hand img { width: 58px; height: 85px; border-radius: 6px; box-shadow: 1px 1px 2px rgba(0,0,0,.6); }
.cpu-hand.h { justify-content: center; } .cpu-hand.h img { margin-right: -36px; } .cpu-hand.h img:last-child { margin-right: 0; }
.cpu-hand.v { flex-direction: column; align-items: center; } .cpu-hand.v img { margin-bottom: -60px; } .cpu-hand.v img:last-child { margin-bottom: 0; }

.gin-hand { display: flex; justify-content: center; align-items: flex-end; min-height: 124px; padding-top: 22px; }
.gin-hand img { width: 85px; height: 124px; margin-right: -36px; position: relative; display: block; transition: transform .15s ease; border-radius: 9.5px; box-shadow: 1px 2px 2px rgba(60,60,60,.75); cursor: pointer; }
.gin-hand img:last-child { margin-right: 0; }
.gin-hand img.selected { transform: translateY(-18px); outline: 3px solid gold; outline-offset: -3px; z-index: 5; }
.gin-hand img.drawn { filter: drop-shadow(0 0 6px #fff); }

#piles { display: flex; gap: 40px; justify-content: center; margin-top: 2px; }
.pile .label { font-size: .8rem; margin: 2px 0 0; }
#stock, #discard { width: 66px; height: 96px; border: 2px dashed rgba(255,255,255,.3); border-radius: 8px; box-sizing: border-box; position: relative; }
#stock img, #discard img { position: absolute; top: -2px; left: -2px; width: 66px; height: 96px; display: block; border-radius: 8px; 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: 6px 0; min-height: 1.4em; padding: 0 12px; text-shadow: 1px 1px 3px rgba(0,0,0,.7); }

#melds { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 8px 12px; width: 100%; flex: 1; min-height: 0; overflow-y: auto; padding: 4px; }
#melds:empty::before { content: 'Melds will appear here'; color: rgba(255,255,255,.35); align-self: center; }
.meld { display: flex; padding: 3px 3px 3px 3px; border-radius: 7px; background: rgba(0,0,0,.18); border: 2px solid transparent; }
.meld img { width: 34px; height: 50px; margin-right: -16px; border-radius: 4px; box-shadow: 1px 1px 2px rgba(0,0,0,.6); }
.meld img:last-child { margin-right: 0; }
.meld.accepts { border-color: gold; cursor: pointer; box-shadow: 0 0 10px gold; }

.modal-button { background: orange; color: #fff; border: 0; text-align: center; padding: 8px 14px; font-weight: bold; border-radius: 5px; cursor: pointer; margin: 0; }
.modal-button:disabled { opacity: .45; cursor: not-allowed; }
#controls { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 8px; flex-wrap: wrap; }

#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: 28px; flex-wrap: wrap; }
#scores .score-box { width: auto; }

#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: 6px 0; text-align: left; min-height: 56px; }
.res-row > b { width: 52px; flex: none; }
.res-cards { display: flex; flex: 1; align-items: center; }
.res-cards img { width: 36px; height: 52px; margin-right: -12px; border-radius: 4px; box-shadow: 1px 1px 2px rgba(0,0,0,.5); }
.res-pts { margin-left: auto; font-weight: bold; padding-left: 12px; white-space: nowrap; }
#result-card p { margin: 6px 0; font-weight: bold; }
#res-btn { padding: 8px 20px; margin-top: 6px; }

.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; }
