
:root{--he-bg:#080817;--he-card:#0d0d21;--he-line:#29214e;--he-text:#f6f4ff;--he-muted:#aaa5bd;--he-purple:#7c4dff;--he-cyan:#16c8ff}
.he-wrap{font-family:Inter,system-ui,sans-serif;color:var(--he-text);background:linear-gradient(180deg,#09091a,#070713);padding:22px;border-radius:18px}
.he-next{display:grid;grid-template-columns:auto 1fr auto auto;gap:18px;align-items:center;border:1px solid #3a2b78;background:linear-gradient(100deg,#14102d,#0c1022);padding:18px 22px;border-radius:15px;margin-bottom:18px}
.he-next.soon{box-shadow:0 0 28px rgba(124,77,255,.22);animation:hePulse 2.2s infinite}.he-next-kicker{font-size:11px;font-weight:900;letter-spacing:1.5px;color:#c9baff}.he-next strong,.he-next span{display:block}.he-next span{font-size:12px;color:var(--he-muted);margin-top:3px}.he-countdown{font-weight:800}
@keyframes hePulse{50%{border-color:#16c8ff}}
.he-btn,.he-nav{border:1px solid #6744c9;background:linear-gradient(120deg,#3977ff,#c427e9);color:#fff!important;border-radius:10px;padding:10px 15px;font-weight:800;text-decoration:none;cursor:pointer}
.he-toolbar{display:flex;gap:10px;margin:14px 0;flex-wrap:wrap}.he-toolbar input,.he-toolbar select,.he-form input,.he-form select,.he-form textarea{background:#09091a;color:#f5f3ff;border:1px solid #33255f;border-radius:10px;padding:10px;box-sizing:border-box}.he-toolbar input{min-width:230px;flex:1}
.he-cal-head{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;text-align:center}.he-cal-head h2{font-size:21px;margin:12px}.he-nav{padding:7px;font-size:22px;background:#111027}
.he-week,.he-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}.he-week span{text-align:center;color:var(--he-muted);font-size:12px;font-weight:700;padding:8px}
.he-day{min-height:116px;border:1px solid var(--he-line);background:#080815;padding:7px;position:relative}.he-day.today{border-color:var(--he-cyan)}.he-day.blank{opacity:.25}.he-date{font-size:12px;color:#d8d5e5}
.he-event{display:block;width:100%;text-align:left;margin-top:5px;padding:6px;border:1px solid #443080;background:#15102e;color:#fff;border-radius:7px;cursor:pointer;font-size:11px;line-height:1.25}.he-event b,.he-event small{display:block}.he-event small{color:#bbb4d2}
.he-modal{display:none;position:fixed;inset:0;background:rgba(2,2,12,.78);z-index:999999;padding:5vh 15px;overflow:auto}.he-modal.open{display:block}.he-modal-card{position:relative;max-width:720px;margin:auto;background:#0b0b1c;color:#f7f5ff;border:1px solid #45357b;border-radius:18px;padding:28px;box-shadow:0 30px 90px #000}.he-close{position:absolute;right:15px;top:10px;background:none;border:0;color:#fff;font-size:30px;cursor:pointer}.he-tag{display:inline-block;padding:5px 9px;border-radius:20px;background:#251b4a;color:#c9baff;font-size:11px;font-weight:800}.he-detail h2{font-size:28px}.he-detail h3{margin-top:22px;font-size:13px;color:#bca9ff;letter-spacing:1px}.he-detail-grid,.he-prizes{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.he-detail-grid>div,.he-prizes>div{background:#101026;border:1px solid #29214e;border-radius:9px;padding:10px}.he-detail-grid b,.he-detail-grid span,.he-prizes b,.he-prizes span{display:block}.he-detail-grid b{font-size:10px;color:#8e87a5}.he-teleport{display:inline-block;margin-top:18px}
.he-dashboard h2{margin-top:0}.he-add{border:1px solid #382868;border-radius:12px;padding:13px;margin-bottom:18px}.he-add summary{font-weight:900;cursor:pointer;color:#c6b5ff}.he-form{margin-top:18px}.he-form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.he-form label{display:flex;flex-direction:column;gap:5px;color:#bcb6cf;font-size:12px}.he-form .wide{grid-column:1/-1}.he-days{border:1px solid #302353;padding:12px;border-radius:10px}.he-days label{display:inline-flex;flex-direction:row;margin:5px 12px 5px 0}.he-form textarea{width:100%}#he-prize-list{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-top:7px}
.he-table{border:1px solid #2d2451;border-radius:12px;overflow:hidden}.he-tr{display:grid;grid-template-columns:2fr 1.4fr 1fr 1fr 1.3fr;gap:10px;padding:12px;border-bottom:1px solid #251e43;align-items:center}.he-tr:last-child{border:0}.he-th{background:#14102b;color:#bbaaff;font-size:11px;font-weight:900;text-transform:uppercase}.he-tr small{display:block;color:#8f899f}.he-tr a{color:#bca9ff}.he-status{font-size:10px;font-weight:900}.he-notice{padding:16px;border:1px solid #3c2a72;background:#100d25;border-radius:12px}
@media(max-width:760px){.he-next{grid-template-columns:1fr}.he-week{display:none}.he-grid{grid-template-columns:1fr}.he-day{min-height:auto}.he-day.blank{display:none}.he-form-grid,#he-prize-list,.he-detail-grid,.he-prizes{grid-template-columns:1fr}.he-tr{grid-template-columns:1fr}.he-th{display:none}}

.he-loading,.he-feed-error{grid-column:1/-1;padding:28px;text-align:center;border:1px solid #33255f;background:#0d0d21;border-radius:10px}.he-feed-error{color:#ffb8c7}.he-empty-note{text-align:center;color:var(--he-muted);padding:12px;font-size:12px}

/* 1.0.2: keep native dropdowns readable on light select backgrounds */
.he-toolbar select,.he-form select{background:#fff!important;color:#171226!important;font-weight:700}
.he-toolbar select option,.he-form select option{background:#fff!important;color:#171226!important}
.he-toolbar select:focus,.he-form select:focus{color:#171226!important}

/* 1.0.3 modal robustness */
.he-modal.open{display:flex!important;align-items:flex-start;justify-content:center}
.he-modal-card{width:min(720px,calc(100vw - 30px));max-height:90vh;overflow:auto;margin:0 auto}
.he-event{position:relative;z-index:2}

/* 1.0.4 recurrence form */
#he-weekdays-box small{color:#8f899f}

/* 1.0.5 admin editor */
.he-admin-editor{max-width:1000px;margin:18px 0 24px;padding:18px;background:#0d0d21;color:#f6f4ff;border:1px solid #382868;border-radius:14px}
.he-admin-editor h2{color:#fff}.he-admin-editor p{color:#aaa5bd}

/* 1.0.6 compact calendar */
.he-event{padding:5px 7px;margin-top:4px;background:linear-gradient(100deg,#316fd0,#367ddc);border:0;border-radius:6px;min-height:38px}
.he-event b.he-event-time{font-size:10px;line-height:1.05;color:#fff;margin-bottom:2px}.he-event span{display:block;font-size:11px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff}.he-event.ended{opacity:.48}.he-event.ended small{font-size:8px;color:#ddd}
.he-more{width:100%;border:0;background:transparent;color:#bca9ff;font-weight:900;font-size:11px;text-align:left;padding:6px 4px;cursor:pointer}.he-more:hover{color:#fff}
.he-day-events{display:grid;gap:7px;margin-top:16px}.he-day-event{display:grid;grid-template-columns:90px 1fr auto;gap:12px;align-items:center;width:100%;padding:13px 14px;border:1px solid #30265b;background:#111027;color:#fff;border-radius:10px;text-align:left;cursor:pointer}.he-day-event:hover{border-color:#7652df;background:#171232}.he-day-event b{color:#69a7ff}.he-day-event span{font-weight:800}.he-day-event small{font-size:9px;color:#8e879e}.he-day-event.ended{opacity:.5}

/* 1.0.7 Calendar / Table public switch */
.he-view-switch{display:flex;gap:6px}.he-view{background:#111027!important;border-color:#3b2b72!important}.he-view.active{background:linear-gradient(120deg,#3977ff,#c427e9)!important}
.he-public-table{margin-top:16px;border:1px solid #2d2451;border-radius:12px;overflow:hidden}
.he-list-head,.he-list-row{display:grid;grid-template-columns:1.05fr .75fr 2fr 1.4fr 1fr;gap:12px;align-items:center}
.he-list-head{padding:11px 14px;background:#14102b;color:#bbaaff;font-size:10px;font-weight:900}
.he-list-row{width:100%;padding:12px 14px;border:0;border-bottom:1px solid #251e43;background:#0a0a19;color:#eae7f5;text-align:left;cursor:pointer}
.he-list-row:last-child{border-bottom:0}.he-list-row:hover{background:#14102b}.he-list-row.ended{opacity:.5}.he-list-time{color:#69a7ff;font-weight:900}.he-list-title{font-weight:900;color:#fff}.he-list-empty{padding:25px;text-align:center;color:#aaa5bd}
@media(max-width:760px){.he-view-switch{width:100%}.he-list-head{display:none}.he-list-row{grid-template-columns:1fr 1fr}.he-list-title{grid-column:1/-1;grid-row:1}.he-public-table{overflow:visible}}

/* 1.0.8 switch/calendar fix */
.he-calendar[hidden],.he-public-table[hidden]{display:none!important}
.he-calendar:not([hidden]){display:block!important}
#he-month{display:block!important;color:#f6f4ff!important;opacity:1!important;visibility:visible!important}

/* 1.0.9 viewport-level modal fix */
html.he-modal-lock,body.he-modal-lock{overflow:hidden!important}
body>#he-modal{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100vh!important;
    margin:0!important;
    padding:24px!important;
    box-sizing:border-box!important;
    z-index:2147483647!important;
    isolation:isolate!important;
    overflow:auto!important;
    background:rgba(0,0,0,.76)!important;
}
body>#he-modal.open{
    display:flex!important;
    align-items:flex-start!important;
    justify-content:center!important;
}
body>#he-modal .he-modal-card{
    position:relative!important;
    z-index:1!important;
    width:min(760px,calc(100vw - 48px))!important;
    max-height:calc(100vh - 48px)!important;
    margin:0 auto!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain;
}
@media(max-width:600px){
    body>#he-modal{padding:10px!important}
    body>#he-modal .he-modal-card{
        width:calc(100vw - 20px)!important;
        max-height:calc(100vh - 20px)!important;
    }
}

/* 1.1.0 admin approval mode */
.he-approval-panel{display:flex;align-items:center;justify-content:space-between;gap:24px;max-width:1100px;margin:18px 0 22px;padding:16px 18px;background:#120d27;border:1px solid #39276e;border-radius:14px;color:#fff}
.he-approval-copy strong{font-size:14px;color:#c6a8ff}
.he-approval-copy p{margin:5px 0 0;color:#aaa5bd}
.he-approval-form{display:flex;gap:8px;flex-shrink:0}
.he-approval-choice{min-width:150px;padding:10px 14px;border:1px solid #4a347e;border-radius:10px;background:#0c091b;color:#fff;cursor:pointer;text-align:left}
.he-approval-choice b,.he-approval-choice span{display:block}
.he-approval-choice b{font-size:13px}
.he-approval-choice span{margin-top:2px;font-size:10px;color:#a9a3b8}
.he-approval-choice.active{background:linear-gradient(120deg,#3977ff,#c427e9);border-color:transparent}
.he-approval-choice.active span{color:#fff}
@media(max-width:760px){.he-approval-panel{align-items:stretch;flex-direction:column}.he-approval-form{width:100%}.he-approval-choice{flex:1;min-width:0}}

.he-detail-image{display:block;width:100%;max-height:300px;object-fit:cover;border-radius:12px;margin:14px 0 16px;border:1px solid #29214e}
.he-media-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.he-media-preview img{display:block;max-width:520px;max-height:180px;margin-top:12px;border-radius:8px;border:1px solid #ccd0d4}
.he-type-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:16px;margin:18px 0 28px}.he-type-card{background:#fff;border:1px solid #dcdcde;border-radius:10px;padding:12px}.he-type-card img,.he-type-noimg{width:100%;height:120px;object-fit:cover;border-radius:7px;background:#f0f0f1}.he-type-noimg{display:flex;align-items:center;justify-content:center;color:#777;font-weight:700}.he-type-card h3{margin:10px 0 6px}

/* 1.1.4 calendar geometry */
.he-calendar{width:100%;overflow-x:auto;padding-bottom:4px}
.he-cal-head,.he-week,.he-grid{min-width:700px}
.he-week,.he-grid{grid-template-columns:repeat(7,minmax(0,1fr))!important;gap:6px!important}
.he-grid{grid-auto-rows:minmax(108px,auto)}
.he-day{box-sizing:border-box!important;width:auto!important;min-width:0!important;min-height:108px!important;overflow:hidden!important;padding:7px!important}
.he-day.blank{visibility:hidden;opacity:0!important}
.he-event{width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important;overflow:hidden!important}
.he-event span{min-width:0!important;max-width:100%!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
@media(max-width:760px){
 .he-calendar{overflow-x:auto!important;-webkit-overflow-scrolling:touch}
 .he-cal-head,.he-week,.he-grid{min-width:700px!important}
 .he-week{display:grid!important}
 .he-grid{display:grid!important;grid-template-columns:repeat(7,minmax(0,1fr))!important}
 .he-day{display:block!important;min-height:108px!important}
 .he-day.blank{display:block!important;visibility:hidden!important}
}

/* 1.1.5 visual calendar */
@media(min-width:761px){
 .he-calendar{overflow-x:hidden!important}
 .he-cal-head,.he-week,.he-grid{min-width:0!important;width:100%!important}
}
.he-grid{grid-auto-rows:minmax(112px,auto)!important}
.he-day{min-height:112px!important}
.he-event.he-event-visual{position:relative!important;display:block!important;height:42px!important;min-height:42px!important;padding:0!important;margin-top:4px!important;border:1px solid rgba(255,255,255,.12)!important;border-radius:7px!important;overflow:hidden!important;background:#17132d!important}
.he-event-visual .he-event-image{display:block!important;width:100%!important;height:100%!important;object-fit:cover!important;margin:0!important;border:0!important;border-radius:0!important}
.he-event-visual::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(5,5,18,.78),rgba(5,5,18,.08) 72%);pointer-events:none}
.he-event-visual .he-event-time{position:absolute!important;left:6px!important;top:6px!important;z-index:2!important;display:inline-block!important;margin:0!important;padding:3px 5px!important;border-radius:5px!important;background:rgba(8,8,24,.78)!important;color:#fff!important;font-size:9px!important;line-height:1!important;font-weight:900!important}
.he-event-visual .he-event-fallback{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;height:100%!important;padding:0 5px!important;background:linear-gradient(120deg,#3977ff,#9a2ce8)!important;color:#fff!important;font-size:9px!important;font-weight:900!important;letter-spacing:.04em!important;text-align:center!important}
.he-event-visual small{position:absolute!important;right:5px!important;bottom:4px!important;z-index:2!important;padding:2px 4px!important;border-radius:4px!important;background:rgba(0,0,0,.72)!important;color:#ddd!important;font-size:7px!important}
.he-event-visual.ended{opacity:.48!important}
@media(max-width:760px){.he-calendar{overflow-x:auto!important}.he-cal-head,.he-week,.he-grid{min-width:700px!important}}

/* 1.1.7 compact one-screen event popup */
body>#he-modal{padding:12px!important;overflow:hidden!important;align-items:center!important}
body>#he-modal .he-modal-card{width:min(760px,calc(100vw - 24px))!important;max-height:calc(100vh - 24px)!important;height:auto!important;overflow:hidden!important;margin:auto!important}
body>#he-modal .he-detail{padding:14px 18px 16px!important;font-size:13px!important}
body>#he-modal .he-detail>.he-type-image,body>#he-modal .he-detail>img,body>#he-modal .he-event-type-image{width:100%!important;height:125px!important;max-height:125px!important;object-fit:cover!important;margin:0 0 10px!important;border-radius:10px!important}
body>#he-modal .he-detail .he-tag{margin-bottom:6px!important}
body>#he-modal .he-detail h2{font-size:24px!important;line-height:1.05!important;margin:5px 0 10px!important}
body>#he-modal .he-detail h3{font-size:13px!important;line-height:1!important;margin:11px 0 6px!important}
body>#he-modal .he-detail-grid{gap:6px!important;margin:0!important}
body>#he-modal .he-detail-grid>div{min-height:48px!important;padding:8px 10px!important}
body>#he-modal .he-detail-grid b{font-size:9px!important;margin-bottom:3px!important}
body>#he-modal .he-detail-grid span{font-size:13px!important;line-height:1.15!important}
body>#he-modal .he-prizes{gap:6px!important;margin:0!important}
body>#he-modal .he-prizes>div{min-height:44px!important;padding:7px 10px!important}
body>#he-modal .he-prizes b{font-size:11px!important;margin-bottom:2px!important}
body>#he-modal .he-prizes span{font-size:12px!important;line-height:1.1!important}
body>#he-modal .he-desc{font-size:12px!important;line-height:1.25!important;margin:0!important;max-height:55px!important;overflow:hidden!important}
body>#he-modal .he-desc p{margin:0!important}
body>#he-modal .he-teleport{margin-top:10px!important;padding:10px 14px!important}
body>#he-modal .he-close{top:7px!important;right:9px!important}
@media (min-width:601px) and (max-height:800px){body>#he-modal .he-detail{padding:10px 14px 12px!important}body>#he-modal .he-detail>.he-type-image,body>#he-modal .he-detail>img,body>#he-modal .he-event-type-image{height:82px!important;max-height:82px!important;margin-bottom:6px!important}body>#he-modal .he-detail h2{font-size:20px!important;margin:3px 0 7px!important}body>#he-modal .he-detail h3{margin:7px 0 4px!important}body>#he-modal .he-detail-grid{gap:4px!important}body>#he-modal .he-detail-grid>div{min-height:39px!important;padding:5px 8px!important}body>#he-modal .he-prizes{gap:4px!important}body>#he-modal .he-prizes>div{min-height:34px!important;padding:5px 8px!important}body>#he-modal .he-desc{max-height:38px!important}body>#he-modal .he-teleport{margin-top:6px!important;padding:8px 12px!important}}
@media(max-width:600px){body>#he-modal{padding:6px!important;overflow:auto!important}body>#he-modal .he-modal-card{width:calc(100vw - 12px)!important;max-height:calc(100vh - 12px)!important;overflow:auto!important}}

/* 1.1.9: background page remains untouched while modal is open */
html.he-modal-lock,body.he-modal-lock{overflow:auto!important}

/* 1.1.11 table pagination */
.he-table-pagination{display:flex;align-items:center;justify-content:center;gap:14px;padding:14px;border-top:1px solid #2d2451;background:#0d0b1d}
.he-table-pagination span{min-width:90px;text-align:center;color:#c9c3da;font-size:11px;font-weight:800}
.he-table-pagination .he-btn{min-width:92px;padding:8px 12px!important}
.he-table-pagination .he-btn:disabled{opacity:.32!important;cursor:default!important;pointer-events:none!important}
@media(max-width:600px){.he-table-pagination{gap:7px}.he-table-pagination .he-btn{min-width:78px;font-size:10px!important}.he-table-pagination span{min-width:70px;font-size:10px}}
