/* DINGO shared styles */
:root{
  --maroon:#6e1420; --maroon-dk:#4a0d15; --red:#c0212f; --black:#16161a; --gold:#f2b705; --green:#1f7a3a;
  --bg:#f4efe9; --panel:#fff; --line:#d9cfc4; --muted:#6f655d;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;background:var(--bg);color:var(--black);-webkit-tap-highlight-color:transparent}
button{font:inherit;cursor:pointer;border:0;touch-action:manipulation;color:inherit}
input,select,textarea{font:inherit;color:var(--black)}
[hidden]{display:none!important}
.hidden{display:none!important}

/* buttons */
.btn{padding:.8rem 1.2rem;border-radius:10px;background:#fff;border:2px solid var(--line);font-weight:600;font-size:1rem;white-space:nowrap;color:var(--black)}
.btn:active{transform:scale(.97)}
.btn.primary{background:var(--maroon);border-color:var(--maroon);color:#fff}
.btn.go{background:var(--green);border-color:var(--green);color:#fff}
.btn.stop{background:var(--red);border-color:var(--red);color:#fff}
.btn.gold{background:var(--gold);border-color:var(--gold);color:#2a1d00}
.btn.small{padding:.45rem .8rem;font-size:.9rem}
.btn:disabled{opacity:.4;pointer-events:none}

/* playing-card tiles */
.tile{container-type:size;position:relative;border-radius:8px;background:#ebe4dc;border:2px solid #d6ccc1;display:grid;place-items:center;transition:background .3s,border-color .3s,transform .3s}
.tile .s{font-size:min(55cqh,80cqw);line-height:1;opacity:.17;transition:opacity .3s}
.tile .r{position:absolute;top:5cqh;left:8cqw;font-family:Oswald,sans-serif;font-weight:700;font-size:min(30cqh,46cqw);line-height:1;opacity:0}
.tile.red{color:var(--red)} .tile.blk{color:var(--black)}
.tile.on{background:#fff;border-color:currentColor;box-shadow:0 2px 6px rgba(0,0,0,.15)}
.tile.on .s{opacity:1;font-size:min(42cqh,62cqw);margin-top:22cqh}
.tile.on .r{opacity:1}
.tile.last{outline:4px solid var(--gold);outline-offset:2px;transform:scale(1.06);z-index:2}

/* small inline card chip e.g. 7♥ */
.chip{display:inline-flex;align-items:center;gap:.1em;font-family:Oswald,sans-serif;font-weight:700;padding:.1rem .45rem;border-radius:6px;background:#fff;border:1.5px solid var(--line)}
.chip.red{color:var(--red)}

/* prominent current card */
.bigcard{container-type:size;background:var(--panel);border-radius:16px;border:3px solid var(--line);position:relative;display:grid;place-items:center;overflow:hidden}
.bigcard .r{position:absolute;top:4cqh;left:6cqw;font-family:Oswald,sans-serif;font-weight:700;font-size:min(30cqw,18cqh);line-height:1}
.bigcard .r2{top:auto;left:auto;bottom:4cqh;right:6cqw;transform:rotate(180deg)}
.bigcard .s{font-size:min(70cqw,46cqh);line-height:1}
.bigcard .name{position:absolute;bottom:4cqh;left:6cqw;right:30cqw;font-weight:700;font-size:min(7cqw,4.5cqh);color:var(--muted)}
.bigcard.red{color:var(--red);border-color:var(--red)} .bigcard.blk{color:var(--black);border-color:var(--black)}
.bigcard.joker{color:var(--maroon);border-color:var(--gold);background:repeating-linear-gradient(45deg,#fff8e1 0 14px,#fff 14px 28px)}
.bigcard .jk{font-family:Oswald,sans-serif;font-weight:700;font-size:min(22cqw,14cqh);text-align:center;line-height:1}
.bigcard .jk small{display:block;font-size:.35em;margin-top:.4em;color:var(--black)}
/* pre-game "default card image": vertical title + suits */
.brand{display:grid;grid-template-columns:auto auto;gap:0 6cqw;align-items:center}
.brand .letters{display:flex;flex-direction:column;align-items:center;font-family:Oswald,sans-serif;font-weight:700;color:var(--maroon);font-size:min(17cqh,40cqw);line-height:1.02}
.brand .suits{display:flex;flex-direction:column;justify-content:space-around;height:100%;font-size:min(14cqh,30cqw);line-height:1.1}
.pop{animation:pop .45s cubic-bezier(.2,1.4,.4,1)}
@keyframes pop{from{transform:scale(.6) rotate(-6deg);opacity:0}to{transform:none;opacity:1}}

/* modal */
.modal{position:fixed;inset:0;background:rgba(20,10,12,.62);display:none;place-items:center;z-index:60;padding:1rem}
.modal.open{display:grid}
.box{background:#fff;border-radius:16px;max-width:560px;width:100%;max-height:92vh;overflow:auto;padding:1.5rem;box-shadow:0 20px 50px rgba(0,0,0,.3)}
.box.wide{max-width:900px}
.box h2{font-family:Oswald,sans-serif;color:var(--maroon);font-size:1.6rem;margin-bottom:.6rem}
.box p{line-height:1.5;margin-bottom:.7rem}
.box label.f{display:block;font-weight:600;font-size:.9rem;margin:.8rem 0 .3rem}
.box input[type=text],.box input[type=number],.box input[type=password],.box input[type=date],.box select,.box textarea{width:100%;padding:.7rem;border:2px solid var(--line);border-radius:10px;background:#fff}
.box .row{display:flex;gap:.6rem;justify-content:flex-end;margin-top:1.2rem;flex-wrap:wrap}
.chk{display:flex;gap:.6rem;align-items:center;font-weight:600;margin-top:.7rem}
.chk input{width:1.35rem;height:1.35rem;flex:none}
.msg{font-weight:600;min-height:1.3em;margin-top:.5rem}
.msg.bad{color:var(--red)} .msg.ok{color:var(--green)}

/* full-screen flash on new card (visual alert) */
.flash{position:fixed;inset:0;pointer-events:none;opacity:0;z-index:50}
.flash.go{animation:flash .7s ease-out}
@keyframes flash{0%{opacity:.55}100%{opacity:0}}

/* validation / board rows */
.boardrow{display:grid;grid-template-columns:repeat(13,1fr);gap:.35rem}
.bcell{border:2px solid var(--line);border-radius:8px;text-align:center;padding:.35rem 0 .2rem;background:#fff}
.bcell .rk{font-family:Oswald,sans-serif;font-weight:700;font-size:1.3rem;line-height:1.1}
.bcell .su{font-size:1.2rem;line-height:1}
.bcell.red{color:var(--red)}
.bcell .mk{font-size:1.3rem;margin-top:.2rem;height:1.5rem;color:var(--black)}
.bcell.hit{border-color:var(--green);background:#eaf6ee}
.bcell.miss{opacity:.55}
