@font-face {
  font-family: "Minecraft";
  src: url("../Minecraft.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #111111;
  --paper: #f4f2ed;
  --paper-deep: #dedbd2;
  --green: #3c8527;
  --green-dark: #245a18;
  --green-light: #52a535;
  --red: #b92f2f;
  --pixel: "Minecraft", "Arial Black", sans-serif;
  --body: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #111; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow-x: hidden;
}

.world {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 4, 10, .72), rgba(7, 4, 10, .22) 48%, rgba(7, 4, 10, .48)),
    linear-gradient(to bottom, rgba(10, 6, 12, .14), rgba(10, 6, 12, .58)),
    url("../img/image.png") center / cover no-repeat;
}

.page-shell {
  width: min(100% - 40px, 1120px);
  min-width: 0;
  margin: auto;
  padding: 70px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.portal {
  width: min(100%, 760px);
  position: relative;
  filter: drop-shadow(14px 14px 0 rgba(0, 0, 0, .58));
}

.portal-gate { max-width: 530px; }
.portal-success { max-width: 760px; }

.portal::after {
  content: "";
  position: absolute;
  inset: 8px -8px -8px 8px;
  z-index: -1;
  background: #111;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.portal-hero {
  padding: 34px 40px 25px;
  color: #fff;
  background: #171615;
  border-bottom: 6px solid var(--green);
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px);
}

.server-address {
  margin: 0 0 12px;
  color: #70c657;
  font: 14px var(--pixel);
  letter-spacing: 2px;
}

h1 {
  margin: 0;
  color: #fff;
  font: normal clamp(2rem, 6vw, 3.45rem) / .95 var(--pixel);
  letter-spacing: .5px;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 #000;
}

.hero-copy {
  margin: 13px 0 0;
  color: #c8c4bc;
  font: 17px var(--pixel);
}

.steps {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 8px;
}

.steps li {
  min-width: 132px;
  padding: 10px 13px;
  color: #77736c;
  background: #282725;
  border-left: 4px solid #3a3834;
  font: 12px var(--pixel);
}

