:root{--lounge-cream:#f8f3e9;--lounge-ink:#203d35;--lounge-gold:#bfa06a;--lounge-line:#dcd0bd}
body.ludicera-lounge{background:radial-gradient(ellipse at 50% 0,#fffdf7,#f1e9dc 75%);color:var(--lounge-ink);display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:18px 26px;gap:0}
.ludicera-header{width:min(1280px,100%);display:flex;align-items:center;gap:12px;margin:0 0 18px;padding:0 0 14px;border-bottom:1px solid var(--lounge-line)}
.ludicera-header .logo{padding:0;background:none;line-height:0}.ludicera-header .logo img{width:62px;height:62px;object-fit:contain;mix-blend-mode:multiply}.ludicera-header h1{font:600 30px Georgia,serif}.ludicera-header p{font-size:13px;margin:4px 0 0}
.ludicera-lounge #visit-counter{font-size:11px;padding:3px 8px;background:transparent;border:0;box-shadow:none;margin:0 0 12px;min-height:0;color:#68736a;align-self:center}
.lounge-game{width:min(1280px,100%)!important;min-width:0;max-width:100%}.lounge-game .game-header{gap:14px;flex-wrap:wrap;margin-bottom:14px}.lounge-game .game-header h2{font:600 32px Georgia,serif}.lounge-game .game-header h2:before{content:'♠';font-size:26px;margin-right:9px;color:#264c3d}.lounge-game .game-header p{font-size:13px;color:#687065}
.lounge-game .game-toolbar{min-width:0;flex-wrap:wrap;gap:8px}.lounge-game .game-toolbar button{min-height:42px;padding:10px 14px;border:1px solid var(--lounge-line);border-radius:10px;background:linear-gradient(#fffdf8,#f2eadf);color:var(--lounge-ink);box-shadow:0 2px 3px #4a351012;transition:background-color 150ms,box-shadow 150ms}
.lounge-game .game-toolbar button:hover:not(:disabled){background:#eadcc5;box-shadow:0 3px 7px #4a35101f}.lounge-game .game-toolbar button:focus-visible,.game-help-card summary:focus-visible{outline:3px solid #a7803e;outline-offset:3px}
.lounge-game .table-scroll{border:2px solid #bfa06a;border-radius:24px;box-shadow:0 12px 26px #3e2d1929,0 2px 3px #3e2d1926;max-width:100%}
.lounge-game .felt{border-radius:21px;background:radial-gradient(ellipse at 45% 5%,#167146,#075638 65%,#05452e);box-shadow:inset 0 0 0 2px #f1dd9630,inset 0 2px 15px #00291bcc}
.lounge-game .playing-card{box-shadow:0 2px 4px #00180d4d}.lounge-game .column{background:#073e201a;box-shadow:inset 0 0 0 1px #d7e7bc16}.lounge-game .table-status{font-size:13px;color:#edf1dc}
.game-help-card{background:#fffbf4b8;border:1px solid var(--lounge-line);border-radius:14px;margin:12px 0 16px;padding:13px 16px;box-shadow:0 3px 10px #47381708}.game-help-card summary{cursor:pointer;font-size:15px;font-weight:600}.game-help-card .table-note{margin:12px 0 0;line-height:1.65;color:#536357}
@media(max-width:1000px){.lounge-game .game-header{align-items:flex-start}.lounge-game .game-toolbar{max-width:100%}.lounge-game .table-scroll{min-width:0}.lounge-game .felt{min-width:0}}
@media(max-width:700px){body.ludicera-lounge{padding:10px 8px}.ludicera-header{margin-bottom:10px;padding-bottom:10px;gap:8px}.ludicera-header .logo img{width:44px;height:44px}.ludicera-header h1{font-size:25px}.ludicera-header p{font-size:11px}.lounge-game .game-header h2{font-size:26px}.lounge-game .game-header{gap:10px}.lounge-game .game-toolbar{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.lounge-game .game-toolbar button{padding:8px 6px;font-size:12px;white-space:normal}.lounge-game .table-scroll{border-radius:15px}.lounge-game .felt{border-radius:12px}.game-help-card{padding:11px 12px}.game-help-card summary{font-size:14px}}
@media(prefers-reduced-motion:reduce){.lounge-game .game-toolbar button{transition:none}}

.ludicera-lounge .visitor-badge{font-size:11px;padding:2px 8px;background:transparent;border:0;box-shadow:none;margin:0 0 10px;color:#68736a}
.language-bar{margin-left:auto;display:flex;gap:4px;align-items:center;flex-wrap:wrap;max-width:100%}.language-bar button{display:grid;place-items:center;font-family:'Segoe UI Emoji','Apple Color Emoji',sans-serif;font-size:21px;line-height:1;min-width:36px;min-height:36px;padding:5px;border:1px solid transparent;border-radius:8px;background:transparent;color:#203d35;cursor:pointer}.language-bar button:hover{background:#efe4d2}.language-bar button[aria-pressed=true]{background:#ead8b1;border-color:#a88142;box-shadow:inset 0 -2px #886b35}.language-bar button:focus-visible{outline:3px solid #9a753b;outline-offset:2px}
@media(max-width:700px){.ludicera-header{flex-wrap:wrap}.language-bar{gap:2px}.language-bar button{font-size:19px;min-width:32px;min-height:36px;padding:4px}}
@media(max-width:520px){.language-bar{width:100%;justify-content:flex-end;margin-top:3px}.language-bar button{min-width:34px}}

.language-bar img{display:block;width:24px;height:16px;object-fit:cover;border-radius:2px;box-shadow:0 0 0 1px #0002}
@media(max-width:700px){:is(#table,#dk-table,#kl-table,#ft-table,#fc-table,#ss-table,#ds-table) .game-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}}


/* Ludicera v38 premium game polish */
:root{
  --lounge-cream:#f5efe4;
  --lounge-cream-2:#fffaf1;
  --lounge-ink:#173e35;
  --lounge-muted:#68756d;
  --lounge-gold:#b99555;
  --lounge-gold-soft:#d9c49b;
  --lounge-line:#ddd0bc;
  --lounge-felt:#075c3d;
  --lounge-felt-deep:#03452f;
}
body.ludicera-lounge{
  background:
    radial-gradient(circle at 12% 16%,#ffffff80 0 4%,transparent 5%),
    radial-gradient(circle at 88% 10%,#ffffff66 0 3%,transparent 4%),
    linear-gradient(180deg,#fbf7ef 0%,#f2eadf 58%,#eee4d7 100%);
  color:var(--lounge-ink);
  padding:20px 28px 34px;
}
.ludicera-header{
  width:min(1320px,100%);
  min-height:82px;
  gap:14px;
  padding:12px 18px 14px;
  margin:0 auto 18px;
  border:1px solid #e2d6c5;
  border-radius:18px;
  background:linear-gradient(180deg,#fffdf8e8,#f8f1e7dc);
  box-shadow:0 12px 34px #5c463014,0 2px 5px #5c463012;
  backdrop-filter:blur(8px);
}
.ludicera-header .logo{
  width:68px;height:68px;display:grid;place-items:center;flex:0 0 auto;
}
.ludicera-header .logo img{
  width:64px;height:64px;filter:drop-shadow(0 3px 4px #4937192b);mix-blend-mode:multiply;
}
.ludicera-header h1{font:600 31px/1.05 Georgia,serif;letter-spacing:.2px;color:#173e35}
.ludicera-header p{font-size:13px;color:#6f756e;margin:6px 0 0}
.ludicera-header .header-visitor{
  margin-left:auto!important;margin-bottom:0!important;padding:5px 10px!important;
  border:1px solid #e1d4bf!important;border-radius:999px!important;
  background:#fffaf0cc!important;color:#647069!important;font-size:11px!important;
  line-height:1.2;white-space:nowrap;
}
.ludicera-header .language-bar{margin-left:4px;gap:3px;padding:3px;border:1px solid #e5d8c5;border-radius:10px;background:#fffaf0b8}
.ludicera-header .language-bar button{min-width:34px;min-height:31px;border-radius:7px}
.ludicera-header .language-bar button:hover{background:#efe2cc}
.ludicera-header .language-bar button[aria-pressed=true]{background:#ead5a9;border-color:#a78242;box-shadow:0 1px 2px #5f461a24,inset 0 -2px #8a6a33}

.lounge-game{width:min(1320px,100%)!important;margin:0 auto;position:relative}
.lounge-game .game-header{
  position:relative;display:flex;align-items:center;justify-content:space-between;
  gap:18px;flex-wrap:wrap;margin:0 0 13px;padding:0 4px;
}
.lounge-game .game-header>div:first-child{min-width:210px}
.lounge-game .game-header h2{
  font:600 32px/1.05 Georgia,serif;color:#173e35;letter-spacing:.15px;margin:0;
  display:flex;align-items:center;gap:7px;
}
.lounge-game .game-header h2:before{
  content:'♠';font-size:23px;line-height:1;color:#173e35;
  width:34px;height:34px;display:grid;place-items:center;border-radius:50%;
  background:#efe5d3;border:1px solid #d5c19a;box-shadow:inset 0 0 0 3px #fff8ec;
  margin-right:2px;
}
.lounge-game .game-header p{font-size:13px;color:#778077;margin:5px 0 0 43px}
.lounge-game .game-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap;margin-left:auto}
.lounge-game .game-toolbar button{
  min-height:40px;padding:9px 13px;border:1px solid #d8cbb8;border-radius:10px;
  background:linear-gradient(180deg,#fffdf8,#f0e5d6);color:#23483e;
  box-shadow:0 2px 4px #513d2415,inset 0 1px #fff;
  font-size:13px;font-weight:600;transition:transform 130ms ease,box-shadow 130ms ease,background 130ms ease;
}
.lounge-game .game-toolbar button:hover:not(:disabled){
  transform:translateY(-1px);background:linear-gradient(180deg,#fffaf0,#e8d7bb);box-shadow:0 4px 10px #513d2423,inset 0 1px #fff;
}
.lounge-game .game-toolbar button:active:not(:disabled){transform:translateY(0)}
.lounge-game .game-toolbar button[id$='new'],
.lounge-game .game-toolbar #new-deal{
  border-color:#b9975d;background:linear-gradient(180deg,#f2d99b,#dfbd72);color:#24453c;box-shadow:0 3px 8px #75571e25,inset 0 1px #fff8d9;
}
.lounge-game .game-toolbar button[data-feedback-button]{background:linear-gradient(180deg,#fffdf8,#f4ecdf);border-color:#d8c7aa}

.lounge-game .table-scroll{
  overflow-x:auto;
  border:2px solid #9b7740;
  border-radius:24px;
  padding:6px;
  background:linear-gradient(145deg,#d9c09a,#9b7740 38%,#76552c 58%,#cfb184);
  box-shadow:0 18px 44px #3f2f1c2c,0 4px 10px #3f2f1c24,inset 0 1px #f6e6c5;
}
.lounge-game .felt{
  position:relative;
  border-radius:18px;
  background:
    radial-gradient(circle at 35% 18%,#16805840 0 2px,transparent 3px),
    radial-gradient(circle at 72% 76%,#b3d6b214 0 1px,transparent 2px),
    radial-gradient(ellipse at 48% 2%,#0b6845 0%,#064b34 52%,#033824 100%);
  background-size:auto,7px 7px,auto;
  box-shadow:inset 0 0 0 1px #d7c58c28,inset 0 4px 22px #00291dcc,inset 0 -16px 34px #00291d66;
  border:1px solid #d7c58c2b;
}
.lounge-game .felt:before{
  content:'';position:absolute;inset:8px;border:1px solid #e8d9aa14;border-radius:13px;pointer-events:none;
}
.lounge-game .table-top,.lounge-game .kl-top,.lounge-game .ft-top,.lounge-game .fc-top,.lounge-game .ss-top,.lounge-game .dk-top,.lounge-game .ds-top{position:relative;z-index:1}
.lounge-game .columns{position:relative;z-index:1;align-items:stretch}
.lounge-game .column{
  background:linear-gradient(180deg,#ffffff08,#001f1215);
  border:1px solid #dfeac813;
  border-radius:9px;
  box-shadow:inset 0 1px #ffffff0a;
}
/* Center each card precisely inside its tableau column. */
.lounge-game .columns .column>.playing-card{
  left:50%!important;
  transform:translateX(-50%)!important;
}
.lounge-game .playing-card{
  box-shadow:0 3px 7px #00180d50,0 1px 2px #00180d40!important;
  transition:box-shadow 120ms ease,filter 120ms ease;
}
.lounge-game .column .playing-card:hover{box-shadow:0 5px 12px #00180d63,0 2px 4px #00180d50!important;filter:brightness(1.015)}
.lounge-game .playing-card.chosen{outline:3px solid #f0ce74!important;box-shadow:0 0 0 2px #fff3c255,0 7px 16px #00180d70!important}
.lounge-game .column.drop-target{background:#e8dba013!important;outline:2px solid #d7b967!important;outline-offset:-2px}

.lounge-game .foundation,.lounge-game .kl-slot,.lounge-game .ft-slot,.lounge-game .fc-slot,.lounge-game .ss-slot,.lounge-game .dk-slot,.lounge-game .ds-slot{
  border-color:#e9ddbb63!important;
  background:linear-gradient(180deg,#ffffff08,#001d1214)!important;
  box-shadow:inset 0 0 0 1px #ffffff08,inset 0 3px 8px #001b1029;
}
.lounge-game .foundation:not(.complete):empty:after{content:'♠';color:#dbe7d62c;font:28px Georgia,serif}
.lounge-game .stock-caption{color:#d6e1d3;font-size:11px;letter-spacing:.1px}
.lounge-game .table-status{
  position:relative;z-index:1;display:flex;align-items:center;min-height:34px;
  color:#e6eee2;font-size:12px;line-height:1.35;padding:7px 10px;border-top:1px solid #dae5c91c;
  background:linear-gradient(180deg,#ffffff05,#001a101f);border-radius:8px;
}

.game-help-card{
  background:linear-gradient(180deg,#fffdf8,#f8f0e4);
  border:1px solid #ddcfbb;border-radius:15px;margin:14px 0 18px;padding:0;
  box-shadow:0 7px 22px #503b2011;overflow:hidden;
}
.game-help-card summary{
  list-style:none;cursor:pointer;padding:14px 16px;font:600 15px Georgia,serif;color:#244b40;
  display:flex;align-items:center;gap:9px;
}
.game-help-card summary::-webkit-details-marker{display:none}
.game-help-card summary:before{content:'♠';width:26px;height:26px;display:grid;place-items:center;border-radius:50%;background:#efe1c8;color:#234b40;font-size:13px;border:1px solid #d2bb8f}
.game-help-card summary:after{content:'▾';margin-left:auto;color:#9a7c4d;font:14px Segoe UI,sans-serif;transition:transform 150ms ease}
.game-help-card[open] summary:after{transform:rotate(180deg)}
.game-help-card .table-note{margin:0;padding:0 16px 16px 51px;line-height:1.65;color:#58685e;font-size:12.5px}

@media(min-width:1180px){
  body.ludicera-lounge:before,body.ludicera-lounge:after{position:fixed;z-index:-1;opacity:.5;pointer-events:none;filter:blur(.1px)}
  body.ludicera-lounge:before{content:'♣';left:34px;top:42%;font:112px Georgia,serif;color:#1c5a4720;transform:rotate(-12deg)}
  body.ludicera-lounge:after{content:'♦';right:38px;top:45%;font:102px Georgia,serif;color:#a4772d1c;transform:rotate(12deg)}
}

@media(max-width:860px){
  .ludicera-header{padding:9px 10px;border-radius:14px;gap:9px}
  .ludicera-header .header-visitor{order:3;margin-left:0!important}
  .ludicera-header .language-bar{order:4;margin-left:auto}
  .lounge-game .game-header{align-items:flex-start;gap:10px}
  .lounge-game .game-toolbar{width:100%;justify-content:flex-start;margin-left:0}
}
@media(max-width:700px){
  body.ludicera-lounge{padding:8px 6px 18px}
  .ludicera-header{margin-bottom:9px;min-height:0}
  .ludicera-header .logo{width:48px;height:48px}.ludicera-header .logo img{width:46px;height:46px}
  .ludicera-header h1{font-size:25px}.ludicera-header p{font-size:11px;margin-top:3px}
  .ludicera-header .header-visitor{font-size:10px!important;padding:4px 7px!important}
  .ludicera-header .language-bar{width:auto;margin-top:0;padding:2px;gap:1px}
  .ludicera-header .language-bar button{min-width:31px;min-height:29px;padding:3px}
  .ludicera-header .language-bar img{width:22px;height:15px}
  .lounge-game .game-header{padding:0 2px;margin-bottom:9px}
  .lounge-game .game-header h2{font-size:25px}.lounge-game .game-header h2:before{width:30px;height:30px;font-size:19px}
  .lounge-game .game-header p{margin-left:39px;font-size:11px}
  .lounge-game .game-toolbar{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important}
  .lounge-game .game-toolbar button{min-height:42px;padding:7px 5px;font-size:11.5px}
  .lounge-game .table-scroll{padding:3px;border-radius:15px;border-width:1px}
  .lounge-game .felt{border-radius:11px!important}
  .game-help-card summary{padding:12px;font-size:14px}.game-help-card .table-note{padding:0 12px 13px 12px;font-size:11.5px}
  .game-help-card summary:before{width:23px;height:23px}
}
@media(prefers-reduced-motion:reduce){
  .lounge-game .playing-card,.lounge-game .game-toolbar button,.game-help-card summary:after{transition:none!important}
}


/* v38.2: Klondike uses the same visual card scale as Spider on desktop. */
@media(min-width:701px) and (min-height:501px){
  #kl-table #kl-columns{
    grid-template-columns:repeat(7,minmax(0,1fr))!important;
    gap:18px!important;
  }
  #kl-table #kl-columns .column{
    min-width:0!important;
  }
  #kl-table #kl-columns .column>.playing-card{
    width:76px!important;
    max-width:76px!important;
    height:108px!important;
    left:50%!important;
    transform:translateX(-50%)!important;
  }
  #kl-table .kl-top{
    grid-template-columns:repeat(7,minmax(0,1fr))!important;
    gap:18px!important;
  }
  #kl-table .kl-slot{
    width:76px!important;
    max-width:76px!important;
    height:108px!important;
    justify-self:center!important;
  }
  #kl-table #kl-stock{
    width:76px!important;
    max-width:76px!important;
    height:108px!important;
    margin-inline:auto!important;
  }
  #kl-table .kl-slot .playing-card{
    width:76px!important;
    max-width:76px!important;
    height:108px!important;
  }
  #kl-table .kl-top>div:first-child,
  #kl-table .stock-caption{text-align:center!important}
  #kl-table #kl-foundations .kl-slot{justify-self:center!important}
}
