/* The island shipyard: existing portraits, real captain upgrades and shared panel controls. */
#up-open { display: none !important; }
#up-panel.ui-panel {
  width: min(880px, calc(100vw - 32px)); max-width: 880px;
  max-height: calc(100dvh - 32px); border: 1px solid #6d828c; border-radius: 22px;
  color: #eff2e8; background: linear-gradient(135deg,#213c49,#10232f 48%,#0b1923);
  box-shadow: 0 24px 90px #0009, inset 0 0 32px #60899b19;
}
#up-top.ui-panel-header { padding: 20px 28px 15px; background: transparent; border-bottom: 1px solid #8099a130; }
#up-title { margin: 0 40px 10px 0; color: #f6f1dc; text-transform: uppercase; font-size: var(--ui-heading-size); letter-spacing: .04em; }
#up-summary { color: #b8c9cf; font-size: var(--ui-small-size); }
#up-summary .pts { background: #f8cf65; color: #282413; padding: 4px 10px; }
#up-xp { max-width: 340px; height: 4px; }
#up-xp i { background: #f8cf65; }
#up-body.ui-panel-body { padding: 0 22px 18px; }
.up-showcase { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; min-height: 265px; }
.up-stage { position: relative; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; min-width: 0;
  background: radial-gradient(ellipse at 50% 70%,#52929c50,transparent 67%); }
.up-stage-label { position: absolute; top: 16px; left: 0; right: 0; text-align: center; color: #8caab3; font-size: var(--ui-caption-size); letter-spacing: .18em; }
.up-stage > button { width: 44px; height: 52px; border: 0; background: transparent; color: #f8efcb; font-size: 48px; cursor: pointer; z-index: 1; }
.up-pedestal { position: relative; align-self: stretch; display: grid; place-items: center; padding: 20px 0 12px; min-width: 0; }
.up-pedestal::before { content: ''; position: absolute; width: 100%; height: 26%; bottom: 15px; border-radius: 50%; background: radial-gradient(ellipse at 50% 15%,#4e8491,#294654 65%); border-bottom: 14px solid #172e3d; box-shadow: 0 16px 14px #0004,inset 0 2px 0 #aac4c675; }
#up-portrait { position: relative; width: 120%; max-width: 320px; height: 240px; object-fit: contain; filter: drop-shadow(0 10px 8px #0005); }
.up-details { display: flex; flex-direction: column; justify-content: center; padding: 20px 0; min-width: 0; }
#up-ship-state { color: #adc4cc; font-size: var(--ui-caption-size); font-weight: 700; letter-spacing: .13em; }
#up-ship-name { margin: 5px 0 20px; font-size: var(--ui-display-size); color: #fff9e6; }
.up-stats { display: grid; grid-template-columns: 82px 1fr 54px; gap: 12px 12px; align-items: center; font-size: var(--ui-text-size); }
.up-stats > i { position: relative; height: 10px; overflow: hidden; border-radius: 3px; background: #52616b65; }
.up-stats > i::before { content: ''; display: block; width: var(--fill,0%); height: 100%; background: linear-gradient(#ffe994,#efbe4c); }
.up-stats > i::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg,transparent 0 calc(20% - 3px),#122631 calc(20% - 3px) 20%); }
.up-stats > small { color: #c4d0d2; text-align: right; font-size: var(--ui-caption-size); font-variant-numeric: tabular-nums; }
.up-base-note { color: #8ca6b1; font-size: var(--ui-caption-size); margin-top: 9px; }
#up-switch { margin-top: 14px; min-height: 44px; border: 1px solid #8098a3; border-radius: 9px; background: #28434f; color: #eee7ca; font: inherit; cursor: pointer; }
#up-fleet { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; margin: 2px 0 18px; }
.up-ship { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 107px; padding: 4px 3px 8px; border: 2px solid #596b75; border-radius: 12px; background: linear-gradient(150deg,#203a47,#122430); color: #c8d4d7; font: inherit; cursor: pointer; }
.up-ship img { width: 100%; height: 76px; object-fit: contain; }
.up-ship > span { font-size: var(--ui-caption-size); white-space: nowrap; }
.up-ship small { position: absolute; top: 5px; right: 5px; font-size: var(--ui-caption-size); background: #10202fdd; padding: 2px 4px; border-radius: 4px; }
.up-ship[aria-pressed=true] { border-color: #ffdb70; box-shadow: inset 0 0 15px #ffe07c14,0 0 0 1px #ffdb7033; color: #ffdf83; }
.up-refit { border-top: 1px solid #6b849450; padding-top: 15px; }
#up-options { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.up-option { flex: 1 1 auto; min-height: 44px; padding: 8px; font: inherit; font-size: var(--ui-small-size); border: 1px solid #536977; border-radius: 8px; background: #1c333f; color: #bfd0d5; cursor: pointer; }
.up-option[aria-pressed=true] { border-color: #e6bc5c; color: #ffe296; background: #5a502e55; }
.up-purchase { display: grid; grid-template-columns: 1fr minmax(200px,40%); align-items: center; gap: 20px; }
#up-now { margin: 0 0 5px; color: #b9cbd1; font-size: var(--ui-label-size); }
#up-gain { margin: 0; color: #f9df9c; font-size: var(--ui-text-size); }
#up-spend { min-height: 50px; padding: 10px 20px; border: 1px solid #fff0a9; border-radius: 28px; background: linear-gradient(#ffde7b,#f5c64f); box-shadow: inset 0 2px 1px #fff4bd66,0 4px 12px #0003; color: #242718; font: inherit; font-weight: 800; cursor: pointer; }
#up-note { color: #94adb6; font-size: var(--ui-caption-size); line-height: 1.5; margin: 12px 0 0; }
#up-panel button:disabled { opacity: .5; cursor: default; }
#up-panel button:focus-visible { outline: 3px solid #fff0ae; outline-offset: 3px; }
@media (max-width: 600px) {
  #up-panel.ui-panel { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 16px; }
  #up-top.ui-panel-header { padding: 15px 16px 12px; }
  #up-title { font-size: var(--ui-title-size); }
  #up-total { display: none; }
  #up-body.ui-panel-body { padding: 0 12px 16px; }
  .up-showcase { grid-template-columns: 1fr; gap: 0; }
  .up-stage { min-height: 205px; grid-template-columns: 44px 1fr 44px; }
  .up-pedestal { width: 190px; justify-self: center; }
  #up-portrait { height: 195px; }
  .up-details { padding: 8px 6px 18px; }
  #up-ship-name { font-size: var(--ui-heading-size); margin-bottom: 12px; }
  .up-stats { gap: 9px 12px; }
  #up-fleet { display: flex; overflow-x: auto; padding: 3px 2px 8px; scroll-snap-type: x proximity; }
  .up-ship { flex: 0 0 82px; scroll-snap-align: center; }
  .up-purchase { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-height: 500px) and (min-width: 601px) {
  .up-showcase { min-height: 205px; }
  #up-portrait { height: 190px; }
  .up-details { padding: 14px 0; }
  .up-ship { min-height: 88px; }
  .up-ship img { height: 58px; }
}
/* Local theme tokens and overrides for the shared panel's legacy !important rules. */
#up-panel.ui-panel {
  --ui-panel-width: 880px; --ui-navy: #10232f; --ui-raised: #203946; --ui-surface: #2b4653;
  --ui-border: #617783; --ui-gold: #f7d16e; --ui-text: #eeeede;
  --ui-radius: 22px; --ui-control-radius: 10px; --ui-panel-wash: #10232fdd;
  --ui-heading-font: var(--ui-font);
  height: max-content; width: min(880px,calc(100vw - 32px)) !important;
  max-height: calc(100dvh - 32px - var(--ui-notice-space,0px)) !important;
  background: linear-gradient(135deg,#213c49,#10232f 48%,#0b1923) !important;
}
#up-top.ui-panel-header { background: transparent !important; padding: 20px 24px 14px !important; }
#up-title { color: #f6f1dc !important; font-size: var(--ui-heading-size) !important; }
#up-body.ui-panel-body { padding: 0 22px 18px !important; }
#up-panel .up-stage > button { padding: 0 !important; background: transparent !important; border-color: transparent !important; font-size: 46px !important; font-weight: 400 !important; }
#up-panel .up-ship { padding: 4px 3px 8px !important; background: linear-gradient(150deg,#203a47,#122430) !important; border: 2px solid #596b75 !important; border-radius: 12px !important; }
#up-panel .up-ship[aria-pressed=true] { border-color: #ffdb70 !important; color: #ffdf83 !important; }
#up-panel .up-option { font-size: var(--ui-small-size) !important; padding: 8px !important; }
#up-panel .up-option[aria-pressed=true] { background: #5a502e55 !important; border-color: #e6bc5c !important; color: #ffe296 !important; }
#up-panel #up-spend { min-height: 50px !important; border-radius: 28px !important; border-color: #fff0a9 !important; background: linear-gradient(#ffde7b,#f5c64f) !important; color: #242718 !important; font-size: var(--ui-title-size) !important; }
@media (max-width:600px) {
  #up-panel.ui-panel { width: calc(100vw - 12px) !important; max-height: calc(100dvh - 12px - var(--ui-notice-space,0px)) !important; --ui-radius: 16px; }
  #up-top.ui-panel-header { padding: 14px 14px 12px !important; }
  #up-title { font-size: var(--ui-title-size) !important; }
  #up-body.ui-panel-body { padding: 0 12px 16px !important; }
}

@media (max-height:500px) {
  #up-panel.ui-panel { max-height: calc(100dvh - 12px - var(--ui-notice-space,0px)) !important; }
}
