* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: "Sarabun", sans-serif; 
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #00b4db, #0083b0, #1a237e);
    background-size: 200% 200%;
    animation: skyGlow 8s ease infinite;
    display: flex; 
    justify-content: center; 
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

@keyframes skyGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.stars-overlay {
    position: fixed;
    top: -50%; left: -50%; width: 200%; height: 200%;
    pointer-events: none;
    background-image: 
        radial-gradient(2px 2px at 50px 100px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(3px 3px at 150px 300px, #ffd700, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 250px 80px, #00f0ff, rgba(0,0,0,0)),
        radial-gradient(3px 3px at 350px 400px, #ff4081, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 350px 350px;
    animation: starRotate 40s linear infinite;
    opacity: 0.7;
    z-index: 1;
}

@keyframes starRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ticket {
    margin-top: 60px !important;
    width: 100%; 
    max-width: 440px; 
    border-radius: 20px;
    overflow: hidden; 
    color: #2b2b2b; 
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 25px rgba(255, 215, 0, 0.3);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    background: #ffffff;
    margin: auto;
}

.ticket-banner {
    width: 100%;
    background: #00b4db;
}
.ticket-banner img {
    width: 100%;
    height: auto;
    display: block;
}

.ticket-head {
    background: linear-gradient(135deg, #101c54, #1e3c72);
    color: #fff; 
    padding: 16px 15px; 
    text-align: center; 
    font-family: 'Kanit', sans-serif;
    border-bottom: 3.5px solid #ffd700;
}
.ticket-head h1 { 
    font-size: 21px; 
    font-weight: 800; 
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.4); 
    letter-spacing: 0.5px; 
    line-height: 1.3;
}
.ticket-head .sub-title {
    font-size: 13.5px;
    color: #ffe082;
    font-weight: 700;
    margin-top: 2px;
    letter-spacing: 0.5px;
}
.ticket-head .meta-info { 
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 16px;
    border-radius: 20px;
    margin-top: 10px;
    font-size: 13px; 
    color: #ffffff; 
    font-weight: 600; 
    line-height: 1.4;
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.ticket-body { 
    padding: 18px 16px; 
    background: #f4f9fc;
}

.target-box {
    background: #e1f5fe;
    border: 1.5px dashed #0288d1;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 13.5px;
    color: #01579b;
    line-height: 1.5;
    text-align: center;
}
.target-box strong { color: #0277bd; font-family: 'Kanit', sans-serif; }

.event-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 14px 12px;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    border: 2px solid #ffb300;
}

.event-header {
    background: linear-gradient(135deg, #1565c0, #1e88e5);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 10px;
    font-family: 'Kanit', sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.event-title { font-size: 15px; font-weight: 700; }
.event-pool { 
    font-size: 12px; 
    background: linear-gradient(135deg, #ff1744, #d50000); 
    color: #fff;
    padding: 3px 10px; 
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(213, 0, 0, 0.3);
    white-space: nowrap;
}

/* Mission Styles */
.mission-grid { display: flex; flex-direction: column; gap: 10px; }
.mission-row {
    background: linear-gradient(135deg, #fffdf0, #fff8e1);
    border: 2px solid #ffe082;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.mission-row.special {
    background: linear-gradient(135deg, #fff0f3, #ffe4e8);
    border: 2px solid #ff80ab;
}
.mission-info .title { font-family: 'Kanit'; font-size: 14px; font-weight: 700; color: #1a237e; }
.mission-info .cond { font-size: 11.5px; color: #555; font-weight: 600; margin-top: 2px; }
.mission-prize { font-family: 'Kanit'; font-size: 15px; font-weight: 800; text-align: right; line-height: 1.2; color: #d48806; }
.mission-row.special .mission-prize { color: #c2185b; }

/* --- Horizontal Slider Style for Steps --- */
.slider-container {
    position: relative;
    width: 100%;
}
.steps-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: #0288d1 #e1f5fe;
}
.steps-slider::-webkit-scrollbar {
    height: 6px;
}
.steps-slider::-webkit-scrollbar-track {
    background: #e1f5fe;
    border-radius: 10px;
}
.steps-slider::-webkit-scrollbar-thumb {
    background: #0288d1;
    border-radius: 10px;
}
.step-card {
    flex: 0 0 100%;
    scroll-snap-align: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.step-header {
    font-family: 'Kanit', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.step-badge {
    background: #1e3c72;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}
.step-desc {
    font-size: 12.5px;
    color: #475569;
    margin-bottom: 8px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.step-img {
    width: 100%;
    max-width: 220px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.slider-hint {
    text-align: center;
    font-size: 11.5px;
    color: #0288d1;
    margin-top: 6px;
    font-weight: 600;
}

.ticket-foot {
    border-top: 2px dashed #b2ebf2; 
    padding: 16px; 
    text-align: center; 
    background: #e0f7fa;
    margin-top: auto;
}
.ticket-foot .note { 
    color: #006064; 
    line-height: 1.5; 
    font-size: 11.5px; 
    text-align: left;
    margin-bottom: 14px;
}
.ticket-foot .note strong {
    font-size: 12.5px;
    color: #004d40;
}

.btn-play {
    display: block; 
    width: 100%; 
    background: linear-gradient(135deg, #ff2a6d, #ff5252); 
    color: #ffffff;
    font-family: 'Kanit'; 
    font-weight: 800; 
    text-decoration: none; 
    padding: 13px;
    border-radius: 12px; 
    font-size: 15.5px;
    box-shadow: 0 4px 14px rgba(255, 42, 109, 0.4);
    text-align: center;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}
.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 42, 109, 0.5);
}

/* ================= PLAYER PROGRESS CARD ================= */
.progress-card {
    background: linear-gradient(135deg, #ffffff, #fffdf4);
    border-radius: 16px;
    padding: 14px 12px;
    margin-bottom: 12px;
    border: 2px solid #ffb300;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    color: #1a237e;
    position: relative;
    overflow: hidden;
}
.progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-family: 'Kanit', sans-serif;
}
.user-badge {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 1.5px solid #64b5f6;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: #0d47a1;
    letter-spacing: 0.3px;
}
.progress-numbers {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
}
.progress-numbers .current {
    font-size: 20px;
    font-weight: 800;
    color: #00c853;
}
.progress-numbers .target {
    color: #d48806;
    font-weight: 800;
}
.progress-track {
    width: 100%;
    height: 25px;
    background: #e2e8f0;
    border-radius: 20px;
    padding: 2px;
    border: 1.5px solid #cbd5e1;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}
.progress-fill {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, #ff9100, #ffc400, #00e676);
    background-size: 200% 100%;
    animation: barGlow 3s ease infinite;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    min-width: 0;
}
.progress-fill.completed {
    background: linear-gradient(90deg, #00c853, #69f0ae, #00e676);
    box-shadow: 0 0 10px rgba(0, 200, 83, 0.5);
}
@keyframes barGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.progress-percent-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Kanit', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #1a237e;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
    z-index: 2;
}
.btn-claim {
    margin-top: 12px;
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 11px 10px;
    font-family: 'Kanit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.btn-claim.ready {
    background: linear-gradient(135deg, #ff6d00, #ffab00);
    color: #ffffff;
    border: 1.5px solid #ffd740;
    box-shadow: 0 4px 14px rgba(255, 109, 0, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.btn-claim.ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 109, 0, 0.55);
}
.btn-claim.disabled {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    color: #b45309;
    border: 1.5px dashed #ffb300;
    cursor: default;
    box-shadow: none;
}
.btn-claim.claimed {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #1b5e20;
    border: 1.5px solid #66bb6a;
    cursor: default;
    box-shadow: none;
    white-space: normal;
    line-height: 1.35;
}
.btn-claim.claimed .claimed-sub {
    display: block;
    font-size: 11.5px;
    font-weight: 500;
    color: #2e7d32;
    margin-top: 2px;
}
.btn-claim.full {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    border: 1.5px solid #ef9a9a;
    cursor: not-allowed;
    box-shadow: none;
}
