:root {
    --ts-primary: #DC143C; /* Crimson Red */
    --ts-primary-dark: #b01030;
    --ts-dark: #1a1a1a;
    --ts-gray: #f5f5f5;
    --ts-border: #e0e0e0;
    --ts-text: #333;
}

/* Container */
.ts-wrapper {
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--ts-text);
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    /* REMOVED the red border-top here as requested */
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    animation: tsFadeIn 0.8s ease;
}

@keyframes tsFadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* Header */
.ts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--ts-dark);
}
.ts-title {
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.5rem;
    color: var(--ts-primary);
}
.ts-btn-rules {
    background: transparent;
    border: 2px solid var(--ts-dark);
    color: var(--ts-dark);
    padding: 6px 16px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}
.ts-btn-rules:hover {
    background: var(--ts-primary);
    border-color: var(--ts-primary);
    color: #fff;
}

/* Marquee */
.ts-marquee-container {
    background: var(--ts-dark);
    color: #fff;
    padding: 10px 0;
    overflow: hidden;
    white-space: nowrap;
    margin-bottom: 25px;
    border-radius: 4px;
    border-bottom: 2px solid var(--ts-primary);
}
.ts-marquee-content {
    display: inline-block;
    animation-name: tsScroll;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}
.ts-marquee-item {
    display: inline-block;
    padding-right: 80px;
    font-size: 1rem;
    letter-spacing: 0.5px;
    font-weight: 500;
}
@keyframes tsScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-33.33%); } }

/* Cards */
.ts-card {
    background: #fff;
    border: 1px solid var(--ts-border);
    padding: 30px;
    text-align: center;
    border-radius: 6px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.ts-winner-card {
    border: 2px solid var(--ts-primary);
    background: linear-gradient(to bottom right, #fff, #fff0f3);
}
.ts-pending-card {
    background: var(--ts-gray);
    border-left: 5px solid var(--ts-dark);
}

/* Headings inside cards */
.ts-pending-card h3 {
    color: var(--ts-dark);
    font-size: 1.4rem;
    margin-top: 0;
}

.ts-winner-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--ts-primary);
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.ts-winner-name {
    font-size: 2rem;
    margin: 5px 0;
    color: var(--ts-dark);
}
.ts-winner-city {
    color: #666;
    margin: 0;
}
.ts-prize-tag {
    display: inline-block;
    margin-top: 15px;
    background: var(--ts-primary);
    color: #fff;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(220, 20, 60, 0.4);
}

/* Stats */
.ts-stats { 
    text-align: center; 
    margin-bottom: 30px; 
    font-size: 1rem; 
    color: var(--ts-dark);
    background: #fafafa;
    padding: 10px;
    border-radius: 4px;
    border: 1px dashed var(--ts-border);
}
.ts-stats strong { color: var(--ts-primary); }

/* Lists & Tables */
.ts-subtitle {
    font-size: 1.1rem;
    border-bottom: 2px solid var(--ts-primary);
    padding-bottom: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--ts-dark);
}
.ts-date { font-size: 0.8rem; color: #777; font-weight: normal; }

.ts-scroll-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--ts-border);
    background: #fff;
}
.ts-scroll-list::-webkit-scrollbar { width: 8px; }
.ts-scroll-list::-webkit-scrollbar-thumb { background: var(--ts-primary); border-radius: 4px; }
.ts-scroll-list::-webkit-scrollbar-track { background: #eee; }

.ts-scroll-list ul { list-style: none; margin: 0; padding: 0; }
.ts-scroll-list li {
    padding: 12px 15px;
    border-bottom: 1px solid var(--ts-border);
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.ts-scroll-list li:hover { background: #fff0f3; }
.ts-scroll-list li:last-child { border-bottom: none; }
.ts-entry-order { color: var(--ts-primary); font-family: monospace; font-weight: bold; }

/* Table */
.ts-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ts-table th { 
    text-align: left; padding: 12px; 
    background: var(--ts-dark); 
    color: #fff; 
    font-weight: 600; 
    text-transform: uppercase;
    font-size: 0.8rem;
}
.ts-table td { padding: 12px; border-bottom: 1px solid var(--ts-border); }
.ts-table tr:hover { background-color: #fff0f3; }
.ts-city-small { font-size: 0.8em; color: #888; margin-left: 5px; }
.ts-prize-cell { color: var(--ts-primary); font-weight: 700; }

/* Modal */
.ts-modal {
    display: none;
    position: fixed; z-index: 99999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
    align-items: center; justify-content: center;
    backdrop-filter: blur(2px);
}
.ts-modal-content {
    background-color: #fff;
    width: 90%; max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    border-top: 5px solid var(--ts-primary);
    animation: tsPopIn 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 85vh; /* Prevent modal from being taller than screen */
}
@keyframes tsPopIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.ts-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0; /* Keep header fixed */
}
.ts-modal-header h3 { margin: 0; font-size: 1.2rem; color: var(--ts-dark); }
.ts-close { font-size: 28px; cursor: pointer; color: #aaa; line-height: 20px; }
.ts-close:hover { color: var(--ts-primary); }

/* SCROLLABLE BODY */
.ts-modal-body { 
    padding: 20px; 
    line-height: 1.6; 
    font-size: 0.95rem; 
    overflow-y: auto; /* Enable Scroll */
    max-height: 60vh; /* Limit height */
}

/* Responsive */
@media(max-width: 600px) {
    .ts-header { flex-direction: column; gap: 10px; text-align: center; }
    .ts-table th, .ts-table td { padding: 8px; font-size: 0.85rem; }
    
    .ts-pending-card h3 { font-size: 1.1rem; } 
    .ts-winner-name { font-size: 1.5rem; }
}
