/* =============================================
   xlotto.pl — Mobile-First Responsive CSS
   ============================================= */

/* --- Reset & Base (Mobile) --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    color: #222;
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #1a5c2a;
    -webkit-text-size-adjust: 100%;
}

a {
    color: #0066FF;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    border: 0;
    max-width: 100%;
    height: auto;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

p {
    font-size: 16px;
    line-height: 1.6;
    margin: 12px 0;
}

/* --- Header / Top Div --- */
#topdiv {
    background: linear-gradient(135deg, #0d3b1a 0%, #1a5c2a 100%);
    padding: 12px 16px;
    text-align: center;
}

h1 {
    font-size: 18px;
    margin: 0 0 4px;
    color: #FFFA7D;
    text-align: center;
    line-height: 1.3;
}

h1 span {
    font-size: 22px;
    color: #ffa500;
}

.xlotto {
    text-decoration: none;
    font-size: 20px;
    color: #FFFA7D;
}

.xlotto:hover {
    text-decoration: underline;
}

.intro {
    display: none;
}

/* --- Main Container --- */
#main {
    width: 100%;
    max-width: 1020px;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

/* --- Navigation Menu --- */
.topmenu {
    background: #0d3b1a;
    padding: 0;
    margin: 0;
    overflow: hidden;
    font-size: 15px;
}

.menu-toggle {
    display: block;
    background: #0d3b1a;
    color: #fff;
    border: none;
    padding: 14px 16px;
    font-size: 16px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.menu-toggle::after {
    content: "\25BC";
    float: right;
    font-size: 12px;
    transition: transform 0.2s;
}

.menu-toggle.open::after {
    transform: rotate(180deg);
}

.topmenu .menu-items {
    display: none;
    flex-direction: column;
}

.topmenu .menu-items.show {
    display: flex;
}

.topmenu a {
    display: block;
    padding: 10px 16px;
    color: #cfc;
    border-top: 1px solid #1a5c2a;
    text-decoration: none;
}

.topmenu a:hover {
    background: #1a5c2a;
    color: #fff;
    text-decoration: none;
    font-weight: normal;
}

.topmenu a.active {
    font-weight: bold;
    color: #ffdd57;
    background: #164d24;
}

/* Sub-menu for maps (sort/range) */
.maps .topmenu {
    height: auto;
}

#content > .topmenu {
    background: #e8f5e9;
    border-radius: 8px;
    margin: 8px;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

#content > .topmenu a {
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    color: #1a5c2a;
    font-size: 15px;
    background: #fff;
}

#content > .topmenu a.active {
    background: #1a5c2a;
    color: #fff;
}

/* --- Content Area --- */
#content {
    width: 100%;
    margin: 0;
    padding: 8px 0;
    background: #FFFEDC;
    border: 2px solid #D6B50A;
    border-radius: 0 0 12px 12px;
}

/* --- Results Section (#ostatnieWyniki) --- */
#ostatnieWyniki {
    margin: 0 8px 16px;
    background: #162;
    border: 2px solid #140;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
}

#ostatnieWyniki div {
    float: none;
    width: 100%;
    height: auto !important;
    text-align: center;
    border: none;
    border-bottom: 1px solid #2a7a3a;
    padding: 12px 8px 16px;
}

#ostatnieWyniki div:last-child {
    border-bottom: none;
}

h2 {
    color: #eea;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin: 8px 0;
}

h2 span {
    font-size: 13px;
    font-weight: normal;
}

#ostatnieWyniki p {
    font-size: 18px;
    color: #ffff66;
    font-weight: normal;
    margin: 4px 0;
    text-align: center;
}

#ostatnieWyniki .pula span {
    font-size: 18px;
    color: #eff;
}

#ostatnieWyniki ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin: 8px auto;
    width: auto;
    max-width: 100%;
}

#ostatnieWyniki a {
    color: #aaffff;
    margin: 0 6px;
    font-size: 15px;
}

/* Lottery balls */
#content ul {
    overflow: visible;
}

