/*
 * APOC Solitaire – ein Tisch im Dunkeln, eine Lampe darüber.
 * Farbwelt wie apocalyptical.de: Night, Soot, Logo-Rot, Bone. Schriften lokal (SIL OFL).
 */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url("../fonts/archivo.woff2") format("woff2"); }
@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("../fonts/bodoni-moda.woff2") format("woff2"); }
@font-face { font-family: "Bodoni Moda"; font-style: italic; font-weight: 400 900; font-display: swap; src: url("../fonts/bodoni-moda-italic.woff2") format("woff2"); }

.sol {
  --night: #0d0a09; --soot: #171211; --vermilion: #e44028; --bone: #ece3d6; --ash: #a39589; --rule: rgba(236, 227, 214, .13);
  --display: "Archivo", "Arial Black", Arial, sans-serif; --serif: "Bodoni Moda", "Bodoni 72", Didot, "Times New Roman", serif;
  --radius: 6% / 4.3%;
  position: relative; display: flex; flex-direction: column; overflow: hidden; isolation: isolate;
  color: var(--bone); font-family: var(--display); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none;
  background:
    radial-gradient(ellipse 75% 65% at 50% 6%, #3b2219 0%, #25140f 36%, #130a08 66%, #070404 100%);
  outline: none;
}
.sol *, .sol *::before, .sol *::after { box-sizing: border-box; }
.sol::before { /* felt */
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .55; mix-blend-mode: overlay;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .55  0 0 0 0 .45  0 0 0 0 .4  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.sol::after { /* vignette */
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(ellipse 85% 85% at 50% 45%, transparent 55%, rgba(0, 0, 0, .62) 100%);
}
body.apoc-solitaire-page { margin: 0; background: #070404; overflow: hidden; }
.sol-full { position: fixed; inset: 0; }
body.admin-bar .sol-full { top: 32px; }
@media (max-width: 782px) { body.admin-bar .sol-full { top: 46px; } }
.sol-embedded { height: min(88vh, 900px); min-height: 560px; border-radius: 16px; }
.sol:fullscreen { border-radius: 0; }
.sol-light {
  position: absolute; left: 50%; top: -18%; width: 130%; height: 115%; transform: translateX(-50%); z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 46% 58% at 50% 0%, rgba(255, 214, 170, .22), rgba(255, 186, 135, .08) 46%, transparent 72%);
  mix-blend-mode: screen; animation: sol-breathe 14s ease-in-out infinite; transition: filter 3s ease;
}
@keyframes sol-breathe { 50% { opacity: .82; transform: translateX(-50%) scale(1.03); } }
.sol-glow .sol-light { filter: brightness(1.8) saturate(1.2); }
.sol-dust { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

/* ---------- HUD ---------- */
.sol-hud { position: relative; z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 12px clamp(10px, 2.4vw, 26px); }
.sol-brand { display: flex; align-items: baseline; gap: 12px; white-space: nowrap; }
.sol-brand b { font-weight: 900; font-stretch: 125%; font-size: .72rem; letter-spacing: .3em; color: var(--ash); }
.sol-brand i { font-family: var(--serif); font-size: 1.35rem; color: var(--bone); }
.sol-stats { display: flex; gap: 10px; align-items: baseline; font-variant-numeric: tabular-nums; font-size: .82rem; letter-spacing: .14em; color: var(--ash); }
.sol-time { font-family: var(--serif); font-size: 1.25rem; letter-spacing: .02em; color: var(--bone); }
.sol-dot { opacity: .4; }
.sol-tools { display: flex; justify-content: flex-end; gap: 6px; }
.sol-tools button { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--rule); background: rgba(13, 10, 9, .45); color: var(--bone); cursor: pointer; transition: border-color .25s, background .25s, opacity .25s; }
.sol-tools button[hidden] { display: none; }
.sol-tools button:hover { border-color: rgba(236, 227, 214, .45); background: rgba(236, 227, 214, .06); }
.sol-tools button:disabled { opacity: .35; cursor: default; }
.sol-tools button.off { opacity: .45; }
.sol-tools button.off svg { stroke-dasharray: 2 2; }
.sol-tools svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sol button:focus-visible, .sol select:focus-visible, .sol input:focus-visible { outline: 2px solid var(--vermilion); outline-offset: 2px; }

/* ---------- table ---------- */
.sol-table { position: relative; z-index: 5; flex: 1; min-height: 0; touch-action: none; }
.sol-slot { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); border-radius: var(--radius); border: 1px solid var(--rule); background: rgba(0, 0, 0, .16); box-shadow: inset 0 0 22px rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; }
.sol-slot span { font-family: var(--serif); font-size: calc(var(--cw) * .5); color: rgba(236, 227, 214, .1); line-height: 1; }
.sol-slot-s { cursor: pointer; }
.sol-slot-s .sol-recycle { opacity: 0; font-family: var(--display); font-size: calc(var(--cw) * .42); color: rgba(236, 227, 214, .35); transition: opacity .3s; }
.sol-slot-s.can-recycle .sol-recycle { opacity: 1; }
.sol-slot.sol-hint { border-color: var(--vermilion); box-shadow: inset 0 0 22px rgba(0, 0, 0, .45), 0 0 18px rgba(228, 64, 40, .55); }

/* ---------- cards ---------- */
.sol-c {
  position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); cursor: pointer; perspective: 1000px; will-change: transform;
  transition-property: transform, filter; transition-timing-function: cubic-bezier(.22, .8, .2, 1); transition-duration: .42s, .5s;
}
.sol-flip { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateY(180deg); transition: transform .5s cubic-bezier(.3, .7, .2, 1); }
.sol-c.up .sol-flip { transform: rotateY(0deg); }
.sol-face { position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; background: #ece3d6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .55), 0 5px 12px rgba(0, 0, 0, .32); transition: box-shadow .25s ease; }
.sol-back { transform: rotateY(180deg); background: #3c1712; }
.sol-face img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-user-drag: none; }
.sol-front::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(160deg, rgba(255, 240, 220, .12), transparent 40%, rgba(0, 0, 0, .06)); }
.sol-c.sol-drag .sol-face { box-shadow: 0 16px 34px rgba(0, 0, 0, .55), 0 4px 10px rgba(0, 0, 0, .4); }
.sol-c.sol-hint .sol-face { box-shadow: 0 0 0 2px var(--vermilion), 0 0 24px rgba(228, 64, 40, .65); }
.sol-c.sol-nope .sol-flip { animation: sol-shake .32s ease; }
@keyframes sol-shake { 25% { translate: -4px 0; } 75% { translate: 4px 0; } }

