html {
  touch-action: manipulation;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 10px 0 4px;
  width: 100%;
  background: transparent;
  color: #f7f7f7;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: #9bdc2a;
  text-decoration: none;
}

a:focus,
a:hover {
  color: #76b900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.container-lg {
  max-width: 1500px;
  margin: auto;
}

.text-center {
  text-align: center;
}

.row {
  display: flex;
  justify-content: center;
  width: 100%;
}

.viewer-card {
  width: 66.666%;
  min-width: min(100%, 660px);
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
  padding: 16px 18px 18px;
  text-align: center;
}

h3 {
  margin: 0 0 8px;
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  color: #f7f7f7;
}

p {
  margin: 0 0 1rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  color: #d4d4d4;
}

.viewer-note {
  display: inline-block;
  margin: -4px auto 12px;
  padding: 6px 10px;
  border: 1px solid rgba(155, 220, 42, 0.34);
  border-radius: 6px;
  background: rgba(118, 185, 0, 0.1);
  color: #dce8c7;
  font-size: 12px;
  line-height: 1.35;
}

#brush_canvas {
  width: 100%;
  max-width: 760px;
  aspect-ratio: 16 / 9;
  display: block;
  position: relative;
  margin-left: auto;
  margin-right: auto;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.warning {
  background-color: rgba(232, 163, 54, 0.16);
  border-left: 4px solid #e8a336;
  border-radius: 4px;
  color: #ffd891;
  font-family: system-ui, -apple-system, sans-serif;
  margin: 1rem auto;
  max-width: 600px;
  padding: 1rem;
  text-align: left;
}

.warning-title {
  align-items: center;
  display: flex;
  font-size: 17px;
  font-weight: 700;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.warning-title svg {
  height: 24px;
  width: 24px;
}

.warning-message {
  line-height: 1.5;
  margin: 0;
}

.pill-row {
  margin: 12px auto 0;
  text-align: center;
}

.scene-pills {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  justify-content: center;
  max-width: min(100%, 620px);
}

.pill {
  cursor: pointer;
  padding: 2px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: #111111;
  display: block;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
  vertical-align: top;
}

button.pill {
  appearance: none;
  color: inherit;
  font: inherit;
}

.pill:disabled {
  cursor: wait;
}

.scene-pill-large {
  position: relative;
  width: 100%;
  border-radius: 6px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.scene-pill-large:hover {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.38);
  transform: translateY(-2px);
}

.scene-pill-large.has-view::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  background: #76b900;
  box-shadow: 0 0 0 2px rgba(118, 185, 0, 0.28);
}

.scene-pill-large.active {
  background: rgba(118, 185, 0, 0.18);
  border-color: #76b900;
  box-shadow: 0 0 0 2px rgba(118, 185, 0, 0.18), 0 6px 14px rgba(0, 0, 0, 0.38);
}

.card-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  object-fit: cover;
}

.scene-pill-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: #000000;
}

.scene-pill-caption {
  display: block;
  color: #d4d4d4;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  padding: 4px 0 2px;
  text-align: center;
}

.scene-pill-large.active .scene-pill-caption {
  color: #9bdc2a;
}

.viewer-status {
  color: #a7a7a7;
  font-size: 12px;
  min-height: 18px;
  padding-top: 8px;
}

@media (max-width: 900px) {
  body {
    padding-left: 2%;
    padding-right: 2%;
  }

  .viewer-card {
    width: 100%;
    min-width: 0;
  }

  .scene-pills {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
  }

  h3 {
    font-size: 23px;
  }
}

@media (max-width: 430px) {
  .scene-pills {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .scene-pill-caption {
    font-size: 9px;
    line-height: 1.1;
    padding-top: 3px;
  }

}
