:root{color-scheme:dark;--bg:#0f1512;--surface:#18211c;--text:#eef3ef;--muted:#9bab9f;--brand:#3fbf80;--brand-ink:#06150d;--accent:#f2b134;--line:#26322b;--radius:14px;--shadow:none}
:root[data-theme="light"]{color-scheme:light;--bg:#eef6f0;--surface:#fff;--text:#12231a;--muted:#546a5c;--brand:#17794a;--brand-ink:#fff;--line:#d3e3d8;--shadow:0 1px 2px rgb(10 60 30/.06),0 6px 18px rgb(10 60 30/.07)}
.theme-toggle{display:inline-grid;place-items:center;width:38px;height:38px;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--text);font-size:1.05rem;cursor:pointer}
.theme-toggle:hover{border-color:var(--brand);color:var(--brand)}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--text);font:16px/1.6 system-ui,-apple-system,"Segoe UI","Noto Sans Telugu","Nirmala UI",Roboto,sans-serif}
h1,h2,h3{line-height:1.25;margin:0 0 .4em}
h1{font-size:clamp(2rem,6vw,3.4rem)}h2{font-size:1.5rem}h3{font-size:1.1rem}
p{margin:0 0 .8em}
a{color:var(--brand)}
.wrap{max-width:68rem;margin:0 auto;padding:0 1rem}
.muted{color:var(--muted)}
.skip{position:absolute;left:-999px}.skip:focus{left:1rem;top:1rem;background:var(--surface);padding:.5rem 1rem;z-index:20;border-radius:8px}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.site-header{position:sticky;top:0;z-index:10;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
.bar{display:flex;align-items:center;justify-content:space-between;min-height:3.5rem;gap:1rem}
.brand{display:flex;align-items:center;gap:.6rem;font-weight:700;color:var(--text);text-decoration:none}
.logo{display:grid;place-items:center;width:2rem;height:2rem;border-radius:50%;background:var(--brand);color:var(--brand-ink)}
nav{display:flex;align-items:center;gap:1rem}
nav a:not(.btn){color:var(--text);text-decoration:none;padding:.5rem 0}
nav a:not(.btn):hover{color:var(--brand)}
.btn{display:inline-block;background:var(--brand);color:var(--brand-ink);padding:.5rem 1.05rem;min-height:40px;border:0;border-radius:8px;line-height:1.35;font:inherit;font-weight:600;text-decoration:none;cursor:pointer}
.btn.small{padding:.3rem .8rem;min-height:34px;font-size:.875rem;border-radius:7px}
.btn:hover{filter:brightness(1.08)}
.hero{padding:clamp(2.5rem,8vw,5rem) 0;background:linear-gradient(160deg,color-mix(in srgb,var(--brand) 16%,var(--bg)),var(--bg))}
.eyebrow{text-transform:uppercase;letter-spacing:.12em;font-size:.8rem;color:var(--brand);font-weight:700;margin-bottom:.3rem}
.lead{font-size:1.15rem;color:var(--muted);max-width:36rem;margin-bottom:1.4rem}
.section{padding:2rem 1rem}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:1.1rem 1.2rem;box-shadow:var(--shadow)}
.featured{border-left:6px solid var(--accent)}
.grid{list-style:none;padding:0;margin:0;display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(16rem,1fr))}
.list{list-style:none;padding:0;margin:0;display:grid;gap:.8rem}
.row{display:flex;gap:1rem;align-items:center}
.date{display:grid;place-items:center;min-width:3.4rem;padding:.4rem;border-radius:10px;background:color-mix(in srgb,var(--brand) 14%,var(--surface));color:var(--brand);line-height:1.1}
.date strong{font-size:1.4rem}.date span{font-size:.75rem;text-transform:uppercase}
.badge{display:inline-block;font-size:.75rem;font-weight:700;padding:.15rem .6rem;border-radius:999px;background:var(--line);margin-bottom:.5rem}
.badge.live{background:var(--accent);color:#2b1d00}
.draw{margin-top:1rem;padding:1rem;border-radius:12px;background:color-mix(in srgb,var(--accent) 14%,var(--surface));border:1px dashed var(--accent)}
.winners{list-style:none;margin:0;padding:0}
.winners li{display:flex;justify-content:space-between;gap:1rem;padding:.5rem 0;border-bottom:1px solid var(--line)}
.winners .prize{font-weight:600}
.empty{padding:1.2rem;border:1px dashed var(--line);border-radius:var(--radius);color:var(--muted);text-align:center}
.center{min-height:80vh;display:grid;place-content:center;text-align:center;gap:.5rem;padding:1rem}
.site-footer{padding:2rem 0;margin-top:2rem;border-top:1px solid var(--line);color:var(--muted);font-size:.9rem;text-align:center}
@media (max-width:30rem){nav a:not(.btn){display:none}}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* admin */
.between{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap}
.inline{display:inline;margin:0}
.btn.ghost{background:transparent;color:var(--brand);border:1.5px solid var(--brand)}
.btn[disabled]{opacity:.6;cursor:wait}
.login{max-width:26rem;margin:3rem auto;text-align:center}
.error{color:#c0392b;font-size:.9rem;margin:.3rem 0 0}
.notice{background:color-mix(in srgb,var(--brand) 14%,var(--surface));padding:.6rem 1rem;border-radius:10px}
.form{display:grid;gap:1rem;max-width:36rem}
.field label{display:block;font-weight:600;margin-bottom:.25rem}
.field input,.field select,.field textarea{width:100%;padding:.65rem .8rem;min-height:44px;font:inherit;color:var(--text);background:var(--bg);border:1.5px solid var(--line);border-radius:10px}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--brand)}
.danger{margin-top:1.5rem}
.list h3 a{color:var(--text);text-decoration:none}

