/* ========================================================================
   FREECELL - Green Felt Theme with Gold Accent
   ======================================================================== */

:root {
    --fc-bg: #1a4a1a;
    --fc-bg-light: #1e5a1e;
    --fc-card-width: 100px;
    --fc-card-height: 140px;
    --fc-card-radius: 8px;
    --fc-gold: #d4af37;
    --fc-gold-light: #e8c86e;
}

/* Background */
.fc-bg {
    background: radial-gradient(ellipse at center, var(--fc-bg-light) 0%, var(--fc-bg) 100%);
}

/* Board */
.fc-board {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 8px;
    max-width: 900px;
    margin: 0 auto;
}

/* --- Top Row --- */
.fc-top-row {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.fc-free-cells,
.fc-foundations {
    display: flex;
    gap: 10px;
}

/* Slot (empty card space) */
.fc-slot {
    width: var(--fc-card-width);
    height: var(--fc-card-height);
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--fc-card-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.fc-slot:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.25);
}

.fc-slot.fc-valid-target {
    border-color: var(--fc-gold);
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.fc-slot-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fc-foundation-suit {
    font-size: 32px;
    color: rgba(255, 255, 255, 0.15);
}

.fc-foundation-slot {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.1);
}

/* --- Cards --- */
.fc-card {
    width: var(--fc-card-width);
    height: var(--fc-card-height);
    background: #fff;
    border-radius: var(--fc-card-radius);
    position: absolute;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    user-select: none;
    display: flex;
    flex-direction: column;
}

.fc-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
    z-index: 100 !important;
}

.fc-card.fc-selected {
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.6), 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-4px);
    z-index: 200 !important;
    outline: 2px solid var(--fc-gold);
}

/* Card in a slot (not in tableau) */
.fc-slot .fc-card {
    position: relative;
}

/* Card colors */
.fc-card.fc-card-red {
    color: #e53935;
}

.fc-card.fc-card-black {
    color: #1a1a1a;
}

/* Card corners */
.fc-card-corner {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    gap: 0;
    padding: 4px 6px;
}

.fc-card-tl {
    position: absolute;
    top: 0;
    left: 0;
}

.fc-card-br {
    position: absolute;
    bottom: 0;
    right: 0;
    transform: rotate(180deg);
}

.fc-card-rank {
    font-size: 16px;
    font-weight: 700;
    font-family: 'Georgia', 'Palatino Linotype', serif;
    line-height: 1;
}

.fc-card-suit {
    font-size: 13px;
    line-height: 1;
    margin-top: -1px;
}

/* Card center */
.fc-card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.fc-card-center-suit {
    font-size: 30px;
}

/* --- Tableau --- */
.fc-tableau-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.fc-tableau-col {
    width: var(--fc-card-width);
    position: relative;
    min-height: var(--fc-card-height);
}

.fc-empty-col {
    width: var(--fc-card-width);
    height: var(--fc-card-height);
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.12);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--fc-card-radius);
    cursor: pointer;
    transition: all 0.15s ease;
}

.fc-empty-col:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.fc-empty-col.fc-valid-target,
.fc-tableau-col.fc-valid-target .fc-empty-col {
    border-color: var(--fc-gold);
    background: rgba(212, 175, 55, 0.12);
}

/* --- Drag & Drop --- */
.fc-card.fc-dragging {
    opacity: 0.3;
    pointer-events: none;
}

.fc-drag-ghost .fc-card {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    outline: none;
}

.fc-drop-target-possible {
    transition: border-color 0.15s ease, background 0.15s ease;
}

.fc-drop-target-hover {
    border-color: var(--fc-gold) !important;
    background: rgba(212, 175, 55, 0.18) !important;
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.35);
}

.fc-tableau-col.fc-drop-target-hover .fc-empty-col {
    border-color: var(--fc-gold);
    background: rgba(212, 175, 55, 0.15);
}

/* --- Win Overlay --- */
.fc-win-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 20000;
    animation: fcFadeIn 0.5s ease;
    backdrop-filter: blur(6px);
}

.fc-win-card {
    background: linear-gradient(135deg, var(--fc-bg-light) 0%, var(--fc-bg) 100%);
    border: 3px solid var(--fc-gold);
    border-radius: 16px;
    padding: 40px 60px;
    text-align: center;
    color: #e0ddd4;
    box-shadow: 0 0 60px rgba(212, 175, 55, 0.3);
    animation: fcScaleIn 0.5s ease 0.2s both;
}

.fc-win-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--fc-gold-light);
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.fc-win-stats {
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.8;
}

.fc-win-stats strong {
    color: var(--fc-gold-light);
}

@keyframes fcFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fcScaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Responsive --- */
@media (max-width: 900px) {
    :root {
        --fc-card-width: 80px;
        --fc-card-height: 112px;
    }
    .fc-card-rank { font-size: 13px; }
    .fc-card-suit { font-size: 11px; }
    .fc-card-center-suit { font-size: 24px; }
    .fc-foundation-suit { font-size: 26px; }
    .fc-slot-label { font-size: 11px; }
    .fc-board { max-width: 740px; }
    .fc-top-row { gap: 8px; }
    .fc-free-cells, .fc-foundations { gap: 8px; }
    .fc-tableau-row { gap: 8px; }
    .fc-win-card { padding: 24px 32px; }
    .fc-win-title { font-size: 24px; }
}

@media (max-width: 650px) {
    :root {
        --fc-card-width: 60px;
        --fc-card-height: 84px;
    }
    .fc-card-rank { font-size: 11px; }
    .fc-card-suit { font-size: 9px; }
    .fc-card-center-suit { font-size: 18px; }
    .fc-foundation-suit { font-size: 20px; }
    .fc-slot-label { font-size: 9px; }
    .fc-board { max-width: 560px; gap: 12px; }
    .fc-top-row { gap: 4px; }
    .fc-free-cells, .fc-foundations { gap: 4px; }
    .fc-tableau-row { gap: 4px; }
}

@media (max-width: 480px) {
    :root {
        --fc-card-width: 44px;
        --fc-card-height: 62px;
    }
    .fc-card-rank { font-size: 9px; }
    .fc-card-suit { font-size: 7px; }
    .fc-card-center-suit { font-size: 14px; }
    .fc-board { max-width: 420px; gap: 8px; }
    .fc-top-row { gap: 3px; }
    .fc-free-cells, .fc-foundations { gap: 3px; }
    .fc-tableau-row { gap: 3px; }
}