#content li {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent url(kula5.gif) no-repeat center center;
    background-size: contain;
    font-size: 15px;
    font-weight: bold;
    font-family: arial, sans-serif;
    height: 36px;
    width: 36px;
    margin: 0;
    padding: 5px 14px;
    color: #000;
    float: none;
    line-height: 36px;
}

#content li.plus {
    background-image: url(kula2.gif);
    color: #000;
}

/* --- Game-specific overrides (remove fixed sizes) --- */
#ostatnieWyniki #wyniki-lotto,
#ostatnieWyniki #wyniki-multimulti,
#ostatnieWyniki #wyniki-lottoplus,
#ostatnieWyniki #wyniki-minilotto,
#ostatnieWyniki #wyniki-kaskada,
#ostatnieWyniki #wyniki-keno,
#ostatnieWyniki #wyniki-eurojackpot,
#ostatnieWyniki #wyniki-pensja,
#ostatnieWyniki #wyniki-szybkie600,
#ostatnieWyniki #wyniki-super-szansa,
#ostatnieWyniki #adsense,
#ostatnieWyniki #ekstra-premia {
    width: 100%;
    height: auto !important;
    float: none;
    border: none;
    border-bottom: 1px solid #2a7a3a;
    padding: 20px 8px 20px;
}

#ostatnieWyniki #ekstra-premia {
}

#wyniki-lotto ul,
#wyniki-lottoplus ul,
#wyniki-minilotto ul,
#wyniki-multimulti ul,
#wyniki-keno ul,
#wyniki-kaskada ul,
#wyniki-pensja ul,
#wyniki-eurojackpot ul,
#ostatnieWyniki #wyniki-super-szansa ul {
    width: auto;
    margin: 8px auto;
}

#wyniki-lotto p,
#wyniki-lotto p.pula,
#wyniki-multimulti p.pula,
#wyniki-minilotto p,
#wyniki-eurojackpot .pula,
#wyniki-szybkie600 .pula {
    margin: 8px 0;
    text-align: center;
}

#wyniki-pensja .plus {
    margin-right: 0;
}

/* Mobile order: Pensja, Premia, Keno, Szybkie600, Eurojackpot */
#wyniki-pensja { order: 1; }
#ekstra-premia { order: 2; }
#wyniki-keno { order: 3; }
#wyniki-szybkie600 { order: 4; }
#wyniki-eurojackpot { order: 5; }

/* --- AdSense in results --- */
#ostatnieWyniki #adsense {
    border: none;
    padding: 12px 0;
    text-align: center;
}

/* --- Sidebar (#skyscraper) --- */
#skyscraper {
    float: none;
    width: 100%;
    padding: 16px 0;
    margin: 0;
    border: 2px solid #D6B50A;
    border-top: 0;
    border-radius: 0;
    background: #FFFEDC;
}

#skyscraper a {
    color: #0066FF;
}

#adsense-right {
    padding: 12px;
    border: none;
    float: none;
    text-align: center;
    display: none;
}

/* --- Clock --- */
#clock {
    position: relative;
    width: 182px;
    height: 185px;
    margin: 5px auto;
    padding-top: 90px;
    font-size: 14px;
    font-weight: bold;
    color: #00f;
    background: url(clock/clockface180.gif) no-repeat;
    list-style: none;
    float: none;
    display: none;
}

#sec, #min, #hour {
    position: absolute;
    width: 9px;
    height: 180px;
    top: 0;
    left: 85px;
}

#sec { background: url(clock/sechand180.png); z-index: 3; }
#min { background: url(clock/minhand180.png); z-index: 2; }
#hour { background: url(clock/hourhand180.png); z-index: 1; }

/* --- Today's draws --- */
#dzisiejsze {
    margin: 0 16px 16px;
    padding: 12px;
    background: #fff8dc;
    border-radius: 8px;
}

#dzisiejsze h3 {
    color: #c00;
    text-align: center;
    font-size: 16px;
    margin: 0 0 8px;
    padding: 0;
}

#dzisiejsze ul {
    text-align: center;
    margin-bottom: 8px;
}

#dzisiejsze li {
    font-size: 15px;
    font-weight: bold;
    line-height: 28px;
}

#dzisiejsze a {
    font-weight: bold;
}

