/* Site chrome and content pages (home, rules, legal). The game board styles live in game.css. */
:root {
  --felt: #0f5132; --felt-dark: #0b3d26; --gold: #f5c542; --paper: #fdfcf7; --ink: #1b1b1b;
  --link: #0a57a3; --muted: #4a4a4a; --line: #e2dfd2;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--felt-dark); color: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif; line-height: 1.5; }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: #000; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1280px; margin: 0 auto; padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top)); min-height: 48px; background: var(--felt-dark); }
.site-header .brand { white-space: nowrap; color: #fff; font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: .01em; }
.site-header nav { display: flex; gap: 4px; }
.site-header nav a { color: #fff; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 15px; }
.site-header nav a:hover, .site-header nav a[aria-current] { background: rgba(255,255,255,.14); }

main { display: block; }
.content { background: var(--paper); color: var(--ink); max-width: 800px; margin: 20px auto; padding: 24px 20px 28px; border-radius: 14px; font-size: 17px; }
.page-game .content { margin-top: 24px; }
.content h1 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; }
.content h2 { font-size: 24px; line-height: 1.25; margin: 32px 0 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.content h3 { font-size: 19px; margin: 20px 0 6px; }
.content p, .content li { max-width: 68ch; }
.content li { margin-bottom: 6px; }
.content a { color: var(--link); }
.content code { background: #efece0; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.content .meta { color: var(--muted); font-size: 14px; }
.content .draft { background: #fff3cd; border: 1px solid #e6c767; border-radius: 8px; padding: 10px 12px; font-size: 15px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.toc a { background: #e9efe9; color: #0b3d26; text-decoration: none; padding: 7px 14px; border-radius: 20px; font-size: 15px; font-weight: 600; }
details { border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; margin: 8px 0; background: #fff; }
summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
details p { margin: 0 0 12px; }
.nojs { padding: 24px; text-align: center; }

/* ---- Home page ---- */
body.page-home { background: radial-gradient(ellipse 120% 70% at 50% -10%, #17703f 0%, #0f5132 38%, var(--felt-dark) 75%) no-repeat, var(--felt-dark); background-attachment: fixed; }
.home-main { max-width: 1100px; margin: 0 auto; padding: 0 16px 8px; }
.home-main h2 { font-size: 26px; line-height: 1.2; margin: 0 0 14px; }
.block { margin: 44px 0; }

.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 24px; align-items: center; padding: 36px 0 12px; }
.hero h1 { font-size: 44px; line-height: 1.08; margin: 0 0 14px; letter-spacing: -.01em; }
.hero h1 span { display: block; color: var(--gold); }
.lead { font-size: 19px; line-height: 1.5; max-width: 34em; margin: 0 0 22px; color: rgba(255,255,255,.92); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.cta { display: inline-block; background: var(--gold); color: #1b1b1b; font-weight: 800; font-size: 18px; text-decoration: none; padding: 14px 24px; border-radius: 12px; box-shadow: 0 4px 0 rgba(0,0,0,.28); }
.cta:hover { filter: brightness(1.06); }
.cta:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.28); }
.cta.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.cta.ghost:hover { background: rgba(255,255,255,.1); filter: none; }
.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.badges li { font-size: 14px; font-weight: 600; background: rgba(0,0,0,.25); padding: 6px 12px; border-radius: 20px; }
.badges li::before { content: "\2713"; color: var(--gold); margin-right: 6px; }

/* playing cards used as artwork */
.pc { position: relative; display: block; width: 78px; height: 110px; border-radius: 9px; background: var(--paper); color: #1b1b1b; box-shadow: 0 6px 16px rgba(0,0,0,.4); border: 1px solid #cfcab8; }
.pc.red { color: #c62828; }
.pc b { position: absolute; top: 6px; left: 8px; font-size: 22px; line-height: 1; }
.pc i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 46px; padding-top: 10px; }
.hero-art { position: relative; height: 270px; }
.hero-art .pc { position: absolute; left: 50%; bottom: 20px; width: 104px; height: 148px; margin-left: -52px; transform-origin: 50% 130%; }
.hero-art .pc b { font-size: 28px; top: 8px; left: 10px; }
.hero-art .pc i { font-size: 62px; }
.hero-art .f1 { transform: rotate(-32deg); } .hero-art .f2 { transform: rotate(-16deg); } .hero-art .f3 { transform: rotate(0deg); }
.hero-art .f4 { transform: rotate(16deg); } .hero-art .f5 { transform: rotate(32deg); }

/* "Browse all games": highlights the grid so it is obvious even when the whole page already fits on screen */
#games { scroll-margin-top: 16px; }
@keyframes tile-flash { 0%, 100% { box-shadow: 0 6px 18px rgba(0,0,0,.3), 0 0 0 0 rgba(245,197,66,0); } 35% { box-shadow: 0 6px 18px rgba(0,0,0,.3), 0 0 0 6px rgba(245,197,66,.95); } }
#games.flash .tile { animation: tile-flash 1.4s ease-out; }
#games.flash .tiles > li:nth-child(2) .tile { animation-delay: .12s; } #games.flash .tiles > li:nth-child(3) .tile { animation-delay: .24s; }

/* game tiles */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.tiles > li { display: flex; }
.tile { display: flex; flex-direction: column; width: 100%; background: var(--paper); color: var(--ink); border-radius: 16px; overflow: hidden; text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.3); transition: transform .15s, box-shadow .15s; }
a.tile:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(0,0,0,.4); }
a.tile:focus-visible { outline-offset: 4px; }
.tile-art { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; }
.tile-art .pc { position: absolute; left: 50%; top: 50%; margin: -55px 0 0 -39px; transform-origin: 50% 160%; }
.tile-art .a1 { transform: translateX(-46px) rotate(-14deg); } .tile-art .a2 { transform: rotate(0deg) translateY(-6px); } .tile-art .a3 { transform: translateX(46px) rotate(14deg); }
.art-rummy-500 { background: linear-gradient(135deg, #17703f, #0b3d26); }
.art-crazy-eights { background: linear-gradient(135deg, #5a3786, #2e1a47); }
.art-texas-holdem { background: linear-gradient(135deg, #7a2a3d, #3a1019); }
.art-soon { background: linear-gradient(135deg, #3b4a52, #1f282c); }
.tile.soon { opacity: .92; box-shadow: none; background: rgba(253,252,247,.9); }
.tile.soon .pc { filter: grayscale(.4); opacity: .85; }
.art-texas-holdem .a1 { transform: translateX(-30px) rotate(-12deg); } .art-texas-holdem .a2 { transform: translateX(20px) rotate(8deg); }
.chips { position: absolute; right: 22px; bottom: 16px; display: flex; flex-direction: column-reverse; gap: 0; }
.chips i { display: block; width: 46px; height: 12px; border-radius: 50%; margin-top: -5px; background: repeating-linear-gradient(90deg, #f5c542 0 8px, #fff 8px 12px); border: 2px solid #b8861b; box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.tile-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tile-body h3 { margin: 0; font-size: 22px; line-height: 1.2; }
.tile-body p { margin: 0; font-size: 15px; line-height: 1.45; color: #3b3b3b; }
.tags { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 12px; font-weight: 700; color: #0b3d26; background: #e4eee6; padding: 3px 10px; border-radius: 12px; }
.tile-cta { margin-top: auto; padding-top: 6px; font-weight: 800; color: var(--link); }

/* the teaser for upcoming games is a slim strip across the grid rather than a lone card */
.tiles > li:has(.soon) { grid-column: 1 / -1; }
.tile.soon { flex-direction: row; align-items: stretch; }
.tile.soon .tile-art { flex: 0 0 200px; height: auto; min-height: 120px; }
.tile.soon .tile-art .pc { width: 58px; height: 82px; margin: -41px 0 0 -29px; }
.tile.soon .tile-art .pc b { font-size: 16px; top: 5px; left: 6px; } .tile.soon .tile-art .pc i { font-size: 32px; padding-top: 6px; }
.tile.soon .tile-art .a1 { transform: translateX(-34px) rotate(-14deg); } .tile.soon .tile-art .a3 { transform: translateX(34px) rotate(14deg); }
.tile.soon .tile-body { justify-content: center; }

/* leaderboard band */
.band { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; background: rgba(0,0,0,.26); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 26px 28px; margin: 44px 0; }
.band h2 { margin-bottom: 8px; }
.band p { margin: 0 0 16px; max-width: 36em; color: rgba(255,255,255,.92); }
.band .cta { font-size: 16px; padding: 11px 20px; }
.band-art { display: flex; gap: 16px; }
.av { margin: 0; text-align: center; font-size: 12px; color: rgba(255,255,255,.8); }
.avbox { display: block; width: 72px; height: 72px; border-radius: 16px; overflow: hidden; line-height: 0; box-shadow: 0 4px 12px rgba(0,0,0,.45); margin-bottom: 6px; }
.avbox svg { width: 100%; height: 100%; display: block; }

/* why play here */
.why .why-link { padding: 0; background: rgba(245,197,66,.1); border-color: rgba(245,197,66,.45); }
.why .why-link a { display: flex; flex-direction: column; gap: 6px; padding: 18px; color: inherit; text-decoration: none; height: 100%; border-radius: 14px; }
.why .why-link a:hover { background: rgba(245,197,66,.12); }
.why .why-link em { margin-top: auto; padding-top: 4px; font-style: normal; font-weight: 800; color: var(--gold); }
.why { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.why li { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.why .ico { color: var(--gold); margin-bottom: 4px; flex: none; }
.why strong { font-size: 17px; }
.why li > span:last-child { font-size: 15px; line-height: 1.45; color: rgba(255,255,255,.85); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 22px; gap: 0; }
  .hero h1 { font-size: 36px; }
  .hero-art { height: 200px; order: -1; margin: 0 0 22px; overflow: hidden; }
  .hero-art .pc { width: 84px; height: 120px; margin-left: -42px; }
  .hero-art .pc b { font-size: 22px; } .hero-art .pc i { font-size: 48px; }
  .band { grid-template-columns: 1fr; padding: 22px 18px; }
  .band-art { justify-content: space-between; gap: 8px; }
  .block { margin: 34px 0; }
}
@media (max-width: 560px) {
  .tile.soon { flex-direction: column; }
  .tile.soon .tile-art { flex-basis: auto; height: 110px; }
}
@media (max-width: 480px) {
  .site-header { padding-left: 12px; padding-right: 8px; gap: 6px; }
  .site-header nav { gap: 0; }
  .site-header nav a { padding: 8px 7px; font-size: 14px; }
  .site-header .brand { font-size: 16px; }
}
@media (max-width: 380px) { .site-header nav a[href="/"] { display: none; } }   /* the brand already links home */
@media (max-width: 420px) {
  .hero h1 { font-size: 31px; }
  .lead { font-size: 17px; }
  .tiles { grid-template-columns: 1fr; }
  .avbox { width: 60px; height: 60px; }
}
/* home-screen instructions dialog */
.dlg { width: min(94vw, 520px); max-height: 90dvh; overflow: auto; background: var(--paper); color: var(--ink); border: 0; border-radius: 16px; padding: 22px 22px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.dlg::backdrop { background: rgba(0,0,0,.65); }
.dlg h2 { margin: 0 0 8px; font-size: 24px; padding-right: 36px; }
.dlg p { margin: 0 0 12px; line-height: 1.5; }
.dlg ol { margin: 4px 0 12px; padding-left: 22px; line-height: 1.5; }
.dlg li { margin-bottom: 8px; }
.dlg details { margin: 8px 0; }
.dlg .cta { margin: 8px 0 4px; font-size: 16px; padding: 12px 20px; }
.dlg .cta.ghost.dark { color: #1b1b1b; box-shadow: inset 0 0 0 2px #bdb8a4; width: 100%; text-align: center; }
.dlg .cta.ghost.dark:hover { background: #efece0; }
.dlg-x { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #e8e4d4; color: #222; font-size: 22px; line-height: 1; cursor: pointer; }
.dlg form { margin: 0; }
@media (prefers-reduced-motion: reduce) { a.tile, .cta { transition: none; } #games.flash .tile { animation: none; outline: 3px solid var(--gold); } }

.site-footer { max-width: 1000px; margin: 8px auto 0; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); text-align: center; color: rgba(255,255,255,.85); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin-bottom: 8px; }
.site-footer a, .linklike { color: #fff; padding: 8px 10px; text-decoration: underline; background: none; border: 0; font: inherit; cursor: pointer; }

/* Phone: game page header is a thin strip so the board stays on screen */
@media (max-width: 699px) {
  .content { margin: 12px 8px; padding: 18px 14px 22px; font-size: 16px; }
  .content h1 { font-size: 25px; }
  .content h2 { font-size: 21px; }
  .page-game .site-header { min-height: 40px; padding-top: calc(4px + env(safe-area-inset-top)); padding-bottom: 4px; }
  .page-game .site-header nav a { padding: 6px 8px; font-size: 14px; }
  .page-game .site-header .brand { font-size: 16px; }
}
/* The game board fills the viewport below the header */
body.page-game #app { min-height: calc(100dvh - 50px); padding-top: 0; }
@media print { .site-header, .site-footer, #app { display: none; } .content { background: #fff; } }

/* ---- Ad slots: space is reserved up front so nothing jumps when an ad arrives ---- */
.ad-slot { display: block; position: relative; margin: 14px auto; width: 100%; max-width: 728px; min-height: 120px; background: rgba(255,255,255,.04); border-radius: 8px; overflow: hidden; text-align: center; }
.ad-slot::before { content: "Advertisement"; display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.55); padding: 3px 0 0; height: 16px; }
.ad-slot .adsbygoogle { min-height: 100px; }
.ad-slot.ad-empty { visibility: hidden; }          /* blocked or unavailable: keeps the space, shows nothing */
.ad-sim-text { display: grid; place-items: center; min-height: 100px; color: rgba(255,255,255,.7); font-size: 14px; }
.ad-below { padding: 0 8px; }
.ad-side { display: none; }
.stage { display: block; }
@media (min-width: 1440px) {
  .stage { display: flex; justify-content: center; align-items: flex-start; gap: 20px; padding: 0 12px; }
  .page-game .stage #app { flex: 0 1 1120px; min-width: 0; margin: 0; }
  .ad-side { display: block; flex: none; width: 300px; min-height: 616px; margin: 0; position: sticky; top: 12px; }
  .ad-below { display: none; }
}

/* Simulated ad used only until a real publisher ID is configured */
.sim-ad { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.88); display: grid; place-items: center; padding: 16px; }
.sim-ad-box { background: #fdfcf7; color: #1b1b1b; border-radius: 14px; padding: 22px; width: min(92vw, 360px); text-align: center; }
.sim-ad-box h2 { margin: 6px 0 10px; }
.sim-tag { margin: 0; font-size: 12px; font-weight: 700; color: #8a1f1f; letter-spacing: .06em; }
.sim-count { font-size: 18px; margin: 8px 0 14px; }
.sim-skip { width: 100%; background: #e8e8e8; color: #111; border: 0; border-radius: 10px; padding: 12px; font-size: 16px; font-weight: 700; }

.owner-notice { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 300; max-width: min(92vw, 520px); background: #1b1b1b; color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 15px; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.5); }

/* Game page: you are already on Rummy 500, so drop that link and keep the header slim */
.page-game .site-header nav a[aria-current] { display: none; }
.page-game .site-header { min-height: 36px; padding-top: calc(4px + env(safe-area-inset-top)); padding-bottom: 4px; }
