/* A self-contained interactive showcase. The existing demo handlers own the first tab. */
.trainer-showcase {
  --trainer-accent: #cfb0ff;
  --trainer-accent-rgb: 187, 148, 244;
  --trainer-muted: #c4b8d6;
  overflow: hidden;
  border: 1px solid #b193d56e;
  border-radius: 18px;
  background: linear-gradient(135deg, #342c47, #252333 75%);
  box-shadow: 0 25px 75px #08051055, 0 0 55px #b587ff20;
  transition: border-color .3s, background .3s;
}
.trainer-showcase[data-showcase="rpg"] { --trainer-accent: #9edcff; --trainer-accent-rgb: 117, 193, 239; --trainer-muted: #b4c8d9; border-color: #84b4d280; background: linear-gradient(135deg, #273d50, #252a3a 75%); }
.trainer-chrome { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 21px; border-bottom: 1px solid #b5a8ca20; background: #ffffff03; }
.trainer-brand { display: flex; align-items: center; gap: 8px; font-size: 10px; letter-spacing: 1.5px; font-weight: 700; }
.trainer-brand b { font-size: 7px; letter-spacing: 1px; color: #c5afd9; border: 1px solid #b8a1d340; padding: 3px 4px; border-radius: 3px; }
.trainer-preview-label { display: flex; align-items: center; gap: 6px; color: #cbbbdc; font-size: 8px; letter-spacing: 1.15px; }
.trainer-preview-label i { width: 5px; height: 5px; border-radius: 50%; background: #a7d4c3; box-shadow: 0 0 8px #a7d4c330; }
.trainer-navigation { display: flex; align-items: center; gap: 15px; padding: 15px 21px 0; }
.trainer-tabs { display: flex; padding: 4px; gap: 4px; border-radius: 9px; background: #17142175; border: 1px solid #c7b9d823; flex: 1; }
.trainer-tabs button { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; padding: 9px 10px; border-radius: 6px; background: none; color: #b8acc9; font-size: 12px; font-weight: 600; white-space: nowrap; transition: color .2s, background .2s, box-shadow .2s; }
.trainer-tabs button > span { font-size: 17px; font-weight: 400; line-height: 1; }
.trainer-tabs button[aria-selected="true"] { color: #f6efff; background: rgba(var(--trainer-accent-rgb), .22); box-shadow: inset 0 0 0 1px rgba(var(--trainer-accent-rgb), .3), 0 3px 9px #0c061c25; }
.trainer-tabs button:hover { color: white; background: #ffffff0b; }
.trainer-tabs button[aria-selected="true"]:hover { background: rgba(var(--trainer-accent-rgb), .26); }
.trainer-arrows { display: flex; gap: 5px; }
.trainer-arrows button { width: 29px; height: 32px; border-radius: 6px; color: #d0c5df; font-size: 17px; background: #ffffff06; border: 1px solid #c9b6e233; transition: background .2s; }
.trainer-arrows button:hover { background: rgba(var(--trainer-accent-rgb), .18); }
.trainer-deck { display: grid; }
.trainer-pane { grid-area: 1 / 1; padding: 23px 21px 15px; display: flex; flex-direction: column; min-width: 0; }
/* Retaining the inactive panel's grid footprint prevents a layout jump when changing tabs. */
.trainer-pane[hidden] { display: flex !important; visibility: hidden; pointer-events: none; }
.trainer-pane:not([hidden]) .trainer-heading { animation: trainer-arrive .3s ease-out both; }
.trainer-pane:not([hidden]) .trainer-panels { animation: trainer-arrive .35s ease-out both; }
.trainer-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.trainer-eyebrow { color: var(--trainer-accent); font-size: 8px; font-weight: 650; letter-spacing: 1.7px; }
.trainer-heading h2 { font-size: clamp(21px, 2vw, 27px); line-height: 1.25; letter-spacing: -.9px; margin-top: 6px; }
.trainer-heading p { color: var(--trainer-muted); font-size: 11px; margin-top: 6px; line-height: 1.7; }
.trainer-emblem { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgba(var(--trainer-accent-rgb), .32); border-radius: 13px; background: rgba(var(--trainer-accent-rgb), .08); color: var(--trainer-accent); font-size: 31px; flex-shrink: 0; box-shadow: inset 0 0 18px rgba(var(--trainer-accent-rgb), .06); }
.trainer-stats, .rpg-stat-strip { gap: 17px; margin: 22px 0; padding: 14px 16px; border: 1px solid #cbb7e321; background: #1816234d; border-radius: 10px; }
.trainer-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trainer-stats > div { width: auto; }
.trainer-stats > div > span { font-size: 10px; color: var(--trainer-muted); }
.trainer-stats strong { font-size: 25px; line-height: 1.7; letter-spacing: -.6px; }
.trainer-stats strong span { font-size: 10px; }
.trainer-stats .stat-meter, .trainer-stats .speed-track { margin-top: 3px; }
.trainer-stats .stat-meter { background: #ffffff0a; }
.trainer-stats #health-meter { background: linear-gradient(90deg, #ae82ec, #dabdff); }
.trainer-stats #stamina-meter { background: linear-gradient(90deg, #67ac98, #b5ead6); }
.trainer-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; }
.trainer-panel { padding: 15px 14px; border: 1px solid #c8b1e030; border-radius: 11px; background: #ffffff04; min-width: 0; }
.trainer-panel h3 { display: flex; align-items: center; gap: 7px; font-size: 12px; margin-bottom: 20px; }
.trainer-panel-icon { color: var(--trainer-accent); font-size: 18px; line-height: 1; font-weight: 400; }
.trainer-panel .toggle-row { gap: 8px; margin-bottom: 17px; }
.trainer-panel .toggle-row strong { font-size: 11px; line-height: 1.5; }
.trainer-panel .toggle-row p { font-size: 10px; margin-top: 4px; color: var(--trainer-muted); line-height: 1.4; }
.trainer-panel .toggle { width: 34px; height: 20px; padding: 3px; border-color: #978aa366; background: #252535; }
.trainer-panel .toggle > span { width: 12px; height: 12px; }
.trainer-panel .toggle[aria-checked="true"] { background: #a984dc; border-color: #dfc1ff; box-shadow: 0 0 14px #bda0e830; }
.trainer-panel .toggle[aria-checked="true"] > span { transform: translateX(13px); }
.trainer-panel .speed-label { margin: 14px 0 8px; padding-top: 13px; font-size: 10px; color: var(--trainer-muted); }
.trainer-panel .segmented { background: #1b17264d; border-color: #c3a6df33; border-radius: 7px; }
.trainer-panel .segmented button { min-height: 29px; padding: 6px 0; border-radius: 4px; font-size: 11px; color: #c9bddb; }
.trainer-panel .segmented button[aria-pressed="true"] { background: #a383cc36; color: #f0e2ff; box-shadow: inset 0 0 0 1px #bea0e14d; }
.trainer-test { display: flex; flex-direction: column; }
.trainer-test h3 { margin-bottom: 10px; }
.trainer-test > p { color: var(--trainer-muted); font-size: 10px; line-height: 1.7; margin: 10px 0 9px; }
.trainer-showcase .demo-action { padding: 9px 11px; min-height: 34px; border-radius: 6px; color: #ecd9ff; background: #a785d429; border-color: #c7a4ec44; font-size: 11px; margin-top: auto; }
.trainer-showcase .demo-action:hover { background: #b893ef44; border-color: #c7a4ec80; }
.trainer-arena { flex: 1; position: relative; isolation: isolate; overflow: hidden; min-height: 104px; border-radius: 7px; background: radial-gradient(ellipse at center, #76509638, transparent 70%), #231c32; border: 1px solid #b398d129; }
.arena-grid { position: absolute; inset: 0; background-image: linear-gradient(#bfa2e90a 1px, transparent 1px), linear-gradient(90deg, #bfa2e90a 1px, transparent 1px); background-size: 19px 19px; mask-image: radial-gradient(ellipse, black, transparent); }
.arena-orbit { position: absolute; width: 114px; height: 114px; border: 1px solid #baa1da30; border-radius: 50%; top: 42%; left: 50%; transform: translate(-50%, -50%); }
.arena-orbit.orbit-small { width: 68px; height: 68px; border-style: dashed; border-color: #c7a4f14f; animation: trainer-orbit 18s linear infinite; }
.arena-player { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%); font-size: 30px; color: #e2c4ff; text-shadow: 0 0 20px #bb81ff80; }
.arena-beacon { width: 5px; height: 5px; border-radius: 50%; background: #b1e5d3; position: absolute; box-shadow: 0 0 13px #b4e0cf66; animation: trainer-beacon 3s ease-in-out infinite alternate; }
.beacon-one { top: 31%; left: 24%; }
.beacon-two { top: 43%; right: 25%; animation-delay: -1.5s; background: #cfa9ff; }
.arena-caption { position: absolute; bottom: 8px; left: 0; width: 100%; text-align: center; color: #c4b1da; font-size: 6px; letter-spacing: 1.3px; }
.trainer-feedback { margin-top: 14px; min-height: 39px; gap: 7px; padding-top: 9px; border-top: 1px solid #c3aedb1c; font-size: 10px; line-height: 1.5; color: var(--trainer-muted); }
.trainer-feedback > .live-dot { flex-shrink: 0; }
.trainer-feedback > span[role="status"] { flex: 1; }
.trainer-feedback button { padding: 8px 0 8px 8px; font-size: 10px; flex-shrink: 0; }
.trainer-bottom { display: flex; align-items: center; gap: 12px; padding: 12px 21px; border-top: 1px solid #cbb7e31c; background: #110d192e; }
.trainer-bottom > span:first-child { font-size: 7px; color: var(--trainer-accent); letter-spacing: 1.15px; font-weight: 600; }
.trainer-bottom > span:nth-child(2) { font-size: 10px; color: #c7bdd6; }
.trainer-page-indicator { display: flex; gap: 5px; margin-left: auto; }
.trainer-page-indicator i { height: 4px; width: 4px; border-radius: 4px; background: #82728e; transition: width .2s, background .2s; }
.trainer-page-indicator i.is-current { width: 16px; background: var(--trainer-accent); }
.rpg-stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rpg-stat-strip > div > span { display: block; font-size: 10px; color: var(--trainer-muted); }
.rpg-stat-strip strong { font-size: 25px; line-height: 1.7; font-variant-numeric: tabular-nums; letter-spacing: -.6px; }
.rpg-stat-strip > div:last-child strong { font-size: 22px; }
.rpg-stat-strip small { font-size: 10px; font-weight: 400; letter-spacing: 0; color: #a9c0d0; margin-left: 3px; }
.rpg-stat-strip .stat-meter, .rpg-gold-line { height: 3px; margin-top: 3px; background: #ffffff0a; }
.rpg-stat-strip .stat-meter i { background: linear-gradient(90deg, #63b4d7, #bce9ff); }
.rpg-stat-strip .rpg-magic-meter i { background: linear-gradient(90deg, #9785cb, #d5c4f5); }
.rpg-gold-line { background: linear-gradient(90deg, #d7b767, #dec58a33); border-radius: 3px; }
.rpg-pane .trainer-panel { background: #8ac5e805; border-color: #9bc7e52c; }
.rpg-pane .trainer-panel h3 { margin-bottom: 17px; }
.rpg-speed-label { font-size: 10px; display: flex; justify-content: space-between; gap: 9px; color: #c9dbe7; margin-bottom: 8px; }
.rpg-speed-label span { color: var(--trainer-accent); }
.rpg-pane .trainer-panel .segmented { border-color: #9ac6e238; background: #172b3a66; }
.rpg-pane .trainer-panel .segmented button { color: #c4dcea; }
.rpg-pane .trainer-panel .segmented button[aria-pressed="true"] { background: #71b9e53b; box-shadow: inset 0 0 0 1px #9bcee854; color: #e3f7ff; }
.rpg-pane .trainer-panel .toggle[aria-checked="true"] { background: #4d9ec2; border-color: #99ddfa; box-shadow: 0 0 14px #6abcdf30; }
.rpg-pane .trainer-panel .rpg-first-toggle { border-top: 1px solid #b3cce224; padding-top: 18px; margin-top: 17px; }
.rpg-pane .trainer-panel .toggle-row:last-child { margin-bottom: 0; }
.rpg-resources { display: flex; flex-direction: column; }
.rpg-resource-button { display: flex; align-items: center; text-align: left; gap: 9px; width: 100%; border: 1px solid #a4c4d82e; background: #18273570; border-radius: 7px; padding: 11px 9px; margin-bottom: 9px; color: #e0eef6; transition: background .2s, border-color .2s; }
.rpg-resource-button:hover { background: #739db02a; border-color: #9bcee866; }
.rpg-resource-button strong { display: block; font-size: 10px; line-height: 1.5; }
.rpg-resource-button small { display: block; font-size: 8px; color: #afc5d5; line-height: 1.5; margin-top: 2px; }
.rpg-resource-icon { color: #9ddcff; font-size: 24px; line-height: 1; flex-shrink: 0; }
.rpg-resource-icon.gold-icon { color: #e6ce92; }
.rpg-resource-button b { margin-left: auto; color: #a6dafa; font-size: 16px; font-weight: 400; }
.rpg-pane .demo-action { background: #70b4da26; border-color: #87c6e64d; color: #c9eeff; }
.rpg-pane .demo-action:hover { background: #70b4da40; }
.rpg-pane .trainer-feedback button { color: #a7daf7; }
@keyframes trainer-arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes trainer-orbit { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes trainer-beacon { from { opacity: .4; } to { opacity: 1; box-shadow: 0 0 15px #d5b3ff99; } }
body:is(.motion-paused, .motion-suspended) .trainer-showcase *, .effects-outside .trainer-showcase * { animation-play-state: paused; }
body.motion-paused .trainer-pane:not([hidden]) :is(.trainer-heading, .trainer-panels) { animation: none; }
@media (min-width: 1450px) { .trainer-pane { padding: 25px 25px 17px; } .trainer-chrome, .trainer-navigation, .trainer-bottom { padding-inline: 25px; } .trainer-panel { padding: 17px; } .trainer-panel .toggle-row strong { font-size: 12px; } .trainer-panel .toggle-row p { font-size: 11px; } .trainer-test > p { font-size: 11px; } .rpg-resource-button strong { font-size: 11px; } .rpg-resource-button small { font-size: 9px; } }
@media (max-width: 1150px) and (min-width: 901px) { .trainer-chrome, .trainer-navigation, .trainer-bottom { padding-inline: 15px; } .trainer-navigation { gap: 9px; } .trainer-pane { padding-inline: 15px; } .trainer-arrows { gap: 3px; } .trainer-arrows button { width: 26px; } .trainer-tabs button { font-size: 11px; padding-inline: 8px; gap: 5px; } .trainer-panels { gap: 9px; } .trainer-panel { padding-inline: 11px; } .trainer-panel h3 { font-size: 11px; } .trainer-panel .toggle-row strong { font-size: 10px; } .trainer-panel .toggle-row p { font-size: 9px; } .rpg-resource-button { padding-inline: 7px; gap: 6px; } .rpg-resource-button small { font-size: 7px; } }
@media (max-width: 600px) {
  .trainer-chrome, .trainer-navigation, .trainer-bottom { padding-inline: 15px; }
  .trainer-chrome { padding-block: 13px; }
  .trainer-brand { font-size: 9px; }
  .trainer-preview-label { font-size: 7px; letter-spacing: .7px; }
  .trainer-navigation { gap: 8px; }
  .trainer-arrows { gap: 4px; }
  .trainer-arrows button { width: 27px; height: 33px; }
  .trainer-tabs button { font-size: 11px; padding-inline: 7px; gap: 6px; }
  .trainer-pane { padding: 21px 15px 12px; }
  .trainer-heading h2 { font-size: 23px; }
  .trainer-heading p { font-size: 11px; }
  .trainer-emblem { width: 42px; height: 42px; font-size: 27px; }
  .trainer-stats, .rpg-stat-strip { padding: 11px 12px; margin: 19px 0; gap: 13px; }
  .trainer-panels { grid-template-columns: 1fr; gap: 11px; }
  .trainer-panel { padding: 16px; }
  .trainer-panel h3 { font-size: 14px; margin-bottom: 17px; }
  .trainer-panel .toggle-row { margin-bottom: 14px; }
  .trainer-panel .toggle-row strong { font-size: 13px; }
  .trainer-panel .toggle-row p { font-size: 11px; }
  .trainer-panel .speed-label, .rpg-speed-label { font-size: 12px; }
  .trainer-panel .segmented button { min-height: 33px; font-size: 12px; }
  .trainer-test { display: grid; grid-template-columns: 90px 1fr; column-gap: 13px; }
  .trainer-test h3 { grid-column: 1 / -1; }
  .trainer-arena { grid-row: span 2; min-height: 101px; }
  .trainer-test > p { font-size: 11px; margin: 0 0 10px; }
  .trainer-test .demo-action { align-self: end; }
  .arena-caption { display: none; }
  .arena-orbit { width: 95px; height: 95px; }
  .arena-orbit.orbit-small { width: 59px; height: 59px; }
  .arena-orbit, .arena-player { top: 50%; }
  .trainer-showcase .demo-action { font-size: 12px; min-height: 36px; }
  .trainer-feedback { font-size: 10px; }
  .trainer-bottom { gap: 9px; padding-block: 11px; }
  .trainer-bottom > span:first-child { font-size: 6px; letter-spacing: .7px; }
  .trainer-bottom > span:nth-child(2) { font-size: 9px; }
  .rpg-resource-button { padding: 10px; }
  .rpg-resource-button strong { font-size: 12px; }
  .rpg-resource-button small { font-size: 10px; }
  .rpg-resources { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .rpg-resources h3, .rpg-resources .demo-action { grid-column: 1 / -1; margin: 0; }
  .rpg-resources h3 { margin-bottom: 4px; }
  .rpg-resource-button { margin: 0; flex-wrap: wrap; align-content: start; }
  .rpg-resource-button > span:nth-child(2) { order: 2; width: 100%; }
  .rpg-resource-button b { align-self: start; }
  .rpg-resources .demo-action { margin-top: 1px; }
}
@media (max-width: 370px) { .trainer-arrows { display: none; } .trainer-heading h2 { font-size: 20px; } .trainer-heading p { font-size: 10px; } .trainer-stats strong, .rpg-stat-strip strong { font-size: 22px; } .trainer-bottom > span:first-child { display: none; } .trainer-test { grid-template-columns: 78px 1fr; } }
@media (prefers-reduced-motion: reduce) { .trainer-showcase, .trainer-showcase * { animation: none !important; transition: none !important; } }

/* Midnight Menu uses the structure of the RPG Maker interface, independently of the trainer preview. */
.trainer-pane.midnight-pane { padding: 16px; }
.midnight-window { color: #e5ecf5; border: 1px solid #7d9ab455; border-radius: 12px; overflow: hidden; background: #111a26; box-shadow: 0 12px 30px #07111c55; min-width: 0; }
.midnight-titlebar { height: 48px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #8da5bc30; background: linear-gradient(115deg, #263341, #1a2330); }
.midnight-titlebar > div > strong { display: block; font-size: 15px; letter-spacing: -.3px; line-height: 1.15; }
.midnight-titlebar > div > span { color: #de9c83; font-size: 9px; display: block; margin-top: 3px; }
.midnight-titlebar i { font-style: normal; color: #9dafc3; font-size: 7px; letter-spacing: 1.1px; margin-left: 9px; }
.midnight-titlebar > button { font-size: 10px; color: #eef1f5; background: #ffffff0e; border: 1px solid #adbed422; border-radius: 7px; padding: 7px 12px; }
.midnight-titlebar > button:hover { background: #ffffff1c; }
.midnight-body { display: grid; grid-template-columns: 116px minmax(0, 1fr); height: 429px; }
.midnight-nav { display: flex; flex-direction: column; gap: 7px; border-right: 1px solid #83a5c533; background: linear-gradient(145deg, #162230, #101720); padding: 11px 9px; }
.midnight-nav > button { display: flex; align-items: center; gap: 7px; padding: 10px 8px; text-align: left; border: 1px solid #7da3c52d; background: linear-gradient(#1b2836, #15202b); border-radius: 8px; color: #d8e1ee; font-size: 10px; font-weight: 650; line-height: 1.2; white-space: nowrap; transition: background .18s, border-color .18s, box-shadow .18s; }
.midnight-nav > button > span { color: #83d0ff; font-size: 16px; width: 15px; line-height: 1; font-weight: 400; text-align: center; }
.midnight-nav > button:nth-child(3) > span { color: #ffd777; }
.midnight-nav > button:nth-child(4) > span, .midnight-nav > button:nth-child(6) > span { color: #92e0b3; }
.midnight-nav > button[aria-selected="true"] { background: linear-gradient(145deg, #246a9e, #173d62); border-color: #6cbaf0b3; box-shadow: inset 0 1px 7px #8fc9ff22, 0 0 18px #288fe12b; color: #f3f8ff; }
.midnight-nav > button:hover { border-color: #90c5ed80; background: #25435c; }
.midnight-content { overflow: auto; overscroll-behavior: contain; padding: 13px; scrollbar-color: #56687e #121b28; scrollbar-width: thin; min-width: 0; }
.midnight-heading { margin: 0 0 12px; }
.midnight-heading h3 { font-size: 16px; line-height: 1.25; letter-spacing: -.35px; margin: 0 0 4px; }
.midnight-heading > p { font-size: 9px; line-height: 1.5; color: #a7b8cc; }
.midnight-columns { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 10px; }
.midnight-column { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.midnight-card { background: linear-gradient(135deg, #1d2e3d, #16222f 75%); border: 1px solid #85abc43a; border-radius: 10px; padding: 11px; min-width: 0; }
.midnight-view > .midnight-card + .midnight-card { margin-top: 12px; }
.midnight-card h4 { font-size: 12px; line-height: 1.5; margin: 0; letter-spacing: -.1px; }
.midnight-card > p { color: #a7bace; font-size: 9px; line-height: 1.6; margin: 2px 0 9px; }
.midnight-card > p b { color: #d4e5f4; font-weight: 550; }
.midnight-speeds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.midnight-speeds button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; min-height: 66px; padding: 9px 0; border: 1px solid #8ab6d43b; border-radius: 8px; background: linear-gradient(#1e3142, #14222e); color: #deebf7; font-size: 10px; font-weight: 650; }
.midnight-speeds button > span { display: block; position: relative; font-size: 25px; color: #93d7ff; line-height: 1; font-weight: 400; }
.midnight-speeds button > span i { position: absolute; left: 17px; top: 5px; font-size: 18px; font-style: normal; }
.midnight-speeds button[aria-pressed="true"] { background: linear-gradient(145deg, #2375a7, #143e60); border-color: #4ebcffa6; box-shadow: inset 0 0 14px #66bbff20, 0 0 12px #3295d21e; }
.midnight-speeds button:hover { border-color: #b7dffc; }
.midnight-speed-value { color: #9fb7ca; font-size: 8px; margin: 8px 0; }
.midnight-speed-value b { color: #8ad6ff; }
.midnight-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; }
.midnight-toggle-row + .midnight-toggle-row { border-top: 1px solid #9fbfd214; }
.midnight-toggle-row strong { display: block; font-size: 10px; line-height: 1.5; font-weight: 650; }
.midnight-toggle-row small { display: block; color: #a7bace; font-size: 9px; line-height: 1.6; margin-top: 2px; }
.midnight-toggle { position: relative; display: flex; align-items: center; width: 31px; height: 19px; flex-shrink: 0; padding: 3px; border: 1px solid #8fb4d155; border-radius: 20px; background: #243c4f; }
.midnight-toggle::before { content: ""; position: absolute; inset: -6px -3px; border-radius: inherit; }
.midnight-toggle > i { width: 11px; height: 11px; background: #adc1d4; border-radius: 50%; transition: transform .2s, background .2s; }
.midnight-toggle[aria-checked="true"] { background: #1b789d; border-color: #8ad8ffbd; }
.midnight-toggle[aria-checked="true"] > i { transform: translateX(11px); background: #edfaff; }
.midnight-info { display: flex; align-items: flex-start; gap: 7px; padding: 9px; color: #90d7ff; font-size: 8px; line-height: 1.6; border: 1px solid #349bd660; border-radius: 6px; background: #0e375155; margin-top: 8px; }
.midnight-info > span:first-child { font-size: 14px; line-height: 1.2; }
.midnight-resource-list { display: flex; flex-direction: column; gap: 5px; margin: 9px 0; }
.midnight-resource-list > button { display: flex; align-items: center; gap: 7px; width: 100%; border: 1px solid #7ca3c129; background: #10202e; border-radius: 7px; padding: 6px; text-align: left; color: #e3edf8; }
.midnight-resource-list > button:hover { border-color: #8acafb88; background: #173044; }
.midnight-resource-symbol { display: grid; place-items: center; border: 1px solid #80b1d126; color: #85d3ff; border-radius: 5px; width: 25px; height: 26px; font-size: 19px; flex-shrink: 0; }
.midnight-resource-symbol.symbol-red { color: #ff8990; }
.midnight-resource-symbol.symbol-green { color: #96edbb; }
.midnight-resource-symbol.symbol-purple { color: #c3a1ff; }
.midnight-resource-list strong { display: block; font-size: 10px; line-height: 1.5; }
.midnight-resource-list small { display: block; font-size: 9px; color: #a7bdd1; line-height: 1.4; }
.midnight-resource-list small b { font-weight: 400; }
.midnight-resource-list button > i { display: grid; place-items: center; margin-left: auto; width: 17px; height: 21px; border-radius: 5px; background: #18374c; color: #8ccaff; font-size: 18px; font-style: normal; flex-shrink: 0; }
.midnight-button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; color: #daedff; background: linear-gradient(#29475d, #1c3448); border: 1px solid #89b8d744; border-radius: 7px; font-size: 9px; font-weight: 600; padding: 9px 10px; min-height: 32px; white-space: nowrap; }
.midnight-button > span[aria-hidden="true"] { color: #8cd5ff; font-size: 15px; line-height: 1; }
.midnight-button.accent { background: linear-gradient(#2675a5, #18456a); border-color: #5db3eb77; }
.midnight-button:hover { border-color: #a1d7ff; background: #2b6386; }
.midnight-input-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.midnight-window input, .midnight-window select { min-width: 0; flex: 1; background: #101d29; border: 1px solid #85accc40; color: #dbe8f4; border-radius: 7px; font: inherit; font-size: 10px; padding: 9px; width: 100%; }
.midnight-window input::placeholder { color: #8396aa; }
.midnight-input-row button { flex-shrink: 0; }
.midnight-play-card > button { width: 100%; justify-content: space-between; }
.midnight-play-card > small { display: block; color: #a7bace; font-size: 8px; line-height: 1.6; margin-top: 8px; }
.midnight-status { display: flex; align-items: center; gap: 7px; padding: 9px 12px; min-height: 42px; border-top: 1px solid #85a4c32b; background: #162432; font-size: 9px; line-height: 1.5; color: #bdd0e1; }
.midnight-status > i { width: 4px; height: 4px; border-radius: 50%; background: #84c8e9; flex-shrink: 0; }
.midnight-status > span { flex: 1; }
.midnight-status > button { color: #aad9fc; background: none; font-size: 9px; margin-left: auto; padding: 6px 0 6px 8px; }
.midnight-home-card { padding: 24px; }
.midnight-home-icon { display: grid; place-items: center; border-radius: 13px; border: 1px solid #7fcefa66; background: #1e5c7d66; width: 56px; height: 56px; color: #a5dcfc; font-size: 35px; margin-bottom: 17px; }
.midnight-home-card h4 { font-size: 20px; margin-bottom: 9px; }
.midnight-home-card > p { font-size: 11px; max-width: 360px; }
.midnight-home-stats { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 10px; color: #9cb5ca; padding: 17px 0; margin-bottom: 9px; }
.midnight-home-stats b { color: #d7eafa; font-size: 19px; margin-right: 3px; }
.midnight-balance { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.midnight-balance > span { color: #f3d28c; font-size: 30px; }
.midnight-balance strong { color: #f5e1ad; font-size: 37px; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.midnight-balance small { color: #c4ab7c; font-size: 9px; letter-spacing: 1px; }
.midnight-quick-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 3px; }
.midnight-need { margin: 18px 0; }
.midnight-need > span { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 9px; color: #d2e2ef; }
.midnight-need > span b { color: #9ce6cb; font-weight: 550; }
.midnight-need meter { width: 100%; height: 10px; display: block; }
.midnight-need meter::-webkit-meter-bar { background: #10222d; border: none; border-radius: 7px; }
.midnight-need meter::-webkit-meter-optimum-value { background: linear-gradient(90deg, #419e94, #8cd9b5); border-radius: 7px; }
.midnight-items { display: grid; gap: 7px; margin: 12px 0 20px; }
.midnight-items > div { display: flex; justify-content: space-between; gap: 10px; border: 1px solid #7eabc42b; padding: 11px; border-radius: 6px; background: #142432; font-size: 11px; }
.midnight-items b { color: #aadcfb; }
.midnight-field-label { display: block; font-size: 10px; color: #acbfd1; margin-bottom: 7px; }
.midnight-minigame { padding: 19px; border: 1px solid #91aed233; background: radial-gradient(ellipse, #48799225, transparent 80%), #13212f; text-align: center; border-radius: 8px; margin: 10px 0 14px; }
.midnight-minigame > span { display: block; color: #a7c8df; font-size: 8px; letter-spacing: 1px; }
.midnight-minigame strong { display: grid; place-items: center; width: 62px; height: 62px; border: 1px solid #92c9ea88; background: #28577266; border-radius: 13px; margin: 16px auto; font-size: 30px; color: #d8edfa; }
.midnight-minigame > p, .midnight-game-score { color: #b5c9da; font-size: 10px; line-height: 1.6; }
.midnight-game-score { margin-top: 13px !important; }
.midnight-game-score > span { margin-left: 16px; }
#midnight-checkpoint-state { margin-top: 13px; color: #9fcdec; }
@media (min-width: 1500px) { .midnight-body { grid-template-columns: 135px minmax(0, 1fr); height: 443px; } .midnight-nav > button { font-size: 11px; padding-block: 11px; } .midnight-content { padding: 15px; } .midnight-card { padding: 12px; } .midnight-card h4 { font-size: 12px; } .midnight-card > p { font-size: 9px; } .midnight-toggle-row strong, .midnight-resource-list strong { font-size: 10px; } .midnight-toggle-row small, .midnight-resource-list small { font-size: 9px; } .midnight-button { font-size: 10px; } .midnight-status { font-size: 10px; } }
@media (max-width: 1150px) and (min-width: 901px) { .trainer-pane.midnight-pane { padding: 10px; } .midnight-body { grid-template-columns: 94px minmax(0, 1fr); } .midnight-nav { padding-inline: 6px; gap: 6px; } .midnight-nav > button { font-size: 9px; gap: 4px; padding-inline: 6px; } .midnight-content { padding: 10px; } .midnight-columns { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .trainer-pane.midnight-pane { padding: 12px; } .midnight-body { grid-template-columns: 99px minmax(0, 1fr); } .midnight-nav { padding-inline: 6px; } .midnight-nav > button { font-size: 9px; gap: 5px; padding-inline: 6px; } .midnight-content { padding: 10px; } .midnight-columns { grid-template-columns: 1fr; } .midnight-card h4 { font-size: 13px; } .midnight-card > p, .midnight-toggle-row small, .midnight-resource-list small, .midnight-info { font-size: 10px; } .midnight-toggle-row strong, .midnight-resource-list strong, .midnight-button { font-size: 11px; } }
@media (max-width: 480px) { .trainer-pane.midnight-pane { padding: 11px; } .midnight-titlebar { padding-inline: 11px; } .midnight-titlebar > div > strong { font-size: 14px; } .midnight-body { display: flex; flex-direction: column; height: 579px; } .midnight-nav { flex-direction: row; overflow-x: auto; overflow-y: hidden; flex-shrink: 0; padding: 9px; gap: 6px; border-right: 0; border-bottom: 1px solid #83a5c533; scrollbar-width: thin; scrollbar-color: #3d5971 #162433; } .midnight-nav > button { padding: 9px 11px; font-size: 11px; gap: 6px; } .midnight-nav > button > span { font-size: 16px; } .midnight-content { min-height: 0; padding: 12px; } .midnight-heading h3 { font-size: 18px; } .midnight-heading > p { font-size: 10px; } .midnight-card { padding: 13px; } .midnight-status { font-size: 10px; align-items: flex-start; min-height: 49px; } .midnight-status > i { margin-top: 6px; } .midnight-status > button { font-size: 10px; padding-top: 0; } .midnight-home-card { padding: 17px; } .midnight-home-card > p { font-size: 12px; } .midnight-speeds button { min-height: 73px; font-size: 12px; } .midnight-toggle-row { padding-block: 12px; } .midnight-toggle-row strong { font-size: 12px; } .midnight-toggle-row small { font-size: 10px; } .midnight-toggle { width: 35px; height: 21px; } .midnight-toggle > i { width: 13px; height: 13px; } .midnight-toggle[aria-checked="true"] > i { transform: translateX(13px); } .midnight-input-row input, .midnight-window select { font-size: 12px; } }

/* The wider desktop workbench can show the original menu at a readable scale. */
@media (min-width: 701px) {
  .midnight-body { grid-template-columns: 135px minmax(0, 1fr); height: 455px; }
  .midnight-nav { padding: 12px 9px; gap: 8px; }
  .midnight-nav > button { font-size: 12px; padding: 11px 9px; gap: 8px; }
  .midnight-nav > button > span { font-size: 18px; width: 18px; }
  .midnight-titlebar { height: 53px; padding-inline: 16px; }
  .midnight-titlebar > div > strong { font-size: 17px; }
  .midnight-titlebar > div > span { font-size: 11px; }
  .midnight-titlebar i { font-size: 9px; }
  .midnight-titlebar > button { font-size: 12px; }
  .midnight-content { padding: 16px; }
  .midnight-heading h3 { font-size: 17px; }
  .midnight-heading > p { font-size: 11px; }
  .midnight-card { padding: 14px; }
  .midnight-card h4 { font-size: 14px; }
  .midnight-card > p { font-size: 11px; }
  .midnight-speeds button { font-size: 12px; min-height: 76px; }
  .midnight-speed-value { font-size: 11px; }
  .midnight-toggle-row strong, .midnight-resource-list strong { font-size: 12px; }
  .midnight-toggle-row small, .midnight-resource-list small { font-size: 11px; }
  .midnight-toggle-row { padding-block: 12px; }
  .midnight-info { font-size: 11px; }
  .midnight-button, .midnight-window input, .midnight-window select { font-size: 12px; }
  .midnight-button { min-height: 36px; }
  .midnight-resource-list > button { padding: 8px; }
  .midnight-resource-symbol { width: 30px; height: 31px; font-size: 22px; }
  .midnight-play-card > small { font-size: 11px; }
  .midnight-status, .midnight-status > button { font-size: 11px; }
  .midnight-home-stats, .midnight-field-label, .midnight-minigame > p, .midnight-game-score { font-size: 12px; }
  .midnight-items > div { font-size: 12px; }
}
