
* { box-sizing: border-box; }

body {
  margin: 0;
  font: 13px/1.4 monospace;
}

[v-cloak] { display: none; }


.band {
  border: 1px solid;
  padding: 4px 6px;
}

#site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
}

.head-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

#site-header .box {
  border: 1px solid;
  padding: 4px 6px;
}

#header-actions { justify-content: flex-end; }

#logo { text-align: center; }

#header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border: 0;
}

#header-actions button.active { outline: 2px solid; }

#rerolls-btn { font: inherit; white-space: nowrap; }


#menu-btn {
  font: inherit;
  font-size: 1.5em;
  line-height: 1;
  padding: 2px 10px;
  cursor: pointer;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(0, 0, 0, 0.35);
}

.drawer {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(280px, 85vw);
  overflow-y: auto;
  padding: 6px;
  border-right: 1px solid;
  background: Canvas;
  color: CanvasText;
}

.drawer-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 1.1em;
  border-bottom: 1px solid;
  padding-bottom: 4px;
}

.drawer-item {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 12px 10px 18px;
  border: 1px solid;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.drawer-item.submit { border-width: 2px; }
.drawer-item.active { outline: 2px solid; }
.drawer-item:hover,
.drawer-item:focus-visible { outline: 2px solid; }

.drawer-item small {
  position: absolute;
  right: 6px;
  bottom: 3px;
}

#profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ava-mini {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 4px;
  border: 1px solid;
  object-fit: cover;
}


#site-header { position: relative; }

.notify-panel {
  position: absolute;
  z-index: 20;
  top: 100%;
  right: 0;
  width: min(340px, calc(100vw - 12px));
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid;
  background: Canvas;
  color: CanvasText;
  padding: 6px;
}

.notify-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notify-list li {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid;
  padding: 4px 0;
}

.notify-list li:last-child { border-bottom: 0; }

.notify-list li { font-weight: bold; }
.notify-list li small { font-weight: normal; }


#main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  border: 1px solid;
}

#main-nav button { padding: 6px 10px; }


#cycle-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 6px;
  border: 1px solid;
}

.cycle-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.cycle-steps li {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid;
  white-space: nowrap;
}

.cycle-steps li b {
  display: inline-grid;
  place-content: center;
  width: 1.5em;
  height: 1.5em;
  border: 1px solid;
  border-radius: 50%;
  font-size: 0.8em;
}

.cycle-now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.cycle-error { flex-basis: 100%; margin: 0; }


main {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
  gap: 6px;
  padding: 6px;
  align-items: start;
}

body.view-main { --map-frame: 720px; }

body.view-main main {
  min-height: calc(100vh - var(--chrome, 300px));
  min-height: calc(100dvh - var(--chrome, 300px));
  align-items: stretch;
}

body.view-main main > .panel,
body.view-main #side-column > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

body.view-main #map-panel .map-wrap {
  flex: 0 0 auto;
  height: var(--map-frame);
}

body.view-main #participants-panel .leaderboard {
  max-height: var(--map-frame);
}

@media (max-width: 800px) {
  main { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  #site-header {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  #logo { grid-row: 1; width: 100%; }
  .head-left { grid-row: 2; }
  #header-actions { grid-row: 3; justify-content: center; }
}

.panel {
  border: 1px solid;
  padding: 6px;
  min-width: 0;
}

.panel-title {
  margin: 0 0 6px;
  font-size: 1em;
  border-bottom: 1px solid;
  padding-bottom: 4px;
}

.placeholder {
  border: 1px dashed;
  padding: 20px;
  text-align: center;
}

.placeholder.tall { padding: 80px 20px; }

.hint { opacity: 0.7; }


#side-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

#side-column > #participants-panel { flex: 1 1 auto; min-height: 0; }

.leaderboard {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.leaderboard li {
  border: 1px solid;
  margin-bottom: 4px;
}

.lb-row {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.leaderboard .who { flex: 1; min-width: 0; }
.leaderboard .avatar { border: 1px solid; padding: 8px; }

.lb-row.showcased::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--showcase) center / 100% 100% no-repeat;
  pointer-events: none;
}



#events-strip {
  flex: 1 1 150px;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
}

