/* The Velvet's card table (/poker): the game's own table at eye level, its buttons, its words. */
body.poker { overflow: hidden; height: 100svh; }
#room { position: fixed; inset: 0; background: #050505; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
/* the room's edges dark, as the game's lens */
#room::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse 75% 70% at 50% 46%, transparent 55%, rgba(0,0,0,.6) 100%); }

/* numbers on the felt and the plaques by their heads, put there each frame */
#marks { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.sum { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); font: 700 var(--fs, 15px)/1 "Courier Prime", monospace; color: var(--paper); text-shadow: var(--edge); white-space: nowrap; }
.sum:empty { display: none; }
.plaque { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); padding: .18em .62em .1em; border: 2px solid var(--ink); border-radius: 1em; background: rgba(8,8,8,.88);
  font: 400 clamp(17px, 1.5vw, 26px)/1 "League Gothic", Impact, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--paper); white-space: nowrap; opacity: 0; transition: opacity .18s; }
.plaque.on { opacity: 1; }
.plaque.win { border-color: var(--paper); box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--paper), 0 0 0 6px #000; }
.plaque.think { letter-spacing: .2em; color: var(--dim); }
.plaque.out { color: var(--dim); }

/* her two cards, held up at the bottom as in the game */
#hand { position: absolute; z-index: 3; left: 50%; bottom: 0; width: clamp(150px, 17vw, 300px); height: clamp(110px, 15vw, 260px); transform: translateX(-62%); pointer-events: none; }
#hand .card { position: absolute; bottom: -6%; width: 52%; aspect-ratio: 5 / 7; background: url(/assets/poker/cards.webp) 0 0 / 1400% 400% no-repeat; border-radius: 6%;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.75)); transition: transform .38s cubic-bezier(.2,.8,.3,1), opacity .25s; opacity: 0; transform: translateY(70%); }
#hand .c1 { left: 0; --r: -7deg; }
#hand .c2 { left: 40%; --r: 6deg; }
#hand.on .card { opacity: 1; transform: rotate(var(--r)); }
#hand.out .card { opacity: .0; transform: translateY(80%) rotate(var(--r)); }

/* what's said, as the game's subtitles */
#say { position: absolute; z-index: 3; left: 50%; bottom: calc(clamp(150px, 17vw, 300px) * .76 + 16px); transform: translateX(-50%); width: min(92vw, 900px); margin: 0; text-align: center;
  font: 700 clamp(16px, 1.25vw, 22px)/1.35 "Courier Prime", monospace; color: var(--paper); text-shadow: var(--edge); opacity: 0; transition: opacity .2s; }
#say.on { opacity: 1; }
#say b { color: var(--dim); font-weight: 700; }
/* the blinds and the hand, top left */
#log { position: absolute; z-index: 3; left: max(16px, env(safe-area-inset-left)); top: calc(14px + 1.5em); margin: 0; max-width: 46vw; font: 700 clamp(14px, 1.05vw, 18px)/1.3 "Courier Prime", monospace; color: var(--ink); text-shadow: var(--edge); }
#info { position: absolute; z-index: 3; left: max(16px, env(safe-area-inset-left)); top: 14px; margin: 0; font: 400 clamp(17px, 1.3vw, 24px)/1.2 "League Gothic", Impact, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); text-shadow: var(--edge); }

/* the game's buttons: drawn, three states */
.pk { display: block; width: 180px; aspect-ratio: 719 / 262; background: var(--b) center / 100% 100% no-repeat; cursor: pointer; }
.pk.sq { width: auto; height: 42px; aspect-ratio: 361 / 118; }
@media (hover: hover) { .pk:hover { background-image: var(--h); } }
.pk:active { background-image: var(--p); }
.pk[hidden] { display: none; }