/* draws */
.section-gap{margin-top:2rem}
.steps ol{list-style:none;display:flex;gap:.5rem;flex-wrap:wrap;margin:0 0 1rem;padding:0}
.steps li{padding:.3rem .8rem;border-radius:999px;background:var(--line);color:var(--muted);font-size:.9rem}
.steps li.done{background:color-mix(in srgb,var(--brand) 18%,var(--surface));color:var(--brand)}
.steps li.now{background:var(--accent);color:#2b1d00;font-weight:700}
.actions{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap}
.actions form{margin:0}
.btn.run{background:var(--accent);color:#2b1d00;font-size:1.05rem}
.btn[disabled]{opacity:.5;cursor:not-allowed}
.inline-form{display:flex;gap:.6rem;align-items:flex-end;flex-wrap:wrap;margin-bottom:.8rem}
.inline-form .field{flex:1 1 14rem}
.chips{list-style:none;display:flex;flex-wrap:wrap;gap:.5rem;padding:0;margin:1rem 0 0}
.chips li{display:flex;align-items:center;gap:.3rem;padding:.3rem .4rem .3rem .8rem;border-radius:999px;background:var(--surface);border:1px solid var(--line)}
.chips form{margin:0}
.chips button{border:0;background:transparent;color:var(--muted);font-size:1.2rem;line-height:1;min-width:28px;min-height:28px;border-radius:50%;cursor:pointer}
.chips button:hover{background:var(--line);color:var(--text)}
.prizes{counter-reset:none}
.token{display:inline-block;min-width:2.4em;padding:0 .45em;border-radius:6px;background:var(--accent);color:#2b1d00;font-weight:700;font-size:.85em;text-align:center;font-variant-numeric:tabular-nums}
.participants{margin-top:1rem}
.participants summary{cursor:pointer;font-weight:600;padding:.4rem 0}
.participants .chips{margin-top:.4rem}

.hero-actions{display:flex;gap:.7rem;flex-wrap:wrap}
.btn.ghost{background:transparent;color:var(--brand);border:1.5px solid var(--brand)}
.donate-card{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap}
.donate-card h2{margin:0 0 .2rem}
.donate-card .eyebrow{font-size:.72rem;font-weight:650;letter-spacing:.09em;text-transform:uppercase;color:var(--brand);margin:0 0 .2rem}
.raised{margin:0;font-size:1.05rem}.raised strong{font-size:1.5rem}
.num{font-variant-numeric:tabular-nums}
.fest-raise{margin:.8rem 0 0;font-weight:550}
.donors{list-style:none;margin:.4rem 0 0;padding:0}
.donors li{display:flex;align-items:baseline;gap:.8rem;padding:.55rem 0;border-bottom:1px solid var(--line)}
.donor-name{font-weight:600;flex:1;min-width:0}
.donor-name small{margin-left:.4rem;font-weight:500;color:var(--muted);font-size:.75rem}
.donor-for{color:var(--muted);font-size:.85rem}
.eyebrow{font-size:.72rem;font-weight:650;letter-spacing:.09em;text-transform:uppercase}
.crumb{font-size:.85rem;color:var(--muted);margin:0 0 .6rem}.crumb a{color:var(--muted);text-decoration:none}.crumb a:hover{color:var(--brand)}
.fest-desc{max-width:42rem;margin:.2rem 0 1.2rem}
.fest-card h3 a{color:var(--text);text-decoration:none}.fest-card h3 a:hover{color:var(--brand);text-decoration:underline}

.hero.has-cover{background:linear-gradient(0deg,rgb(8 16 12/.88),rgb(8 16 12/.45)),var(--img) center/cover no-repeat;color:#fff}
.hero.has-cover .lead,.hero.has-cover .crumb,.hero.has-cover .crumb a{color:rgb(255 255 255/.85)}
.hero.has-cover h1{color:#fff;text-shadow:0 2px 16px rgb(0 0 0/.4)}
.fest-cover{display:block;margin:-1.1rem -1.2rem 1rem;border-radius:var(--radius) var(--radius) 0 0;overflow:hidden;aspect-ratio:16/6;background:var(--line)}
.fest-cover img{width:100%;height:100%;object-fit:cover;display:block}
.fest-thumb{display:block;margin:-1.1rem -1.2rem .8rem;border-radius:var(--radius) var(--radius) 0 0;overflow:hidden;aspect-ratio:16/9;background:var(--line)}
.fest-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.photo-grid{list-style:none;margin:0;padding:0;display:grid;gap:.6rem;grid-template-columns:repeat(auto-fill,minmax(11rem,1fr))}
.photo{display:block;width:100%;padding:0;border:0;border-radius:12px;overflow:hidden;aspect-ratio:4/3;background:var(--line);cursor:zoom-in}
.photo img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .25s}
.photo:hover img{transform:scale(1.04)}
.lightbox{width:100vw;height:100vh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:rgb(5 10 8/.94);display:grid;place-items:center}
.lightbox::backdrop{background:transparent}
.lightbox img{max-width:min(96vw,1400px);max-height:90vh;object-fit:contain;border-radius:8px}
.lb-close,.lb-nav{position:absolute;border:0;background:rgb(255 255 255/.14);color:#fff;border-radius:50%;width:48px;height:48px;font-size:1.4rem;cursor:pointer}
.lb-close{top:1rem;right:1rem}
.lb-nav{top:50%;transform:translateY(-50%)}.lb-nav.prev{left:1rem}.lb-nav.next{right:1rem}
.lb-close:hover,.lb-nav:hover{background:rgb(255 255 255/.28)}
@media (prefers-reduced-motion:reduce){.photo img{transition:none}}
.lightbox:not([open]){display:none}
.logo-img{width:2rem;height:2rem;border-radius:50%;object-fit:cover;background:var(--surface)}
.prize-img{width:2.6rem;height:2.6rem;border-radius:10px;object-fit:cover;flex:none;background:var(--line)}

/* ---- compact featured festival on the home page ---- */
.hero{padding:clamp(1.8rem,5vw,3.2rem) 0}
.hero h1{margin-bottom:.2em}
.hero .lead{margin-bottom:1rem}
.featured{display:grid;grid-template-columns:minmax(0,19rem) minmax(0,1fr);gap:1.4rem;align-items:start}
.featured.no-cover{grid-template-columns:minmax(0,1fr)}
.featured .fest-cover{margin:0;aspect-ratio:4/3;border-radius:12px;max-height:15rem}
.featured-body h2{margin:.2rem 0 .3rem}
.featured-body h2 a{color:inherit;text-decoration:none}.featured-body h2 a:hover{color:var(--brand)}
.featured-body .draw{margin-top:.9rem;padding:.8rem .95rem}
.featured-body .draw h3{margin:0 0 .3rem;font-size:1rem}
.featured-body .draw p{margin:0 0 .4rem}
.featured-body .fest-raise{margin:.4rem 0 0}
@media (max-width:42rem){
  .featured{grid-template-columns:1fr;gap:.9rem}
  .featured .fest-cover{aspect-ratio:16/9;max-height:12rem;width:100%}
}
.join{margin-top:.6rem}
.join summary{display:inline-block;cursor:pointer;list-style:none}
.join summary::-webkit-details-marker{display:none}
.join-form{display:grid;gap:.7rem;margin-top:.8rem;max-width:26rem}
.join-form .field label{display:block;font-weight:600;font-size:.95rem}
.join-form .field input{display:block;width:100%;margin-top:.25rem;padding:.65rem .8rem;min-height:44px;font:inherit;color:var(--text);background:var(--bg);border:1.5px solid var(--line);border-radius:10px}
.join-form .hp{position:absolute;left:-9999px;height:0;overflow:hidden}
.token-count{margin:.6rem 0 0}
.draw .join-form{max-width:26rem}
.price{margin-left:.4rem}
.total{margin:0;font-size:1.1rem}
.donor-ph{width:2.25rem;height:2.25rem;border-radius:50%;object-fit:cover;flex:none;align-self:center;background:var(--line)}
.contact{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.5rem 1.2rem;margin:0 0 1rem;font-size:.92rem}
.home-footer .contact{justify-content:flex-start;margin:1.1rem 0 0}
.c-addr{color:var(--muted)}
.btn.wa-btn{background:#25d366;color:#06150d;border:0}
.btn.ghost.wa-btn{background:transparent;color:#1fa855;border:1.5px solid #25d366}
.ticket-names{border:1.5px dashed var(--line);border-radius:12px;padding:.8rem .9rem;margin:0;display:grid;gap:.5rem;min-width:0}
.ticket-names[hidden]{display:none}
.ticket-names legend{font-weight:700;padding:0 .4rem}
.ticket-names .hint{margin:0}
.ticket-names>div{display:grid;gap:.6rem}
.fest-page .draw .join-form .ticket-names,.j-form .join-form .ticket-names{grid-column:1/-1}
.trow{display:flex;gap:.5rem;align-items:center}
.trow .tno{flex:none;display:grid;place-items:center;width:1.7rem;height:1.7rem;border-radius:50%;background:var(--accent);color:#2b1d00;font-weight:750;font-size:.8rem}
.trow input{flex:1;min-width:0;width:100%;padding:.65rem .8rem;min-height:44px;font:inherit;color:var(--text);background:var(--bg);border:1.5px solid var(--line);border-radius:10px}
.trow [data-del]{flex:none;display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--muted);cursor:pointer}
.trow [data-del]:hover:not(:disabled){color:#c0392b;border-color:#c0392b}
.trow [data-del]:disabled{opacity:.35;cursor:not-allowed}
.ticket-names .btn[data-add]{justify-self:start}
.ticket-names .btn[disabled]{opacity:.5}
.ptable-wrap{max-height:30rem;overflow:auto;margin-top:.5rem;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.ptable{width:100%;border-collapse:collapse;font-size:.95rem}
.ptable th{position:sticky;top:0;background:var(--surface);text-align:left;font-size:.75rem;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);padding:.55rem .9rem;border-bottom:1px solid var(--line)}
.ptable td{padding:.5rem .9rem;border-bottom:1px solid var(--line)}
.ptable tbody tr:last-child td{border-bottom:0}
.ptable tbody tr:nth-child(even){background:color-mix(in srgb,var(--line) 30%,transparent)}
.ptable th:first-child,.ptable td:first-child{width:5.5rem}
.ptable tr[hidden]{display:none}
.ptable-search{width:100%;margin-top:.5rem;padding:.55rem .8rem;min-height:42px;font:inherit;color:var(--text);background:var(--bg);border:1.5px solid var(--line);border-radius:10px}
.ptable tr.res td{color:var(--muted);font-style:italic}
.ptable tr.res .token{background:transparent;color:var(--muted);box-shadow:inset 0 0 0 1.5px var(--line)}
.trow .tkno{flex:none;width:6.2rem;text-align:center}

/* public token board */
.board{margin-top:1rem}
.board h4{margin:0 0 .4rem;font-size:1rem}
.legend{list-style:none;display:flex;flex-wrap:wrap;gap:.3rem 1rem;margin:0 0 .6rem;padding:0;font-size:.8rem;color:var(--muted)}
.legend li{display:flex;align-items:center;gap:.35rem}
.legend .t{width:.95rem;height:.95rem;min-width:0;border-radius:4px;padding:0;display:inline-block}
.tgrid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(2.7rem,1fr));gap:.3rem}
.tgrid li{margin:0}
.t{display:grid;place-items:center;width:100%;min-height:2.3rem;padding:0;border-radius:8px;font:inherit;font-size:.85rem;font-weight:650;font-variant-numeric:tabular-nums;border:1.5px solid var(--line);background:var(--surface);color:var(--text)}
button.t{cursor:pointer}
button.t.free:hover,button.t.free:focus-visible{border-color:var(--brand);color:var(--brand)}
.t.free.mine{background:var(--brand);color:var(--brand-ink);border-color:var(--brand)}
.t.taken{background:var(--accent);color:#2b1d00;border-color:var(--accent)}
.t.res{background:repeating-linear-gradient(135deg,transparent 0 5px,color-mix(in srgb,var(--muted) 30%,transparent) 5px 10px);color:var(--muted)}
.t.hold{background:color-mix(in srgb,var(--accent) 22%,var(--surface));color:var(--text);border-style:dashed;border-color:var(--accent)}
.tk-warn{margin:.4rem 0;padding:.55rem .8rem;border-radius:10px;background:color-mix(in srgb,#c0392b 16%,var(--surface));border:1px solid #c0392b;font-size:.9rem}
.trow .tkno.bad{border-color:#c0392b}

/* board: filter, phone collapse */
.board-head{display:flex;justify-content:space-between;align-items:center;gap:.6rem;margin-bottom:.4rem}
.board-head h4{margin:0}
.seg-mini{display:inline-flex;border:1.5px solid var(--line);border-radius:999px;overflow:hidden}
.seg-mini button{border:0;background:transparent;color:var(--muted);font:inherit;font-size:.82rem;font-weight:650;padding:.25rem .8rem;cursor:pointer}
.seg-mini button.on{background:var(--brand);color:var(--brand-ink)}
.board.only-free .tgrid li:not(.k-free){display:none}
.board-more{display:none;margin:.5rem auto 0;border:1.5px solid var(--line);background:transparent;color:var(--text);font:inherit;font-weight:650;font-size:.9rem;padding:.45rem 1rem;border-radius:999px;cursor:pointer}
@media (max-width:40rem){
  .tgrid{grid-template-columns:repeat(auto-fill,minmax(2.35rem,1fr));gap:.25rem}
  .t{min-height:2.1rem;font-size:.8rem}
  .board:not(.open) .tgrid{max-height:7.1rem;overflow:hidden;-webkit-mask-image:linear-gradient(#000 70%,transparent);mask-image:linear-gradient(#000 70%,transparent)}
  .board-more{display:block}
  .legend{font-size:.74rem;gap:.2rem .7rem}
}
.in-kind{font-size:.85rem;font-weight:600;color:var(--muted);white-space:nowrap;max-width:14rem;overflow:hidden;text-overflow:ellipsis}
.btn-amt{margin-left:.25rem;font-weight:800;font-variant-numeric:tabular-nums}
.t.taken.locked{box-shadow:0 0 0 2px var(--text) inset}
#mgrid li[hidden]{display:none}
button.t.taken,button.t.res,button.t.hold{cursor:pointer}

/* selected number: keep the white-on-green look while the button is hovered / focused / just tapped (the hover colour used to turn the text green too) */
button.t.free.mine,button.t.free.mine:hover,button.t.free.mine:focus,button.t.free.mine:focus-visible,button.t.free.mine:active{background:var(--brand);color:var(--brand-ink);border-color:var(--brand);box-shadow:0 0 0 2px color-mix(in srgb,var(--brand) 35%,transparent)}
@media (hover:none){button.t.free:hover:not(.mine){border-color:var(--line);color:var(--text)}}

/* phones: give the ticket name box the width back (less padding / borders around the rows, narrower side boxes) */
@media (max-width:40rem){
  .fest-page .draw{padding:.8rem .65rem}
  .fest-page .draw .join-form,.j-form .join-form{padding:.75rem .6rem}
  .ticket-names{padding:.55rem .45rem;border-width:1px}
  .ticket-names legend{padding:0 .3rem}
  .trow{gap:.3rem}
  .trow .tno{width:1.5rem;height:1.5rem;font-size:.72rem}
  .trow .tkno{width:3.3rem;padding-inline:.2rem}
  .trow input{padding:.6rem .55rem}
  .trow [data-del]{width:32px;height:36px}
}

/* narrow phones: the name gets the whole row; the token-number box takes all the space left under it and the delete button only what it needs */
@media (max-width:34rem){
  .trow{display:grid;grid-template-columns:1.5rem minmax(0,1fr) auto;grid-template-areas:"n name name" ". no del";align-items:center;gap:.35rem;margin-bottom:.4rem}
  .trow .tno{grid-area:n}
  .trow input:not(.tkno){grid-area:name;width:100%}
  .trow .tkno{grid-area:no;width:100%;text-align:left}
  .trow [data-del]{grid-area:del;justify-self:end;width:34px;height:44px;padding:0}
}
