/* Video Wall — the action row, the 3:1 strip under the player, and the panel
   you leave a mark from. */

/* ---- Action row ---------------------------------------------------------- */

.watch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 2px;
}
.watch-actions[hidden] { display: none; }

.watch-actions__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: inherit;
  background: rgba(127, 127, 127, .12);
  border: 1px solid rgba(127, 127, 127, .18);
  border-radius: 999px;
  cursor: pointer;
  transition: background .14s ease;
}
.watch-actions__btn:hover { background: rgba(127, 127, 127, .2); }

.watch-actions__more {
  width: 36px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.watch-actions__more-wrap { position: relative; }

.watch-actions__menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  padding: 6px;
  background: var(--app-bg, #fff);
  border: 1px solid rgba(127, 127, 127, .24);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .18);
}
.watch-actions__menu[hidden] { display: none; }

.watch-actions__item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.watch-actions__item:hover { background: rgba(22, 200, 210, .14); }

/* ---- The strip ----------------------------------------------------------- */

.wall-strip { margin: 18px 0 8px; }
.wall-strip[hidden] { display: none; }

.wall-strip__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.wall-strip__head h2 { font-size: 16px; font-weight: 700; margin: 0; }
.wall-strip__tagline {
  margin: 1px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  font-style: italic;
  color: #0a8b9a;
}
.wall-strip__count { flex: none; font-size: 12.5px; color: var(--app-dim); }

.wall-strip__empty-sub {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: rgba(20, 20, 20, .45);
}

/* 3:1, and it stays 3:1 — every stored position is a fraction of this box, so
   the aspect ratio is what makes a coordinate mean the same thing at any
   width. overflow:hidden is what makes it a wall rather than a pile. */
