*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#090b10;color:#f4f6fa}a{color:inherit;text-decoration:none}.topbar{padding:28px 5vw;display:flex;justify-content:space-between;gap:20px;align-items:center;background:linear-gradient(120deg,#121722,#0b0d12);border-bottom:1px solid #252b38}.topbar.compact{padding:20px 5vw}.eyebrow{font-size:12px;letter-spacing:.16em;color:#9da7b8}.topbar h1{margin:4px 0;font-size:clamp(24px,4vw,42px)}.topbar p{margin:0;color:#aeb7c7}.container{max-width:1200px;margin:28px auto;padding:0 18px}.grid{display:grid;gap:18px}.card{background:#11151d;border:1px solid #262d39;border-radius:18px;padding:22px;box-shadow:0 12px 40px #0004}.hero{display:flex;justify-content:space-between;gap:30px;align-items:center;margin-bottom:18px}.hero h2{font-size:28px;margin:10px 0}.contact{min-width:280px;padding:16px;border-radius:14px;background:#171d27}.pill{display:inline-block;padding:7px 12px;border-radius:99px;background:#252d3b;color:#d8deea;font-size:13px}.ghost-btn{border:1px solid #3a4352;background:#151a23;color:#fff;border-radius:10px;padding:10px 14px;cursor:pointer}.primary-btn{border:0;background:#e7b23c;color:#101217;border-radius:10px;padding:13px 18px;font-weight:800;cursor:pointer}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.form-grid label,.card>label,.inline-form>*{display:flex;flex-direction:column;gap:7px;color:#dce2ec;font-size:14px}.full{grid-column:1/-1}input,select{width:100%;background:#0b0e14;border:1px solid #323b49;color:#fff;border-radius:9px;padding:11px 12px;font-size:15px}input[type=file]{padding:9px}small,.muted{color:#98a2b3}.info-box{margin-top:14px;padding:12px;border-radius:10px;background:#17202d;color:#cbd4e1}.class-group{margin:18px 0;padding:16px;border:1px solid #293140;border-radius:14px}.class-group.rookie{border-color:#735b23}.class-group h4{margin:0 0 10px}.checks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.checks label,.rules-mini label{display:flex;gap:8px;align-items:flex-start;padding:9px;border-radius:9px;background:#0c1017}.checks input,.rules-mini input{width:auto;margin-top:3px}.fee-box{margin-top:18px;border-top:1px solid #303846;padding-top:14px}.fee-box>div{display:flex;justify-content:space-between;padding:8px 0}.fee-box .total{font-size:21px;border-top:1px solid #303846;margin-top:5px}.payment{margin-top:18px;display:flex;justify-content:space-between;gap:20px;align-items:center;background:#0c1017;border-radius:14px;padding:16px}.payment img{width:180px;height:180px;object-fit:contain;background:#fff;border-radius:10px}.message{margin:12px 0;min-height:22px}.message.ok{color:#79e2a8}.message.err{color:#ff8c8c}.toolbar{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px}.toolbar input{max-width:360px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;min-width:800px}th,td{padding:11px 9px;border-bottom:1px solid #293140;text-align:left;font-size:14px}th{color:#aeb7c7;font-weight:600}.narrow{max-width:460px;margin:50px auto}.narrow label{margin:12px 0}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:18px}.stat span{color:#98a2b3}.stat b{display:block;font-size:30px;margin-top:5px}.inline-form{display:grid;grid-template-columns:1.4fr 1fr 1fr 1.4fr auto;gap:10px}.status{font-weight:700}.status.pending{color:#f0c96a}.status.approved{color:#78e3a9}.status.rejected{color:#ff8f8f}@media(max-width:800px){.hero{flex-direction:column;align-items:flex-start}.contact{min-width:0;width:100%}.form-grid,.checks,.stats,.inline-form{grid-template-columns:1fr}.payment{flex-direction:column;align-items:flex-start}.payment img{width:220px;height:220px}}