/* stock thickness */
.sol-slot-s::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--back) center / cover; opacity: 0; }

/* ---------- footer ---------- */
.sol-foot { position: relative; z-index: 10; display: flex; justify-content: space-between; gap: 12px; padding: 8px clamp(10px, 2.4vw, 26px) 12px; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(163, 149, 137, .75); }
.sol-track { text-transform: none; letter-spacing: .04em; font-family: var(--serif); font-style: italic; font-size: .82rem; }

/* ---------- overlay (start / win / loading) ---------- */
.sol-overlay { position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5, 3, 3, .5); backdrop-filter: blur(3px); opacity: 0; transition: opacity .45s ease; }
.sol-overlay.show { opacity: 1; }
.sol-overlay[hidden] { display: none; }
.sol-card-ui { max-width: 520px; text-align: center; transform: translateY(12px); transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.sol-overlay.show .sol-card-ui { transform: none; }
.sol-kicker { margin: 0 0 10px; font-weight: 700; font-stretch: 112%; font-size: .7rem; letter-spacing: .34em; text-transform: uppercase; color: var(--vermilion); }
.sol-title { margin: 0 0 16px; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(3.2rem, 2rem + 6vw, 6.4rem); line-height: 1; color: var(--bone); text-shadow: 0 0 40px rgba(255, 200, 150, .25); }
.sol-title-sm { font-size: clamp(2.6rem, 1.8rem + 4vw, 4.6rem); }
.sol-h2 { margin: 0 0 18px; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.8rem; }
.sol-lead { margin: 0 auto 26px; max-width: 30em; color: #d6cbbd; line-height: 1.6; }
.sol-small { margin: 18px 0 0; font-size: .74rem; letter-spacing: .1em; color: var(--ash); }
.sol-btns { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.sol-btn { min-height: 48px; padding: 0 28px; border: 1px solid rgba(236, 227, 214, .35); background: transparent; color: var(--bone); font: 700 .78rem/1 var(--display); font-stretch: 115%; letter-spacing: .22em; text-transform: uppercase; cursor: pointer; transition: background .2s, border-color .2s, transform .2s; }
.sol-btn:hover { border-color: var(--bone); background: rgba(236, 227, 214, .06); }
.sol-primary { background: var(--vermilion); border-color: var(--vermilion); color: #fff; }
.sol-primary:hover { background: #ff5338; border-color: #ff5338; transform: translateY(-1px); }
.sol-prog { width: 220px; height: 3px; margin: 0 auto; background: rgba(236, 227, 214, .12); overflow: hidden; }
.sol-prog i { display: block; height: 100%; width: 0; background: var(--vermilion); transition: width .2s; }
.sol-result { display: flex; justify-content: center; gap: 34px; margin: 0 0 28px; }
.sol-result div { display: flex; flex-direction: column-reverse; }
.sol-result dt { font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ash); }
.sol-result dd { margin: 0; font-family: var(--serif); font-size: 2rem; }
/* APOC Rewards: Cosmic Coins */
.sol-rw { margin: -10px auto 26px; max-width: 30em; font-size: .86rem; line-height: 1.6; color: #d6cbbd; }
.sol-rw b { font-weight: 700; font-stretch: 112%; letter-spacing: .08em; color: var(--vermilion); }
.sol-rw-link { color: var(--bone); text-decoration: underline; text-underline-offset: 2px; }
.sol-rw-link:hover { color: #fff; }
.sol-rw-hint[hidden] { display: none; }

/* ---------- settings panel ---------- */
.sol-panel { position: absolute; top: 0; right: 0; bottom: 0; z-index: 50; width: min(360px, 92vw); overflow-y: auto; padding: 18px 22px 30px; background: rgba(16, 10, 9, .95); backdrop-filter: blur(10px); border-left: 1px solid var(--rule); box-shadow: -20px 0 60px rgba(0, 0, 0, .5); transform: translateX(105%); transition: transform .38s cubic-bezier(.2, .7, .2, 1); user-select: auto; }
.sol-panel.show { transform: none; }
.sol-panel[hidden] { display: none; }
.sol-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sol-panel h2 { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.7rem; }
.sol-panel h3 { margin: 22px 0 10px; font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; color: var(--vermilion); font-weight: 700; }
.sol-x { width: 38px; height: 38px; border: 1px solid var(--rule); border-radius: 50%; background: none; color: var(--bone); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sol-x svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.sol-field { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: .78rem; color: var(--ash); }
.sol-field span { min-width: 66px; }
.sol-field select { flex: 1; min-height: 38px; background: var(--soot); color: var(--bone); border: 1px solid var(--rule); padding: 0 10px; font: 500 .86rem var(--display); }
.sol-field input[type=range] { flex: 1; accent-color: var(--vermilion); }
.sol-check { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: .86rem; cursor: pointer; }
.sol-check input { accent-color: var(--vermilion); width: 16px; height: 16px; }
.sol-seg { display: flex; border: 1px solid var(--rule); margin: 0 0 10px; }
.sol-seg button { flex: 1; min-height: 36px; border: 0; background: none; color: var(--ash); font: 600 .7rem var(--display); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.sol-seg button.on { background: var(--bone); color: var(--night); }
.sol-note { margin: 4px 0 10px; font-size: .74rem; line-height: 1.5; color: var(--ash); }
.sol-link { border: 0; background: none; padding: 0; color: var(--bone); text-decoration: underline; cursor: pointer; font: inherit; }
.sol-backs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 12px; }
.sol-backopt { min-width: 0; width: 100%; padding: 0; border: 0; background: none; color: var(--ash); cursor: pointer; font-size: .62rem; letter-spacing: .06em; text-align: center; }
.sol-backopt img { display: block; width: 100%; height: auto; max-width: 100%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: var(--radius); box-shadow: 0 4px 12px rgba(0, 0, 0, .5); outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .2s, transform .2s; }
.sol-backopt span { display: block; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sol-backopt:hover img { transform: translateY(-2px); }
.sol-backopt.on img { outline-color: var(--vermilion); }
.sol-backopt.on span { color: var(--bone); }
.sol-upload { display: inline-block; margin: 2px 0 6px; padding: 10px 14px; border: 1px dashed rgba(236, 227, 214, .3); font-size: .78rem; cursor: pointer; }
.sol-upload:hover { border-color: var(--bone); }
.sol-statlist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; }
.sol-statlist div { display: flex; flex-direction: column-reverse; }
.sol-statlist dt { font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ash); }
.sol-statlist dd { margin: 0; font-family: var(--serif); font-size: 1.3rem; }

.sol-toast { position: absolute; left: 50%; bottom: 46px; z-index: 70; transform: translate(-50%, 20px); padding: 10px 18px; background: rgba(16, 10, 9, .92); border: 1px solid var(--rule); font-size: .82rem; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; }
.sol-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 700px) {
  .sol-hud { grid-template-columns: auto 1fr; padding: 8px 10px; }
  .sol-brand b { display: none; }
  .sol-brand i { font-size: 1.1rem; }
  .sol-stats { display: none; }
  .sol-tools button { width: 36px; height: 36px; }
  .sol-foot { font-size: .58rem; padding: 6px 10px 10px; }
  .sol-foot .sol-track { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sol-light { animation: none; }
  .sol-c, .sol-flip { transition-duration: .01s !important; }
}