#events-strip .hint {
  margin: 0;
  padding: 0 8px;
  font-size: 0.85em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.feed-line {
  display: flex;
  width: max-content;
  align-items: baseline;
  list-style: none;
  margin: 0;
  padding: 0;
  animation: feed-scroll var(--feed-time, 40s) linear infinite;
}

.feed:hover .feed-line,
.feed:focus-within .feed-line { animation-play-state: paused; }

@keyframes feed-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.feed-line li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-right: 22px;
  white-space: nowrap;
}

.ev-kind {
  flex: 0 0 auto;
  font-size: 0.8em;
  text-transform: uppercase;
}

.ev-text { flex: 0 0 auto; }
.ev-when { flex: 0 0 auto; font-size: 0.8em; }


.player-nick { font-size: 1.4em; }

.player-bank {
  flex: 1;
  min-width: 240px;
  align-self: flex-start;
  margin-bottom: 0;
}

.player-bank-spent { margin: 0 0 10px; }


.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

#search {
  flex: 1;
  min-width: 200px;
  padding: 5px;
  font: inherit;
}

.tags {
  border: 1px solid;
  padding: 4px;
  margin-bottom: var(--gap);
  max-height: 288px;
  overflow-y: auto;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(180deg, #000 calc(100% - 18px), transparent 100%);
}

.tags:not(:hover) { scrollbar-width: thin; }

.tag-group { margin-bottom: 4px; }
.pool-filter { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px dashed; }
.tag-group button { margin: 1px; }
.tag-group button.active { outline: 2px solid; }

.game-list ul {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.group-title {
  margin: 8px 0 4px;
  font-size: 1em;
  border-bottom: 1px solid;
}

.game-row {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 34px;
  text-align: left;
  font: inherit;
  padding: 3px 4px;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
}

.game-row:hover { border-color: currentColor; }
.game-row.active { outline: 2px solid; }

.game-row .g-title { flex: 1; min-width: 0; }
.game-row .g-player,
.game-row .g-time { opacity: 0.75; white-space: nowrap; }
.game-row .g-dup { border: 1px solid; padding: 0 3px; white-space: nowrap; }

.game-row.cover::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg,
      rgba(8,8,11,0.92) 0%,
      rgba(8,8,11,0.62) 38%,
      rgba(8,8,11,0.12) 74%),
    var(--cover) center / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 55%, transparent 96%);
  mask-image: linear-gradient(90deg, #000 0%, #000 55%, transparent 96%);
  pointer-events: none;
}

.game-row.out-done .g-title { text-decoration: line-through; }
.game-row.out-done,
.game-row.out-held { opacity: 0.55; }

.g-out {
  flex: 0 0 auto;
  padding: 0 5px;
  border: 1px solid;
  border-radius: 2px;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.dupes-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.dupes-note { flex: 1 1 100%; font-size: 0.78em; font-weight: normal; }

.game-row.challenge { border-style: dashed; }

.g-challenge {
  flex: 0 0 auto;
  padding: 0 6px;
  border: 1px solid;
  border-radius: 8px;
  font-size: 0.8em;
  white-space: nowrap;
}


#game-detail {
  position: sticky;
  top: 6px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

#game-detail .cover {
  max-width: 120px;
  height: auto;
  border: 1px solid;
}

.times { border-collapse: collapse; }
.times td { border: 1px solid; padding: 2px 6px; }

.notes { margin: 4px 0; padding-left: 18px; }
.raw { word-break: break-word; }


#roll-btn {
  font: inherit;
  font-size: 1.4em;
  padding: 8px 28px;
}

.dice-table {
  border: 1px dashed;
  padding: 12px;
  margin-bottom: 8px;
}