#bar { position: absolute; z-index: 4; right: max(16px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#bar[hidden] { display: none; }
#bar .moves { display: flex; gap: 6px 6px; row-gap: 20px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 16px; }
#bar .moves .pk { width: clamp(118px, 10vw, 180px); position: relative; }
#bar .pk[data-cost]:not([data-cost=""])::after { content: attr(data-cost); position: absolute; left: 50%; top: 100%; transform: translate(-50%, 2px); font: 700 15px/1 "Courier Prime", monospace; color: var(--paper); text-shadow: var(--edge); }
#bar .size { display: flex; align-items: center; gap: 4px; }
#bar .size[hidden] { display: none; }
#bar .size .pk { width: auto; height: clamp(34px, 2.8vw, 44px); }
#amount { min-width: 3.4em; text-align: center; font: 700 clamp(20px, 1.6vw, 28px)/1 "Courier Prime", monospace; color: var(--paper); text-shadow: var(--edge); }
#hint { margin: 0 0 4px; font: 700 clamp(14px, 1.05vw, 18px)/1.3 "Courier Prime", monospace; color: var(--ink); text-shadow: var(--edge); text-align: right; }

#corner { position: absolute; z-index: 11; right: max(16px, env(safe-area-inset-right)); top: 10px; display: flex; align-items: center; gap: 10px; }
#corner .pk.sq { height: 38px; }
#corner #leave { width: 128px; }
#sound { font: 400 clamp(16px, 1.2vw, 22px)/1 "League Gothic", Impact, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); text-shadow: var(--edge); padding: 6px; }
#sound[aria-pressed="false"] { color: #6f6b62; }

/* the cards over the table: the start, the rules, the end */
.card-page { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: rgba(5,5,5,.8); overflow: auto; }
#room:has(.card-page:not([hidden])) #marks, #room:has(.card-page:not([hidden])) #log { visibility: hidden; }
#rules { background: rgba(5,5,5,.9); }
.card-page[hidden] { display: none; }
.sheet { max-width: 34em; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sheet h1, .sheet h2 { margin: 0 0 .2em; font: 400 clamp(46px, 6vw, 96px)/.95 Limelight, serif; color: var(--paper); text-shadow: var(--edge); }
.sheet h1 span { font-size: .5em; color: var(--ink); }
.sheet h2 { font-size: clamp(36px, 4.4vw, 72px); }
.sheet p { margin: 0 0 .6em; text-shadow: var(--edge); }
.sheet .keys { margin-top: .8em; font: 700 14px/1.4 "Courier Prime", monospace; color: var(--dim); }
.keys.touch { display: none; }
@media (hover: none) { .keys.mouse { display: none; } .keys.touch { display: block; } }
.ranks { margin: 0 0 .8em; padding: 0; list-style: none; counter-reset: r; font: 400 clamp(19px, 1.5vw, 26px)/1.25 "League Gothic", Impact, sans-serif; letter-spacing: .05em; text-transform: uppercase; color: var(--paper); text-shadow: var(--edge); }
.ranks em { font: italic 400 .78em/1 "Old Standard", serif; text-transform: none; letter-spacing: 0; color: var(--dim); margin-left: .5em; }
#end-how { font-size: 1.05em; }
#end-line { font: 700 clamp(16px, 1.25vw, 21px)/1.4 "Courier Prime", monospace; }
.struck-note { font-size: .85em; color: var(--dim); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nojs { position: absolute; inset: 0; display: grid; place-items: center; }

/* a phone held upright: the buttons under the table in two rows, her cards on the left */
@media (orientation: portrait) and (max-width: 820px) {
  #bar { left: 10px; right: 10px; align-items: stretch; }
  #bar .moves { justify-content: center; }
  #bar .moves .pk { width: calc((100vw - 40px) / 3); max-width: 170px; }
  #bar .size { justify-content: center; }
  #bar .size .pk { width: auto; height: 36px; }
  #hint { text-align: center; }
  #hand { left: 50%; bottom: auto; top: 50svh; width: min(50vw, 300px); height: min(34vw, 204px); transform: translateX(-54%); }
  #log { top: 82px; max-width: 70vw; font-size: 13px; }
  #hand .card { bottom: auto; top: 0; }
  #say { bottom: auto; top: 70svh; font-size: 14px; }
  #info { top: 54px; }
  #corner #leave { width: 104px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  #hand { left: 5%; transform: none; width: 20vw; height: 46vh; }
  #bar .moves .pk { width: 112px; }
  #bar .size .pk { width: auto; height: 30px; }
  #say { bottom: 120px; }
}
@media (prefers-reduced-motion: reduce) { #hand .card { transition: none; } }
