/* ==========================================================================
   lottery.css — /lottery-results/ only. Loaded after style.css + responsive.css.
   Colours, radii and shadows are the tokens of style.css (logo green, logo gold).

   1. Result panel   2. Prize cards   3. Other prizes + source   4. History   5. Responsive
   ========================================================================== */

/* 1. Result panel ------------------------------------------------------------ */
.lotto { margin-top: var(--space-md); }
.lotto-panel {
    padding: 18px 20px 20px;
    border: 1px solid rgba(63, 214, 148, .13); border-radius: var(--radius-panel);
    background: var(--panel-face);
    box-shadow: var(--shadow-card);
}
.lotto-panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.lotto-panel__name { display: inline-flex; align-items: center; gap: 10px; color: var(--text-primary); font-size: 17px; font-weight: 500; }
.lotto-panel__code {
    display: grid; place-items: center; min-width: 34px; height: 24px; padding: 0 6px;
    border: 1px solid var(--border-gold); border-radius: 5px;
    color: var(--logo-gold-light); font-size: 12px; font-weight: 500; letter-spacing: .04em;
}
.lotto-panel__mode { padding: 2px 9px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); color: var(--accent); font-size: 12px; font-weight: 400; }
.lotto-panel__mode--past { border-color: var(--border-gold); color: var(--logo-gold-light); }
.lotto-panel__meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lotto-panel__date { color: var(--text-secondary); font-size: 15px; }
.lotto-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 500; }
.lotto-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lotto-status--ok { background: rgba(63, 214, 148, .12); color: var(--accent); }
.lotto-status--wait { background: rgba(250, 226, 113, .1); color: var(--logo-gold-light); }
.lotto-status--error { background: rgba(229, 138, 120, .12); color: var(--error); }
.lotto-message { padding: 26px 8px; color: var(--text-secondary); font-size: 16px; text-align: center; }
.lotto-message--error { display: grid; justify-items: center; gap: 12px; }
.lotto-message--error .btn { min-height: 44px; padding: 0 22px; }

/* 2. Prize cards: the first prize is the one gold card ------------------------ */
.lotto-prizes { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.lotto-prize {
    display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0;
    padding: 16px 14px 18px;
    border: 1px solid var(--border); border-radius: var(--radius-card);
    background: var(--bg-card);
    text-align: center;
}
.lotto-prize--first { border-color: var(--border-gold); background: linear-gradient(rgba(250, 226, 113, .07), rgba(250, 226, 113, .03)), var(--bg-card); }
.lotto-prize__title { color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.lotto-prize--first .lotto-prize__title { color: var(--logo-gold-light); }
.lotto-prize__values { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 16px; }
.lotto-number { color: var(--text-strong); font-size: 30px; font-weight: 600; line-height: 1.15; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.lotto-digits { display: inline-flex; gap: 6px; }
.lotto-digit {
    display: grid; place-items: center; width: 46px; height: 58px;
    border: 1px solid rgba(250, 226, 113, .3); border-radius: var(--radius-md);
    background: var(--bg-deep); color: var(--logo-gold-light);
    font-size: 34px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums;
}
.lotto-prize__wait { color: var(--logo-gold-light); font-size: 16px; font-weight: 400; }

/* 3. Other prizes + source ---------------------------------------------------- */
.lotto-more { margin-top: var(--gap); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg-card); }
.lotto-more__summary { display: flex; align-items: center; min-height: 46px; padding: 0 16px; color: var(--text-primary); font-size: 15px; font-weight: 500; cursor: pointer; }
.lotto-more__summary:hover { color: var(--accent-hover); }
.lotto-more__group { padding: 12px 16px 14px; border-top: 1px solid var(--border); }
.lotto-more__title { margin-bottom: 8px; color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.lotto-more__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px 10px; }
.lotto-more__list li { color: var(--text-primary); font-size: 16px; font-weight: 500; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.lotto-source { margin-top: 14px; color: var(--text-muted); font-size: 13px; line-height: 1.7; }
.lotto-source a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.lotto-source a:hover { color: var(--accent-hover); }
.lotto-back { margin-top: 14px; min-height: 44px; }

/* 4. History ------------------------------------------------------------------- */
.lotto-history-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: var(--space-lg) 0 12px; }
.lotto-history-head__count { color: var(--text-secondary); font-size: 14px; }
.lotto-history__year { margin: 16px 0 8px; color: var(--logo-gold-light); font-size: 15px; font-weight: 500; letter-spacing: .02em; }
.lotto-history__year:first-child { margin-top: 0; }
.lotto-history { display: grid; gap: 8px; list-style: none; }
.lotto-history__row {
    display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 10px 16px;
    padding: 10px 14px;
    border: 1px solid var(--border); border-radius: var(--radius-card);
    background: var(--bg-card);
}
.lotto-history__row.is-current { border-color: var(--border-gold); }
.lotto-history__date { color: var(--text-primary); font-size: 15px; font-weight: 500; }
.lotto-history__cell { display: grid; gap: 1px; min-width: 0; }
.lotto-history__label { color: var(--text-muted); font-size: 12px; }
.lotto-history__first, .lotto-history__two { color: var(--text-strong); font-size: 19px; font-weight: 600; letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.lotto-history__first { color: var(--logo-gold-light); }
.lotto-history__open { min-height: 44px; }
.lotto-note { max-width: 860px; margin-top: var(--space-md); color: var(--text-muted); font-size: 13px; line-height: 1.7; }

/* 5. Responsive ------------------------------------------------------------------ */
@media (max-width: 1023px) {
    .lotto-prizes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lotto-prize--first { grid-column: 1 / -1; }
}
@media (max-width: 599px) {
    .lotto-panel { padding: 14px 12px 16px; }
    .lotto-prizes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .lotto-prizes > .lotto-prize:last-child { grid-column: 1 / -1; }       /* first prize full, 3 front | 3 back, 2 last full */
    .lotto-digits { gap: 5px; }
    .lotto-prize { padding: 14px 10px 16px; }
    .lotto-digit { width: clamp(34px, 10.6vw, 46px); height: 52px; font-size: 30px; }
    .lotto-number { font-size: 27px; }
    .lotto-history__row { grid-template-columns: 1fr 1fr; }
    .lotto-history__open { grid-column: 2; grid-row: 1; justify-self: end; }      /* date + button, then the two numbers */
}