.shot-field { margin: 8px 0; }
.shot-field .hint { margin: 2px 0; }

.shot-preview {
  margin: 6px 0 0;
  max-width: 320px;
}

.shot-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.submit-shot { margin: 6px 0; max-width: 260px; }
.submit-shot .shot { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.submit-shot img { display: block; width: 100%; height: auto; }
.submit-shot figcaption { text-align: center; }

.ticket-card { border: 1px solid; padding: 8px; margin-bottom: 8px; }
.ticket-text { white-space: pre-wrap; }
.ticket-answer { margin-top: 6px; }


.spin-settings {
  margin: 0 0 8px;
  border: 1px solid;
  padding: 4px 6px;
}

.spin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 4px 14px;
  margin: 6px 0;
}

.spin-grid label {
  display: grid;
  grid-template-columns: 11em 1fr 4.5em;
  align-items: center;
  gap: 8px;
}

.spin-grid label > b {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.spin-grid label > span { min-width: 0; }
.spin-grid input[type="range"] { min-width: 0; }
.spin-grid select { min-width: 0; }

.spin-check { grid-template-columns: auto 1fr !important; }

.link-btn {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.dice-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.dice-switch button { padding: 4px 16px; font-weight: 700; }

.dice-tray {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 180px;
  margin-bottom: 6px;
  overflow: hidden;
}

.dice-tray.flat {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 30px 34px;
  justify-content: center;
  align-items: center;
  padding: 24px 12px;
  perspective: 900px;
}

.die {
  --die: 78px;
  position: relative;
  width: var(--die);
  height: var(--die);
  transform-style: preserve-3d;
  transition-property: transform;
  transition-duration: 0s;
  will-change: transform;
}

.die.landed .face { outline: 1px solid; }

.die .face {
  position: absolute;
  inset: 0;
  border: 1px solid;
  background: Canvas;
  backface-visibility: hidden;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  padding: 6px;
}

.die .face { padding: 9px; gap: 3px; }
.die .face span { border-radius: 50%; }
.die .face span.pip { background: currentColor; }

.die .f1 { transform: translateZ(calc(var(--die) / 2)); }
.die .f6 { transform: rotateX(-90deg) translateZ(calc(var(--die) / 2)); }
.die .f5 { transform: rotateX(90deg)  translateZ(calc(var(--die) / 2)); }
.die .f4 { transform: rotateY(-90deg) translateZ(calc(var(--die) / 2)); }
.die .f2 { transform: rotateY(90deg)  translateZ(calc(var(--die) / 2)); }
.die .f3 { transform: rotateY(180deg) translateZ(calc(var(--die) / 2)); }

.dice-tray canvas {
  position: absolute;
  inset: 0;
  display: block;
}

.dice-caption { text-align: center; margin: 0; }

.dice-empty {
  position: absolute;
  inset: auto 8px 10px;
  margin: 0;
  text-align: center;
}
.dice-source { margin: 0 0 8px; }

.roll-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.dice-rules summary { cursor: pointer; padding: 4px 0; }
.dice-rules tr.active td { outline: 2px solid; }


.tv {
  position: relative;
  height: 190px;
  margin-bottom: 8px;
  border: 1px solid;
  overflow: hidden;
}

.tv-map {
  position: absolute;
  inset: 0;
  background-image: url("art/map/skyrim.jpg");
  background-repeat: no-repeat;
  background-size: 420%;
  transition: background-position 260ms linear;
}

.tv.walking .tv-map { transition-duration: 240ms; }

.tv-pawn {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid;
  border-radius: 50%;
  background: currentColor;
}

.tv-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 8px;
  text-align: center;
}

.tv-cell { font-size: 1.15em; margin-right: 6px; }

.tv-track {
  position: relative;
  height: 6px;
  margin: 0 6px 14px;
  border: 1px solid;
}

.tv-mark {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid;
  border-radius: 50%;
  background: currentColor;
  transition: left 400ms cubic-bezier(0.2, 0.9, 0.25, 1);
}


.map-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.map-view {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
}

.map {
  position: relative;
  line-height: 0;
  margin: 0 auto;
}

.map-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.map-tools {
  position: absolute;
  z-index: 6;
  top: 8px;
  right: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  max-width: calc(100% - 16px);
}

.map-scale {
  min-width: 4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.map-wrap.zoom {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 8px;
}


.pawn {
  position: absolute;
  z-index: 2;
  width: var(--pawn-px, clamp(8px, 1.05%, 44px));
  height: auto;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid;
  border-radius: 50%;
  background: Canvas;
  font-size: calc(var(--pawn-px, 26px) * 0.6);
  line-height: 1;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: left 260ms linear, top 260ms linear, transform 0.12s;
}

.pawn::after {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
}

.pawn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.pawn b { font-size: 0.7em; text-transform: uppercase; }

.pawn:hover, .pawn:focus-visible { z-index: 4; transform: translate(-50%, -50%) scale(1.25); }
.pawn.mine { z-index: 3; }

.pawn-name {
  position: absolute;
  left: 50%;
  bottom: 120%;
  transform: translateX(-50%);
  padding: 2px 6px;
  border: 1px solid;
  background: Canvas;
  color: CanvasText;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s;
}

.pawn:hover .pawn-name,
.pawn:focus-visible .pawn-name,
.pawn-name.open { opacity: 1; }

.map-finish {
  position: absolute;
  z-index: 1;
  width: clamp(22px, 1.9%, 72px);
  height: auto;
  aspect-ratio: 1;
  border: 2px dashed;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}


#spin-btn {
  font: inherit;
  font-size: 1.4em;
  flex: 1 1 100%;
  width: 100%;
  min-height: 84px;
  padding: 10px 28px;
  border-width: 10px;
  border-style: solid;
  border-radius: 16px;
  transition: transform 0.06s, box-shadow 0.06s, filter 0.12s;
}

#spin-btn:not(:disabled):hover { filter: brightness(1.08); }

#spin-btn:not(:disabled):active { transform: translateY(4px); }

#spin-btn:disabled { filter: grayscale(0.7) brightness(0.65); }

#roulette-panel.skinned { position: relative; isolation: isolate; }

.skin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: var(--gap-tight);
}

