*,
*::before,
*::after {
    box-sizing: border-box;
}
:root {
    --ui-sidebar: #1e1e1e;
    --ui-header: #2b2b2b;
    --ui-main-dark: #131313;
    --ui-footer: #262626;
    --ui-hover: #353535;
    --ui-active: #3e3e3e;
    --ui-border: #0e0e0e;
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --discord-gray: #727272;
    --ui-select: #3c8527;
    --play-green: #3c8527;
    --play-green-hover: #4a9d31;
    --play-green-dark: #27581a;
    --sidebar-width: clamp(14rem, 18vw, 17.5rem);
    --font-ui: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mc: 'Minecraft', 'Minecraftia', var(--font-ui);
    color-scheme: dark;
}
html, body {
    height: 100%;
}
body {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    margin: 0;
    overflow: hidden;
    color: var(--text-primary);
    background-color: var(--ui-main-dark);
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.4;
    -webkit-user-select: none;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}
h1, p, ul {
    margin: 0;
}
ul {
    list-style: none;
    padding: 0;
}
button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}
img {
    display: block;
}
.pixelated {
    image-rendering: pixelated;
}
:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    background-color: var(--ui-sidebar);
    border-right: 1px solid var(--ui-border);
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar {
    display: none;
}
.sidebarGroup {
    display: flex;
    flex-direction: column;
}
.sidebarBottom {
    margin-top: auto;
    padding-bottom: 0.5rem;
}
.sidebarOption {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    min-height: 3.75rem;
    padding: 0.6rem 1.25rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    transition: background-color 0.15s ease;
}
.sidebarOption:hover {
    background-color: var(--ui-hover);
}
.sidebarOption:active {
    background-color: var(--ui-active);
}
.sidebarOption img {
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    object-fit: contain;
}
.sidebarOption.selected {
    font-weight: 700;
    background-color: var(--ui-hover);
}
.sidebarOption.selected::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background-color: var(--ui-select);
}
.sidebarBrand {
    display: flex;
    flex: none;
    align-items: center;
    min-height: 4.5rem;
    padding: 0 1.25rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--ui-border);
}
.sidebarBrand {
    gap: 0.9rem;
    font-weight: 700;
}
.sidebarBrand img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 4px;
}
.sidebarBottom .sidebarOption {
    min-height: 3rem;
}
.sidebarDiscord .discordIcon {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0.1rem;
    color: #8c96f5;
}
.sidebarBottom .sidebarOption img {
    width: 1.75rem;
    height: 1.75rem;
}
.sidebarIcon {
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0.15rem;
    color: var(--text-secondary);
}
.sidebarOption.selected .sidebarIcon {
    color: var(--text-primary);
}
/* Bottom of the sidebar: version on the left, Legal on the right */
.launcherFoot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem 0;
}
.launcherVersion {
    color: var(--text-secondary);
    font-size: 0.8rem;
}
.legalLink {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.legalLink:hover,
.legalLink.selected {
    color: var(--text-primary);
}

/* Main */
.mainPage {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    height: 100%;
}
.gameHeader {
    padding: 1.25rem 1.75rem 0;
    background-color: var(--ui-header);
    box-shadow: 0 1px 0 var(--ui-border);
    z-index: 1;
}
.currentGame {
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.gameTabs {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.4rem;
}
.headerButton {
    padding: 0.7rem 0.9rem 0.8rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 3px solid transparent;
    transition: color 0.15s ease;
}
.headerButton:hover {
    color: var(--text-primary);
}
.headerButton.selected {
    color: var(--text-primary);
    font-weight: 700;
    border-bottom-color: var(--ui-select);
}
.tabPanel[hidden] {
    display: none;
}
.gameBg {
    display: flex;
    justify-content: center;
    background: var(--ui-main-dark) url(../assets/backgrounds/panorama.jpg) center / cover no-repeat;
}
/* Title art over the background (transparent PNG) */
.heroTitle {
    align-self: flex-start;
    /* sized and placed like the Java launcher's logo: centered, near the top, about 2/5 of the width */
    width: clamp(14rem, 42%, 28rem);
    height: auto;
    margin-top: clamp(1.25rem, 5vh, 3rem);
    filter: drop-shadow(0 0.4rem 0.6rem rgba(0, 0, 0, 0.55));
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

/* Installations */
.installations {
    overflow-y: auto;
    background-color: var(--ui-main-dark);
}
.installationsInner {
    max-width: 60rem;
    margin: 0 auto;
    padding: 2rem 1.75rem 3rem;
}
.installationsHint {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}
.installationsList {
    border-top: 1px solid var(--ui-hover);
}
.installation {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--ui-hover);
    transition: background-color 0.15s ease;
}
.installation:hover {
    background-color: var(--ui-sidebar);
}
.installation img {
    width: 2.75rem;
    height: 2.75rem;
}
.installation .versionText {
    flex: 1;
}
.installation .playButton {
    min-width: 0;
    height: 2.5rem;
    padding: 0 1.5rem;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}
.installation:hover .playButton,
.installation:focus-within .playButton {
    opacity: 1;
}

/* Credits */
.mainPage.is-page .gameTabs,
.mainPage.is-page .tabPanel,
.mainPage.is-page .gameSelection {
    display: none;
}
.mainPage.is-page {
    grid-template-rows: auto minmax(0, 1fr);
}
.mainPage.is-page .gameHeader {
    padding-bottom: 1.25rem;
}
.sidePage {
    overflow-y: auto;
    background-color: var(--ui-main-dark);
}
.sidePage[hidden] {
    display: none;
}
.creditsInner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    max-width: 38rem;
    margin: 0 auto;
    padding: 2rem 1.75rem 3rem;
}
/* Minecraft-style divider: stone bar with a light top and dark bottom bevel */
.creditDivider {
    height: 4px;
    margin: 0.5rem 0;
    border: 0;
    background-color: #4a4a4a;
    box-shadow: inset 0 1px 0 #5e5e5e, inset 0 -1px 0 #2a2a2a, 0 0 0 1px #000;
    opacity: 0.6;
}
.creditCard {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    background-color: var(--ui-sidebar);
    border: 1px solid var(--ui-hover);
}
.creditHead {
    flex: none;
    width: 6rem;
    height: 6rem;
    background-color: var(--ui-hover);
}
.creditText {
    min-width: 0;
}
.creditRole {
    text-wrap: balance;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.3;
}
.creditName {
    margin: 0.3rem 0 0.4rem;
    font-family: var(--font-mc);
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}
.creditBadges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}
.creditBadges li {
    padding: 0.1rem 0.5rem;
    color: #b9e6a8;
    background-color: rgba(60, 133, 39, 0.22);
    border: 1px solid rgba(60, 133, 39, 0.6);
    font-size: 0.75rem;
    font-weight: 500;
}
.creditEmail {
    color: #7fc66a;
    overflow-wrap: anywhere;
    -webkit-user-select: text;
    user-select: text;
}
.creditDiscord {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.15rem;
    color: var(--discord-gray);
    -webkit-user-select: text;
    user-select: text;
}
.discordIcon {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
}
.creditDiscord.is-empty {
    font-style: italic;
}
.creditEmail.is-empty {
    color: var(--text-secondary);
    font-style: italic;
}

