:root {
    --primary-red: #ff0000;
    --dark-bg: #1a1a1a;
    --card-header: linear-gradient(to bottom, #d32f2f, #8b0000);
    --yellow: #ffff00;
    --body-bg: #333333;
    --content-bg: #ffffff;
    --btn-orange: #e64a19;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: var(--body-bg);
    color: #000;
    line-height: 1.4;
}

.main-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--content-bg);
    min-height: 100vh;
    border-left: 5px solid #000;
    border-right: 5px solid #000;
}

/* Header & Nav */
header {
    background: var(--primary-red);
    padding: 10px 0;
    text-align: center;
    border-bottom: 2px solid #000;
}

header a {
    color: #fff;
    text-decoration: none;
}

.nav-bar {
    background: var(--primary-red);
    display: flex;
    flex-wrap: nowrap;
    border-top: 1px solid #fff;
}

.nav-item {
    color: #fff;
    text-decoration: none;
    padding: 7px 0;
    font-weight: bold;
    font-size: 11px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.nav-item:hover {
    background: #000;
}

.nav-item.active {
    background: #fff;
    color: #ff0000;
}

/* Intro Section */
.intro-box {
    margin: 20px;
    padding: 15px;
    border: 2px solid #000;
    text-align: center;
}

.intro-title {
    color: #ff0000;
    font-weight: bold;
    font-size: 1.2rem;
}

.branding {
    padding: 20px 0;
    text-align: center;
}

.branding h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.logo-text {
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(to bottom, #cfb53b, #8a6d3b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -2px;
}

/* Market Grid */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    padding: 20px;
}

.market-card {
    background: var(--dark-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    border: 2px solid #000;
}

.market-card-header {
    background: var(--card-header);
    padding: 15px;
    text-align: center;
    border-bottom: 2px solid #000;
}

.market-card-header h3 {
    color: var(--yellow);
    font-size: 1.4rem;
    text-transform: capitalize;
}

.market-card-body {
    padding: 15px;
    color: #fff;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.result-date {
    font-weight: bold;
    color: var(--yellow);
}

.result-number {
    background: #d32f2f;
    padding: 5px 15px;
    border-radius: 5px;
    font-weight: bold;
    border: 1px solid #fff;
}

.card-footer {
    padding: 15px;
    text-align: center;
}

.btn-paito {
    background: var(--btn-orange);
    color: var(--yellow);
    text-decoration: none;
    padding: 8px 25px;
    border-radius: 8px;
    font-weight: bold;
    border: 2px solid var(--yellow);
    display: inline-block;
}

.btn-paito:hover {
    filter: brightness(1.2);
}

/* Paito Table Section */
.paito-container {
    padding: 20px;
}

#drawing-table {
    width: 100%;
    border-collapse: collapse;
}

#drawing-table th,
#drawing-table td {
    border: 1px solid #ccc;
    padding: 5px;
    text-align: center;
}

/* Sidebar/Nav specifically for Paito */
#colormenu {
    background: #eee;
    padding: 10px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.color {
    width: 30px;
    height: 20px;
    border: 1px solid #000;
    cursor: pointer;
}

@media (max-width: 768px) {
    .market-grid {
        grid-template-columns: 1fr;
    }

    .logo-text {
        font-size: 3rem;
    }

    .main-wrapper {
        border: none;
    }

    .nav-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .nav-item {
        text-align: center;
        padding: 7px 3px;
        font-size: 10px;
        border-right: 1px solid rgba(255,255,255,0.3);
        border-bottom: 1px solid rgba(255,255,255,0.3);
    }
}
/* Compact Tools Override */
.primary-content .card-body {
    padding: 5px !important;
}
.primary-content .card-header {
    padding: 5px 10px !important;
    background: #333 !important;
    color: #fff !important;
}
.primary-content .card-header h3 {
    font-size: 14px !important;
    margin: 0 !important;
    text-transform: uppercase;
    font-weight: bold;
}
.primary-content .card {
    border-radius: 4px !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    margin-bottom: 10px !important;
}
/* Footer Premium */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-font);
    padding: 40px 0 20px;
    margin-top: 50px;
    border-top: 3px solid var(--primary-red);
}

.footer-container {
    max-width: var(--wrapper-width);
    margin: 0 auto;
    padding: 0 20px;
}

.footer-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-title {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 20px;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background: var(--primary-red);
}

.footer-text {
    line-height: 1.6;
    font-size: 13px;
}

.footer-links, .footer-contact {
    list-style: none;
    padding: 0;
}

.footer-links li, .footer-contact li {
    margin-bottom: 0px;
    font-size: 13px;
}

.footer-links a {
    color: var(--footer-font);
    text-decoration: none;
    transition: 0.2s;
}

.footer-links a:hover {
    color: #fff;
    padding-left: 5px;
}

.footer-contact i {
    color: var(--primary-red);
    margin-right: 8px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
}

.footer-bottom a {
    text-decoration: none;
    font-weight: bold;
    color: inherit;
}

@media (max-width: 768px) {
    .footer-row {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}