.skin-pick input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.skin-pick { position: relative; }

.skin-pick span {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid;
  cursor: pointer;
}

.spec-groups {
  border: 1px solid;
  padding: 4px;
  margin-bottom: 6px;
  max-height: 200px;
  overflow-y: auto;
}


.wheel-box {
  border: 1px dashed;
  padding: 12px;
  margin-bottom: 8px;
  text-align: center;
}

.wheel-wrap {
  position: relative;
  width: min(520px, 100%);
  margin: 0 auto 10px;
  aspect-ratio: 1;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.12, 0.85, 0.12, 1);
  will-change: transform;
}

.wheel-skin {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: 50%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  mix-blend-mode: overlay;
  opacity: 0.9;
  pointer-events: none;
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.12, 0.85, 0.12, 1);
  will-change: transform;
}

.wheel-wrap.skin-under .wheel { position: relative; z-index: 1; }

.wheel-wrap.skin-under .wheel-skin {
  z-index: 0;
  mix-blend-mode: normal;
  opacity: 1;
}

.wheel-pin {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: -4px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 26px solid;
}

.wheel-hub {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 22%;
  aspect-ratio: 1;
  border: 2px solid;
  border-radius: 50%;
  line-height: 1.1;
}

.wheel-hub b { font-size: 1.5em; }
.wheel-hub small { font-size: 0.75em; }

.reel {
  border: 1px dashed;
  padding: 12px;
  margin-bottom: 8px;
}

.reel-window {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 8px;
  font-size: 1.3em;
  text-align: center;
  overflow: hidden;
}

.reel-window.spinning { font-weight: bold; }

.rolled {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid;
  padding: 8px;
}

