/* ============================================
   SPIDER SOLITAIRE (GameOS) — all classes sp-
   Load after style.css; relies on its :root vars
   (--win-bg etc.) and window/title-bar chrome.
   ============================================ */

.window-spider {
    width: 592px;
    min-width: 592px;
}

/* Menu bar hosts the Game dropdown */
.sp-menu-bar {
    position: relative;
}

.sp-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 1px;
    z-index: 60;
    min-width: 176px;
    background: var(--win-bg);
    border-top: 1px solid var(--win-white);
    border-left: 1px solid var(--win-white);
    border-right: 1px solid var(--win-darker);
    border-bottom: 1px solid var(--win-darker);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
    padding: 2px;
}

.sp-menu-entry {
    display: flex;
    align-items: center;
    font-size: 11px;
    padding: 3px 16px 3px 20px;
    position: relative;
    cursor: default;
    white-space: nowrap;
}

.sp-menu-entry:hover {
    background: var(--win-highlight);
    color: var(--win-highlight-text);
}

.sp-menu-key {
    margin-left: auto;
    padding-left: 24px;
    color: inherit;
}

.sp-menu-check {
    position: absolute;
    left: 6px;
    font-size: 8px;
    line-height: 11px;
}

.sp-menu-sep {
    height: 0;
    margin: 3px 2px;
    border-top: 1px solid var(--win-dark);
    border-bottom: 1px solid var(--win-white);
}

/* Table */
.sp-body {
    --sp-card-w: 50px;
    --sp-card-h: 68px;
    --sp-gap: 6px;
    --sp-facedown-off: 6px;
    --sp-faceup-off: 17px;
    background: #008000;
    padding: 8px;
    height: 468px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.sp-tableau {
    display: flex;
    gap: var(--sp-gap);
    justify-content: center;
    align-items: flex-start;
    flex-grow: 1;
}

.sp-column {
    position: relative;
    width: var(--sp-card-w);
    min-height: var(--sp-card-h);
}

.sp-slot {
    width: var(--sp-card-w);
    height: var(--sp-card-h);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    cursor: default;
}

.sp-col-empty {
    background: rgba(0, 0, 0, 0.1);
}

/* Cards — same look as the existing Solitaire's, sp- namespaced */
.sp-card {
    width: var(--sp-card-w);
    height: var(--sp-card-h);
    background: #fff;
    border: 1px solid #333;
    border-radius: 3px;
    cursor: default;
    position: absolute;
    left: 0;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.sp-card.sp-face-down {
    background:
        repeating-linear-gradient(
            45deg,
            #1a3399 0px,
            #1a3399 3px,
            #2244aa 3px,
            #2244aa 6px
        );
    border: 1px solid #111;
}

.sp-card.sp-face-down::after {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.sp-card.sp-selected {
    outline: 2px solid #ffff00;
    outline-offset: -1px;
    box-shadow: 0 0 6px rgba(255, 255, 0, 0.5);
}

.sp-card.sp-red { color: #cc0000; }
.sp-card.sp-black { color: #000; }

.sp-card-rank {
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
}

.sp-card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    line-height: 1;
}

/* Bottom row: completed suits (left), stock (right) */
.sp-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 10px;
    min-height: var(--sp-card-h);
    flex-shrink: 0;
}

.sp-done {
    position: relative;
    width: calc(var(--sp-card-w) + 7 * 14px);
    height: var(--sp-card-h);
}

.sp-stock {
    position: relative;
    width: calc(var(--sp-card-w) + 4 * 12px);
    height: var(--sp-card-h);
    cursor: pointer;
}

.sp-stock .sp-slot {
    position: absolute;
    right: 0;
}

.sp-stock .sp-card,
.sp-done .sp-card {
    position: absolute;
}

/* Drag ghost */
.sp-drag-ghost {
    position: fixed;
    z-index: 100000;
    pointer-events: none;
    opacity: 0.9;
    width: var(--sp-card-w, 50px);
}

.sp-drag-ghost .sp-card {
    --sp-card-w: 50px;
    --sp-card-h: 68px;
}

/* Win overlay */
.sp-win {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
}

.sp-win-box {
    background: var(--win-bg);
    border-top: 2px solid var(--win-white);
    border-left: 2px solid var(--win-white);
    border-right: 2px solid var(--win-darker);
    border-bottom: 2px solid var(--win-darker);
    padding: 16px 28px;
    text-align: center;
}

.sp-win-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

.sp-win-text {
    font-size: 11px;
    margin-bottom: 12px;
}

/* Status bar */
.sp-statusbar {
    display: flex;
    gap: 3px;
    padding: 2px 3px;
    font-size: 11px;
    background: var(--win-bg);
    flex-shrink: 0;
}

.sp-status-msg {
    flex-grow: 1;
}

.sp-status-msg,
.sp-status-cell {
    border-top: 1px solid var(--win-dark);
    border-left: 1px solid var(--win-dark);
    border-bottom: 1px solid var(--win-white);
    border-right: 1px solid var(--win-white);
    padding: 1px 6px;
    white-space: nowrap;
}

/* 16px icon: green felt, dangling spider over a wee card */
.icon-spider-sm {
    width: 16px;
    height: 16px;
    background: #008000;
    border: 1px solid #004000;
    position: relative;
    display: inline-block;
}

.icon-spider-sm::before {
    content: '';
    position: absolute;
    bottom: 1px;
    right: 2px;
    width: 6px;
    height: 8px;
    background: #fff;
    border: 1px solid #404040;
    border-radius: 1px;
}

.icon-spider-sm::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #111;
    /* thread above, legs + eyes via shadows */
    box-shadow:
        1px -5px 0 -1.5px #111,
        1px -3px 0 -1.5px #111,
        -3px -1px 0 -1px #111,
        5px -1px 0 -1px #111,
        -3px 2px 0 -1px #111,
        5px 2px 0 -1px #111;
}
