/* Jeggataire: classic solitaire table */
#jt-box { position: relative; width: 100%; height: min(86vh, 860px); min-height: 520px; margin: 0 auto; border-radius: 10px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 35%, #2f9a52 0%, #1f7a3e 55%, #145a2c 100%); font-family: Arial, Helvetica, sans-serif; color: #fff;
  user-select: none; -webkit-user-select: none; touch-action: none; -webkit-tap-highlight-color: transparent; }
#jt-box.full { position: fixed; inset: 0; width: auto; height: auto; min-height: 0; border-radius: 0; z-index: 1000; }
#jt-box * { box-sizing: border-box; }
/* felt texture */
#jt-box::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.25) 0 1px, transparent 1px 4px), repeating-linear-gradient(-45deg, rgba(255,255,255,.12) 0 1px, transparent 1px 5px); }
#jt-top { position: absolute; left: 0; right: 0; top: 0; height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px;
  background: rgba(0,0,0,.28); font-size: 14px; font-weight: bold; z-index: 3; }
#jt-top .stat b { font-weight: normal; opacity: .8; margin-right: 4px; }
#jt-top .mid { flex: 1; text-align: center; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #ffe27a; }
#jt-top .full-btn { background: none; border: 0; color: #fff; font-size: 18px; cursor: pointer; padding: 0 2px; }
#jt-table { position: absolute; left: 0; right: 0; top: 34px; bottom: 58px; z-index: 1; }
#jt-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 58px; display: flex; justify-content: space-around; align-items: stretch;
  background: linear-gradient(#1a1a1a, #000); z-index: 3; border-top: 1px solid #333; }
#jt-bar button { flex: 1; background: none; border: 0; color: #eee; font: inherit; font-size: 11px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; padding: 4px 0; }
#jt-bar button i { font-style: normal; font-size: 22px; line-height: 1; }
#jt-bar button:active { background: rgba(255,255,255,.08); }
#jt-bar button[disabled] { opacity: .35; cursor: default; }
/* piles */
.jt-slot { position: absolute; border-radius: 7%/5%; border: 2px solid rgba(255,255,255,.28); background: rgba(0,0,0,.08); }
.jt-slot.found::after { content: attr(data-mark); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 160%; color: rgba(255,255,255,.28); }
.jt-slot.stock { cursor: pointer; }
.jt-slot.stock::after { content: "↻"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 200%; color: rgba(255,255,255,.4); }
.jt-slot.stock.done::after { content: "✕"; }
/* cards */
.jc { position: absolute; left: 0; top: 0; perspective: 600px; will-change: transform; }
.jc .in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .26s ease; transform: rotateY(180deg); }
.jc.up .in { transform: rotateY(0deg); }
.jc img, .jc canvas { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 7%/5%;
  box-shadow: 0 1px 2px rgba(0,0,0,.45); pointer-events: none; }