.rolled .cover {
  flex: 0 0 auto;
  width: 140px;
  height: auto;
  border: 1px solid;
}

.rolled-body { flex: 1; min-width: 260px; }
.rolled-body .times { width: 100%; }

.rolled-back {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px dashed;
  padding: 6px 8px;
}

#roulette-side { position: sticky; top: 6px; }

@media (max-width: 800px) {
  #roulette-side { position: static; }
}

.dice-total { text-align: center; }
.dice-total .big { font-size: 2.6em; }

@media (prefers-reduced-motion: reduce) {
  .die { transition-duration: 0s !important; transition-delay: 0s !important; }
  .tv-pawn { transition: none; }
}


.doc { max-width: 70ch; }
.doc p { margin: 4px 0; }
.doc section { margin-bottom: 14px; }
.doc .times { margin: 6px 0; }
.doc .times th { border: 1px solid; padding: 2px 6px; text-align: left; }


.doc-head { margin-bottom: 16px; }
.doc-head h3 { margin: 0 0 4px; }
.doc-head p { margin: 0; }

.rule-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0 8px;
  font-size: 1.15em;
}

.rule-num {
  flex: 0 0 auto;
  min-width: 1.9em;
  padding: 1px 6px;
  text-align: center;
}

.clause {
  display: grid;
  grid-template-columns: 3.4em 1fr;
  gap: 0 10px;
  margin: 0 0 5px;
  scroll-margin-top: 12px;
}

.clause-no { text-align: right; }
.clause-text { min-width: 0; }

.rule-ref {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  text-decoration: underline dotted;
}

.rule-table { margin: 8px 0 10px; }
.rule-table figcaption { margin-bottom: 4px; }

#reference-nav .notes { list-style: none; padding-left: 0; }

.controls button.active { outline: 2px solid; }


.doc.emu-doc { max-width: none; }

.emu-platforms { margin: 6px 0; }
.emu-platforms button { font: inherit; padding: 4px 8px; }

.emu-section { margin-bottom: 22px; }

.emu-section .group-title { font-size: 1.15em; }

.emu-head {
  margin: 10px 0 4px;
  font-size: 1em;
}

.emu-step {
  max-width: 70ch;
  margin: 4px 0;
}

.emu-shots {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  margin: 6px 0 10px;
}

.emu-shots .shot {
  flex: 1 1 320px;
  width: auto;
  max-width: 700px;
}

.emu-table {
  border: 1px solid;
  padding: 4px 6px;
  margin-top: 10px;
}

.emu-table summary { cursor: pointer; }


.family { margin-bottom: 14px; }

.family-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.family-count { white-space: nowrap; }

.bar {
  border: 1px solid;
  height: 10px;
  padding: 1px;
  margin: 4px 0 6px;
}

.bar-fill {
  width: 100%;
  height: 100%;
  background: currentColor;
  transform-origin: left center;
  transition: transform 0.15s linear;
}

.titles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
  gap: 6px;
}

.titul {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  box-shadow: inset 0 0 0 1px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.titul.noart { box-shadow: inset 0 0 0 1px; }
.titul:hover,
.titul:focus-visible { outline: 2px solid; outline-offset: -2px; }

.titul img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.titul-stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
  padding: 2px 22px;
  overflow: hidden;
  text-align: center;
}

.titul:not(.owned) .titul-stub { opacity: 0.6; }
.titul-stub small { opacity: 0.6; }

.titul-mark {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0 4px;
  border-left: 1px solid;
  border-bottom: 1px solid;
  background: Canvas;
}

.tip {
  position: fixed;
  z-index: 10;
  width: 300px;
  max-width: calc(100vw - 16px);
  border: 1px solid;
  background: Canvas;
  color: CanvasText;
  padding: 4px 6px;
  pointer-events: none;
}


#titles-tracker {
  position: sticky;
  top: 6px;
}

.tracker-total { text-align: center; margin: 4px 0; }
.tracker-total .big { font-size: 2em; }

