/* The game's UI kit on the web (mirrors Assets/Scripts/Game/UI/Kit): night-glass panels cut at the top-left and
   bottom-right corners, a Line600 hairline, corner brackets on the uncut corners, a magenta accent tab, faint
   scanlines; Tektur uppercase titles; cyan-outlined chamfered buttons. Colours = KitCore Pal. */
:root {
  --ink950: #05060F; --ink900: #0A0C1C; --ink800: #11142B;
  --line600: #2C3363; --line400: #4A5494;
  --text100: #EEF2FF; --text300: #A9B1D6; --text500: #6B74A3;
  --kcyan: #41E8FF; --kmagenta: #FF3D8B;
}

/* ---- panel ---- */
.mg-panel { --ch: 22px; position: relative; isolation: isolate; color: var(--text100); text-align: left;
  padding: 34px 36px 30px; filter: drop-shadow(0 24px 60px rgba(0,0,0,.55)); }
.mg-panel::before, .mg-panel::after { content: ""; position: absolute; z-index: -1; pointer-events: none;
  clip-path: polygon(var(--ch) 0, 100% 0, 100% calc(100% - var(--ch)), calc(100% - var(--ch)) 100%, 0 100%, 0 var(--ch)); }
.mg-panel::before { inset: 0; background: var(--line600); }                                     /* hairline */
.mg-panel::after { inset: 1.5px; --ch: 21px;
  background: repeating-linear-gradient(0deg, rgba(238,242,255,.028) 0 1px, transparent 1px 4px), rgba(10,12,28,.96); }
.mg-panel > .mg-tab { position: absolute; top: 0; left: calc(var(--ch) + 14px); width: 52px; height: 2px; background: var(--kmagenta); }
/* brackets on the two uncut corners (top-right, bottom-left) */
.mg-panel > .mg-br { position: absolute; inset: -7px; pointer-events: none; --b: rgba(107,116,163,.75);
  background:
    linear-gradient(var(--b), var(--b)) right top / 12px 1.5px no-repeat, linear-gradient(var(--b), var(--b)) right top / 1.5px 12px no-repeat,
    linear-gradient(var(--b), var(--b)) left bottom / 12px 1.5px no-repeat, linear-gradient(var(--b), var(--b)) left bottom / 1.5px 12px no-repeat; }

.mg-title { margin: 0 0 10px; font: 700 26px/1.1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--text100); }
.mg-line { margin: 0 0 24px; font: 500 16px/1.5 var(--ui); color: var(--text300); }
.mg-note { margin: 0; font: 500 14px/1.55 var(--ui); color: var(--text300); }
.mg-note b { color: var(--text100); font-weight: 600; }
.mg-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mg-row.end { justify-content: space-between; }

/* ---- buttons ---- */
.mg-btn { --ch: 10px; --acc: var(--kcyan); position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: 56px; padding: 0 28px; border: 0; cursor: pointer; background: none; text-decoration: none; white-space: nowrap;
  font: 700 16px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--text100);
  transition: transform .18s ease, filter .25s ease; }
.mg-btn::before, .mg-btn::after { content: ""; position: absolute; z-index: -1;
  clip-path: polygon(var(--ch) 0, 100% 0, 100% calc(100% - var(--ch)), calc(100% - var(--ch)) 100%, 0 100%, 0 var(--ch)); }
.mg-btn::before { inset: 0; background: rgba(65,232,255,.9); }
.mg-btn::after { inset: 1.5px; --ch: 9.4px; background: linear-gradient(180deg, rgba(65,232,255,.2), rgba(65,232,255,.1)), var(--ink900); transition: background .2s; }
.mg-btn:hover, .mg-btn:focus-visible { outline: none; filter: drop-shadow(0 0 18px rgba(65,232,255,.35)); }
.mg-btn:hover::after, .mg-btn:focus-visible::after { background: linear-gradient(180deg, rgba(65,232,255,.34), rgba(65,232,255,.16)), var(--ink900); }
.mg-btn:active { transform: translateY(1px); }
.mg-btn .mg-arrow { transition: transform .2s; }
.mg-btn:hover .mg-arrow { transform: translateX(4px); }
.mg-btn[disabled] { opacity: .6; cursor: default; }
/* secondary: dark fill, Line400 stroke */
.mg-btn.sec::before { background: var(--line400); }
.mg-btn.sec::after { background: rgba(17,20,43,.95); }
.mg-btn.sec { font: 600 15px/1 var(--ui); letter-spacing: .1em; color: var(--text300); height: 50px; padding: 0 22px; }
.mg-btn.sec:hover::after { background: rgba(27,32,64,.98); }
/* ghost: text only */
.mg-ghost { appearance: none; border: 0; background: none; cursor: pointer; padding: 10px 4px;
  font: 600 14px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--text300); transition: color .2s; }
.mg-ghost:hover, .mg-ghost:focus-visible { color: var(--text100); outline: none; }

/* ---- input ---- */
.mg-input { --ch: 8px; position: relative; flex: 1 1 240px; min-width: 0; height: 56px; }
.mg-input::before { content: ""; position: absolute; inset: 0; background: var(--line400); transition: background .2s;
  clip-path: polygon(var(--ch) 0, 100% 0, 100% calc(100% - var(--ch)), calc(100% - var(--ch)) 100%, 0 100%, 0 var(--ch)); }
.mg-input:focus-within::before { background: var(--kcyan); }
.mg-input.bad::before { background: #FF4E5E; }
.mg-input input { position: absolute; inset: 1.5px; width: calc(100% - 3px); height: calc(100% - 3px); box-sizing: border-box; border: 0; outline: none;
  padding: 0 18px; background: var(--ink950); color: var(--text100); font: 500 17px/1 var(--ui); letter-spacing: .02em;
  clip-path: polygon(7.4px 0, 100% 0, 100% calc(100% - 7.4px), calc(100% - 7.4px) 100%, 0 100%, 0 7.4px); }
.mg-input input::placeholder { color: var(--text500); }

/* ---- overlay shell ---- */
.mg-overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px;
  background: rgba(5,6,15,.62); backdrop-filter: blur(5px); animation: mg-fade .22s ease both; }
.mg-overlay[hidden] { display: none; }
.mg-overlay > .mg-panel { width: min(640px, 100%); animation: mg-pop .26s cubic-bezier(.2,.8,.2,1) both; }
@keyframes mg-fade { from { opacity: 0; } }
@keyframes mg-pop { from { opacity: 0; transform: scale(.98); } }

/* waitlist states */
.wl-form .wl-msg { margin: 14px 0 0; min-height: 1em; font: 500 14px/1.4 var(--ui); color: var(--text300); }
.wl-form .wl-msg:empty { display: none; }
.wl-form .wl-msg.is-error { color: #FF9DB5; }
.wl-form .wl-msg.is-ok { color: var(--kcyan); font-size: 16px; }
.wl-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.wl-form.is-done .mg-row.fields { display: none; }
.wl-form.is-busy .mg-btn { opacity: .7; }
.wl-foot { margin-top: 22px; }

@media (max-width: 560px), (max-height: 460px) {
  .mg-panel { padding: 26px 22px 22px; --ch: 16px; }
  .mg-title { font-size: 21px; }
  .mg-line { font-size: 15px; margin-bottom: 18px; }
  .mg-btn { height: 50px; padding: 0 20px; font-size: 14px; }
  .mg-input { height: 50px; }
}
@media (prefers-reduced-motion: reduce) { .mg-overlay, .mg-overlay > .mg-panel { animation: none; } }
.wl-form.is-invalid .mg-input::before { background: #FF4E5E; }
