/* Language choice (every plan): seatback "Select your language" screen, start-screen globe button, Settings row. */

/* The start card is the monitor bezel; the picker is the lit screen inside it. */
.startup-root.startup-language-step {
  display: flex;
  align-items: stretch;
  justify-content: center;
}
/* "Night cabin navy": the screen of a seatback monitor dimmed for the night. The app's navy (#1D0D78) stays as
   the hue and as the ink of the lit key and the Continue button; only the large surfaces lose their glare. */
:root {
  --ife-lang-top: #1b1b38;
  --ife-lang-mid: #121228;
  --ife-lang-bottom: #080817;
  --ife-lang-glow: rgba(168, 171, 206, 0.08);
  --ife-lang-lit: #f4f5f9;
  --ife-lang-cta: #d8d9ef;
  --ife-lang-cta-glow: rgba(216, 217, 239, 0.06);
  --ife-lang-ink: #1d0d78;
}
.ife-lang {
  display: flex;
  width: 100%;
}
.ife-lang-screen {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 30px 38px 28px;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(90% 60% at 50% -8%, var(--ife-lang-glow), transparent 62%),
    linear-gradient(180deg, var(--ife-lang-top) 0%, var(--ife-lang-mid) 55%, var(--ife-lang-bottom) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 28px 60px rgba(0, 0, 0, 0.46);
  overflow: hidden;
}
/* Faint pixel grid, as on a seatback LCD seen up close. */
.ife-lang-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 3px;
  pointer-events: none;
}
.ife-lang-head {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.86;
}
.ife-lang-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.ife-lang-brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ife-lang-welcome {
  margin-top: 22px;
  min-height: 1.2em;
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.ife-lang-welcome-text {
  display: inline-block;
  transition: opacity 200ms ease, transform 200ms ease;
}
.ife-lang-welcome-text.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
}
.ife-lang-title:lang(ko),
.ife-lang-title:lang(ja),
.ife-lang-title:lang(zh-CN) {
  letter-spacing: 0.04em;
}
.ife-lang-title {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}
.ife-lang-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.ife-lang-key {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 82px;
  padding: 14px 30px 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04));
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}
.ife-lang-key:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background-color: rgba(255, 255, 255, 0.10);
}
.ife-lang-key:active {
  transform: scale(0.98);
}
.ife-lang-key:focus-visible,
.ife-lang-continue:focus-visible,
.startup-language-btn:focus-visible {
  outline: 2px solid rgba(255, 210, 58, 0.92);
  outline-offset: 3px;
}
.ife-lang-key-native {
  max-width: 100%;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.ife-lang-key-english {
  max-width: 100%;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.56);
}
/* Annunciator lamp: dark when off, lit green on the chosen language. */
.ife-lang-key-lamp {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.55);
  transition: background-color 180ms ease, box-shadow 180ms ease;
}
.ife-lang-key.is-selected {
  border-color: #ffffff;
  background: var(--ife-lang-lit);
  color: var(--ife-lang-ink);
}
.ife-lang-key.is-selected .ife-lang-key-english {
  color: rgba(29, 13, 120, 0.62);
}
.ife-lang-key.is-selected .ife-lang-key-lamp {
  background: #2fdc98;
  box-shadow: 0 0 0 3px rgba(47, 220, 152, 0.22), 0 0 10px rgba(47, 220, 152, 0.8);
}
.ife-lang-key-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}
.ife-lang-key-tag svg {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
}
.ife-lang-key.is-selected .ife-lang-key-tag {
  background: rgba(29, 13, 120, 0.10);
  color: var(--ife-lang-ink);
}
.ife-lang-key.is-soon {
  cursor: default;
  opacity: 0.46;
}
.ife-lang-key.is-soon:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background-color: transparent;
}
.ife-lang-key-tag.is-soon {
  background: transparent;
  padding-left: 0;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
}
.ife-lang-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: auto;
  padding-top: 24px;
}
.ife-lang-note {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
}
/* Same lit pill as the flight's START button, in a pale lavender grey instead of gold. */
.ife-lang-continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 232px;
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--ife-lang-cta);
  color: var(--ife-lang-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 26px rgba(4, 0, 30, 0.5), 0 0 28px var(--ife-lang-cta-glow);
  transition: transform 180ms ease, filter 180ms ease;
}
.ife-lang-continue:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.ife-lang-continue:active {
  transform: translateY(0) scale(0.99);
}

/* Start screen globe button with the current language code. */
.startup-language-btn {
  position: relative;
}
.startup-language-btn-code {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 18px;
  height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--ife-lang-top);
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 15px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26), 0 0 0 1.5px rgba(0, 0, 0, 0.7);
}

/* Settings: Language sits on top, outside the folding groups. */
.topbar-settings-language-row {
  margin-bottom: 2px;
  padding: 0 0 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.topbar-settings-language-globe {
  display: inline-flex;
  color: rgba(255, 255, 255, 0.82);
}
.topbar-settings-language-anchor {
  margin-left: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.46);
}
html[data-ui-language="en"] .topbar-settings-language-anchor {
  display: none;
}

@media (max-height: 500px) {
  #loading-overlay .startup-shell .startup-root.startup-game-step.startup-language-step {
    flex: 1 1 auto;
    align-self: stretch;
    height: auto;
    margin-bottom: 14px;
    overflow: hidden;
  }
  .ife-lang-screen {
    padding: 12px 16px 12px;
    border-radius: 14px;
  }
  .ife-lang-head {
    display: none;
  }
  .ife-lang-welcome {
    margin-top: 0;
    font-size: 22px;
  }
  .ife-lang-title {
    margin-top: 3px;
    font-size: 10px;
  }
  .ife-lang-grid {
    gap: 6px;
    margin-top: 10px;
  }
  .ife-lang-key {
    min-height: 50px;
    padding: 7px 16px 7px 10px;
    border-radius: 10px;
    gap: 1px;
  }
  .ife-lang-key-native {
    font-size: 13.5px;
    line-height: 1.1;
  }
  .ife-lang-key-english {
    display: none;
  }
  .ife-lang-key-lamp {
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
  }
  .ife-lang-key-tag {
    margin-top: 3px;
    padding: 2px 6px 2px 4px;
    font-size: 8.5px;
  }
  .ife-lang-key-tag svg {
    width: 10px;
    height: 10px;
    flex-basis: 10px;
  }
  .ife-lang-foot {
    padding-top: 10px;
  }
  .ife-lang-note {
    font-size: 11px;
  }
  .ife-lang-continue {
    min-width: 170px;
    min-height: 38px;
    font-size: 13.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ife-lang-welcome-text,
  .ife-lang-continue,
  .ife-lang-key,
  .ife-lang-key-lamp {
    transition: none;
  }
}