.tracker-list {
  list-style: none;
  margin: 6px 0;
  padding: 0;
}

.tracker-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 1px 0;
}

.tracker-list li.done { font-weight: bold; }

@media (max-width: 800px) {
  #titles-tracker { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  .bar-fill { transition: none; }
}


.profile-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.profile-ava-col {
  flex: 0 0 auto;
  width: 128px;
}

.ava-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.ava-actions .file-btn, .ava-actions button { font-size: 0.85em; padding: 3px 8px; }
.ava-note { margin: 4px 0 0; font-size: 0.8em; }

.profile-ava {
  width: 128px;
  height: 128px;
  border: 1px solid;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.profile-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ava-stub {
  padding: 4px;
  text-align: center;
  opacity: 0.6;
}

.profile-id {
  flex: 1;
  min-width: 220px;
}

.profile-id input { padding: 4px; font: inherit; }

.file-btn {
  display: inline-block;
  border: 1px solid;
  padding: 4px 8px;
  cursor: pointer;
}

.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-btn:focus-within { outline: 2px solid; }

.warn { border: 1px dashed; padding: 2px 4px; }

.titles-grid.small {
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
}

.titul.small .titul-stub { font-size: 0.85em; padding: 2px 12px; }

.showcase-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.1em;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.profile-settings {
  margin-top: 12px;
  border: 1px solid;
  padding: 4px 6px;
}

.profile-settings summary { cursor: pointer; }


.logbook {
  margin: 14px 0;
  border: 2px solid;
}

.logbook-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 2px solid;
}

.logbook-tabs button {
  flex: 1;
  min-width: 180px;
  padding: 12px 16px;
  border: 0;
  border-right: 1px solid;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 1.15em;
  cursor: pointer;
}

.logbook-tabs button:last-child { border-right: 0; }
.logbook-tabs button.active { outline: 2px solid; outline-offset: -4px; }

.logbook-body {
  min-height: 260px;
  padding: 10px;
}

.done-game {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid;
  padding: 8px;
  margin-bottom: 8px;
}

.done-proof {
  flex: 0 0 auto;
  width: min(260px, 100%);
  margin: 0;
}

.done-proof .placeholder { padding: 34px 8px; }
.done-proof figcaption { text-align: center; margin-top: 2px; }

.done-body {
  flex: 1;
  min-width: 240px;
}

.done-title { margin: 0 0 6px; font-size: 1.1em; }
.done-facts { width: 100%; }
.done-review { margin: 6px 0; }

.reroll-counters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.reroll-counters .tracker-total {
  flex: 1;
  min-width: 140px;
  border: 1px solid;
  padding: 8px 4px;
}

.reroll-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.reroll-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border: 1px solid;
  padding: 4px 6px;
  margin-bottom: 4px;
}

.reroll-kind {
  flex: 0 0 auto;
  border: 1px solid;
  padding: 0 4px;
  white-space: nowrap;
}

.reroll-what { flex: 1; min-width: 0; }


.current-game {
  border: 1px solid;
  padding: 6px;
  margin-bottom: 10px;
}

.current-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.current-title { font-size: 1.2em; }

.current-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}


.submit-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.submit-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border: 1px solid;
  padding: 4px 6px;
  margin-bottom: 4px;
}

.submit-status {
  flex: 0 0 auto;
  border: 1px solid;
  padding: 0 4px;
  white-space: nowrap;
}

.submit-what { flex: 1; min-width: 0; }

.submit-card {
  border: 1px solid;
  padding: 6px;
  margin-bottom: 8px;
}

.submit-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.submit-who { border: 1px solid; padding: 0 4px; }
.submit-review { margin: 6px 0; }

.submit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.admin-pick select { max-width: min(280px, 100%); }

.admin-ctl {
  display: flex;
  flex-direction: column;
  gap: var(--gap-tight);
  margin: var(--gap) 0;
  padding: 8px;
  border: 1px solid;
}

