
:root { --green:#11ae5f; --green-dark:#0e9651; --slate:#313a46; --ink:#212529; --muted:#6c757d; --line:#e3e6ea;
        --soft:#f3f4f6; --red:#d93838; }
* { box-sizing:border-box; }
html, body { margin:0; height:100%; }
body { font-family:Karla, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color:var(--ink); background:#fff; font-size:15px; }
a { color:inherit; }
button, input, select, textarea { font:inherit; color:inherit; }
.layout { display:grid; grid-template-columns:230px minmax(0, 1fr) 410px; height:100vh; height:100dvh; }
.topbar { display:none; }
.logo { display:flex; align-items:center; gap:8px; font-weight:800; font-size:18px; letter-spacing:.5px; text-decoration:none; }
.logo-mark { display:inline-grid; place-items:center; width:34px; height:34px; border:2px solid var(--green); border-radius:8px;
             color:var(--green); font-size:12px; }
.side { border-right:1px solid var(--line); padding:22px 22px 30px; overflow-y:auto; }
.side .logo { margin-bottom:26px; }
.side a.nav { display:block; padding:8px 0; text-decoration:none; font-size:14px; color:#333; }
.side a.nav:hover { color:var(--green); }
.side a.nav.on { font-weight:700; }
.side-links { margin-top:34px; }
.main { overflow-y:auto; padding:30px 40px 60px; }
.cart { border-left:1px solid var(--line); display:flex; flex-direction:column; min-height:0; background:#fff; }
.cart-head { display:flex; align-items:center; border-bottom:1px solid var(--line); min-height:56px; }
.cart-head h2 { margin:0; padding:0 20px; font-size:21px; }
#cart-close { display:none; }
.cart-lines { flex:1; overflow-y:auto; }
.cart-empty { padding:22px 20px; color:var(--muted); }
.cl { display:grid; grid-template-columns:22px 36px minmax(0, 1fr) auto auto; gap:10px; align-items:center; padding:14px 16px;
      border-bottom:1px solid var(--line); }
.cl img, .cl .noimg { width:36px; height:50px; object-fit:contain; background:var(--soft); border-radius:3px; }
.cl-title { font-size:13px; line-height:1.35; }
.cl-sub { font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cl-del { border:none; background:none; color:var(--green); cursor:pointer; padding:0; width:22px; height:22px; }
.cl-del:hover { color:var(--red); }
.cl-del svg { width:18px; height:18px; }
.cl-qty { display:flex; align-items:center; gap:4px; font-size:13px; }
.cl-qty button { width:22px; height:22px; border:1px solid #777; background:#fff; border-radius:3px; cursor:pointer; padding:0; line-height:1; }
.cl-qty span { min-width:18px; text-align:center; }
.cl-price { font-weight:700; font-size:14px; min-width:56px; text-align:right; }
.cart-foot { border-top:1px solid var(--line); padding:22px 20px; }
.cart-total { display:flex; justify-content:space-between; align-items:flex-start; }
.cart-total b { font-size:18px; padding-top:8px; }
.cart-sums { text-align:right; font-size:14px; line-height:1.6; }
.cart-sums i { color:var(--muted); font-size:13px; }
.cart-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:16px; }
.btn-green, .btn-light, .btn-dark { display:inline-flex; align-items:center; justify-content:center; gap:8px; border:none; border-radius:3px;
      padding:10px 16px; cursor:pointer; text-decoration:none; font-size:14px; }
.btn-green { background:var(--green); color:#fff; }
.btn-green:hover { background:var(--green-dark); }
.btn-green.off { opacity:.45; pointer-events:none; }
.btn-light { background:#eef1f1; color:#555; }
.btn-light:hover { background:#e2e6e6; }
.btn-light.armed { background:var(--red); color:#fff; }
.btn-dark { background:var(--slate); color:#fff; }
.btn-dark:disabled { opacity:.55; cursor:default; }
.shade { display:none; }

/* Home */
.home h1 { font-size:21px; margin:20px 0 14px; }
.tiles { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px; max-width:1080px; }
.tile { display:grid; place-items:center; aspect-ratio:2.5 / 1; border:2px solid #333; border-radius:6px; overflow:hidden;
        background:linear-gradient(135deg, var(--slate), #4a5868); color:#fff; text-decoration:none; font-size:24px; font-weight:800;
        text-align:center; padding:0; }
.tile img { width:100%; height:100%; object-fit:cover; display:block; }
.tile:hover { border-color:var(--green); }

/* Game */
.bar { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; }
.search { display:flex; width:min(350px, 100%); }
.search input { flex:1; min-width:0; border:1px solid #d9dde1; border-right:none; border-radius:3px 0 0 3px; padding:9px 14px; }
.search button { width:47px; border:none; background:var(--green); color:#fff; border-radius:0 3px 3px 0; cursor:pointer; }
.search svg { width:15px; height:15px; vertical-align:middle; }
.show { display:flex; align-items:center; gap:10px; font-size:14px; }
.toggle { display:flex; border:1px solid #d9dde1; border-radius:3px; overflow:hidden; }
.toggle button { border:none; background:#fff; padding:8px 15px; cursor:pointer; color:#555; }
.toggle button.on { background:#333; color:#fff; }
.count { margin:12px 0 16px; font-size:14px; }
.filters { display:flex; gap:12px; flex-wrap:wrap; padding-bottom:20px; border-bottom:1px solid var(--soft); }
.filters select { appearance:none; border:1px solid #d9dde1; background:#f3f3f3; border-radius:18px; padding:7px 30px 7px 18px; cursor:pointer;
                  background-image:linear-gradient(45deg, transparent 50%, #333 50%), linear-gradient(135deg, #333 50%, transparent 50%);
                  background-position:calc(100% - 15px) 50%, calc(100% - 11px) 50%; background-size:4px 4px; background-repeat:no-repeat;
                  max-width:260px; font-size:14px; }
.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(205px, 1fr)); gap:34px 26px; margin-top:34px; }
.card { display:flex; flex-direction:column; }
.card-img { aspect-ratio:63 / 88; background:var(--soft); border-radius:8px; overflow:hidden; }
.card-img img { width:100%; height:100%; object-fit:contain; display:block; }
.card-title { font-size:13px; margin-top:12px; line-height:1.5; }
.card-set { font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; }
.conds { display:flex; gap:5px; flex-wrap:wrap; margin-top:8px; }
.conds button { min-width:46px; border:1px solid #555; background:#fff; border-radius:3px; padding:5px 9px; cursor:pointer; font-size:14px; }
.conds button.on { background:var(--slate); border-color:var(--slate); color:#fff; }
.buy { font-weight:700; margin:9px 0 7px; font-size:15px; }
.qty { display:flex; gap:6px; }
.qty button { width:34px; height:34px; border:1px solid #555; background:#fff; border-radius:3px; cursor:pointer; font-size:17px; padding:0; }
.qty input { flex:1; min-width:0; text-align:center; border:1px solid #d9dde1; border-radius:3px; }
.add { margin-top:9px; width:100%; letter-spacing:.3px; }
.add svg { width:15px; height:15px; }
.add.done { background:var(--slate); }
.pager { display:flex; justify-content:center; align-items:center; gap:14px; margin-top:40px; }
.pager button { border:1px solid #d9dde1; background:#fff; border-radius:3px; padding:8px 16px; cursor:pointer; }
.pager button:disabled { opacity:.4; cursor:default; }
.msg { color:var(--muted); padding:30px 0; }
.err-banner { background:#fdecec; border:1px solid #f2b8b8; color:#8a1f1f; border-radius:4px; padding:12px 16px; margin:0 0 16px; }
.note-banner { background:#fff7e0; border:1px solid #f0d58a; color:#6b5313; border-radius:4px; padding:12px 16px; margin:0 0 16px; }

/* Checkout */
body.checkout .main { background:var(--green); color:#fff; }
.co { display:grid; grid-template-columns:minmax(0, 620px) minmax(0, 440px); gap:28px; }
.co h1 { font-size:21px; margin:0 0 18px; grid-column:1 / -1; }
.co h2 { font-size:18px; margin:0 0 10px; }
#co-banner { grid-column:1 / -1; }
#co-banner:empty { display:none; }
img.broken { visibility:hidden; }
.fl { position:relative; display:block; background:#fff; color:var(--ink); border-radius:3px; margin-bottom:6px; }
.fl span { position:absolute; left:11px; top:7px; font-size:11px; color:var(--muted); pointer-events:none; }
.fl input, .fl select, .fl textarea { width:100%; border:none; background:none; padding:24px 11px 8px; border-radius:3px; outline:none; }
.fl textarea { resize:vertical; min-height:62px; }
.fl:focus-within { box-shadow:0 0 0 2px var(--slate); }
.fl.bad { box-shadow:0 0 0 2px #ffd166; }
.row { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.row3 { display:grid; grid-template-columns:1fr 1fr 110px; gap:6px; }
.ferr { display:block; font-style:normal; color:#ffe08a; font-size:13px; padding:0 2px 6px; }
.ferr:empty { display:none; }
.fl + .ferr { margin-top:-2px; }
.co-label { margin:22px 0 10px; font-size:14px; }
.choices { display:flex; gap:6px; flex-wrap:wrap; }
.choices button { border:1px solid #cfd4d9; background:#fff; color:var(--ink); border-radius:3px; padding:9px 13px; cursor:pointer; font-size:14px; }
.choices button.on { background:var(--slate); border-color:var(--slate); color:#fff; }
.choices button.no { opacity:.55; cursor:not-allowed; }
.pay-email { margin-top:12px; }
.why { font-size:13px; margin-top:8px; color:#ffe08a; }
.why:empty { display:none; }
.agree { display:flex; gap:9px; align-items:flex-start; margin:24px 0 6px; font-size:14px; line-height:1.55; cursor:pointer; }
.agree input { margin-top:4px; width:16px; height:16px; flex:none; accent-color:var(--slate); }
#ts { margin:16px 0 4px; min-height:0; }
.co-submit { margin-top:16px; }
.form-msg { margin-top:12px; color:#ffe08a; font-size:14px; }
.form-msg:empty { display:none; }
.notes p { font-size:14px; line-height:1.6; margin:0 0 14px; }
.notes a { color:#fff; font-weight:700; text-decoration:none; }
.notes a:hover { text-decoration:underline; }
.mailto { white-space:pre-line; font-weight:800; font-size:17px; line-height:1.25; margin:14px 0 16px; }
.co-min { font-size:14px; background:rgba(0,0,0,.15); border-radius:4px; padding:10px 12px; margin-top:12px; }

/* Done */
.done { max-width:780px; }
.done h1 { font-size:24px; margin:10px 0 6px; }
.done-id { font-size:30px; font-weight:800; margin:14px 0; }
.done-id b { color:var(--green); }
.done .mailto { background:var(--soft); border-radius:6px; padding:14px 16px; display:inline-block; }
.done table { width:100%; border-collapse:collapse; margin:10px 0 16px; font-size:14px; }
.done th { text-align:left; color:var(--muted); font-weight:normal; font-size:12px; border-bottom:1px solid var(--line); padding:7px 6px; }
.done td { border-bottom:1px solid var(--line); padding:8px 6px; vertical-align:top; }
.done .r { text-align:right; white-space:nowrap; }
.done .sub { color:var(--muted); font-size:12px; }
.done-total { text-align:right; font-size:15px; line-height:1.6; }
.done p { line-height:1.6; }

@media (max-width:1250px) { .layout { grid-template-columns:210px minmax(0, 1fr) 340px; } .main { padding:26px 24px 60px; }
  .co { grid-template-columns:minmax(0, 1fr); } }
@media (max-width:900px) {
  .layout { display:block; height:auto; }
  .topbar { display:flex; position:sticky; top:0; z-index:20; align-items:center; justify-content:space-between; gap:10px;
            background:#fff; border-bottom:1px solid var(--line); padding:8px 12px; }
  .icon-btn { border:none; background:none; font-size:24px; width:44px; height:44px; cursor:pointer; }
  .cart-btn { border:none; background:var(--green); color:#fff; border-radius:3px; padding:10px 14px; font-size:15px; cursor:pointer; }
  .side, .cart { position:fixed; top:0; bottom:0; z-index:40; background:#fff; transition:transform .2s; overflow-y:auto; }
  .side { left:0; width:min(290px, 85vw); transform:translateX(-105%); }
  .cart { right:0; width:100%; transform:translateX(105%); }
  body.side-open .side, body.cart-open .cart { transform:none; }
  .side .logo { display:none; }
  #cart-close { display:inline-block; }
  .shade { position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:30; }
  body.side-open .shade, body.cart-open .shade { display:block; }
  .main { padding:18px 16px 50px; min-height:calc(100vh - 61px); }
  .tiles { grid-template-columns:minmax(0, 1fr); }
  .grid { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:26px 14px; }
  .search { width:100%; }
  .bar { flex-direction:column; align-items:stretch; }
  .show { justify-content:space-between; }
  .filters select { max-width:100%; flex:1 1 140px; }
  input, select, textarea { font-size:16px; }
  .row3 { grid-template-columns:1fr 1fr; }
  .row3 > :last-child { grid-column:1 / -1; }
  .cl-qty button { width:32px; height:32px; }
  .cart-actions a, .cart-actions button { flex:1; padding:13px 10px; }
  .qty button { width:40px; height:40px; }
  .add, .co-submit { min-height:44px; }
  .done td:nth-child(3), .done th:nth-child(3) { display:none; }
}
@media print { .topbar, .side, .cart, .shade, .noprint { display:none !important; } .layout { display:block; height:auto; }
  .main { overflow:visible; } }