.class-card{background:#11161f;border:1px solid #30394a;border-radius:18px;margin:16px 0;padding:16px;overflow:hidden}
.class-head{display:flex;justify-content:space-between;align-items:center;gap:15px;border-bottom:1px solid #394253;padding:0 0 12px;margin-bottom:12px}
.class-head h2{margin:0;color:#f2c75c}.class-head p{margin:5px 0 0;color:#9ca7b7}.class-head span{border:1px solid #58728c;background:#183047;color:#bfe2ff;border-radius:99px;padding:8px 14px;font-weight:800}
.class-card table{width:100%;border-collapse:collapse}.class-card th{background:#4b0d70;color:#fff;text-align:left;padding:12px}.class-card td{padding:10px;border-bottom:1px solid #30394a}.class-card tr:last-child td{border-bottom:0}.class-card small{color:#aeb7c5}

/* THE CROWN OF SPEED — Premium Black / Gold / White Theme */
:root{
  --bg:#050505;
  --panel:#0d0d0d;
  --panel2:#111111;
  --line:#3a2b0b;
  --gold:#d4af37;
  --gold2:#f3cf63;
  --gold3:#a67c00;
  --white:#ffffff;
  --muted:#c9c9c9;
}
html{background:var(--bg)}
body{
  background:
    radial-gradient(circle at 50% -10%,rgba(212,175,55,.12),transparent 36%),
    linear-gradient(135deg,#050505 0%,#090909 48%,#030303 100%);
  color:var(--white);
}
body:before{
  content:"";
  position:fixed;inset:0;pointer-events:none;opacity:.06;
  background-image:linear-gradient(135deg,transparent 0 47%,#fff 48% 49%,transparent 50%);
  background-size:42px 42px;
}
.topbar{
  background:linear-gradient(120deg,#030303,#101010 55%,#050505);
  border-bottom:1px solid var(--gold3);
  position:relative;
}
.topbar:after{
  content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;
  background:linear-gradient(90deg,transparent,var(--gold),transparent);
}
.eyebrow{color:var(--gold2)}
.topbar h1{
  color:#fff;
  text-shadow:0 2px 18px rgba(212,175,55,.2);
}
.topbar p,.muted,small{color:#cfcfcf}
.card,.class-card{
  background:linear-gradient(145deg,#111 0%,#090909 100%);
  border:1px solid #5b4512;
  box-shadow:0 14px 42px rgba(0,0,0,.45),inset 0 1px rgba(255,255,255,.03);
}
.hero h2,h2,h3,h4{color:#fff}
.pill{
  background:linear-gradient(90deg,#4b3708,#171205);
  border:1px solid var(--gold3);
  color:var(--gold2);
}
.contact,.info-box,.payment,.checks label,.rules-mini label{
  background:#0a0a0a;
  border-color:#3d2d0b;
}
.contact b{color:var(--gold2)}
input,select{
  background:#050505;
  border:1px solid #55410f;
  color:#fff;
}
input:focus,select:focus{
  outline:none;
  border-color:var(--gold);
  box-shadow:0 0 0 2px rgba(212,175,55,.14);
}
.ghost-btn{
  background:#0b0b0b;
  border:1px solid #715817;
  color:#fff;
}
.ghost-btn:hover{border-color:var(--gold);color:var(--gold2)}
.primary-btn{
  background:linear-gradient(135deg,#f0c84b,#b58a19);
  color:#050505;
  box-shadow:0 5px 18px rgba(212,175,55,.18);
}
.class-group{border-color:#3d2e0d}
.class-group.rookie{border-color:var(--gold)}
.class-group h4{color:var(--gold2)}
.fee-box{border-top-color:#4a3810}
.fee-box .total{border-top-color:#4a3810}
.message.ok{color:#9ee6b9}.message.err{color:#ff9b9b}
th{
  color:#fff;
  background:linear-gradient(90deg,#5a4209,#2a1e06);
}
td{border-bottom-color:#30250d}
.class-head{border-bottom-color:#3d2e0d}
.class-head h2{color:var(--gold2)}
.class-head span{
  border-color:#765b17;background:#1b1508;color:var(--gold2)
}
.class-card th{
  background:linear-gradient(90deg,#4b3508,#201703);
  color:#fff;
}
.class-card td{border-bottom-color:#30250d}
.status.pending{color:var(--gold2)}
.status.approved{color:#9ee6b9}
.status.rejected{color:#ff9b9b}
.stat{background:#0d0d0d;border-color:#4b380f}
.stat span{color:#c9c9c9}
.stat b{color:#fff}
.narrow{background:#0d0d0d}
a{color:#fff}
a:hover{color:var(--gold2)}
hr{border-color:#3d2e0d}

.crown-mark{color:var(--gold2);text-shadow:0 0 14px rgba(212,175,55,.35);margin-right:6px}

/* THE CROWN OF SPEED — Premium Red / Gold / White */
:root{
 --bg:#070304;--red:#b00016;--red2:#e0182b;--red3:#5f000d;
 --gold:#d6ad36;--gold2:#ffd85a;--gold3:#8f6b12;
 --white:#fff;--text:#fff;--muted:#e4dfe0;--panel:#120607;--panel2:#1a090b;
}
html,body{background:#070304;color:var(--white)}
body{
 background:
 radial-gradient(circle at 50% -5%,rgba(224,24,43,.20),transparent 35%),
 linear-gradient(135deg,#050203,#160507 45%,#070304);
}
body:before{
 content:"";position:fixed;inset:0;pointer-events:none;opacity:.055;
 background:repeating-linear-gradient(135deg,transparent 0 28px,rgba(255,255,255,.8) 29px 30px,transparent 31px 62px);
}
.topbar{
 background:linear-gradient(110deg,#080304,#24070b 55%,#080304);
 border-bottom:1px solid var(--gold3);position:relative;
}
.topbar:after{
 content:"";position:absolute;left:0;right:0;bottom:-2px;height:3px;
 background:linear-gradient(90deg,transparent,var(--red2),var(--gold2),var(--red2),transparent);
}
.eyebrow{color:var(--gold2)}
.topbar h1{color:#fff;text-shadow:0 0 22px rgba(224,24,43,.22)}
.topbar p,.muted,small{color:#eee}
.card,.class-card{
 background:linear-gradient(145deg,#180709,#0b0304 80%);
 border:1px solid #8b5e12;
 box-shadow:0 15px 45px rgba(0,0,0,.5),inset 0 1px rgba(255,255,255,.04);
}
.card:before{border-color:rgba(214,173,54,.35)}
h1,h2,h3,h4{color:#fff}
h2:after,h3:after{background:linear-gradient(90deg,var(--red2),var(--gold2),transparent)}
input,select,textarea{
 background:#090405;color:#fff;border:1px solid #815d1c;
}
input:focus,select:focus,textarea:focus{
 border-color:var(--gold2);outline:none;
 box-shadow:0 0 0 2px rgba(255,216,90,.14),0 0 18px rgba(224,24,43,.12);
}
input::placeholder,textarea::placeholder{color:#a9a1a3}
.primary-btn{
 background:linear-gradient(135deg,#e0182b,#a60016 60%,#d6ad36);
 color:#fff;border:1px solid #ffd85a;
 box-shadow:0 7px 22px rgba(224,24,43,.25);
}
.primary-btn:hover{filter:brightness(1.1)}
.ghost-btn{
 background:linear-gradient(180deg,#17080a,#0a0304);
 color:#fff;border:1px solid #a17b24;
}
.ghost-btn:hover{border-color:var(--gold2);color:var(--gold2)}
.pill,.badge{
 background:linear-gradient(90deg,#70000d,#260306);
 border:1px solid #d6ad36;color:#ffd85a;
}
.contact,.info-box,.payment,.checks label,.rules-mini label{
 background:#100506;border-color:#704d16;
}
.contact b{color:#ffd85a}
.class-group{border-color:#6d4311}
.class-group.rookie{border-color:#d6ad36}
.class-group h4{color:#ffd85a}
.fee-box{border-top-color:#704d16}
.fee-box .total{border-top-color:#704d16;color:#ffd85a}
.message.ok{color:#a8f0bd}.message.err{color:#ff9b9b}
th{background:linear-gradient(90deg,#8e0618,#4e020b);color:#fff}
td{border-bottom-color:#412329}
.stat{background:#140608;border-color:#714d16}
.stat b{color:#fff}.stat span{color:#ddd}
.class-head{border-bottom-color:#6d4311}
.class-head h2{color:#ffd85a}
.class-head span{border-color:#9d7420;background:#4b090f;color:#ffd85a}
.class-card th{background:linear-gradient(90deg,#8e0618,#4e020b);color:#fff}
.class-card td{border-bottom-color:#412329}
.status.pending{color:#ffd85a}.status.approved{color:#a8f0bd}.status.rejected{color:#ff9b9b}
a{color:#fff}a:hover{color:#ffd85a}
hr{border-color:#4d2d13}
.crown-mark{color:#ffd85a;text-shadow:0 0 16px rgba(214,173,54,.4)}


.gold-title{color:#ffd85a;text-shadow:0 0 18px rgba(214,173,54,.28)}

input[type="date"]{cursor:pointer;min-height:44px}
input[type="date"]::-webkit-calendar-picker-indicator{filter:invert(1);cursor:pointer;opacity:.95}

.eligible-box{margin:14px 0 18px;padding:14px 16px;border:1px solid #d6ad36;border-left:4px solid #e0182b;border-radius:12px;background:linear-gradient(90deg,#21070a,#100405);display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.eligible-box strong{color:#ffd85a}.eligible-box span{color:#fff}
.class-option.ineligible{opacity:.38}.class-option.ineligible input{cursor:not-allowed}.class-option.eligible{box-shadow:inset 3px 0 #d6ad36}

.checks label.ineligible{opacity:.32;filter:grayscale(.5);cursor:not-allowed!important;background:rgba(90,0,12,.16)}
.checks label.ineligible input{cursor:not-allowed;accent-color:#777}
.checks label.eligible{border-left:3px solid #d6ad36;padding-left:9px}
.age-cross-note{color:#ffd85a}

/* SUPER BOY left / SUPER GIRL right */
.super-boy-title{color:#ffd85a}
.super-girl-title{color:#ffd85a}
.class-option.super-boy{grid-column:1}
.class-option.super-girl{grid-column:2}
.class-option.gender-locked{opacity:.35}

.super-columns{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.super-column{background:rgba(0,0,0,.22);border:1px solid #704d16;border-radius:12px;padding:12px}
.super-column h5{margin:0 0 8px;color:#ffd85a;font-size:17px;letter-spacing:.5px}
.super-boy-column{grid-column:1}.super-girl-column{grid-column:2}
.super-column .checks{display:grid;grid-template-columns:1fr;gap:6px}
.super-column label{min-height:38px;display:flex;align-items:center}
.gender-locked{opacity:.28!important}
@media(max-width:700px){.super-columns{grid-template-columns:1fr}.super-boy-column,.super-girl-column{grid-column:1}}

.age-cross-note{color:#ffd85a}.age-month-rule{color:#e9e9e9;font-size:.9rem;margin-top:6px}

/* V32: When gender is selected, show only the matching SUPER column on the left. */
.super-columns.gender-single{grid-template-columns:1fr}
.super-columns.gender-single .super-boy-column,
.super-columns.gender-single .super-girl-column{grid-column:1}
.super-column.is-hidden{display:none!important}

/* V33: Force the visible gender-matched SUPER panel to occupy the left side. */
.super-columns.gender-single{display:grid!important;grid-template-columns:minmax(0,1fr)!important}
.super-columns.gender-single .super-boy-column,
.super-columns.gender-single .super-girl-column{
  grid-column:1!important;
  grid-row:1!important;
  justify-self:stretch!important;
  width:auto!important;
}
.super-columns.gender-single .super-column .checks{
  width:100%!important;
  display:grid!important;
  grid-template-columns:1fr!important;
}
.super-columns.gender-single .super-column label{
  justify-self:start!important;
  width:100%!important;
}

/* V34: SUPER GIRL options match SUPER BOY — left aligned inside its panel. */
.super-columns .super-boy-column .checks,
.super-columns .super-girl-column .checks{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  width:100%!important;
}
.super-columns .super-boy-column .checks label,
.super-columns .super-girl-column .checks label{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  text-align:left!important;
  width:100%!important;
  box-sizing:border-box!important;
  margin-left:0!important;
  margin-right:0!important;
}
.super-columns .super-boy-column .checks label input,
.super-columns .super-girl-column .checks label input{
  flex:0 0 auto!important;
  margin-left:0!important;
  margin-right:10px!important;
}

/* V35: Fix the per-option .class-option.super-girl rule from forcing options to grid column 2. */
.super-columns .super-girl-column .class-option.super-girl{
  grid-column:1!important;
  justify-self:stretch!important;
  width:100%!important;
}
.super-columns .super-boy-column .class-option.super-boy{
  grid-column:1!important;
  justify-self:stretch!important;
  width:100%!important;
}

/* V36: pre-registration rules wizard */
.rules-wizard{margin-bottom:24px}
.wizard-progress{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px;padding:10px;border:1px solid #704d16;border-radius:12px;background:#100506}
.wizard-progress span{padding:8px 12px;border-radius:999px;background:#0a0a0a;color:#aaa;font-size:13px;border:1px solid #3d2d0b}
.wizard-progress .wizard-active{color:#ffd85a;border-color:#d6ad36;background:#260306}
.rules-card h2{color:#fff;margin-top:0}
.rules-card h3,.rules-card h4{color:#ffd85a}
.rules-long,.rules-list{line-height:1.75}
.rules-long p{margin:0 0 12px}
.rules-list li{margin:6px 0}
.warning-text{color:#ffcf4a}
.wizard-agree{display:flex!important;flex-direction:row!important;align-items:flex-start!important;gap:10px!important;margin-top:18px;padding:14px!important;background:#170507!important;border:1px solid #704d16!important;border-radius:10px!important;color:#fff!important}
.wizard-agree input{width:auto!important;margin-top:4px!important;flex:0 0 auto}
.wizard-actions{display:flex;justify-content:space-between;gap:10px;margin-top:18px}
.wizard-actions button{min-width:180px}
.form-start-banner{grid-column:1/-1}
.form-start-banner h2{color:#ffd85a}
@media(max-width:700px){
 .wizard-progress{display:grid;grid-template-columns:1fr 1fr}
 .wizard-actions{flex-direction:column}
 .wizard-actions button{width:100%}
}

/* V37: Never show the registration form until every rules page is completed. */
#registrationForm[hidden]{display:none!important}
.rules-wizard[hidden]{display:none!important}
.wizard-page[hidden]{display:none!important}
.wizard-agree.locked{
  opacity:.55;
  cursor:not-allowed;
}
.wizard-agree.locked input{
  cursor:not-allowed;
}
.read-status{
  margin-top:12px;
  padding:10px 14px;
  border-radius:9px;
  border:1px solid #59420e;
  background:#120607;
  color:#d8d8d8;
  font-size:14px;
}
.read-status.done{
  border-color:#b99225;
  color:#ffd85a;
}

/* V38: Clear post-submission confirmation modal */
.success-modal[hidden]{display:none!important}
.success-modal{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;padding:20px}
.success-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.82);backdrop-filter:blur(5px)}
.success-modal-card{position:relative;width:min(560px,100%);padding:34px 28px 28px;border:2px solid #d5a82c;border-radius:22px;background:linear-gradient(145deg,#190507,#090607 70%);box-shadow:0 20px 70px rgba(0,0,0,.7),0 0 35px rgba(211,35,22,.22);text-align:center;color:#fff}
.success-check{width:64px;height:64px;margin:0 auto 12px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#d6ad36;color:#130606;font-size:38px;font-weight:900;box-shadow:0 0 24px rgba(214,173,54,.35)}
.success-thankyou{font-size:42px;line-height:1;font-weight:900;letter-spacing:1px;color:#fff;margin-bottom:8px}
.success-main{font-size:24px;font-weight:800;color:#ffd85a;margin-bottom:10px}
.success-name{font-size:23px;font-weight:800;margin:4px 0 18px;word-break:break-word}
.success-details{padding:16px;border:1px solid #704d16;border-radius:12px;background:#100607;font-size:16px}
.success-details strong{display:block;font-size:30px;color:#ffd85a;letter-spacing:1px;margin:5px 0 12px}
.success-note{font-size:14px;line-height:1.7;color:#ddd}
.success-close{margin-top:18px;min-width:150px}
@media(max-width:600px){
 .success-thankyou{font-size:34px}
 .success-main{font-size:21px}
 .success-name{font-size:20px}
 .success-details strong{font-size:25px}
}

/* V43: ensure admin applicant rows are visible */
.admin-roster-table{width:100%;border-collapse:collapse}
.admin-roster-table tbody tr{display:table-row!important;visibility:visible!important}
.admin-roster-table tbody td{display:table-cell!important;visibility:visible!important}

.rules-editor-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}
.rules-editor-item{border:1px solid #704d16;border-radius:14px;background:#100607;margin:14px 0;overflow:hidden}
.rules-editor-item .editor-title{padding:12px 14px;border-bottom:1px solid #4b3210;color:#ffd85a;font-weight:800}
.rules-editor-item input{width:100%;margin:0;border:0;border-radius:0;background:#0a0708;color:#fff;font-size:18px;font-weight:800}
.rules-editor-body{min-height:280px;padding:16px;outline:none;line-height:1.75;color:#fff}
.rules-editor-body:focus{box-shadow:inset 0 0 0 2px #d6ad36}
.rules-editor-tools{padding:8px 14px;border-top:1px solid #3d2a0e;color:#8f9aaa;font-size:12px}
.rules-editor-body p{margin:0 0 12px}.rules-editor-body h3,.rules-editor-body h4{color:#ffd85a}.rules-editor-body li{margin:5px 0}
@media(max-width:700px){.rules-editor-head{flex-direction:column;align-items:stretch}}

.db-rules-body{line-height:1.75}.db-rules-body p{margin:0 0 12px}.db-rules-body h3,.db-rules-body h4{color:#ffd85a}.db-rules-body li{margin:6px 0}

.rules-editor-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}
.rules-editor-item{border:1px solid #704d16;border-radius:14px;background:#100607;margin:12px 0;overflow:hidden}
.rules-editor-item .editor-title{padding:16px 18px;display:flex;align-items:center;justify-content:space-between;gap:15px;color:#ffd85a;font-weight:800}
.rules-editor-item .editor-title-text{flex:1}
.rules-editor-item .editor-subtitle{display:block;color:#9ca7b7;font-size:12px;font-weight:400;margin-top:4px}
.rules-edit-btn{white-space:nowrap;padding:9px 18px;border:1px solid #e7b936;border-radius:10px;background:linear-gradient(135deg,#d90722,#e4a92d);color:#fff;font-weight:800;cursor:pointer}
.rules-edit-btn:hover{filter:brightness(1.1);transform:translateY(-1px)}
.rules-editor-modal{position:fixed;inset:0;background:#000b;display:none;align-items:center;justify-content:center;padding:20px;z-index:100}
.rules-editor-modal.show{display:flex}
.rules-editor-modal-card{width:min(1100px,96vw);max-height:92vh;overflow:auto;background:#100607;border:1px solid #d4a928;border-radius:18px;box-shadow:0 20px 70px #000; padding:22px}
.rules-editor-modal-head{display:flex;align-items:center;justify-content:space-between;gap:15px;border-bottom:1px solid #533b12;padding-bottom:14px;margin-bottom:14px}
.rules-editor-modal-head h3{margin:0;color:#ffd85a}
.rules-title-edit{width:100%;background:#080607!important;color:#fff!important;border:1px solid #8b6519!important;border-radius:9px!important;padding:10px!important;font-size:18px!important;font-weight:800!important}
.rules-editor-body{min-height:420px;padding:18px;outline:none;line-height:1.75;color:#fff;background:#080607;border:1px solid #533b12;border-radius:12px}
.rules-editor-body:focus{box-shadow:inset 0 0 0 2px #d6ad36}
.rules-editor-body p{margin:0 0 12px}.rules-editor-body h3,.rules-editor-body h4{color:#ffd85a}.rules-editor-body li{margin:5px 0}
.rules-editor-modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:14px}
.rules-cancel-btn{padding:10px 18px;border:1px solid #6b5727;border-radius:10px;background:#120b0b;color:#fff;font-weight:700;cursor:pointer}
.rules-save-btn{padding:10px 22px;border:1px solid #e7b936;border-radius:10px;background:linear-gradient(135deg,#d90722,#e4a92d);color:#fff;font-weight:800;cursor:pointer}
@media(max-width:700px){.rules-editor-item .editor-title{align-items:flex-start;flex-direction:column}.rules-edit-btn{width:100%}.rules-editor-modal{padding:8px}.rules-editor-modal-card{padding:14px}}

.rules-nav-btn{white-space:nowrap}
html{scroll-behavior:smooth}
#rulesAdmin{scroll-margin-top:20px}

/* V47: Rules editor is hidden until the top navigation button is clicked. */
.rules-admin-overlay{position:fixed;inset:0;z-index:9990;display:none;background:rgba(0,0,0,.78);backdrop-filter:blur(4px);padding:20px;overflow:auto}
.rules-admin-overlay.show{display:flex;align-items:flex-start;justify-content:center}
.rules-admin-dialog{width:min(1450px,96vw);max-height:94vh;overflow:auto;margin:2vh auto 0;background:#100607;border:1px solid #d4a928;border-radius:18px;box-shadow:0 25px 90px #000;padding:20px}
.rules-admin-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:10px}
.rules-admin-dialog-head h2{margin:0;color:#ffd85a}
.rules-admin-dialog #rulesAdmin{margin:0;border:0;background:transparent;padding:0;box-shadow:none}
.rules-admin-dialog #rulesAdmin .rules-editor-head{display:none}
body.rules-modal-open{overflow:hidden}

/* V48: The text editor must appear above the rules list modal. */
.rules-admin-overlay{
  z-index:9990 !important;
}
.rules-editor-modal{
  position:fixed !important;
  inset:0 !important;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(0,0,0,.82);
  backdrop-filter:blur(5px);
  z-index:10050 !important;
}
.rules-editor-modal.show{
  display:flex !important;
}
.rules-editor-modal-card{
  position:relative;
  z-index:10051;
  width:min(1100px,96vw);
  max-height:92vh;
  overflow:auto;
}

.file-card{width:min(1100px,94vw)!important;max-height:94vh;overflow:auto}
.file-viewer{min-height:240px;display:flex;align-items:center;justify-content:center;padding:12px;margin-top:12px;background:#08090c;border:1px solid #273043;border-radius:12px}
.admin-file-image{display:block;max-width:100%;max-height:70vh;width:auto;height:auto;object-fit:contain;border-radius:8px}
.admin-file-pdf{display:block;width:100%;height:70vh;border:0;border-radius:8px;background:#fff}

.applicant-edit-modal{z-index:1100!important}
.applicant-edit-card{width:min(1100px,95vw)!important;max-height:94vh!important;overflow:auto!important}
.edit-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin-bottom:10px}
.edit-modal-head h2{margin:0}
.edit-applicant-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
.edit-field{display:flex;flex-direction:column;gap:6px}
.edit-field span{font-size:13px;color:#aeb9c9}
.edit-field input,.edit-field select,.edit-field textarea{width:100%;box-sizing:border-box;background:#080b10;color:#fff;border:1px solid #303948;border-radius:9px;padding:10px 12px;font:inherit}
.edit-field input:focus,.edit-field select:focus,.edit-field textarea:focus{outline:none;border-color:#d4a928;box-shadow:0 0 0 2px #d4a92833}
.edit-field small{color:#7f8a9b}
.edit-wide{grid-column:1/-1}
.edit-check{flex-direction:row;align-items:center;background:#080b10;border:1px solid #303948;border-radius:9px;padding:10px 12px}
.edit-check input{width:auto}
.edit-actions{justify-content:flex-end}
@media(max-width:700px){.edit-applicant-grid{grid-template-columns:1fr}.edit-wide{grid-column:auto}}

/* V55 competition class editor */
.classes-editor-modal{position:fixed;inset:0;background:#000c;display:none;align-items:center;justify-content:center;padding:20px;z-index:1200}
.classes-editor-modal.show{display:flex}
.classes-editor-card{width:min(1050px,96vw);max-height:92vh;overflow:auto;background:#11161f;border:1px solid #d4a928;border-radius:18px;padding:22px;box-shadow:0 20px 80px #000}
.classes-editor-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;margin-bottom:12px}
.classes-editor-head h2{margin:0 0 5px}
.classes-editor-list{display:grid;gap:12px}
.class-editor-group{border:1px solid #493b16;border-radius:12px;padding:12px;background:#090b10}
.class-editor-group h3{margin:0 0 8px;color:#f3c84d}
.class-editor-row{display:grid;grid-template-columns:1.15fr 1fr;gap:12px;align-items:center;padding:9px 0;border-top:1px solid #252b35}
.class-editor-row:first-of-type{border-top:0}
.class-editor-row span{display:flex;flex-direction:column;gap:3px}.class-editor-row small{color:#7f8a9b}
.class-editor-input{width:100%;box-sizing:border-box;background:#080b10;color:#fff;border:1px solid #3a4351;border-radius:9px;padding:10px 12px;font:inherit}
.class-editor-input:focus{outline:none;border-color:#d4a928;box-shadow:0 0 0 2px #d4a92833}
.classes-editor-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:15px}
@media(max-width:700px){.class-editor-row{grid-template-columns:1fr}.classes-editor-head{flex-direction:column}}

.classes-editor-section-title{margin:24px 0 10px;color:#f4c532}
.classes-section-editor-list{display:grid;gap:12px}
.class-section-editor{padding:16px;border:1px solid #6d4d08;border-radius:12px;background:#090306}
.class-section-editor-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px}
.class-section-editor-head b{color:#ffd13d;font-size:18px}
.class-section-editor-head small{color:#8792a3}
.class-section-editor label{display:block;margin-top:10px;color:#b9c3d3;font-size:13px}
.class-section-editor input,.class-section-editor textarea{width:100%;box-sizing:border-box;margin-top:5px;background:#080b10;color:#fff;border:1px solid #4c3a16;border-radius:8px;padding:10px 12px;font:inherit}
.class-section-editor textarea{resize:vertical;min-height:55px}

.class-group.dependency-locked{opacity:.58}
.class-group.dependency-locked::after{content:"กรุณาเลือกรุ่นหลักก่อน";display:block;margin-top:8px;color:#e8bb2f;font-size:13px}
.class-group input:disabled{cursor:not-allowed;opacity:.45}

.payment-total{
  margin-top: 12px;
  font-size: 18px;
  font-weight: 700;
}
.payment-total #payAmount{
  color: #ffd43b;
  font-size: 26px;
  font-weight: 800;
}

.topbar-actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-shrink:0;
}
@media(max-width:760px){
  .topbar-actions{gap:8px}
  .topbar-actions .ghost-btn{padding:9px 10px;font-size:13px}
}
@media(max-width:560px){
  .topbar{flex-wrap:wrap}
  .topbar-actions{width:100%;justify-content:flex-end}
}


.shirt-size-field{position:relative}
.size-chart-btn{
  display:inline-block;
  margin:0 0 8px 8px;
  padding:6px 10px;
  border:1px solid #c79518;
  border-radius:8px;
  background:#160d0f;
  color:#ffd43b;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  vertical-align:middle;
}
.size-chart-btn:hover{background:#261316}
.size-chart-modal{
  position:fixed;
  inset:0;
  z-index:10000;
}
.size-chart-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.82);
  backdrop-filter:blur(3px);
}
.size-chart-dialog{
  position:relative;
  z-index:1;
  width:min(94vw,900px);
  max-height:94vh;
  margin:3vh auto;
  padding:14px;
  overflow:auto;
  background:#0b0d12;
  border:1px solid #c79518;
  border-radius:16px;
  box-shadow:0 20px 70px rgba(0,0,0,.7);
}
.size-chart-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.size-chart-header h2{
  margin:0;
  color:#ffd43b;
  font-size:20px;
}
.size-chart-close{
  border:1px solid #c79518;
  border-radius:8px;
  background:#151a23;
  color:#fff;
  padding:8px 12px;
  cursor:pointer;
}
.size-chart-image{
  display:block;
  width:100%;
  height:auto;
  border-radius:10px;
}
body.size-chart-open{overflow:hidden}
@media(max-width:600px){
  .size-chart-dialog{width:96vw;margin:2vh auto;padding:9px}
  .size-chart-header h2{font-size:16px}
  .size-chart-btn{display:block;margin:6px 0 8px;padding:7px 10px}
}
