/* ==========================================================================
   Ticket — every game is a printed lottery stub with a tear-off edge.
   ========================================================================== */

:root {
    --desk: #1e232b;
    --desk-2: #141920;
    --paper: #fbf6e9;
    --paper-2: #f2ead6;
    --ink: #1d1a14;
    --dim: #6f6857;
    --red: #c0261c;
    --blue: #123f7a;
    --gold: #b98a1e;
    --wa: #1c7a45;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: radial-gradient(90% 60% at 50% 0%, var(--desk), var(--desk-2) 70%);
    background-attachment: fixed;
    color: var(--paper);
    font-family: "Courier New", ui-monospace, Menlo, monospace;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px 40px; }

/* ------------------------------------------------------------------- nav */

.nav { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px dashed rgba(255, 255, 255, .22); }
.brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: bold; letter-spacing: 2px; text-transform: uppercase; }
.brand .seal { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; background: var(--red); border-radius: 50%; color: #fff; font-size: 14px; font-weight: bold; }

.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-links a { padding: 6px 12px; border: 1px dashed rgba(255, 255, 255, .28); color: #d8d1bd; font-size: 12px; font-weight: bold; letter-spacing: 1px; text-transform: uppercase; }
.nav-links a:hover, .nav-links a.on { background: var(--paper); border-color: var(--paper); color: var(--ink); }

/* ----------------------------------------------------------------- head */

.head { padding: 26px 16px 8px; text-align: center; }
.head .stamp { display: inline-block; padding: 4px 14px; border: 2px solid var(--red); color: var(--red); font-size: 11px; font-weight: bold; letter-spacing: 2px; transform: rotate(-3deg); }
.head h1 { margin-top: 12px; font-size: 26px; font-weight: bold; letter-spacing: 3px; text-transform: uppercase; word-break: break-word; }
.head p { margin-top: 4px; color: #b6ae99; font-size: 13px; }

/* --------------------------------------------------------------- tickets */

.rack { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 22px; }

.tkt {
    position: relative;
    display: flex;
    background: var(--paper);
    color: var(--ink);
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) rotate(-.6deg);
    animation: stamp .5s cubic-bezier(.2, .9, .3, 1) forwards;
    animation-delay: calc(var(--i, 0) * 90ms);
}

@keyframes stamp {
    from { opacity: 0; transform: translateY(16px) scale(.96) rotate(-1.4deg); }
    to   { opacity: 1; transform: none; }
}

/* Perforation: notches punched along the divide plus a dashed line. */
.tkt-main { flex: 1; min-width: 0; padding: 16px 16px 14px; }

.tkt-stub {
    position: relative;
    flex: 0 0 104px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    background: var(--paper-2);
    text-align: center;
}

.tkt-stub::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background-image: linear-gradient(var(--ink) 55%, transparent 0);
    background-size: 2px 9px;
    opacity: .35;
}

/* The punched half-circles that sell the "tear here" idea. */
.tkt::before,
.tkt::after {
    content: "";
    position: absolute;
    right: 96px;
    width: 16px;
    height: 16px;
    background: var(--desk-2);
    border-radius: 50%;
    z-index: 2;
}

.tkt::before { top: -8px; }
.tkt::after { bottom: -8px; }

.tkt-top { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(0, 0, 0, .18); }
.tkt-top .no { color: var(--dim); font-size: 11px; letter-spacing: 1px; }
.tkt-top .tag { margin-left: auto; padding: 2px 8px; border: 1px solid var(--blue); color: var(--blue); font-size: 10px; font-weight: bold; letter-spacing: 1px; }
.tkt.is-wait .tkt-top .tag { border-color: var(--red); color: var(--red); }

.tkt-name { margin-top: 10px; font-size: 23px; font-weight: bold; letter-spacing: 1.2px; text-transform: uppercase; }
.tkt-time { color: var(--dim); font-size: 12px; letter-spacing: 1px; }

.tkt-prev { margin-top: 10px; font-size: 12px; color: var(--dim); }
.tkt-prev b { color: var(--ink); font-size: 16px; }

/* Barcode drawn with a repeating gradient — no image needed. */
.barcode {
    height: 30px;
    margin-top: 12px;
    background-image: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 9px, var(--ink) 9px 12px, transparent 12px 14px);
    opacity: .8;
}

.barcode-no { margin-top: 3px; color: var(--dim); font-size: 10px; letter-spacing: 3px; text-align: center; }

.stub-label { color: var(--dim); font-size: 10px; font-weight: bold; letter-spacing: 1.4px; }
.stub-num { margin: 4px 0; font-size: 34px; font-weight: bold; line-height: 1; color: var(--red); }
.stub-link { margin-top: 6px; color: var(--blue); font-size: 11px; text-decoration: underline; }

/* Pending stub: a rubber "awaited" stamp instead of the word repeated. */
.stub-wait { transform: rotate(-11deg); }
.stub-wait span { display: inline-block; padding: 5px 8px; border: 2px solid var(--red); color: var(--red); font-size: 11px; font-weight: bold; letter-spacing: 1.5px; animation: inkPulse 2.4s ease-in-out infinite; }
@keyframes inkPulse { 50% { opacity: .45; } }