.jc .bk { transform: rotateY(180deg); }
.jc.anim { transition: transform .22s cubic-bezier(.25,.8,.35,1); }
.jc.slow { transition: transform .38s cubic-bezier(.25,.8,.35,1); }
.jc.drag img, .jc.drag canvas { box-shadow: 0 8px 16px rgba(0,0,0,.45); }
.jc.hint img, .jc.hint canvas { box-shadow: 0 0 0 3px #ffe600, 0 0 14px 4px rgba(255,230,0,.8); }
.jc.shake { animation: jt-shake .3s; }
@keyframes jt-shake { 0%,100% { margin-left: 0; } 25% { margin-left: -5px; } 75% { margin-left: 5px; } }
/* big buttons over the table */
#jt-auto { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 4; display: none; }
.jt-btn { background: linear-gradient(#ffe36a, #f5c400); color: #222; border: 2px solid #8a6d00; border-radius: 10px; font: bold 16px Arial, sans-serif; padding: 9px 18px;
  cursor: pointer; box-shadow: 0 3px 0 #8a6d00; }
.jt-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a6d00; }
.jt-btn.blue { background: linear-gradient(#7fb8ff, #3d86e6); border-color: #1f4f99; box-shadow: 0 3px 0 #1f4f99; color: #fff; }
.jt-btn.gray { background: linear-gradient(#eee, #ccc); border-color: #777; box-shadow: 0 3px 0 #777; }
.jt-btn[disabled] { opacity: .5; cursor: default; }
#jt-fx { position: absolute; inset: 0; z-index: 5; display: none; cursor: pointer; }
/* panels */
.jt-panel { position: absolute; inset: 0; z-index: 6; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; padding: 12px; }
.jt-panel.on { display: flex; }
.jt-card { background: #fdfcf7; color: #222; border-radius: 14px; width: 100%; max-width: 460px; max-height: 100%; overflow: auto; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.jt-card h3 { margin: 0; padding: 12px 16px; background: #1f7a3e; color: #fff; font-size: 18px; display: flex; justify-content: space-between; align-items: center; border-radius: 14px 14px 0 0; position: sticky; top: 0; z-index: 1; }
.jt-card h3 button { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.jt-card .body { padding: 14px 16px; }
.jt-card .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 10px 0 2px; }
.jt-list button.item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 1px solid #ddd; border-radius: 10px; padding: 10px 12px;
  margin: 0 0 8px; cursor: pointer; font: inherit; color: #222; }
.jt-list button.item i { font-style: normal; font-size: 24px; width: 30px; text-align: center; }
.jt-list button.item b { display: block; font-size: 15px; }
.jt-list button.item span { font-size: 12px; color: #666; }
.jt-opt { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid #eee; font-size: 15px; }
.jt-seg { display: inline-flex; border: 1px solid #1f7a3e; border-radius: 8px; overflow: hidden; }
.jt-seg button { background: #fff; border: 0; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: #1f7a3e; }
.jt-seg button.on { background: #1f7a3e; color: #fff; }
.jt-stats { width: 100%; border-collapse: collapse; font-size: 14px; }
.jt-stats td { padding: 6px 4px; border-bottom: 1px solid #eee; }
.jt-stats td:last-child { text-align: right; font-weight: bold; }
.jt-win h2 { margin: 4px 0 6px; text-align: center; font-size: 26px; color: #1f7a3e; }
.jt-win .big { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; margin: 8px 0; }
.jt-win .big div { background: #f1f6ee; border-radius: 8px; padding: 8px 2px; font-size: 12px; color: #555; }
.jt-win .big b { display: block; font-size: 19px; color: #222; }
.jt-stars { text-align: center; font-size: 34px; letter-spacing: 4px; color: #f5b400; text-shadow: 0 1px 0 #8a6d00; }
.jt-stars .off { color: #d9d9d9; text-shadow: none; }
/* daily calendar */
.jt-cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.jt-cal-head button { background: #eee; border: 0; border-radius: 8px; width: 34px; height: 30px; font-size: 16px; cursor: pointer; }
.jt-cal-head button[disabled] { opacity: .3; }
.jt-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.jt-cal .dow { font-size: 11px; color: #888; padding-bottom: 2px; }
.jt-cal button { aspect-ratio: 1; border: 1px solid #ddd; background: #fff; border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer; position: relative; color: #222; padding: 0; }
.jt-cal button.today { border: 2px solid #1f7a3e; font-weight: bold; }
.jt-cal button.sel { background: #e3f3e7; }
.jt-cal button.won { background: #fff6cf; border-color: #e0b400; }
.jt-cal button.won::after { content: "👑"; position: absolute; top: -2px; right: 0; font-size: 12px; }
.jt-cal button[disabled] { color: #ccc; background: #fafafa; cursor: default; }
.jt-cal span { display: block; }
/* challenges */
.jt-level { background: #f1f6ee; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.jt-level b { font-size: 18px; }
.jt-bar2 { height: 10px; background: #dfe7da; border-radius: 6px; overflow: hidden; margin-top: 6px; }
.jt-bar2 i { display: block; height: 100%; background: linear-gradient(90deg, #3fae5e, #1f7a3e); }
.jt-chap { margin: 14px 0 6px; font-weight: bold; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; }
.jt-chap span { font-weight: normal; font-size: 12px; color: #777; }
.jt-chal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.jt-chal button { border: 1px solid #cfd8cc; background: #fff; border-radius: 10px; padding: 8px 2px 6px; cursor: pointer; font: inherit; color: #222; font-size: 12px; line-height: 1.2; }
.jt-chal button b { display: block; font-size: 16px; }
.jt-chal button .st { color: #f5b400; letter-spacing: 1px; font-size: 13px; }
.jt-chal button .st .off { color: #ddd; }
.jt-chal button[disabled] { background: #f3f3f3; color: #aaa; cursor: default; }
.jt-chal button.done { background: #f6fbf3; border-color: #9ccc9f; }
.jt-goal { background: #fff6cf; border: 1px solid #e8cd5b; border-radius: 10px; padding: 10px 12px; font-size: 15px; margin: 6px 0 10px; }
.jt-toast { position: absolute; left: 50%; top: 46px; transform: translateX(-50%); background: rgba(0,0,0,.75); color: #fff; padding: 7px 14px; border-radius: 18px; font-size: 14px;
  z-index: 7; pointer-events: none; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.jt-toast.on { opacity: 1; }
@media (max-width: 520px) {
  #jt-box { height: calc(100svh - 120px); min-height: 480px; }
  #jt-top { font-size: 12px; padding: 0 6px; }
  #jt-bar button { font-size: 10px; }
  .jt-chal { grid-template-columns: repeat(4, 1fr); }
}
