.at-nav-header {
  box-sizing: border-box;
  display: flex !important;
  align-items: center;
  gap: clamp(.5rem,1.25vw,1.25rem);
  width: min(100% - 2rem, 96rem) !important;
  min-height: 3.5rem;
  margin: 0 auto;
  padding: max(.25rem,env(safe-area-inset-top)) 0 .25rem;
  position: relative;
  z-index: 5;
  border-bottom: 1px solid #3c577270;
  color: #edf6ff;
}
.at-nav-brand { color: #e0eeff; white-space: nowrap; text-decoration: none; font-weight: 800; }
.at-nav-brand span { color: #8bcdff; margin-inline-end: .25em; }
.at-primary { display: flex; justify-content: center; flex: 1; gap: clamp(.15rem,.5vw,.5rem); }
.at-nav-header :is(.at-primary a,.at-secondary summary,.at-language,.at-language-control) {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: .35rem .55rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  background: #172a45;
  color: #d9e7f9;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.at-nav-header [aria-current="page"] {
  border-color: #7cb4f5 !important;
  background: #284f83 !important;
  color: #fff !important;
}
.at-nav-header :is(a,summary,select):focus-visible { outline: 2px solid #9ddcff; outline-offset: 2px; }
.at-nav-header .at-language-control {
  position: relative;
  flex: 0 0 auto;
  gap: .45rem;
  white-space: nowrap;
}
.at-nav-header .at-language-control > .at-language {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100%;
  min-inline-size: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}
.at-language-control:has(select:focus-visible) { outline: 2px solid #9ddcff; outline-offset: 2px; }
.at-language-code { display: none; }
.at-language-arrow {
  width: .45rem;
  height: .45rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-.1rem) rotate(45deg);
}
.at-nav-header .at-primary [data-at-section="quiz"] {
  border-color:#567fae;
  background:linear-gradient(154deg,#365d8a,#23446c 60%,#192f4d);
  color:#eff7ff;
  box-shadow:inset 0 1px 0 #c4e8ff50,inset 0 -2px 0 #15284075;
}
.at-nav-header .at-primary [data-at-section="quiz"][aria-current="page"] {
  border-color:#99ceff!important;
  background:linear-gradient(154deg,#426fa0,#2b5384 60%,#1e3a60)!important;
}
.at-nav-header .at-primary [data-at-section="quiz"]:hover { border-color:#94c8fc; }
.at-nav-header .at-primary [data-at-section="quiz"]:active { box-shadow:inset 0 2px 5px #1023399c; }
.at-nav-header .at-primary [data-at-section="arena"],
.at-nav-header .at-primary [data-at-section="arena"][aria-current="page"] {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-color: #e6bd75 !important;
  background: linear-gradient(154deg,#f8dfa4,#ddb271 55%,#b78245) !important;
  color: #241709 !important;
  box-shadow: inset 0 1px 0 #fff9d582,inset 0 -2px 0 #7a4a2440;
}
.at-nav-header .at-primary [data-at-section="arena"]::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(114deg, transparent 21%, #fff4bf28 42%, #fff4bfad 50%, #fff4bf28 57%, transparent 77%);
  animation: at541-arena-reflection 5s infinite;
}
@keyframes at541-arena-reflection {
  0% { transform: translateX(-110%); opacity: 0; }
  7% { opacity: .8; }
  20% { opacity: .85; }
  28%, 100% { transform: translateX(110%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .at-nav-header .at-primary [data-at-section="arena"]::before { animation: none; opacity: 0; }
}
.at-weekly-reset { margin: .2rem 0 .55rem; color: #c7ddf5; font-size: .875rem; }
.at-weekly-entry { display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: .55rem; }
.at-weekly-entry > :first-child { overflow-wrap: anywhere; }
.at-weekly-entry > small { grid-column: 1 / -1; color: #c7ddf5; }
.at-weekly-entry-score { white-space: nowrap; }
.at-nav-header .at-short, .at-secondary { display: none; }
.at-nav-secondary-links {
  width: min(100% - 2rem, 96rem);
  margin: 1rem auto;
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1rem;
}
.at-nav-secondary-links a { color: #bad7f8; padding-block: .4rem; }
.at-pilot-info { background: #122039; color: #edf6ff; font: 1rem system-ui; }
.at-pilot-info main { width: min(100% - 2rem, 70rem); margin: 1.5rem auto; }
.at-pilot-info main a { color: #bad7f8; }

body[data-at-area] .arena-shell { max-width: 80rem; }
.arena-view { max-width: 76rem !important; }
body:has(#arenaWorkspace) .arena-view .arena-heading { padding: .65rem 1rem; }
.arena-view .arena-heading h1 { margin: 0; }
.arena-view .arena-heading p { margin-bottom: 0; }
.arena-view .arena-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
.arena-view #arenaWorkspace { align-items: start; }
.arena-view #activity > section + section { margin-top: 1.2rem; }
.arena-view #myDuelsRecord { color: #c6def7; margin-bottom: .45rem; }
.arena-view #profileProgress {
  max-width: 34rem;
  padding: .8rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid #4c6689;
  border-radius: .8rem;
  background: #172c4a;
}
.arena-view #profileProgress .v53-progress { font-size: .95rem; gap: .5rem; }
.arena-view #profileProgress progress { height: .65rem; }
.arena-view #leaderboard section + section { margin-top: 1rem; border-top: 1px solid #435779; padding-top: 1rem; }
.at-total-xp { color: #bfd8f4; font-variant-numeric: tabular-nums; }
#mobileCreate, #backFromCreate { display: none; }

@media (max-width: 1050px) {
  .at-nav-brand { display: none; }
}
@media (max-width: 740px) {
  .at-nav-header {
    gap: .15rem;
    width: auto !important;
    margin-inline: max(.3rem,env(safe-area-inset-left)) max(.3rem,env(safe-area-inset-right));
    min-height: 48px !important;
  }
  .at-primary { gap: .15rem; }
  .at-primary a { flex: 1; }
  .at-nav-header .at-primary :is(.at-long,.at-less) { display: none; }
  .at-nav-header .at-short { display: inline; }
  .at-nav-header :is(.at-primary a,.at-secondary summary,.at-language,.at-language-control) {
    padding-inline: .2rem;
    font-size: .75rem;
  }
  .at-nav-header .at-language { width: 52px; font-size: 1rem; padding-inline: .15rem; }
  .at-nav-header .at-language-control { width: 52px; padding-inline: .15rem; }
  .at-language-name { display: none; }
  .at-language-code { display: inline; }
  .at-secondary { display: block; position: relative; }
  .at-secondary summary { font-size: 1.1rem; cursor: pointer; list-style: none; }
  .at-secondary:has(.at-secondary-menu [aria-current="page"]) summary { border-color:#7cb4f5; background:#284f83; }
  .at-secondary summary::-webkit-details-marker { display: none; }
  .at-secondary-menu {
    position: absolute;
    z-index: 10;
    inset-block-start: calc(100% + .25rem);
    inset-inline-end: 0;
    width: min(15rem,77vw);
    padding: .45rem;
    background: #142640;
    border: 1px solid #5c7ca8;
    border-radius: .75rem;
  }
  .at-secondary-menu a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-inline: .6rem;
    color: #eef5ff;
    border-radius: .4rem;
  }
  .arena-view #notice:empty { display: none; }
}
@media (max-width: 650px) {
  body[data-page="home"] #guessDropdownPanel .aircraft-dropdown-list {
    block-size: clamp(88px,calc(100dvh - 560px),156px) !important;
  }
  body[data-page="home"] .left-panel .v52-wallet { gap: .1rem .6rem; }
}
@media (max-width: 899px) {
  #mobileCreate, #backFromCreate { display: inline-flex; justify-content:center; align-items:center; min-height:44px; }
  .arena-view #lobby .topline { display:grid; grid-template-columns:minmax(0,1fr) auto; }
  .arena-view #mobileCreate { grid-column:1 / -1; grid-row:2; }
}
.arena-view :is(#tabs,#rules,#profileProgress)[hidden] { display: none !important; }
.arena-view :is(#round,#result):not([hidden]) ~ details { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .at-nav-header :is(a,summary) { transition: background-color .16s ease, border-color .16s ease; }
  .at-xp-receipt { animation: at-xp-rise .3s ease-out both; }
  .v53-progress progress::-webkit-progress-value { transition: width .22s ease-out; }
  @keyframes at-xp-rise { from { opacity: .65; transform: translateY(.2em); } to { opacity: 1; transform: translateY(0); } }
}

#resultTitle small { display:block; margin-top:.45rem; font-weight:500; font-size:.95rem; color:#c6def7; }
@media (max-width: 740px) {
  html[lang="tr"] .at-nav-header .at-primary {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    min-width: 0;
  }
}

html[dir="rtl"] { font-family: system-ui, "Segoe UI", Tahoma, Arial, sans-serif; }
html[dir="rtl"] :is(.aircraft-dropdown-option, .finish-leaderboard, .v50-guide-section) { text-align: start; }
html[dir="rtl"] .v50-feature-list { padding-left: 0; padding-inline-start: 20px; }
html[dir="rtl"] :is(.v50-typecode, .coin-amount, #timer, .at-total-xp) {
  direction: ltr;
  unicode-bidi: isolate;
}
html[dir="rtl"] :is(.game h3, #at533-player-name, .v50-comparison-card h3) {
  unicode-bidi: plaintext;
}
html[dir="rtl"] :is(#search, #at533-search-input, input[type="search"]) { text-align: start; }
html[dir="rtl"] :is(.at-primary, .v50-comparison-grid, .game-meta) > * { min-inline-size: 0; }
@media (max-width: 740px) {
  html:is([lang="it"],[lang="ar"]) .at-nav-header .at-primary {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    min-inline-size: 0;
  }
}

/* Keep player controls clear of the device edges without fixing the page in place. */
html { scroll-padding-block-start: max(.75rem,env(safe-area-inset-top)); scroll-padding-block-end:max(1rem,env(safe-area-inset-bottom)); }
:is(main,.at-nav-header) :is(button,a,summary,input,textarea,select):focus-visible {
  outline:2px solid #a3dcff; outline-offset:2px;
}
#at57-retry { min-block-size:44px; max-inline-size:100%; margin-block:.25rem .8rem; }
#at57-retry[hidden] { display:none!important; }
.at-secondary-menu { max-inline-size:min(18rem,calc(100vw - 1.5rem)); overflow-wrap:anywhere; }
#at533-player-name,.at534-person bdi,#result .score-card strong { overflow-wrap:anywhere; }
@media (max-width:980px),(pointer:coarse) {
  :is(#guessInput,#search,#name,#stake,#at533-query,#recovery,textarea) { font-size:16px !important; scroll-margin-block:1rem; }
  :is(#lockAnswer,#at57-retry,#at533-submit,#at533-next,#passkeyLogin,#photoPlaceholder button,#roundPhotoStatus button) {
    min-block-size:44px;
  }
}
@media (max-width:650px) {
  body[data-page="home"] #photoFrame { block-size:clamp(105px,calc(100vh - 495px),250px)!important; }
  @supports(height:100svh) {
    body[data-page="home"] #photoFrame { block-size:clamp(105px,calc(100svh - 495px),250px)!important; }
  }
}
@media (orientation:landscape) and (max-height:480px) {
  body[data-page="home"] #photoFrame { block-size:clamp(85px,calc(100vh - 210px),210px)!important; }
  @supports(height:100svh) {
    body[data-page="home"] #photoFrame { block-size:clamp(85px,calc(100svh - 210px),210px)!important; }
  }
}
@media (max-height:480px) {
  :is(#at534-dialog,#at56-test-ad) { max-block-size:calc(100vh - 1.5rem); max-block-size:calc(100dvh - 1.5rem); overflow:auto; }
}

.at-secondary summary { min-inline-size:44px; min-block-size:44px; justify-content:center; }
.at-menu-icon { inline-size:18px; display:grid; gap:4px; }
.at-menu-icon i { block-size:2px; border-radius:2px; background:currentColor; }
#at571-privacy-summary { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem; margin-block:.75rem; }
#at571-privacy-summary[hidden] { display:none; }
#at571-cancel-dialog {
  color:#f1f6ff; background:#142745; border:1px solid #52739d; border-radius:1rem;
  max-inline-size:min(28rem,calc(100% - 2rem)); padding:1.25rem;
}
#at571-cancel-dialog::backdrop { background:#06101cba; }
#at571-cancel-dialog menu { display:flex; flex-wrap:wrap; gap:.6rem; padding:0; margin-block-end:0; }
#at571-cancel-dialog button,.at571-cancel { min-block-size:44px; }
#at571-cancel-dialog [data-forfeit] { background:#6b2b3b; color:#fff; border-color:#df8698; }
#at571-daily time { display:block; margin-block:.4rem; }
@media (max-width:740px), (orientation:landscape) and (max-width:1000px) and (max-height:510px) {
  body[data-page="home"]:has(#fourOptions:not([hidden])) .site-shell {
    padding-block-end:max(2rem,calc(env(safe-area-inset-bottom) + 1rem));
  }
  body[data-page="home"] #fourOptions:not([hidden]) {
    position:static!important; max-block-size:none!important; overflow:visible!important;
  }
  #fourOptions button { scroll-margin-block:1rem; }
}
@media (orientation:landscape) and (min-width:540px) and (max-width:1000px) and (max-height:510px) {
  body[data-page="home"] .site-shell {
    padding-inline:max(.4rem,env(safe-area-inset-left),env(safe-area-inset-right));
  }
  body[data-page="home"] #quizLayout:not([hidden]) {
    display:grid!important; grid-template-columns:minmax(0,1.08fr) minmax(0,1fr)!important;
    align-items:start; gap:clamp(.45rem,2vw,1rem);
  }
  body[data-page="home"] #quizLayout #photoFrame {
    block-size:clamp(145px,65vh,360px)!important;
    block-size:clamp(145px,65svh,360px)!important;
  }
  body[data-page="home"] #quizLayout #photoFrame #aircraftPhoto {
    inline-size:100%!important; block-size:100%!important; max-height:none!important; object-fit:contain;
  }
  body[data-page="home"] .main-heading { margin-block:.25rem!important; }
}

/* Keep the keyboard and browser chrome outside the document's controls. */
.site-header.at-nav-header,.at-nav-header {
  padding-block-start:max(.35rem,env(safe-area-inset-top))!important;
  padding-inline:max(.15rem,env(safe-area-inset-left),env(safe-area-inset-right))!important;
}
body[data-page="home"] .site-shell {
  padding-block-end:max(1rem,calc(env(safe-area-inset-bottom) + .75rem))!important;
}
body[data-page="home"] .question-top { min-block-size:44px; }
body[data-page="home"] #quizLayout { --at-quiz-box-gap:8px; }
@media (max-width:650px) {
  body[data-page="home"] #quizLayout { --at-quiz-box-gap:6px; row-gap:var(--at-quiz-box-gap); }
}
@media (min-width:651px) {
  body[data-page="home"] #quizLayout .left-panel .v52-wallet { margin-block-start:var(--at-quiz-box-gap); }
}
body[data-page="home"] .answer-card:has(.at572-choice:not([hidden])) {
  /* The outer edge includes the card's one-pixel border. */
  padding-block-start:calc(var(--at-quiz-box-gap) - 1px)!important;
  padding-inline-end:calc(var(--at-quiz-box-gap) - 1px)!important;
}
body[data-page="home"] .question-top:has(.at572-choice:not([hidden])) {
  margin-block-end:var(--at-quiz-box-gap);
}
body[data-page="home"] .answer-card:has(.at572-choice:not([hidden])) #guessForm { margin-block-start:0; }
body[data-page="home"] #v506-choice-status { order:1; }
body[data-page="home"] .question-top .at572-choice {
  inline-size:auto!important; min-inline-size:44px; min-block-size:44px;
  margin:0!important; padding:.25rem .65rem!important; max-inline-size:70%;
  border:1px solid #42688c; border-radius:.55rem; background:#193654; color:#edf6ff;
  font-size:clamp(.72rem,2.8vw,.86rem)!important; line-height:1.2; text-align:center;
  overflow-wrap:anywhere;
}
.at572-choice:not(:disabled):hover { background:#254c72; }
.at572-choice:focus-visible { outline:2px solid #a3dcff; outline-offset:2px; }
.at572-cancel-note { display:block; margin-block:.3rem; max-inline-size:32ch; }
#at572-profile-defaults { margin-block:.55rem; color:#b9d4ee; }

.question-top:has(.at572-choice:not([hidden])) #questionTag{display:none;}

.at541-choice-slot { display:contents; }
.at541-choice-state { display:none; }

body[data-quiz-mode="endless"] :is(.photo-meta,.score-row,#answerHeadline,#answerHelper,#scoringGuide,#answerTip) {
  display:none!important;
}

body[data-page="home"] .left-panel .v52-wallet { padding:.25rem .55rem; }
body[data-page="home"] .left-panel .v52-wallet .v53-meter-label {
  flex-wrap:wrap; gap:.15rem .55em; white-space:normal;
}
body[data-page="home"] .left-panel .v52-wallet .v53-meter-label span { overflow:visible; }
@media (min-width:651px) {
  body[data-page="home"] .left-panel .v52-wallet { padding:.45rem .65rem; }
}

body[data-page="home"] #aircraftGuessList [aria-selected="true"] {
  box-shadow:inset 0 0 0 1px #90c9ff;
}

body[data-quiz-mode="endless"] .question-top :is(#questionNumber,#questionTag) {
  position:absolute; inline-size:1px; block-size:1px; padding:0; margin:0;
  overflow:hidden; white-space:nowrap; clip-path:inset(50%);
}
body[data-page="home"][data-quiz-mode="endless"] .answer-card {
  padding:calc(var(--at-quiz-box-gap) - 1px)!important;
}
body[data-page="home"][data-quiz-mode="endless"] .question-top {
  position:relative; display:grid; grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:stretch; gap:var(--at-quiz-box-gap); margin-block:0 var(--at-quiz-box-gap);
}
body[data-page="home"][data-quiz-mode="endless"] .question-top :is(.score-card,.at541-choice-slot) {
  display:grid; min-inline-size:0; block-size:auto!important; min-block-size:52px!important;
  align-content:center; justify-items:center;
  padding:.25rem; border:1px solid #42688c; border-radius:.55rem;
  background:#172b45; text-align:center; overflow-wrap:anywhere;
}
body[data-page="home"][data-quiz-mode="endless"] .question-top .score-card strong {
  display:block; margin:0; font-size:1rem; line-height:1.25;
}
body[data-page="home"][data-quiz-mode="endless"] .question-top .score-label {
  font-size:.75rem; line-height:1.2; letter-spacing:.025em;
}
body[data-page="home"][data-quiz-mode="endless"] .question-top .at541-choice-slot {
  padding:0; grid-template-rows:1fr; justify-items:stretch;
}
body[data-page="home"][data-quiz-mode="endless"] .question-top .at572-choice {
  min-inline-size:0; min-block-size:44px!important; max-inline-size:none; inline-size:100%!important;
  display:grid; place-content:center; gap:.1rem;
  padding:.25rem!important; border:1px solid #6590bf; border-radius:calc(.55rem - 1px);
  background:linear-gradient(163deg,#315d8c,#254772 58%,#1c3758);
  box-shadow:inset 0 1px 0 #e2f4ff2e,inset 0 -2px 0 #0b1e3466;
  font-size:.78rem!important;
}
body[data-page="home"][data-quiz-mode="endless"] .at572-choice[hidden] { display:none!important; }
body[data-page="home"][data-quiz-mode="endless"] .at572-choice:not(:disabled):hover {
  background:linear-gradient(163deg,#3c6d9f,#285080 65%,#204266);
}
body[data-page="home"][data-quiz-mode="endless"] .at572-choice:not(:disabled):active {
  box-shadow:inset 0 2px 4px #0b1e3480;
}
body[data-page="home"][data-quiz-mode="endless"] .at572-choice:disabled { opacity:.64;cursor:default; }
body[data-quiz-mode="endless"] .at541-choice-label { font-weight:750; }
body[data-quiz-mode="endless"] .at541-choice-xp { color:#c7d9ef;font-size:.9em;font-weight:650; }
body:not([data-quiz-mode="endless"]) .at541-choice-label::after { content:" · ";white-space:pre; }
body[data-quiz-mode="endless"] .at572-choice[hidden]+.at541-choice-state {
  display:grid; place-content:center; padding:.25rem; font-size:.78rem; color:#c6ddf5;
}
body[data-page="home"][data-quiz-mode="endless"] :is(#guessForm,#fourOptions) { margin-block-start:0; }

@media (orientation:portrait) and (max-width:650px) {
  body[data-page="home"][data-quiz-mode="endless"] #guessDropdownPanel .aircraft-dropdown-list {
    height:auto!important;block-size:auto!important;max-height:calc(4 * 44px)!important;
  }
  body[data-page="home"][data-quiz-mode="endless"] #aircraftGuessList .aircraft-dropdown-option {
    white-space:normal;line-height:1.2!important;overflow-wrap:break-word;text-overflow:clip;
  }
}

@media (max-width:20rem) {
  body[data-page="home"][data-quiz-mode="endless"] .question-top { grid-template-columns:repeat(auto-fit,minmax(min(4.75rem,100%),1fr)); }
}
