#world-dialog {
  width: min(450px, calc(100% - 16px));
  max-height: calc(var(--visible-height, 100dvh) - 16px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #241a12;
  color: var(--ink);
  box-shadow: 0 16px 52px #1607038c;
}
#world-dialog[open] { display: flex; flex-direction: column; }
#world-dialog::backdrop { background: #160b06a6; }
.world-head {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
}
.world-head h2 { margin: 0; font-size: clamp(18px, 4vw, 25px); }
#world-close { min-width: 44px; min-height: 44px; }
#world-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 14px 12px; }
#world-scroll a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); }
#world-scroll :is(p, #world-more):empty { display: none; }
#world-status, #world-me, #world-submit-status, #world-more { margin: 8px 0; font-size: .88rem; }
#world-more button { min-height: 44px; }
#world-list { list-style: none; margin: 0; padding: 0; }
#world-list li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding-block: 5px;
  border-bottom: 1px solid var(--line);
}
#world-list bdi { overflow-wrap: anywhere; }
#world-list strong { text-align: end; font-variant-numeric: tabular-nums; }
.world-elapsed { display: block; color: var(--muted); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.world-position { display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.featured .world-position { min-height: 28px; border-radius: 50%; background: #644822; color: #fff3d5; }
.is-me { background: #453019; }
#score-form { margin-block: 8px; text-align: start; font-size: .82rem; }
.submit-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; margin-top: 3px; }
#nickname {
  flex: 1 1 9ch;
  min-width: 0;
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #18100b;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
#nickname:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#submit-button, #world-start { min-height: 44px; }
#world-start { display: block; width: 100%; }

.world-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline: 8px;
  color: var(--accent);
  font-size: 13px;
}
#ready-panel .actions, .result-footer .actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
}
#ready-panel .actions > button, .result-footer .actions > button {
  min-width: 0;
  min-height: 44px;
  padding: 4px 8px;
  overflow-wrap: anywhere;
  line-height: 1.15;
}
#rank-start-status:not(:empty) { color: var(--accent); }
#result-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.result-heading, .result-footer { flex: none; }
.result-body { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.panel.result .result-footer .actions { position: static; margin: 8px 0 0; padding: 0; background: none; }
@media (max-width: 640px) {
  .world-button span:last-child { display: none; }
}

.secondary-button {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff12;
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
  touch-action: manipulation;
}