/* Minor Versions: listed, not playable yet */
.minorVersion .playButton,
.minorVersion .playButton:hover,
.comingSoon .playButton,
.comingSoon .playButton:hover,
.playButton.is-disabled,
.playButton.is-disabled:hover {
    min-width: 9.5rem;
    color: #8a8a8a;
    background-color: #3a3a3a;
    border-bottom-color: #262626;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    text-shadow: none;
    cursor: not-allowed;
    opacity: 1;
}
.minorVersion .playButton:active,
.comingSoon .playButton:active,
.playButton.is-disabled:active {
    border-bottom-width: 4px;
    margin-top: 0;
}

/* Settings */
.settingsInner {
    max-width: 44rem;
    margin: 0 auto;
    padding: 2rem 1.75rem 3rem;
}
.settingsHeading {
    margin: 0 0 0.75rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.settingsGroup {
    border-top: 1px solid var(--ui-hover);
}
.settingsGroup .settingsHeading {
    margin-top: 1.25rem;
}
.settingRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--ui-hover);
    cursor: pointer;
}
.settingRow > span {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.settingHint {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.35;
}
/* On/off switch, green like the launcher */
.switch {
    flex: none;
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    margin: 0;
    background-color: #4a4a4a;
    border-radius: 999px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(1.5rem - 6px);
    height: calc(1.5rem - 6px);
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.15s ease;
}
.switch:checked {
    background-color: var(--play-green);
}
.switch:checked::after {
    transform: translateX(1.25rem);
}
.switch:focus-visible {
    outline-offset: 2px;
}

.cloakOptions {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 0;
    padding: 0.9rem 0;
    border: 0;
    border-bottom: 1px solid var(--ui-hover);
    transition: opacity 0.15s ease;
}
.cloakOptions:disabled {
    opacity: 0.4;
}
.cloakCustom {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.cloakCustom[hidden] {
    display: none;
}
.cloakIconRow {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.cloakIconPreview {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}
.openRow {
    cursor: default;
}
.openButtons {
    display: flex;
    flex: none;
    flex-direction: row !important;
    gap: 0.5rem;
}
.smallButton {
    flex: none;
    height: 2.25rem;
    padding: 0 0.85rem;
    white-space: nowrap;
    background-color: var(--ui-hover);
    border-bottom: 2px solid #1a1a1a;
    font-size: 0.85rem;
    font-weight: 700;
}
.smallButton:hover {
    background-color: var(--ui-active);
}

.settingSelect {
    flex: none;
    height: 2.25rem;
    padding: 0 0.6rem;
    color: var(--text-primary);
    background-color: var(--ui-main-dark);
    border: 1px solid #4a4a4a;
    font: inherit;
    font-size: 0.85rem;
}
.buildSwitch {
    display: flex;
    flex: none;
    border: 1px solid #4a4a4a;
}
.buildSwitch button {
    padding: 0.3rem 0.55rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
}
.buildSwitch button[aria-pressed="true"] {
    color: var(--text-primary);
    background-color: var(--play-green);
}
.buildSwitch button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Playing inside the launcher: the game fills the window; the launcher underneath is hidden */
.gameOverlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    background-color: #000;
}
.gameOverlay[hidden] {
    display: none;
}
.gameFrameHolder,
.gameFrameHolder iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
/* Game menu: three small lines in the corner; opens on hover, or click to keep it open */
.gameMenu {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}
.gameMenuToggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.4rem;
    background-color: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.4;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}
.gameMenuToggle span {
    display: block;
    height: 2px;
    background-color: #fff;
}
.gameMenuItems {
    display: flex;
    flex-direction: column;
    min-width: 11rem;
    background-color: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-0.4rem);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}