/* --- Links section --- */
#links {
    float: none;
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    border: none;
    text-align: center;
    font-size: 15px;
}

/* --- Reklama (Ads) --- */
#reklama {
    margin: 16px auto;
    height: auto;
    text-align: center;
    overflow: hidden;
}

.reklama {
    width: 100%;
    max-width: 750px;
    padding: 0;
    background: transparent;
    margin: 8px auto;
    color: #222;
}

.googleads {
    margin: 12px 0;
    position: relative;
    text-align: center;
}

/* --- Footer --- */
.clear {
    clear: both;
}

#bottom {
    clear: both;
}

#footer {
    margin: 16px;
    color: #ccc;
    font-size: 14px;
    text-align: center;
}

#footer img {
    vertical-align: middle;
}

/* --- Headings --- */
h3 {
    color: #131;
    padding: 7px 0;
    margin: 10px 0 0;
    font-size: 16px;
    text-align: center;
}

h4 {
    padding: 8px;
    margin: 0;
    color: #00f;
    background: #FFFA88;
    font-size: 16px;
    text-align: center;
}

h4.status {
    position: static;
    width: auto;
}

/* --- Info bar --- */
.info {
    position: static;
    background: #ffff66;
    color: #0066FF;
    width: auto;
    margin: 8px;
    padding: 8px 12px;
    font: bold 16px/1.4 inherit;
    border-radius: 8px;
}

/* --- Live stream banner --- */
#nazywo {
    overflow: auto;
    margin: 8px auto;
}

#nazywo h2 {
    color: #f00;
    clear: both;
    width: auto;
    padding: 16px;
    background: #ffa;
    border: 1px solid #888;
    border-radius: 8px;
    font-size: 16px;
}

/* --- Map (Heat Map) --- */
.mapa-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 8px;
}

.mapa {
    margin: auto;
    border: 1px solid #999;
    border-collapse: collapse;
    font-size: 11px;
}

.mapa td {
    padding: 4px 3px;
    font-size: 11px;
    background: #fff;
    color: #777;
    text-align: center;
    white-space: nowrap;
}

#mapa2 td, #mapa3 td, #mapa6 td, #mapa8 td { font-family: tahoma, sans-serif; }
#mapa5 td { padding: 5px; }
#mapa7 td { padding: 3px; }