/* --------------------------------------------------------------- notice */

.notice { margin: 20px 0 0; padding: 11px 14px; background: var(--paper); border-left: 5px solid var(--red); color: var(--ink); font-size: 13px; font-weight: bold; text-align: center; }

/* --------------------------------------------------------------- panels */

.sheet { margin-top: 22px; padding: 20px 18px; background: var(--paper); border-radius: 6px; box-shadow: 0 10px 24px rgba(0, 0, 0, .4); color: var(--ink); }
.sheet h3 { margin-bottom: 4px; font-size: 17px; font-weight: bold; letter-spacing: 1.5px; text-align: center; text-transform: uppercase; }
.sheet .rate { margin-bottom: 12px; color: var(--red); font-size: 13px; font-weight: bold; text-align: center; }
.sheet .note { margin-top: 12px; color: var(--dim); font-size: 12px; text-align: center; }

.plist { list-style: none; max-width: 360px; margin: 0 auto; }
.plist li { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; font-size: 14px; }
.plist li i { flex: 1; border-bottom: 1px dotted rgba(0, 0, 0, .3); }
.plist b { color: var(--blue); }

.btn { display: inline-block; margin-top: 14px; padding: 10px 24px; background: var(--wa); color: #fff; font-size: 14px; font-weight: bold; letter-spacing: 1px; }
.btn.tg { background: var(--blue); margin-left: 6px; }
.center { text-align: center; }

.sec-h { margin: 26px 0 12px; font-size: 16px; font-weight: bold; letter-spacing: 3px; text-align: center; text-transform: uppercase; }
.sec-h::after { content: ""; display: block; width: 60px; height: 2px; margin: 8px auto 0; background: var(--gold); }

/* week table on paper */
.rec-wrap { overflow-x: auto; background: var(--paper); border-radius: 6px; box-shadow: 0 10px 24px rgba(0, 0, 0, .4); }
.rec { width: 100%; border-collapse: collapse; color: var(--ink); font-size: 13px; }
.rec th, .rec td { padding: 9px 10px; border-bottom: 1px dashed rgba(0, 0, 0, .2); text-align: center; white-space: nowrap; }
.rec thead th { background: var(--paper-2); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.rt-date { color: var(--blue); font-weight: bold; }
.rt-dash { color: #bdb6a2; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: 16px; }
.step { padding: 16px; background: var(--paper); border-radius: 6px; box-shadow: 0 8px 18px rgba(0, 0, 0, .35); color: var(--ink); text-align: center; }
.step-ico { display: block; font-size: 24px; }
.step b { display: block; margin: 5px 0 2px; font-size: 14px; }
.step span { color: var(--dim); font-size: 12px; }

/* faq */
.faq-item { margin-bottom: 8px; background: var(--paper); border-radius: 6px; color: var(--ink); overflow: hidden; }
.faq-q { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 14px; background: none; border: 0; color: var(--ink); font-family: inherit; font-size: 14px; font-weight: bold; text-align: left; cursor: pointer; }
.faq-ico { color: var(--red); font-size: 18px; font-style: normal; }
.faq-item.open .faq-ico { transform: rotate(45deg); }
.faq-a { display: none; padding: 0 14px 12px; color: var(--dim); font-size: 13px; }
.faq-item.open .faq-a { display: block; }

.article { margin-bottom: 12px; padding: 18px; background: var(--paper); border-radius: 6px; color: var(--ink); }
.article h4 { margin-bottom: 8px; font-size: 16px; font-weight: bold; }
.article p { margin-bottom: 9px; font-size: 13px; }
.article p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------- footer */

.foot { padding: 26px 16px; border-top: 1px dashed rgba(255, 255, 255, .22); text-align: center; }
.foot .fname { font-size: 17px; font-weight: bold; letter-spacing: 3px; }
.foot p { max-width: 700px; margin: 6px auto; color: #a89f8a; font-size: 12px; word-break: break-word; }

.fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; background: var(--wa); border-radius: 50%; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); color: #fff; }

/* ------------------------------------------------------------ chart page */

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; padding: 14px; background: var(--paper); border-radius: 6px; }
.filters select, .filters input { padding: 8px 10px; background: #fff; border: 1px solid rgba(0, 0, 0, .3); color: var(--ink); font-family: inherit; font-size: 13px; }
.btn-sm { display: inline-block; padding: 9px 16px; background: var(--ink); border: 0; color: var(--paper); font-family: inherit; font-size: 12px; font-weight: bold; letter-spacing: 1px; cursor: pointer; }
.btn-sm.ghost { background: none; border: 1px solid rgba(0, 0, 0, .35); color: var(--ink); }

@media (max-width: 640px) {
    .head h1 { font-size: 20px; letter-spacing: 2px; }
    .rack { grid-template-columns: 1fr; }
    .tkt-stub { flex: 0 0 92px; }
    .tkt::before, .tkt::after { right: 84px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; }
    .tkt { opacity: 1; transform: none; }
}
