body { 
    font-family: Arial, sans-serif; 
    background: #f4f4f9; 
    padding: 0; 
    margin: 0; 
}

/* Layout container spacing rules */
.page-layout-wrapper { 
    display: flex; 
    justify-content: flex-start; 
    align-items: flex-start; 
    gap: 10px; 
    width: 100%; 
    box-sizing: border-box; 
}

/* Main App Container */
.main-app-content { 
    flex: 1;
    min-width: 0;
    margin: 0; 
    padding: 2px 12px 10px 12px;
    box-sizing: border-box; 
}

/* Top Button Row */
.button-center-row { 
    display: flex; 
    flex-wrap: wrap;
    justify-content: center; 
    align-items: center; 
    gap: 6px;
    padding: 4px 0 0;
    margin: 0; 
    width: 100%; 
}

button { 
    border: none; 
    padding: 12px 16px;
    min-height: 48px;
    font-size: 1rem; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: bold; 
    margin: 0; 
    touch-action: manipulation;
}

.btn-normal { background: #2563eb; color: #fff; } 
.btn-normal:hover { background: #1d4ed8; }
.btn-macro { background: #dc2626; color: #fff; } 
.btn-macro:hover { background: #b91c1c; }

/* Grey W Button Styling */
.btn-cycle { 
    background: #9ca3af; 
    color: #ffffff; 
    border: none; 
    padding: 10px 14px; 
}
.btn-cycle:hover { 
    background: #6b7280; 
}

button:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
}

.inline-counter { 
    font-size: 1rem; 
    font-weight: bold; 
    color: #4b5563; 
    margin-left: 6px; 
    white-space: nowrap; 
}

/* UNIFIED TICKET ROW LAYOUT (All Devices) */
.ticket-row { 
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
    padding: 3px 0;
    margin: 8px 0;
    width: 100%;
}

/* Line 1 - Element A: Label */
.label { 
    order: 1;
    font-weight: bold; 
    font-size: 1.05rem; 
    color: #4b5563; 
    text-align: left; 
    padding: 2px 6px; 
    border-radius: 4px;
    white-space: nowrap;
    box-sizing: border-box;
}

/* Reverse Video Winner Highlight for Play Label (Black Background) */
.label.is-winner {
    background-color: #000000;
    color: #ffffff;
}

/* Line 1 - Element C: Prize / Payout text */
.payout-label { 
    order: 2;
    font-weight: bold; 
    font-size: 1.05rem; 
    color: #16a34a; 
    padding-left: 6px; 
    white-space: nowrap;
}

/* Line 1 - DRAW Row Header Results Cap */
.results-end-cap { 
    order: 2;
    display: flex; 
    align-items: center; 
    padding-left: 6px;
}

.summary-inline { 
    font-weight: bold; 
    font-size: 1.05rem; 
    color: #16a34a; 
    margin-left: 6px; 
    white-space: nowrap; 
}

.multiplier-ball { 
    background: #fafafa; 
    color: #b45309; 
    border: 2px solid #f59e0b; 
    padding: 0 10px; 
    border-radius: 20px; 
    height: 32px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: bold; 
    font-size: 0.9rem; 
    margin-right: 4px; 
    white-space: nowrap; 
    box-sizing: border-box !important;
}

/* Line 2 - Element B: 6 Balls Row Wrapper */
.balls-container {
    order: 3;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-top: 4px;
    margin-left: 26px;
}

/* Base Ball Styling - Restored to 48px */
.ball { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 48px; 
    height: 48px; 
    border-radius: 50%; 
    font-weight: bold; 
    font-size: 1.15rem; 
    font-family: monospace; 
    margin: 0; 
    box-sizing: border-box !important; 
}

.quick { background: #f3f4f6; color: #374151; border: 2px solid #d1d5db; }
.powerball { background: #fee2e2; color: #991b1b; border: 2px solid #ef4444; }

.ball.hit-white { background: #16a34a!important; color: #fff!important; border: 2px solid #15803d!important; }
.ball.hit-powerball { background: #dc2626!important; color: #fff!important; border: 2px solid #991b1b!important; }

/* Sidebar Layout Boundaries */
.ad-sidebar-right { 
    width: 300px; 
    min-width: 300px; 
    flex-shrink: 0; 
    position: sticky; 
    top: 0; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding-bottom: 20px; 
}

#sidebar-ad-container {
    width: 300px;
    height: 600px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.weather-widget {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #ffffff;
    padding: 16px;
    height: 200px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.weather-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
}

.weather-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

#weather-icon { font-size: 2.8rem; line-height: 1; }
#weather-temp { font-size: 2.2rem; font-weight: bold; line-height: 1.1; }
#weather-condition { font-size: 0.9rem; opacity: 0.9; }
.weather-details { font-size: 0.8rem; opacity: 0.85; }

.news-widget {
    flex: 1;
    background-color: #ffffff;
    padding: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.news-header {
    font-size: 0.9rem;
    font-weight: bold;
    color: #1f2937;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 8px;
}

.news-feed-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-card-placeholder {
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: center;
    padding-top: 20px;
}

.news-item {
    text-decoration: none;
    color: #374151;
    font-size: 0.82rem;
    line-height: 1.35;
    padding: 8px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #2563eb;
    transition: background 0.15s ease;
}

.news-item:hover {
    background: #f3f4f6;
    color: #1d4ed8;
}

.news-item-time {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 4px;
}

.sidebar-links-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-family: sans-serif;
    width: 100%;
}

/* Tightened top margin utility class for stacked link groups */
.sidebar-links-stack.tight {
    margin-top: 6px;
}

.link-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-main-link, .sidebar-sub-link { 
    color: #1f2937; 
    text-decoration: none; 
    font-size: 14px; 
}
.sidebar-main-link { font-weight: bold; }

.link-sep { color: #4b5563; font-size: 12px; }
.sidebar-main-link:hover, .sidebar-sub-link:hover { text-decoration: underline; }

/* Sidebar Breakpoint */
@media (max-width: 700px) {
    .page-layout-wrapper { flex-direction: column; align-items: center; gap: 20px; }
    .ad-sidebar-right { position: static; width: 100%; max-width: 300px; padding-bottom: 20px; }
    .main-app-content { width: 100%; }
}