td.nr { background: #0273B3; color: #fff; font-weight: bold; position: sticky; left: 0; z-index: 1; }
td.m { background: #260; color: #ff0; }
td.n { background: #a00; color: #ff0; }

#sortuj {
    margin-left: 16px;
}

/* --- Game descriptions --- */
.feed {
    font-size: 15px;
    line-height: 1.6;
    margin: 16px 12px;
}

.feed dt {
    margin: 16px 0 8px;
    font-weight: bold;
    font-size: 19px;
    color: #1a5c2a;
}

.feed dd {
    text-align: left;
    margin: 4px 0 12px;
}

/* --- Input --- */
input[type=text] {
    border: 1px solid #333;
    padding: 8px;
    font-size: 14px;
    width: 100%;
    max-width: 300px;
}

/* --- Modal Dialogs (native <dialog>) --- */
dialog.modal {
    border: none;
    border-radius: 12px;
    padding: 16px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    text-align: left;
    line-height: 1.6;
}

dialog.modal::backdrop {
    background: rgba(0,0,0,0.5);
}

.modal-close {
    float: right;
    background: #c00;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 15px;
    cursor: pointer;
    margin: 0 0 8px 8px;
}

.modal-close:hover {
    background: #a00;
}

dialog.modal table {
    border: 1px solid #ccc;
    margin: 8px auto;
    width: 100%;
    border-collapse: collapse;
}

dialog.modal td {
    text-align: center;
    border: 1px solid #ccc;
    padding: 6px 8px;
    font-size: 14px;
    background: #efe;
}

dialog.modal .even td { background: #ffffcc; }
dialog.modal span { color: #00f; }

dialog.modal td .plus {
    padding-right: 8px;
    color: #0000FF;
}

dialog.modal th {
    text-align: center;
    border: 1px solid #ccc;
    padding: 6px 8px;
    line-height: 1.3;
    font-size: 14px;
    background: #270;
    font-weight: normal;
    color: #fff;
}

dialog.modal .even th { background: #393; }

/* --- Currency --- */
#kursy_walut {
    float: none;
    text-align: left;
    width: 100%;
    border: none;
    background: #FFFEDC;
    padding: 12px;
}

/* --- Misc --- */
div {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    text-align: center;
}

.center { text-align: center; }
.left { float: left; }
.fontBig { font-size: 18px; }


/* =============================================
   TABLET (min-width: 600px)
   ============================================= */
@media (min-width: 600px) {

    h1 {
        font-size: 18px;
    }

    h1 span {
        font-size: 24px;
    }

    .xlotto {
        font-size: 22px;
    }

    .intro {
        display: block;
        border: 0;
        padding: 0 16px 8px;
        text-align: justify;
        margin: 0 auto;
        width: auto;
        color: #fff;
        font-weight: bold;
        font-size: 14px;
        line-height: 1.5;
    }

    .intro a {
        color: #ffff00;
    }

    #content {
        border-radius: 12px 12px 0 0;
    }

    /* Results grid: 2 columns on tablet */
    #ostatnieWyniki {
        margin: 0 12px 16px;
        display: flex;
        flex-wrap: wrap;
    }

    #ostatnieWyniki div,
    #ostatnieWyniki #wyniki-lotto,
    #ostatnieWyniki #wyniki-multimulti,
    #ostatnieWyniki #wyniki-lottoplus,
    #ostatnieWyniki #wyniki-minilotto,
    #ostatnieWyniki #wyniki-kaskada,
    #ostatnieWyniki #wyniki-keno,
    #ostatnieWyniki #wyniki-eurojackpot,
    #ostatnieWyniki #wyniki-pensja {
        width: 50%;
        border-bottom: 1px solid #2a7a3a;
        border-right: 1px solid #2a7a3a;
    }

    #ostatnieWyniki div:nth-child(even) {
        border-right: none;
    }

    #ostatnieWyniki #adsense {
        width: 50%;
    }

    #ostatnieWyniki #ekstra-premia {
        width: 100%;
    }

    #content li {
        height: 32px;
        width: 32px;
        font-size: 15px;
        line-height: 32px;
    }

    .mapa td {
        padding: 4px 3px;
        font-size: 11px;
    }

    dialog.modal td,
    dialog.modal th {
        font-size: 14px;
        padding: 6px 8px;
    }

    .feed {
        margin: 16px 24px;
        font-size: 15px;
    }

    .feed dt {
        font-size: 19px;
    }
}


/* =============================================
   DESKTOP (min-width: 980px)
   ============================================= */