.admin-ctl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.admin-ctl-row > b { flex: 0 0 62px; }
.admin-ctl-row input[type="number"] { width: 72px; }
.admin-ctl-row input.grow { flex: 1 1 220px; }
.admin-ctl-check { display: inline-flex; align-items: center; gap: 4px; }


.admin-titles { margin-bottom: 8px; }

.license-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 1px solid;
  padding: 6px;
  margin: 0 0 10px;
}

.license-switch legend { padding: 0 4px; }

.license-switch label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid;
  padding: 4px 10px;
  cursor: pointer;
}

.license-switch label.picked { outline: 2px solid; }
.license-switch small { flex-basis: 100%; }

.license-tag {
  border: 1px solid;
  padding: 0 4px;
  white-space: nowrap;
}

.rolled-decision {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 1px solid;
  padding: 6px;
  margin-top: 8px;
}

.rolled-decision p { flex-basis: 100%; margin: 0; }


.shot {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid;
  background: none;
  cursor: zoom-in;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.8);
  cursor: zoom-out;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox .modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
}


.col-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  position: sticky;
  top: 6px;
}

@media (max-width: 800px) {
  .col-side { position: static; }
}

.tracker-now {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.tracker-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 6px;
}

.tracker-pair .tracker-total { margin: 0 0 4px; }


.tags-panel .panel-title {
  margin: 0;
  padding: 0;
  border-bottom: 0;
}

.tags-panel.open .panel-title {
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid;
}

.tags-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tags-chevron {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
}

.tags-panel.open .tags-chevron { transform: rotate(180deg); }

.tags-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tags-stage {
  position: relative;
  aspect-ratio: 5 / 6;
  min-height: 200px;
  overflow: hidden;
}

.tags-stage canvas {
  position: absolute;
  inset: 0;
  display: block;
}

.tags-note {
  position: absolute;
  inset: auto 8px 8px;
  margin: 0;
  text-align: center;
}

.tags-hint {
  margin: 0;
  text-align: center;
  font-size: 0.85em;
  opacity: 0.6;
}

.tags-2d {
  container-type: inline-size;
  position: relative;
  aspect-ratio: 100 / 46;
}

.tag2d {
  position: absolute;
  top: 0;
  margin: 0;
  width: 58cqw;
  aspect-ratio: 50 / 28;
  border-radius: 10cqw;
}

.tag2d.back { left: 42cqw; transform: rotate(4deg); }
.tag2d.front { left: 0; top: 7cqw; z-index: 2; transform: rotate(-6deg); }

.tag2d-hole {
  position: absolute;
  left: 4cqw;
  top: 50%;
  width: 4.2cqw;
  height: 4.2cqw;
  margin-top: -2.1cqw;
  border-radius: 50%;
}

.tag2d-lines {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 0 4cqw 0 11cqw;
  overflow: hidden;
}

.tag2d-lines b { font-size: 6cqw; }
.tag2d-lines span { font-size: 4.4cqw; }
.tag2d-lines small { font-size: 3.8cqw; }

.tag2d-lines b,
.tag2d-lines span,
.tag2d-lines small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

.tag2d-stats {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: center;
  gap: 0 2cqw;
  height: 100%;
  margin: 0;
  padding: 3cqw 3.5cqw 3cqw 17cqw;
  font-size: 3.1cqw;
  line-height: 1.4;
}

.tag2d-stats dt {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.65;
}

.tag2d-stats dd {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}


.modal-backdrop {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.35);
}

.modal {
  border: 2px solid;
  background: Canvas;
  color: CanvasText;
  padding: 10px;
  width: min(460px, 100%);
}

.modal.wide { width: min(720px, 100%); }

.modal .panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-close {
  font: inherit;
  padding: 0 8px;
}

.modal label { display: inline-block; margin-bottom: 2px; }
.modal input,
.modal textarea { width: 100%; padding: 4px; font: inherit; }
.modal input[type="file"] { padding: 0; }

footer {
  border: 1px solid;
  padding: 4px 6px;
}
