body {
    font-family: 'Inter', 'Noto Sans TC', sans-serif; 
    background-color: #F8F8F8; 
    color: #333; 
}

/* 標題樣式 */
.title-primary { color: #BD5FFF; } /* 紫色 */
.title-secondary { color: #333; } /* 深色 */

/* 卡牌場景 (3D Perspective) */
.card-scene { 
    perspective: 1000px; 
    width: 100%;
    height: 100%;
    aspect-ratio: 6 / 10; /* 確保卡牌比例一致 */
}
.card-inner {
    position: relative; 
    width: 100%;
    height: 100%;
    transition: transform 0.6s; 
    transform-style: preserve-3d; 
    cursor: default; 
}
.card-inner.is-flipped { 
    transform: rotateY(180deg); 
}

/* 卡牌正反面基礎設定 */
.card-face {
    position: absolute; 
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; 
    backface-visibility: hidden; 
    border-radius: 0.35rem;
    overflow: hidden; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); 
}

/* 卡牌正面 (初始面向後方) */
.card-front { 
    transform: rotateY(180deg); 
    background-color: white; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 卡牌背面 - Lenormand 紫色設計 */
.card-back {
    background-color: #BD5FFF; 
    background-image: linear-gradient(
        135deg,
        #BD5FFF 25%,
        #cb8dff 25%,
        #cb8dff 50%,
        #BD5FFF 50%,
        #BD5FFF 75%,
        #cb8dff 75%,
        #cb8dff 100%
    );
    background-size: 40px 40px;
}

/* 按鈕樣式 */
.btn-draw,
.btn-reset {
    background-color: #BD5FFF; 
    color: white;
    border-radius: 0.75rem;
    font-weight: 600; 
    transition: all 0.2s ease-in-out; 
    padding: 0.75rem 1.5rem; 
    font-size: 1rem; 
    line-height: 1.5rem;
}
.btn-draw:hover {
    background-color: #a44ee2;
}
.btn-draw:disabled {
    background-color: #d1d5db; 
    cursor: not-allowed; 
    color: #6b7280;
}
.btn-reset {
    background-color: #ef4444;
}
.btn-reset:hover {
    background-color: #dc2626;
}
.btn-reset:disabled {
    background-color: #d1d5db; 
    cursor: not-allowed; 
    color: #6b7280;
}

/* 隱藏捲軸 */
#cardDisplay::-webkit-scrollbar {
    display: none;
}
#cardDisplay {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 卡牌圖像填滿空間 */
.card-image-wrapper {
     width: 100%;
     height: 100%;
     display: flex;
     justify-content: center;
     align-items: center;
     overflow: hidden;
}
.card-image-wrapper img {
     width: 100%;
     height: auto;
     object-fit: contain;
}

/* 逆位開關 Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #BD5FFF;
}
input:checked + .slider:before {
    transform: translateX(26px);
}