@media (min-width: 980px) {

    body {
        font-size: 16px;
        background: #1a5c2a;
    }

    #topdiv {
        padding: 16px 20px;
    }

    h1 {
        font-size: 20px;
    }

    h1 span {
        font-size: 28px;
    }

    .xlotto {
        font-size: 24px;
    }

    .intro {
        width: 960px;
        font-size: 15px;
    }

    /* Navigation: horizontal on desktop */
    .menu-toggle {
        display: none;
    }

    .topmenu .menu-items {
        display: flex !important;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0;
    }

    .topmenu a {
        padding: 9px 9px;
        border-top: none;
        font-size: 14px;
    }

    /* Main layout: content + sidebar */
    #main {
        width: 980px;
        display: flex;
        flex-wrap: wrap;
        padding-top: 0;
    }

    .topmenu {
        width: 100%;
        border-radius: 0;
    }

    #content {
        width: 794px;
        float: left;
        border-radius: 0 0 0 12px;
        padding-top: 10px;
    }

    #skyscraper {
        float: left;
        width: 180px;
        padding: 0 0 30px;
        margin-top: 0;
        border: 2px solid #D6B50A;
        border-width: 2px 2px 2px 0;
        border-radius: 0;
    }

    #links {
        float: left;
        margin: 0;
        padding: 10px;
        width: 160px;
        border-style: solid;
        border-color: #D6B50A;
        border-width: 0 2px 2px 0;
        text-align: center;
    }

    /* Results grid: varied widths on desktop */
    #ostatnieWyniki {
        margin: 0 10px 20px;
    }

    #ostatnieWyniki div {
        border-right: 1px solid #6a6;
        border-bottom: 1px solid #6a6;
    }

    #ostatnieWyniki #wyniki-lotto {
        width: 45%;

    }

    #ostatnieWyniki #wyniki-multimulti {
        width: 55%;

        border-right: none;
    }

    #ostatnieWyniki #wyniki-lottoplus {
        width: 45%;

    }

    #ostatnieWyniki #wyniki-minilotto {
        width: 55%;

        border-right: none;
    }

    #ostatnieWyniki #wyniki-kaskada {
        width: 45%;

    }

    #ostatnieWyniki #adsense {
        width: 55%;

        border-right: none;
        border-bottom: none;
    }

    #ostatnieWyniki #wyniki-pensja {
        width: 45%;

    }

    #ostatnieWyniki #wyniki-keno {
        width: 55%;

        border-right: none;
    }

    #ostatnieWyniki #wyniki-eurojackpot {
        width: 100%;
        border-right: none;
    }

    #ostatnieWyniki #wyniki-szybkie600 {
        width: 55%;
        border-right: none;
    }

    /* Desktop: reset order to HTML order */
    #wyniki-pensja,
    #wyniki-keno,
    #ekstra-premia,
    #wyniki-szybkie600,
    #wyniki-eurojackpot { order: unset; }

    #ostatnieWyniki #ekstra-premia {
        width: 45%;
        border-right: 1px solid #2a7a3a;
    }

    #ostatnieWyniki #wyniki-super-szansa {
        width: 100%;

    }

    #wyniki-lotto ul {
        width: 240px;
        margin-top: 20px;
    }

    #wyniki-lottoplus ul {
        width: 240px;
    }

    #wyniki-minilotto ul {
        width: 200px;
    }

    #wyniki-multimulti ul {
        width: 400px;
    }

    #wyniki-keno ul {
        width: 400px;
        margin: 20px auto 10px;
    }

    #wyniki-kaskada ul {
        width: 242px;
        margin: 20px auto 15px;
    }

    #wyniki-pensja ul,
    #wyniki-eurojackpot ul {
        width: 280px;
        margin: 20px auto;
    }

    #wyniki-pensja .plus {
        margin-right: 35px;
    }

    #wyniki-lotto p {
        margin: 7px 0 0 60px;
        text-align: left;
    }

    #wyniki-lotto p.pula {
        margin-bottom: 20px;
    }

    #wyniki-multimulti p.pula {
        margin: 8px 0;
    }

    #wyniki-minilotto p {
        margin: 7px 0 10px 60px;
        text-align: left;
    }

    #ostatnieWyniki p {
        text-align: left;
    }

    #ostatnieWyniki a {
        font-size: 18px;
    }

    #ostatnieWyniki #ekstra-premia {
    }

    #content li {
        height: 36px;
        width: 36px;
        font-size: 17px;
        line-height: 36px;
        padding: 5px 14px;
        margin: 0;
    }

    /* Sidebar content */
    #clock {
        float: right;
    }

    #adsense-right {
        display: block;
        padding-left: 10px;
    }

    /* Map */
    .mapa td {
        font-size: 12px;
        padding: 4px 4px;
    }

    /* Modal dialogs */
    dialog.modal {
        max-width: 700px;
    }

    dialog.modal td,
    dialog.modal th {
        font-size: 15px;
        padding: 8px 12px;
    }

    dialog.modal th {
        padding: 8px 14px;
        line-height: 1.4;
    }

    h4.status {
        position: absolute;
        top: 10px;
        left: 8px;
        width: 762px;
    }

    .info {
        position: absolute;
        top: 220px;
        left: 8px;
        width: 762px;
        font: bold 18px verdana, sans-serif;
        border-radius: 0;
    }

    #nazywo h2 {
        width: 752px;
    }

    .feed {
        margin: 16px 40px;
    }

    .feed dt {
        font-size: 20px;
    }

    #footer {
        margin: 20px 0;
        color: #ccc;
        font-size: 14px;
    }
}