.gameMenuItems button {
    padding: 0.6rem 0.9rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    text-align: left;
}
.gameMenuItems button:hover,
.gameMenuItems button:focus-visible {
    background-color: var(--ui-hover);
}
/* Info overlay controls (the overlay itself is drawn inside the game page) */
.gameMenuSection {
    display: flex;
    flex-direction: column;
    padding: 0.3rem 0 0.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.gameMenuHeading {
    margin: 0;
    padding: 0.35rem 0.9rem 0.2rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.gameMenuCheck {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.9rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}
.gameMenuCheck:hover {
    background-color: var(--ui-hover);
}
.gameMenuCheck input {
    accent-color: var(--ui-select);
}
.gameMenuSection.is-off .gameMenuCheck:not(:first-of-type),
.gameMenuSection.is-off .gameMenuRow {
    opacity: 0.5;
}
.gameMenuRow {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.9rem;
    color: var(--text-primary);
    font-size: 0.85rem;
}
.gameMenuRow span {
    flex: 1;
}
.gameMenuItems .gameMenuRow button {
    min-width: 1.75rem;
    padding: 0.2rem 0.4rem;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid transparent;
}
.gameMenuItems .gameMenuRow button.is-selected {
    border-color: var(--ui-select);
}
.gameMenu:hover .gameMenuToggle,
.gameMenu.is-open .gameMenuToggle,
.gameMenuToggle:focus-visible {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.75);
}
.gameMenu:hover .gameMenuItems,
.gameMenu.is-open .gameMenuItems {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Launcher popups (instead of the browser's own confirm boxes) */
.dialog {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.15s ease;
}
.dialog[hidden] {
    display: none;
}
.dialogPanel {
    width: min(26rem, 100%);
    padding: 1.4rem 1.4rem 1.1rem;
    background-color: var(--ui-footer);
    border: 1px solid #3a3a3a;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.6);
    animation: slideUp 0.15s ease;
}
.dialogTitle {
    margin: 0 0 0.6rem;
    font-family: var(--font-mc);
    font-size: 1.15rem;
    font-weight: 400;
}
.dialogText {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
}
.dialogCheck {
    margin-top: 0.9rem;
}
.dialogCheck[hidden] {
    display: none;
}
.dialogButtons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.2rem;
}
.dialogButtons .textButton {
    padding: 0.5rem 0.9rem;
}
body.is-playing > :not(.gameOverlay):not(.toast):not(.dialog) {
    visibility: hidden;
}
body.is-playing .gameBg {
    background-image: none;
    animation: none;
}

/* Profile (opened from the head next to Play) */
.playerChip {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    max-width: 100%;
    min-width: 0;
    padding: 0.4rem 0.75rem 0.4rem 0.4rem;
    transition: background-color 0.15s ease;
}
.playerChip:hover,
.playerChip[aria-expanded="true"] {
    background-color: var(--ui-hover);
}
.playerChip img {
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--ui-hover);
}
.playerChip.is-off img,
.playerChip.is-off span {
    opacity: 0.45;
}
.playerChip span {
    overflow: hidden;
    font-family: var(--font-mc);
    white-space: nowrap;
    text-overflow: ellipsis;
}
.profilePopover {
    position: absolute;
    right: 1.25rem;
    bottom: 100%;
    z-index: 5;
    width: min(26rem, calc(100vw - 2rem));
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    padding: 1.1rem 1.25rem 0.35rem;
    background-color: var(--ui-footer);
    box-shadow: 0 -0.5rem 1.5rem rgba(0, 0, 0, 0.45);
    animation: slideUp 0.15s ease;
    -webkit-user-select: text;
    user-select: text;
}
.profilePopover[hidden] {
    display: none;
}
.profilePopover .settingRow {
    border-top: 1px solid var(--ui-hover);
    border-bottom: 0;
    margin-top: 1rem;
}
.profileList {
    display: flex;
    gap: 0.4rem;
    margin: 0 -0.25rem 1rem;
    padding: 0 0.25rem 0.25rem;
    overflow-x: auto;
    scrollbar-width: thin;
}
.profileTab {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    width: 4.25rem;
    padding: 0.45rem 0.25rem 0.35rem;
    border: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.72rem;
    transition: background-color 0.15s ease;
}
.profileTab:hover {
    background-color: var(--ui-hover);
    color: var(--text-primary);
}
.profileTab[aria-pressed="true"] {
    color: var(--text-primary);
    background-color: var(--ui-hover);
    border-color: var(--play-green);
}
.profileTab img {
    width: 2.25rem;
    height: 2.25rem;
    background-color: var(--ui-active);
}
.profileTab span {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.profileAddIcon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 2px dashed #5a5a5a;
    color: var(--text-secondary);
    font-size: 1.3rem;
    line-height: 1;
}
.profileDeleteRow {
    display: flex;
    justify-content: flex-start;
    padding-bottom: 0.6rem;
}
.profileDeleteRow[hidden] {
    display: none;
}
.dangerText {
    padding-left: 0;
    color: #ff8a80;
}
.dangerText:hover {
    color: #ffb3ad;
}
.profileEditor {
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
}
.profilePreview {
    flex: none;
    width: 5rem;
    height: 5rem;
    background-color: var(--ui-hover);
}
.profileFields {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.fieldLabel {
    font-size: 0.85rem;
    font-weight: 700;
}
.field input,
.field select {
    width: 100%;
    height: 2.4rem;
    padding: 0 0.7rem;
    color: var(--text-primary);
    background-color: var(--ui-main-dark);
    border: 1px solid #4a4a4a;
    border-radius: 0;
    font: inherit;
}
.field input:focus-visible,
.field select:focus-visible {
    outline: 2px solid var(--play-green);
    outline-offset: -2px;
}
.settingHint.is-error {
    color: #ff8a80;
}
.customSkin {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.customSkin[hidden] {
    display: none;
}
.fileButton {
    position: relative;
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    height: 2.25rem;
    padding: 0 0.9rem;
    background-color: var(--ui-hover);
    border-bottom: 2px solid #1a1a1a;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}
.fileButton:hover {
    background-color: var(--ui-active);
}
.fileButton input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.fileButton:focus-within {
    outline: 2px solid #fff;
}
.segmented {
    display: flex;
    align-self: flex-start;
    border: 1px solid #4a4a4a;
}
.segmented label {
    position: relative;
    cursor: pointer;
}
.segmented input {
    position: absolute;
    opacity: 0;
}
.segmented span {
    display: block;
    padding: 0.35rem 0.8rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
}
.segmented input:checked + span {
    color: var(--text-primary);
    background-color: var(--play-green);
}
.segmented input:focus-visible + span {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

.checkRow {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: -0.35rem;
    font-size: 0.88rem;
    cursor: pointer;
}
.checkRow input {
    flex: none;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: var(--play-green);
}
.skinChoice {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    transition: opacity 0.15s ease;
}
/* Greyed out while the skin comes from the Java account */
.skinChoice:disabled {
    opacity: 0.4;
}
.skinChoice:disabled * {
    cursor: not-allowed;
}
.profileIntro {
    margin: -0.25rem 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.profileActions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0 1rem;
}
.profileActions[hidden] {
    display: none;
}
.textButton {
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.textButton:hover {
    color: var(--text-primary);
}
.smallPlayButton {
    min-width: 7rem;
    height: 2.5rem;
    padding: 0 1.25rem;
    color: #fff;
    background-color: var(--play-green);
    border-bottom: 3px solid var(--play-green-dark);
    font-family: var(--font-mc);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.smallPlayButton:hover {
    background-color: var(--play-green-hover);
}
/* First visit: the profile editor opens as a centered welcome window */
.modalBackdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.2s ease;
}
.modalBackdrop[hidden] {
    display: none;
}
.profilePopover.is-welcome {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    z-index: 21;
    width: min(30rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding-top: 1.4rem;
    transform: translate(-50%, -50%);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.6);
    animation: none;
}
.profilePopover.is-welcome .settingsHeading {
    color: var(--text-primary);
    font-family: var(--font-mc);
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: none;
}
@keyframes fadeIn {
    from { opacity: 0; }
}

@media (min-width: 761px) {
    .gameSelection .playButton.is-disabled {
        min-width: 17rem;
        font-size: 1.15rem;
    }
}

/* Legal page */
.legalInner {
    max-width: 44rem;
    margin: 0 auto;
    padding: 2rem 1.75rem 3rem;
}
.legalNotice {
    padding: 0.25rem 0 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    -webkit-user-select: text;
    user-select: text;
}
.legalNotice p + p,
.legalNotice .legalList {
    margin-top: 0.6rem;
}
.legalNotice strong {
    color: var(--text-primary);
}
.legalNotice a,
.inlineLink {
    color: #7fc66a;
}
.legalSubheading {
    margin: 1.1rem 0 0.2rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.legalList {
    padding-left: 1.1rem;
    list-style: disc;
}
.legalList li + li {
    margin-top: 0.3rem;
}

/* Footer */
.gameSelection {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    height: 5.5rem;
    padding: 0 1.25rem;
    background-color: var(--ui-footer);
    box-shadow: 0 -1px 0 var(--ui-border);
}
.dropdown {
    position: relative;
    justify-self: start;
    align-self: stretch;
    display: flex;
}
.dropdownSelector,
.dropdownOption {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 17rem;
    max-width: 100%;
    padding: 0 1rem;
    text-align: left;
}
.dropdownSelector {
    height: 100%;
    transition: background-color 0.15s ease;
}
.dropdownSelector:hover,
.dropdownSelector[aria-expanded="true"] {
    background-color: var(--ui-hover);
}
.dropdownSelector img,
.dropdownOption img {
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
}
.versionText {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.versionText strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.versionText span {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.dropdownIcon {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.2s ease;
}
.dropdownSelector[aria-expanded="true"] .dropdownIcon {
    transform: rotate(180deg);
}
.dropdownMenu {
    position: absolute;
    left: 0;
    bottom: 100%;
    width: 17rem;
    max-height: 50vh;
    overflow-y: auto;
    background-color: var(--ui-footer);
    box-shadow: 0 -0.5rem 1.5rem rgba(0, 0, 0, 0.45);
    z-index: 5;
    animation: slideUp 0.15s ease;
}
.dropdownMenu[hidden] {
    display: none;
}
.dropdownOption {
    width: 100%;
    height: 4rem;
}
.dropdownOption:hover {
    background-color: var(--ui-hover);
}
.dropdownOption[aria-selected="true"] {
    box-shadow: inset 4px 0 0 var(--ui-select);
}

/* Play button, styled after the Java Edition launcher */
.playButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17rem;
    height: 3.5rem;
    padding: 0 2rem;
    color: #fff;
    background-color: var(--play-green);
    border-bottom: 4px solid var(--play-green-dark);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12);
    font-family: var(--font-mc);
    font-size: 1.4rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
    transition: background-color 0.12s ease;
}
.playButton:hover {
    background-color: var(--play-green-hover);
}
.playButton:active {
    border-bottom-width: 2px;
    margin-top: 2px;
}
.playButton:focus-visible {
    outline-offset: 3px;
}

/* Toast */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    max-width: min(22rem, calc(100vw - 2rem));
    padding: 0.85rem 1.1rem;
    color: var(--text-primary);
    background-color: var(--ui-footer);
    border-left: 4px solid #e2b007;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.5);
}
.toast[hidden] {
    display: none;
}
.toast.is-visible {
    animation: slideDown 0.25s ease;
}
.toast.is-leaving {
    animation: fadeOut 0.2s ease forwards;
}
.toastTitle {
    color: #e2b007;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

/* Page switch, like the Java launcher: new content fades in while sliding up a little */
.pageIn {
    animation: pageIn 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes pageIn {
    from { opacity: 0; transform: translateY(12px); }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-0.5rem); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-0.75rem); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(0.5rem); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Small screens: sidebar becomes a scrolling top bar */
@media (max-width: 760px) {
    body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
    }
    .sidebar {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: 0;
        border-bottom: 1px solid var(--ui-border);
    }
    .sidebarGroup {
        flex-direction: row;
    }
    .sidebarBottom {
        margin: 0 0 0 auto;
        padding: 0;
    }
    .sidebarOption,
    .sidebarBottom .sidebarOption {
        flex-direction: column;
        gap: 0.3rem;
        width: auto;
        min-height: 0;
        padding: 0.6rem 0.85rem;
        font-size: 0.72rem;
        white-space: nowrap;
        text-align: center;
    }
    .sidebarOption img,
    .sidebarIcon,
    .sidebarDiscord .discordIcon,
    .sidebarBrand img,
    .sidebarBottom .sidebarOption img {
        width: 1.75rem;
        height: 1.75rem;
    }
    .sidebarBrand {
        min-height: 0;
        margin: 0;
        padding: 0 0.85rem;
        border-bottom: 0;
        border-right: 1px solid var(--ui-border);
    }
    .sidebarBrand span,
    .launcherFoot {
        display: none;
    }
    .sidebarOption.selected::before {
        inset: auto 0 0 0;
        width: auto;
        height: 3px;
    }
    .mainPage {
        min-height: 0;
    }
    .gameHeader {
        padding: 0.9rem 1rem 0;
    }
    .gameSelection {
        grid-template-columns: minmax(0, 1fr) auto auto;
        height: auto;
        padding: 0.75rem;
        gap: 0.75rem;
    }
    .dropdownSelector {
        width: 100%;
        min-height: 3.5rem;
        padding: 0 0.6rem;
    }
    .dropdown {
        justify-self: stretch;
        min-width: 0;
    }
    .dropdownMenu {
        width: 100%;
        min-width: 15rem;
        margin-bottom: 0.75rem;
    }
    .playButton {
        min-width: 0;
        padding: 0 1.5rem;
        font-size: 1.15rem;
    }
    .installation .playButton {
        opacity: 1;
    }
    .playerChip {
        padding: 0.25rem;
    }
    .gameSelection .playButton.is-disabled {
        min-width: 0;
        padding: 0 0.8rem;
        font-size: 0.8rem;
    }
    .playerChip span {
        display: none;
    }
    .profilePopover {
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }
    .settingsInner {
        padding: 1rem;
    }
    .openRow {
        flex-direction: column;
        align-items: flex-start;
    }
    .creditsInner,
    .installationsInner {
        padding: 1rem;
    }
    .installation {
        gap: 0.75rem;
        padding: 0.75rem 0.5rem;
    }
    .minorVersion .playButton,
    .minorVersion .playButton:hover,
    .comingSoon .playButton,
    .comingSoon .playButton:hover {
        min-width: 0;
        height: 2.25rem;
        padding: 0 0.7rem;
        font-size: 0.7rem;
        letter-spacing: 0.04em;
    }
    .minorVersion .versionText strong {
        white-space: normal;
    }
    .creditCard {
        gap: 0.9rem;
        padding: 1rem;
    }
    .creditHead {
        width: 4rem;
        height: 4rem;
    }
    .creditName {
        font-size: 1.1rem;
        overflow-wrap: anywhere;
    }
}
