/* Shared island controls, using the existing parchment panels and pixel type. */
#outlinks .x-link[hidden], #outlinks .ca-btn[hidden], #feed-new[hidden], #net-status[hidden] { display: none; }
#world-counts { margin-top: 5px; font-size: 16px; }
#island-nav { position: fixed; left: 14px; top: 148px; display: flex; padding: 5px; gap: 3px; z-index: 3; }
#island-nav button, .island-tabs button, .island-card-actions button, #feed-new, .island-link {
  border: 0; border-radius: 3px; padding: 3px 6px; color: var(--ink); background: transparent; white-space: nowrap;
}
#island-nav button:hover, .island-tabs button:hover, .island-card-actions button:hover, .island-link:hover,
#feed-new:hover { background: var(--hover); }
.island-tabs button[aria-pressed="true"] { background: var(--tag); color: #fbecc9; }
#mobile-rank-btn, #mobile-feed-btn { display: none; }
#net-status { display: flex; gap: 8px; justify-content: space-between; margin-top: 6px; padding: 5px 10px; font-size: 16px; }
.island-link { text-decoration: underline; color: var(--accent); }
#top { display: flex; flex-direction: column; min-height: 0; max-height: min(50vh, 420px); }
#board { overflow-y: auto; min-height: 0; scrollbar-width: thin; }
#board button { grid-template-columns: 22px 8px 1fr auto; }
#board button small, .island-ranks button small { display: block; color: var(--muted); font-size: 14px; }
#season-clock { padding: 5px 0 0; margin-top: 6px; border-top: 2px solid var(--line); }
.island-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.island-tabs button { min-height: 25px; font-size: 15px; }
#feed { position: relative; overflow-y: auto; scrollbar-width: thin; -webkit-mask-image: none; mask-image: none; overflow-anchor: none; }
.feed-locate { text-align: left; padding: 0; color: inherit; background: none; border: 0; white-space: normal; }
.feed-locate:hover { text-decoration: underline; color: var(--ink); }
#feed-new { align-self: start; background: var(--on); color: var(--title); }
#feed .island-link { font-size: 15px; }
.island-empty { margin: 7px 3px; }
.island-back .island-modal { width: min(520px, 100%); }
.island-list-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-bottom: 2px solid var(--line); padding: 7px 0; }
.island-modal .island-list-row .wlt-btn { flex: none; min-height: 30px; padding: 3px 8px; }
.island-detail { padding: 7px; border: 2px solid var(--line); border-radius: 4px; }
.island-detail + .island-detail { margin-top: 6px; }
.island-detail summary, .gear-detail summary { cursor: pointer; }
.island-detail summary > span { margin-left: 9px; }
.island-detail p + p { margin-top: 4px; }
.island-detail[open] summary { margin-bottom: 6px; }
.island-world-content > p, .island-season-content > p { margin-bottom: 6px; }
.island-card-actions { display: flex; gap: 5px; margin-top: 4px; }
.island-card-actions button, .gear-detail { background: var(--track); }
.island-card-actions button:disabled { opacity: .72; cursor: default; }
#c-season { margin-top: 7px; }
.gear-detail { padding: 0 3px 1px; border-radius: 3px; }
.gear-detail + .gear-detail { margin-top: 3px; }
.gear-detail summary::-webkit-details-marker { display: none; }
.gear-detail summary em::before { content: "+ "; }
.gear-detail[open] summary em::before { content: "− "; }
.gear-detail > p { font-size: 16px; }
.island-ranks button.rank-row { display: grid; grid-template-columns: 32px 10px 1fr auto; width: 100%; align-items: center; gap: 6px; background: transparent; text-align: left; padding: 4px 5px; border: 0; }
.island-ranks button:hover { background: var(--hover); }
.island-ranks button em { color: var(--accent); }
body.clean #island-nav { display: none; }
:where(#island-nav, #top, #live, #card) button:focus-visible, .island-detail summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (min-width: 821px) and (max-width: 1140px) { #island-nav { top: 178px; } }
@media (max-width: 820px) {
  #island-nav { top: auto; left: 8px; right: auto; bottom: calc(8px + env(safe-area-inset-bottom)); max-width: calc(100vw - 16px); flex-wrap: wrap; }
  #island-nav button { font-size: 15px; min-height: 32px; }
  #mobile-rank-btn, #mobile-feed-btn { display: inline-block; }
  #world-counts, #board-tabs, #right #top { display: none; }
  #right { bottom: calc(56px + env(safe-area-inset-bottom)); }
  #right #live { display: none; }
  body.show-feed:not(.has-card) #right #live { display: flex; max-height: min(42vh, 340px); }
  #card { bottom: calc(58px + env(safe-area-inset-bottom)); max-height: min(54dvh, 510px); z-index: 4; }
  .island-back .island-modal { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Local island saves use the same parchment controls as the agent drawers. */
.island-save-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.island-import { display: grid; justify-items: start; gap: 6px; }
.island-import[hidden] { display: none; }
.island-import textarea { height: auto; min-height: 80px; resize: vertical; padding: 6px 8px; }
.island-import input[type="file"] { max-width: 100%; }
.save-error { color: var(--hurt); }
.island-honors { color: var(--accent); }
@media (max-width: 820px) {
  #right { bottom: calc(var(--island-nav-offset, 56px) + env(safe-area-inset-bottom)); }
  #card { bottom: calc(var(--island-nav-offset, 58px) + env(safe-area-inset-bottom)); }
}
@media (max-width: 355px) {
  #island-nav { gap: 1px; }
  #island-nav button { padding-left: 4px; padding-right: 4px; }
}