.wall-strip__board {
  position: relative;
  aspect-ratio: 3 / 1;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(127, 127, 127, .2);
  background:
    repeating-linear-gradient(
      0deg, rgba(0, 0, 0, .035) 0 1px, transparent 1px 46px
    ),
    repeating-linear-gradient(
      90deg, rgba(0, 0, 0, .035) 0 1px, transparent 1px 92px
    ),
    linear-gradient(180deg, #d8d5cf 0%, #c9c5be 100%);
}

/* Marks are their own layer over the world. The listener rebuilds this on every
   snapshot; the world behind it must not be in that churn. */
.wall-strip__marks {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.wall-strip__board.is-empty .wall-strip__marks {
  display: grid;
  place-items: center;
}

.wall-strip__note {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--app-dim);
}

/* ---- The world behind the wall ------------------------------------------- */

/* A picture of a real place, so every control drawn over it stays clickable. */
.wall-world {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* The map keeps its own aspect ratio inside the 3:1 band — see stageBox(). A
   map that is not 3:1 is letterboxed rather than stretched, because stretching
   moves every monster off the ground it was placed on. */
.wall-world__stage { position: absolute; }

.wall-world__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* fill, not cover: the background is authored as one image stretched across
     the whole world, which is exactly how the game draws it. */
  object-fit: fill;
}

.wall-world__prop {
  position: absolute;
  object-fit: contain;
  /* Art is authored at the size of the box it was placed in, so it fills it. */
  max-width: none;
  max-height: none;
}

/* The world reads as the setting; the marks are the subject. Dropping it back a
   little is what keeps graffiti legible over a busy map without washing the map
   out into a grey rectangle again. */
.wall-strip__board.has-world .wall-world { opacity: .82; }
/* Nothing to read over it yet, so it plays at full strength — the empty state
   is the best look at the world anyone gets. */
.wall-strip__board.has-world.is-empty .wall-world { opacity: 1; }

/* Graffiti is bare paint with no card behind it. Over flat plaster that was
   fine; over art it needs an edge. A drop-shadow on the element works for any
   colour the writer picked and leaves the per-font text-shadows alone. */
.wall-strip__board.has-world .wall-mark--graffiti {
  filter:
    drop-shadow(0 1px 2px rgba(255, 255, 255, .55))
    drop-shadow(0 2px 8px rgba(0, 0, 0, .35));
}

/* The writer's name under a piece of graffiti is dark grey, which was fine on
   plaster and disappears against a night sky. White with a dark shadow reads on
   either — the map behind it can be any colour at all. */
.wall-strip__board.has-world .wall-mark--graffiti .wall-mark__who {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}

/* The empty-state invitation sits on a plate rather than straight on the art,
   for the same reason: the text has to survive whatever is behind it. */
.wall-strip__board.has-world .wall-strip__empty {
  padding: 16px 22px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  backdrop-filter: blur(2px);
}

.wall-strip__empty { text-align: center; }
.wall-strip__empty-line {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(20, 20, 20, .55);
}
.wall-strip__cta {
  height: 38px;
  padding: 0 20px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #062238;
  background: #43dced;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.wall-strip__cta:hover { background: #2fcede; }

/* ---- A mark -------------------------------------------------------------- */

.wall-mark {
  --wall-mark-color: #111827;
  --wall-mark-rotate: 0deg;
  /* The fraction of its OWN size a mark pulls back by. Set per mark from its
     stored position: 0 at the left edge of the wall, 1 at the right, .5 in the
     middle. A flat -50% would hang half of every edge mark outside the board,
     where overflow:hidden slices it in two. */
  --wall-mark-ax: .5;
  --wall-mark-ay: .5;
  position: absolute;
  translate: calc(var(--wall-mark-ax) * -100%) calc(var(--wall-mark-ay) * -100%);
  rotate: var(--wall-mark-rotate);
  max-width: min(30%, 230px);
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
}

.wall-mark__text {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: #14181d;
  /* A mark is a glance, not an essay — a 280-character one is clamped here and
     opens in full on the explorable wall. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.wall-mark__foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
}
.wall-mark__who {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: rgba(20, 24, 29, .5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wall-mark__stamp {
  flex: none;
  padding: 2px 7px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: #06485a;
  background: rgba(22, 200, 210, .2);
  border: 1px solid rgba(22, 200, 210, .4);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.wall-mark__stamp:hover { background: rgba(22, 200, 210, .34); }

.wall-mark__remove {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  padding: 0;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  color: #fff;
  background: rgba(20, 24, 29, .72);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease;
}
.wall-mark:hover .wall-mark__remove,
.wall-mark__remove:focus-visible { opacity: 1; }
@media (hover: none) { .wall-mark__remove { opacity: 1; } }

/* Graffiti sits ON the wall — no card behind it, colour straight from the
   style, and a heavier face so it reads as paint rather than a note. */
.wall-mark--graffiti {
  max-width: min(34%, 280px);
  padding: 2px 4px;
  background: none;
  box-shadow: none;
}
.wall-mark--graffiti .wall-mark__text {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: .01em;
  color: var(--wall-mark-color);
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.wall-mark--graffiti .wall-mark__who { color: rgba(20, 24, 29, .55); }

.wall-mark--graffiti[data-font="spray"] .wall-mark__text {
  text-shadow: 0 0 7px color-mix(in srgb, var(--wall-mark-color) 45%, transparent);
}
.wall-mark--graffiti[data-font="neon"] .wall-mark__text {
  text-shadow:
    0 0 4px color-mix(in srgb, var(--wall-mark-color) 70%, transparent),
    0 0 14px color-mix(in srgb, var(--wall-mark-color) 45%, transparent);
}
.wall-mark--graffiti[data-font="gold"] .wall-mark__text {
  -webkit-text-stroke: .6px rgba(90, 60, 0, .5);
  text-shadow: 0 2px 0 rgba(90, 60, 0, .28);
}
.wall-mark--graffiti[data-font="marker"] .wall-mark__text {
  -webkit-text-stroke: .3px rgba(255, 255, 255, .55);
}

.wall-mark--timestamp { border-left: 3px solid rgba(22, 200, 210, .8); }

@media (max-width: 720px) {
  .wall-mark { max-width: 44%; padding: 6px 8px; }
  .wall-mark__text { font-size: 11.5px; -webkit-line-clamp: 2; line-clamp: 2; }
  .wall-mark--graffiti .wall-mark__text { font-size: 15px; }

  /* A 3:1 band on a phone is about 115px tall, and the invitation at desktop
     size covered the entire world behind it — a plate where a map should be.
     Small enough to read, small enough to see past. */
  .wall-strip__board.has-world .wall-strip__empty { padding: 8px 13px; }
  .wall-strip__empty-line { margin-bottom: 7px; font-size: 12.5px; }
  /* The world behind it makes this pitch better than the sentence does. */
  .wall-strip__board.has-world .wall-strip__empty-sub { display: none; }
  .wall-strip__cta { height: 31px; padding: 0 15px; font-size: 12.5px; }
}

/* ---- The panel ----------------------------------------------------------- */

/* Opened with .show(), not .showModal(): a modal dialog is promoted to the
   browser's top layer, which is ABOVE #videoLayer, so it would cover the
   player. Non-modal keeps the video visible as well as playing. That also
   means there is no ::backdrop to style and no free Escape handling — both are
   handled in wall-panel.js. */
.wall-panel {
  position: fixed;
  z-index: 60;
  inset: auto 22px 22px auto;
  width: min(420px, calc(100vw - 32px));
  max-height: min(78vh, 640px);
  overflow: auto;
  margin: 0;
  padding: 0;
  color: #0b1b24;
  background: #fff;
  border: 1px solid rgba(22, 200, 210, .45);
  border-radius: 18px;
  box-shadow: 0 26px 70px rgba(4, 20, 33, .32);
}
.wall-panel:not([open]) { display: none; }

.wall-panel__form { padding: 18px; }

.wall-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.wall-panel__title { margin: 0; font-size: 17px; font-weight: 800; }
.wall-panel__lede {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #0a8b9a;
}
.wall-panel__close {
  flex: none;
  width: 30px;
  height: 30px;
  font: inherit;
  font-size: 19px;
  line-height: 1;
  color: rgba(11, 27, 36, .55);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.wall-panel__close:hover { background: rgba(11, 27, 36, .08); }

.wall-panel__types {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 14px 0 0;
}
.wall-panel__type {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px;
  font: inherit;
  color: inherit;
  background: rgba(11, 27, 36, .05);
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
}
.wall-panel__type:hover:not(:disabled) { background: rgba(22, 200, 210, .14); }
.wall-panel__type.is-active {
  background: rgba(22, 200, 210, .18);
  border-color: rgba(22, 200, 210, .6);
}
.wall-panel__type:disabled { opacity: .5; cursor: not-allowed; }
.wall-panel__type-hint { font-size: 16px; line-height: 1; }
.wall-panel__type-label { font-size: 11.5px; font-weight: 700; }
.wall-panel__soon {
  position: absolute;
  top: -6px;
  right: -2px;
  padding: 1px 5px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(11, 27, 36, .6);
  border-radius: 999px;
}

.wall-panel__styles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.wall-panel__styles[hidden] { display: none; }
.wall-panel__style {
  --wall-style-color: #111827;
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  color: var(--wall-style-color);
  background: rgba(11, 27, 36, .05);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}
.wall-panel__style.is-active {
  border-color: var(--wall-style-color);
  background: color-mix(in srgb, var(--wall-style-color) 14%, transparent);
}

.wall-panel__field { display: block; margin-top: 12px; }
.wall-panel__label {
  display: block;
  margin-bottom: 5px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(11, 27, 36, .55);
}
.wall-panel__text {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: inherit;
  background: #fff;
  border: 1px solid rgba(11, 27, 36, .2);
  border-radius: 11px;
  resize: vertical;
}
.wall-panel__text:focus {
  outline: 0;
  border-color: rgba(22, 200, 210, .8);
  box-shadow: 0 0 0 3px rgba(22, 200, 210, .18);
}
/* Typing a tag should look like the tag. */
.wall-panel__text--graffiti { font-size: 18px; font-weight: 900; }

.wall-panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}
.wall-panel__stamp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.wall-panel__stamp input:disabled + .wall-panel__stamp-label { opacity: .65; }
.wall-panel__time {
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 800;
  color: #06485a;
  background: rgba(22, 200, 210, .2);
  border-radius: 999px;
  white-space: nowrap;
}
.wall-panel__time[hidden] { display: none; }
.wall-panel__count {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(11, 27, 36, .45);
  font-variant-numeric: tabular-nums;
}
.wall-panel__count.is-over { color: #d1344b; }

.wall-panel__msg {
  min-height: 17px;
  margin: 9px 0 0;
  font-size: 12.5px;
  font-weight: 600;
}
.wall-panel__msg--error { color: #d1344b; }
.wall-panel__msg--ok { color: #0a8b6a; }

.wall-panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.wall-panel__btn {
  height: 38px;
  padding: 0 18px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  border-radius: 999px;
  cursor: pointer;
}
.wall-panel__cancel {
  color: inherit;
  background: none;
  border: 1px solid rgba(11, 27, 36, .18);
}
.wall-panel__submit {
  color: #062238;
  background: #43dced;
  border: 0;
}
.wall-panel__submit:hover:not(:disabled) { background: #2fcede; }
.wall-panel__submit:disabled { opacity: .6; cursor: default; }

/* A phone has no room beside the player, so the panel becomes a bottom sheet.
   It still is not modal — the video keeps playing above it. */
@media (max-width: 640px) {
  .wall-panel {
    inset: auto 0 0 0;
    width: 100%;
    max-height: 82vh;
    border-radius: 18px 18px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wall-mark { rotate: 0deg; }
}

/* The door into the video's own world. Sits with the mark count so the wall
   reads as one thing: here is what people left, and here is how you go in. */
.wall-strip__head-right {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wall-strip__enter {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none;
  color: #062238;
  background: #43dced;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .14s ease;
}
.wall-strip__enter:hover { background: #2fcede; }
@media (max-width: 520px) {
  .wall-strip__enter { height: 34px; padding: 0 12px; font-size: 12px; }
}
