/* =============================================
   제비뽑기 스타일
   ============================================= */

html { background: #000; }

.dl-body {
    overflow: hidden;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #f0f0f0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.dl-game {
    width: 100%;
    height: 100dvh;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Top Bar */
.dl-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    z-index: 10;
    flex-shrink: 0;
}
.dl-back {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
}
.dl-back:hover { color: #fff; }
.dl-info-badge {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(0,0,0,0.2);
}

/* Content */
.dl-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 20px;
    overflow-y: auto;
}

/* States */
.state-setup { background: #0f0f1a; }
.state-playing { background: #0f0f1a; }
.state-result { background: #0f0f1a; }

/* ===== Setup Screen ===== */
.dl-setup-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
    text-align: center;
}
.dl-setup-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 20px;
    text-align: center;
}

.dl-section-label {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
    width: 100%;
    max-width: 360px;
}

.dl-input-row {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 360px;
    margin-bottom: 12px;
}
.dl-input {
    flex: 1;
    padding: 12px 14px;
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: #fff;
    font-size: 15px;
    outline: none;
}
.dl-input:focus {
    border-color: rgba(255,215,0,0.5);
}
.dl-input::placeholder {
    color: rgba(255,255,255,0.3);
}
.dl-btn-add {
    padding: 12px 18px;
    background: rgba(255,215,0,0.2);
    border: 2px solid rgba(255,215,0,0.4);
    border-radius: 10px;
    color: #FFD700;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.dl-btn-add:active { transform: scale(0.95); }

.dl-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    max-width: 360px;
    margin-bottom: 16px;
    min-height: 36px;
}
.dl-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(78,205,196,0.15);
    color: #4ECDC4;
    border: 1px solid rgba(78,205,196,0.3);
}
.dl-tag-remove {
    cursor: pointer;
    opacity: 0.6;
    font-size: 12px;
}
.dl-tag-remove:hover { opacity: 1; }

/* 당첨 수 설정 */
.dl-count-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 360px;
    margin-bottom: 20px;
}
.dl-count-label {
    font-size: 15px;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
}
.dl-count-ctrl {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dl-count-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,215,0,0.4);
    background: rgba(255,215,0,0.1);
    color: #FFD700;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dl-count-btn:active { transform: scale(0.9); }
.dl-count-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}
.dl-count-val {
    font-size: 24px;
    font-weight: 800;
    color: #FFD700;
    min-width: 30px;
    text-align: center;
}

.dl-btn-start {
    display: inline-block;
    padding: 16px 48px;
    background: linear-gradient(135deg, #FFD700, #FF8C00);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
    margin-top: 8px;
}
.dl-btn-start:active { transform: scale(0.95); }
.dl-btn-start:disabled {
    opacity: 0.4;
    pointer-events: none;
}

.dl-error {
    color: #FF6B6B;
    font-size: 13px;
    margin-top: 8px;
    margin-bottom: 8px;
}

/* ===== Playing Screen - Cards ===== */
.dl-instruction {
    font-size: 15px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 16px;
    text-align: center;
}

.dl-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 400px;
    margin-bottom: 20px;
}

.dl-card-slot {
    perspective: 600px;
}

.dl-card {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}
.dl-card.dl-flipped {
    transform: rotateY(180deg);
}

.dl-card-front, .dl-card-back {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

/* 카드 뒷면 (기본) */
.dl-card-back {
    background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
    border: 2px solid rgba(255,255,255,0.12);
}
.dl-card-back-icon {
    font-size: 36px;
    margin-bottom: 8px;
}
.dl-card-back-name {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    text-align: center;
    word-break: keep-all;
}

/* 카드 앞면 (뒤집힌 후) */
.dl-card-front {
    transform: rotateY(180deg);
    border: 2px solid;
}
.dl-card-front.dl-win {
    background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,140,0,0.1));
    border-color: rgba(255,215,0,0.5);
}
.dl-card-front.dl-lose {
    background: linear-gradient(135deg, rgba(128,128,128,0.15), rgba(80,80,80,0.1));
    border-color: rgba(128,128,128,0.3);
}
.dl-card-front-icon {
    font-size: 40px;
    margin-bottom: 8px;
}
.dl-card-front-label {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
}
.dl-card-front.dl-win .dl-card-front-label { color: #FFD700; }
.dl-card-front.dl-lose .dl-card-front-label { color: #888; }
.dl-card-front-name {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

/* 카드 눌림 효과 */
.dl-card:not(.dl-flipped):active {
    transform: scale(0.95);
}

/* Toast */
.dl-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    white-space: nowrap;
}
.dl-toast-show {
    opacity: 1;
    pointer-events: auto;
}