.steps li span { color: #a6a29a; margin-right: 8px; }
.steps li.active { color: #fff; border-color: #66b94d; background: #343c30; }
.steps li.complete { color: #b8dcae; border-color: var(--green); }

.portal-body {
  padding: 34px 40px 39px;
  background-color: var(--paper);
  background-image:
    linear-gradient(45deg, rgba(0, 0, 0, .018) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, .018) 75%),
    linear-gradient(45deg, rgba(0, 0, 0, .018) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, .018) 75%);
  background-position: 0 0, 5px 5px;
  background-size: 10px 10px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}

.portal-gate .portal-body { padding-top: 40px; }

.alert {
  margin: 0 0 27px;
  padding: 14px 16px;
  color: #fff;
  background: #353432;
  border-left: 7px solid var(--red);
  box-shadow: 4px 4px 0 #aaa69e;
  display: flex;
  align-items: center;
  gap: 13px;
}

.alert-success { border-color: var(--green-light); }
.alert-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  background: rgba(255, 255, 255, .13);
  display: grid;
  place-items: center;
  font: 18px var(--pixel);
}
.alert strong { font: 14px var(--pixel); text-transform: uppercase; }
.alert p { margin: 4px 0 0; color: #ddd9d1; font-size: 13px; }

fieldset { margin: 0 0 30px; padding: 0; border: 0; }
legend,
.field > label {
  display: block;
  margin: 0 0 11px;
  color: #242321;
  font: 13px var(--pixel);
  letter-spacing: .5px;
}

.edition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.edition-card { min-width: 0; position: relative; cursor: pointer; }
.edition-card input { position: absolute; opacity: 0; pointer-events: none; }

.edition-content {
  min-width: 0;
  min-height: 128px;
  padding: 17px;
  background: #fff;
  border: 3px solid #2c2b29;
  box-shadow: 5px 5px 0 #aaa69d;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform .12s ease, box-shadow .12s ease;
}

.edition-card:hover .edition-content { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 #918d85; }
.edition-card input:checked + .edition-content { border-color: var(--green); box-shadow: 6px 6px 0 var(--green-dark); background: #f4faef; }
.edition-card input:focus-visible + .edition-content { outline: 4px solid #111; outline-offset: 4px; }

.edition-logo {
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  display: block;
  background-color: #282725;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}

.edition-logo-java {
  background-image: url("../img/java-icon.jpg");
  background-size: 230px auto;
  background-position: -124px -16px;
}

.edition-logo-bedrock {
  background-image: url("../img/bedrock-edition.jpg");
  background-size: 230px auto;
  background-position: -129px -21px;
}

.edition-copy { min-width: 0; }
.edition-copy strong { display: block; font: 16px / 1.15 var(--pixel); }
.edition-copy small { display: block; margin-top: 8px; color: #5c5953; font-size: 12px; line-height: 1.35; }

.select-mark {
  width: 24px;
  height: 24px;
  margin: 0 0 auto auto;
  color: transparent;
  background: #e1dfda;
  display: grid;
  place-items: center;
  font: 13px var(--pixel);
}
.edition-card input:checked + .edition-content .select-mark { color: #fff; background: var(--green); }

.field { margin-bottom: 27px; }
.input-wrap { position: relative; }

.input-wrap input {
  width: 100%;
  height: 58px;
  padding: 0 94px 0 48px;
  color: #111;
  background: #fff;
  border: 3px solid #282725;
  border-radius: 0;
  outline: 0;
  box-shadow: inset 0 -4px #dedbd4;
  font: 16px var(--pixel);
}

.input-wrap input:focus { border-color: var(--green); box-shadow: inset 0 -4px #d9ead1, 5px 5px 0 var(--green-dark); }
.input-wrap input::placeholder { color: #8a867f; opacity: 1; }
.input-icon { position: absolute; z-index: 1; left: 18px; top: 19px; color: #595650; font: 16px var(--pixel); }
.key-icon { color: #806919; font-size: 12px; top: 21px; }

.reveal {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  height: 38px;
  padding: 0 12px;
  color: #fff;
  background: #3a3937;
  border: 0;
  font: 10px var(--pixel);
  cursor: pointer;
}
.reveal:hover { background: #111; }
.reveal:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.field > small { display: block; margin-top: 10px; color: #68645e; font: 12px var(--pixel); }

.profile-preview {
  min-height: 96px;
  margin-top: 16px;
  padding: 11px;
  color: #5e5a54;
  background: #e5e2db;
  border-left: 6px solid #a29e95;
  display: flex;
  align-items: center;
  gap: 15px;
}

.profile-avatar-shell {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  position: relative;
  overflow: hidden;
  background: #cbc7be;
  image-rendering: pixelated;
}
.profile-avatar-shell img { width: 100%; height: 100%; position: relative; z-index: 1; object-fit: cover; image-rendering: pixelated; }
.profile-avatar-shell img:not([src]) { display: none; }
.profile-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #8a867e; font: 24px var(--pixel); }
.profile-copy span { display: block; font: 12px / 1.4 var(--pixel); }
.profile-copy strong { display: block; margin-top: 7px; color: #151412; font: 18px var(--pixel); }
.profile-preview.is-loading { border-color: #b7952d; }
.profile-preview.is-error { color: #8b2424; border-color: var(--red); background: #f1deda; }
.profile-preview.is-valid { color: #2f6e20; border-color: var(--green); background: #e3efdd; }
.profile-preview.is-valid .profile-placeholder { display: none; }

.submit-button {
  width: 100%;
  min-height: 58px;
  padding: 0 58px 0 22px;
  position: relative;
  color: #fff;
  background: var(--green);
  border: 3px solid #1d4814;
  border-radius: 0;
  box-shadow: inset 0 4px rgba(255, 255, 255, .14), 0 6px 0 #193e11;
  font: 16px var(--pixel);
  text-transform: uppercase;
  text-shadow: 2px 2px #1d4814;
  cursor: pointer;
}
.submit-button:hover { background: var(--green-light); }
.submit-button:active { transform: translateY(4px); box-shadow: inset 0 4px rgba(255, 255, 255, .1), 0 2px 0 #193e11; }
.submit-button:focus-visible { outline: 4px solid #111; outline-offset: 4px; }
.submit-button:disabled { color: #d0cdc6; background: #77736d; border-color: #4f4c47; box-shadow: 0 6px 0 #45423e; cursor: not-allowed; text-shadow: none; }
.button-arrow { position: absolute; right: 22px; top: 14px; font: 25px var(--pixel); }

.form-note {
  margin: 28px 0 0;
  padding-top: 20px;
  color: #5e5a54;
  border-top: 2px solid #cac6bd;
  font: 12px / 1.5 var(--pixel);
}

.success-panel h2 { margin: 31px 0 12px; font: 24px var(--pixel); }
.success-panel > p { margin: 0; color: #4c4944; font-size: 16px; line-height: 1.55; }
.success-player {
  padding: 16px;
  color: #fff;
  background: #242321;
  border-left: 7px solid var(--green-light);
  display: flex;
  align-items: center;
  gap: 20px;
}
.success-player img { width: 96px; height: 96px; background: #111; image-rendering: pixelated; }
.success-player span { display: block; color: #73c85b; font: 11px var(--pixel); }
.success-player strong { display: block; margin-top: 10px; font: 24px var(--pixel); }

.connection-options {
  margin-top: 20px;
  display: grid;
  gap: 18px;
}

.connection-card {
  padding: 20px;
  background: #e7e4dc;
  border: 3px solid #77736d;
  box-shadow: 5px 5px 0 #aaa69d;
}

.connection-card-recommended {
  background: #edf5e9;
  border-color: var(--green);
  box-shadow: 5px 5px 0 var(--green-dark);
}

.connection-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.method-number { color: #5d5953; font: 13px var(--pixel); }
.recommended-badge,
.platform-badge {
  padding: 7px 9px 6px;
  color: #fff;
  background: var(--green);
  font: 9px var(--pixel);
}
.platform-badge { background: #514e49; }

.connection-card h3 { margin: 15px 0 8px; font: 17px / 1.25 var(--pixel); }
.connection-card p { margin: 0; color: #4c4944; font-size: 14px; line-height: 1.55; }

.connection-value {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  border: 3px solid #282725;
  box-shadow: 5px 5px 0 #aaa69d;
}
.connection-value code { min-width: 0; padding: 17px; overflow-wrap: anywhere; background: #fff; font: 18px var(--pixel); }
.connection-value button,
.secondary-button {
  padding: 0 18px;
  color: #fff;
  background: #343331;
  border: 0;
  font: 11px var(--pixel);
  cursor: pointer;
}
.connection-value button:hover { background: var(--green); }

.connection-details {
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 10px;
}
.connection-details > div { min-width: 0; }
.connection-details dt { margin-bottom: 6px; color: #615d57; font: 9px var(--pixel); }
.connection-details dd {
  min-width: 0;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 2px solid #282725;
}
.connection-details code { min-width: 0; padding: 12px; overflow-wrap: anywhere; background: #fff; font: 13px var(--pixel); }
.connection-details button {
  padding: 0 10px;
  color: #fff;
  background: #343331;
  border: 0;
  font: 8px var(--pixel);
  cursor: pointer;
}
.connection-details button:hover { background: var(--green); }

.connection-link {
  min-height: 44px;
  margin-top: 17px;
  padding: 0 15px;
  color: #fff;
  background: #343331;
  border-bottom: 4px solid #191817;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 10px var(--pixel);
  text-decoration: none;
}
.connection-link:hover { background: var(--green); border-color: var(--green-dark); }
.connection-link:focus-visible { outline: 4px solid #111; outline-offset: 3px; }

.copy-feedback { min-height: 21px; margin-top: 14px !important; color: #2f6e20 !important; font: 11px var(--pixel) !important; }
.secondary-button { width: 100%; min-height: 48px; margin-top: 8px; background: #514e49; }
.secondary-button:hover { background: #292826; }

@media (max-width: 680px) {
  .page-shell { width: min(100% - 22px, 760px); padding: 30px 0 44px; }
  .portal { filter: drop-shadow(7px 8px 0 rgba(0, 0, 0, .58)); }
  .portal-hero { padding: 27px 22px 21px; }
  .portal-body { padding: 27px 20px 32px; }
  .steps li { min-width: 0; flex: 1; padding: 9px; font-size: 10px; }
  .steps li span { display: block; margin: 0 0 5px; }
  .edition-grid { grid-template-columns: 1fr; }
  .edition-content { min-height: 105px; }
  .success-player img { width: 76px; height: 76px; }
  .success-player strong { font-size: 18px; }
  .connection-value { grid-template-columns: 1fr; }
  .connection-value button { min-height: 43px; }
  .connection-details { grid-template-columns: 1fr; }
  .connection-details button { min-height: 39px; }
  .connection-link { width: 100%; }
}

@media (max-width: 410px) {
  .edition-logo { width: 68px; height: 68px; flex-basis: 68px; }
  .edition-logo-java { background-size: 191px auto; background-position: -103px -13px; }
  .edition-logo-bedrock { background-size: 191px auto; background-position: -107px -17px; }
  .edition-copy strong { font-size: 13px; }
  .submit-button { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .edition-content { transition: none; }
}
