.heaven-passport-trigger {
  position: fixed;
  z-index: 9300;
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  left: auto;
  bottom: auto;
  transform: none;
  display: grid;
  grid-template-columns: 27px auto;
  grid-template-rows: 18px 12px;
  align-items: center;
  min-width: 114px;
  min-height: 46px;
  padding: 4px 9px 4px 6px;
  border: 2px solid #ffc84c;
  border-right-color: #6f3513;
  border-bottom-color: #6f3513;
  color: #160b02;
  background: linear-gradient(#ffd46a, #e86a24 78%, #8b2b15);
  box-shadow: 0 0 0 2px #130703, inset 0 0 0 1px #fff1a884, 0 0 13px #ff9d35a3;
  font: 900 9px/1 "Courier New", monospace;
  letter-spacing: .06em;
  cursor: pointer;
  touch-action: manipulation;
}
.heaven-passport-trigger img { grid-row: 1 / 3; width: 31px; height: 35px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 0 4px #ffe769); }
.heaven-passport-trigger span { align-self: end; }
.heaven-passport-trigger b { align-self: start; color: #fff8c5; text-shadow: 1px 1px #631d0c; }
.heaven-passport-trigger b::after { content: " HALOS"; font-size: 6px; }

.heaven-passport-overlay { position: fixed; z-index: 15000; inset: 0; display: grid; place-items: center; padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); background: #000c; backdrop-filter: blur(5px); }
.heaven-passport-overlay[hidden] { display: none !important; }
.heaven-passport-card { width: min(680px, 100%); max-height: 100%; overflow: auto; border: 3px solid #f4cb61; border-right-color: #5a3a16; border-bottom-color: #5a3a16; padding: 18px; color: #e9fbff; background: linear-gradient(145deg, #111a2cf7, #05070df8 58%, #1b0d25f7); box-shadow: 0 0 0 4px #010207, inset 0 0 35px #41e8ff14, 0 0 32px #ffc84d40; font-family: "Courier New", monospace; image-rendering: pixelated; }
.heaven-passport-card > header { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #263d55; padding-bottom: 13px; }
.heaven-passport-card header small { color: #78f5ff; font-size: 9px; font-weight: 900; letter-spacing: .13em; }
.heaven-passport-card h2 { margin: 5px 0 0; color: #fff3a5; font-size: clamp(20px, 4vw, 30px); line-height: 1; letter-spacing: .08em; text-shadow: 2px 2px #943369, 0 0 9px #ffc842; }
.passport-close { width: 42px; min-width: 42px; height: 42px; border: 2px solid #8798b5; color: #fff0a1; background: linear-gradient(#293a5a, #090d1b); font-size: 24px; cursor: pointer; }
.passport-identity { display: grid; grid-template-columns: 80px 1fr auto; gap: 16px; align-items: center; padding: 17px 0; }
.passport-seal { display: grid; place-items: center; width: 76px; height: 76px; border: 2px solid #ffcf59; background: radial-gradient(circle, #322047, #070b18 69%); box-shadow: inset 0 0 18px #61eeff4a, 0 0 10px #ffcd4f5c; }
.passport-seal i { position: relative; width: 42px; height: 15px; border: 5px solid #ffe554; border-radius: 50%; box-shadow: 0 0 0 3px #111, 0 0 10px #fff165; transform: rotate(-8deg); }
.passport-identity label { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.passport-identity label > span { grid-column: 1 / 3; color: #8ef7ff; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.passport-name { min-width: 0; height: 42px; border: 2px inset #8ca2c4; padding: 0 10px; color: #fff; background: #02050d; font: 900 16px "Courier New", monospace; text-transform: uppercase; outline: none; }
.passport-name:focus { box-shadow: 0 0 9px #5eefff; }
.passport-save { min-width: 66px; border: 2px solid #ffc648; color: #1a0b02; background: linear-gradient(#ffe27c, #ee7a2b); font-size: 10px; font-weight: 900; cursor: pointer; }
.passport-halos { min-width: 94px; text-align: right; }
.passport-halos small, .passport-halos span { display: block; color: #ffdc70; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.passport-halos strong { display: block; color: #fff4aa; font-size: 25px; text-shadow: 0 0 8px #ffc832; }
.passport-gender { margin: 0 0 12px; border: 2px solid #334967; padding: 10px; background: #020611b8; box-shadow: inset 0 0 16px #57efff12; }
.passport-gender > div { display: flex; gap: 8px; }
.passport-gender button { flex: 1; min-height: 44px; border: 2px solid #667995; color: #b9d3e7; background: linear-gradient(#1c2d4d,#080c19); font-weight: 900; cursor: pointer; }
.passport-gender button i { margin-right: 7px; color: #8cf7ff; font-style: normal; font-size: 17px; }
.passport-gender button.is-selected { border-color: #ffe06a; color: #fff6b2; background: linear-gradient(#41306d,#142b56); box-shadow: inset 0 0 12px #62f2ff40,0 0 8px #ffda5850; }
.passport-gender p { margin: 7px 0 0; color: #7f9db5; font-size: 7px; }
.passport-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; }
.heaven-passport-card h3 { margin: 0 0 8px; border-bottom: 1px solid #2b465d; padding-bottom: 6px; color: #6cf3ff; font-size: 10px; letter-spacing: .13em; }
.passport-grid > section, .passport-scores-section { border: 2px solid #283d56; padding: 11px; background: #020611a8; box-shadow: inset 0 0 14px #4beaff0d; }
.passport-badges { display: grid; gap: 6px; }
.passport-badges article { display: grid; grid-template-columns: 32px 1fr; gap: 8px; align-items: center; min-height: 40px; border: 1px solid #27384c; padding: 5px; background: #090d18; }
.passport-badges article > i { display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid #4b5668; color: #747b87; background: #11151e; font-style: normal; font-size: 18px; }
.passport-badges article b, .passport-badges article small { display: block; }
.passport-badges article b { color: #a7b6c6; font-size: 9px; }
.passport-badges article small { margin-top: 3px; color: #738398; font-size: 7px; line-height: 1.25; }
.passport-badges article.is-unlocked { border-color: #957335; box-shadow: inset 0 0 10px #ffca3221; }
.passport-badges article.is-unlocked > i { border-color: #ffd45c; color: #fff4a0; background: #392313; box-shadow: 0 0 8px #ffc6377a; }
.passport-badges article.is-unlocked b { color: #fff1a1; }
.passport-badges article.is-unlocked small { color: #71f5b0; }
.passport-places { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.passport-places li { display: flex; align-items: center; gap: 8px; color: #667688; font-size: 8px; font-weight: 900; }
.passport-places i { width: 9px; height: 9px; border: 1px solid #526070; background: #111723; }
.passport-places li.is-found { color: #d8fbff; }
.passport-places li.is-found i { border-color: #77f4ff; background: #51dfef; box-shadow: 0 0 5px #53edff; }
.passport-scores-section { margin-top: 12px; }
.passport-scores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.passport-scores > div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed #2e485c; padding: 5px 0; color: #cceef5; font-size: 8px; }
.passport-scores b { color: #fff078; }
.passport-empty { grid-column: 1 / -1; margin: 4px 0; color: #74889b; font-size: 8px; line-height: 1.5; }
.heaven-passport-card > footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 13px; border-top: 1px solid #263d55; padding-top: 9px; color: #8298ac; font-size: 7px; font-weight: 900; letter-spacing: .08em; }
.heaven-passport-card > footer b { color: #72f59a; }

@media (max-width: 620px) {
  .heaven-passport-trigger { top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); bottom: auto; min-width: 86px; padding-right:6px; }
  .heaven-passport-trigger span { font-size: 8px; }
  .heaven-passport-card { padding: 13px; }
  .passport-identity { grid-template-columns: 58px 1fr; gap: 10px; }
  .passport-seal { width: 56px; height: 56px; }
  .passport-seal i { width: 32px; height: 11px; border-width: 4px; }
  .passport-halos { grid-column: 1 / 3; display: flex; align-items: baseline; justify-content: flex-end; gap: 7px; text-align: right; }
  .passport-halos small, .passport-halos span { display: inline; }
  .passport-grid { grid-template-columns: 1fr; }
  .passport-scores { grid-template-columns: 1fr; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .heaven-passport-trigger { top: max(6px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); bottom: auto; min-height: 38px; }
  .heaven-passport-card { width: min(820px, 100%); padding: 11px; }
  .passport-identity { grid-template-columns: 58px 1fr auto; padding: 10px 0; }
  .passport-seal { width: 54px; height: 54px; }
  .passport-grid { grid-template-columns: 1.25fr 1fr; }
}

/* V12 Y2K passport shell */
.heaven-passport-trigger { border-color:#69efff; border-right-color:#1a2947; border-bottom-color:#1a2947; color:#eaffff; background:linear-gradient(145deg,#263e67,#11152d 58%,#431d55); box-shadow:0 0 0 2px #02040b,inset 0 0 0 1px #ffffff2b,0 0 14px #63edff78; }
.heaven-passport-trigger b { color:#ffe980; text-shadow:0 0 5px #ffb83d; }
.heaven-passport-card { border-color:#6cf2ff; border-right-color:#26325a; border-bottom-color:#26325a; background:linear-gradient(145deg,#192f55f7,#070a18f8 55%,#3a134cf7); box-shadow:0 0 0 4px #010207,inset 0 0 40px #48edff1d,0 0 36px #b857ff50; clip-path:polygon(0 10px,10px 10px,10px 0,calc(100% - 10px) 0,calc(100% - 10px) 10px,100% 10px,100% calc(100% - 10px),calc(100% - 10px) calc(100% - 10px),calc(100% - 10px) 100%,10px 100%,10px calc(100% - 10px),0 calc(100% - 10px)); }
.passport-seal { background:radial-gradient(circle,#324b79,#090d1b 68%); border-color:#6cf2ff; }
.passport-seal::before { content:""; width:64px; height:64px; background:url("assets/passport-black-leather-v1.webp") center/contain no-repeat; filter:drop-shadow(0 0 5px #ffe86a); }
.passport-seal i { display:none; }

/* V13 hard size guards prevent stale-layout sprite blowouts; the card keeps a readable Y2K terminal skin. */
.heaven-passport-trigger {
  width:114px;
  max-width:114px;
  overflow:hidden;
  contain:layout paint;
  font-family:"Lucida Console","Courier New",monospace;
  clip-path:polygon(0 5px,5px 5px,5px 0,calc(100% - 5px) 0,calc(100% - 5px) 5px,100% 5px,100% calc(100% - 5px),calc(100% - 5px) calc(100% - 5px),calc(100% - 5px) 100%,5px 100%,5px calc(100% - 5px),0 calc(100% - 5px));
}
.heaven-passport-trigger img {
  display:block !important;
  width:31px !important;
  height:35px !important;
  min-width:0 !important;
  max-width:31px !important;
  min-height:0 !important;
  max-height:35px !important;
  overflow:hidden;
}
.heaven-passport-card { position:relative; font-family:"Lucida Console","Courier New",monospace; }
.heaven-passport-card::before { content:"ID/OS 1999"; position:absolute; z-index:0; right:66px; top:9px; color:#ff72d4; font-size:6px; letter-spacing:.14em; text-shadow:0 0 5px #ff58d0; pointer-events:none; }
.heaven-passport-card::after { content:""; position:absolute; z-index:0; inset:0; opacity:.08; background:repeating-linear-gradient(0deg,transparent 0 4px,#6df4ff 5px); pointer-events:none; }
.heaven-passport-card > * { position:relative; z-index:1; }
.passport-grid > section,.passport-scores-section,.passport-gender { border-color:#3d6a8d; background:linear-gradient(145deg,#071328e8,#030712e8); }
.passport-badges article { background:linear-gradient(90deg,#0b1425,#070916); }
.passport-name { font-family:"Lucida Console","Courier New",monospace; font-size:16px; }
@media (max-width:620px) {
  .heaven-passport-trigger { width:86px; max-width:86px; }
  .heaven-passport-trigger img { width:25px!important; height:29px!important; max-width:25px!important; max-height:29px!important; }
}

/* V15 room HUD: the passport docks beneath KINGDOM without covering game controls. */
body[data-room] .heaven-passport-trigger {
  top:calc(max(10px,env(safe-area-inset-top)) + 44px);
  right:auto;
  left:max(10px,env(safe-area-inset-left));
  width:114px;
  max-width:114px;
}
@media (max-width:620px) {
  body[data-room] .heaven-passport-trigger {
    top:calc(max(8px,env(safe-area-inset-top)) + 44px);
    right:auto;
    left:max(8px,env(safe-area-inset-left));
    width:84px;
    max-width:84px;
    min-height:38px;
    height:38px;
    grid-template-columns:22px 1fr;
    grid-template-rows:15px 10px;
    padding:2px 4px;
  }
  body[data-room] .heaven-passport-trigger img { width:23px!important; height:27px!important; max-width:23px!important; max-height:27px!important; }
  body[data-room] .heaven-passport-trigger span,
  body[data-room] .heaven-passport-trigger b { font-size:7px; letter-spacing:0; }
  body[data-room] .heaven-passport-trigger b::after { font-size:4px; }
}
@media (max-height:560px) and (orientation:landscape) {
  body[data-room] .heaven-passport-trigger { top:calc(max(6px,env(safe-area-inset-top)) + 44px); }
}

/* V18: Passport and Kingdom are equal-size navigation controls. */
body[data-room] .heaven-passport-trigger { width:114px; max-width:114px; min-height:46px; height:46px; }
@media (max-width:620px) {
  body[data-room] .heaven-passport-trigger {
    top:calc(max(8px,env(safe-area-inset-top)) + 44px);
    width:96px;
    max-width:96px;
    min-height:42px;
    height:42px;
  }
}

/* V22 CRED$ coin identity in the passport HUD and bank card. */
.passport-creds-coin {
  display:inline-block;
  width:16px;
  height:16px;
  flex:0 0 16px;
  background:url("assets/casino-creds-coin-v19.png") center/contain no-repeat;
  image-rendering:pixelated;
  filter:drop-shadow(0 0 4px #ffd54f);
}
.heaven-passport-trigger > .passport-creds-coin {
  position:absolute;
  right:3px;
  bottom:3px;
  width:12px;
  height:12px;
  opacity:.96;
}
.passport-halos span { display:flex;align-items:center;justify-content:flex-end;gap:4px; }
.passport-halos span .passport-creds-coin { width:18px;height:18px; }
.heaven-passport-trigger b::after { content:" CRED$"; }
.passport-bank-credit { display:flex!important;align-items:center;justify-content:flex-end;gap:4px; }
.passport-bank-credit .passport-creds-coin { width:1.15em;height:1.15em;flex-basis:1.15em; }

/* V36: compact home-page passport on phones; room passports keep their tuned size. */
@media (max-width:700px), (pointer:coarse) {
  body:not([data-room]) .heaven-passport-trigger {
    width:76px;
    max-width:76px;
    min-width:76px;
    min-height:36px;
    height:36px;
    grid-template-columns:21px 1fr;
    grid-template-rows:14px 10px;
    padding:2px 4px;
  }
  body:not([data-room]) .heaven-passport-trigger img {
    width:21px!important;
    height:25px!important;
    max-width:21px!important;
    max-height:25px!important;
  }
  body:not([data-room]) .heaven-passport-trigger span,
  body:not([data-room]) .heaven-passport-trigger b { font-size:6px; letter-spacing:0; }
  body:not([data-room]) .heaven-passport-trigger b::after { font-size:4px; }
  body:not([data-room]) .heaven-passport-trigger > .passport-creds-coin { width:10px; height:10px; }
}
