* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.marinerun {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, #43307e 0%, #221a52 55%, #0e0a28 100%);
  color: #e6e9ff;
  font-family: "Courier New", ui-monospace, monospace;
}

.noscript-info {
  padding: 1rem;
  text-align: center;
  color: #ffd23c;
}

.mr-header {
  text-align: center;
  padding: 1rem 1rem 0.8rem;
}

.mr-header h1 {
  font-size: 1.6rem;
  letter-spacing: 0.25em;
  color: #ffd23c;
  text-shadow: 0 0 18px rgba(255, 210, 60, 0.45);
}

.mr-header h1 span {
  color: #3aa0ff;
  text-shadow: 0 0 18px rgba(58, 160, 255, 0.45);
}

.mr-sub {
  color: #9aa3d8;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  font-style: italic;
}

.mr-back {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: #ffd23c;
  text-decoration: none;
  margin-bottom: 0.4rem;
}

.mr-back:hover {
  color: #ffe89a;
}

.mr-stage {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  max-width: 1240px;
  margin: 0.6rem auto 0;
  padding: 0 1rem 2.5rem;
}

.mr-scene {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mr-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.chip {
  background: rgba(26, 22, 58, 0.92);
  border: 2px solid #4d4d96;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  min-width: 78px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(255, 210, 60, 0.05);
}

.chip span {
  display: block;
  font-size: 0.56rem;
  letter-spacing: 0.15em;
  color: #9aa3d8;
}

.chip b {
  font-size: 0.95rem;
  color: #e6e9ff;
}

.chip.big b {
  font-size: 1.35rem;
  color: #ffd23c;
  text-shadow: 0 0 10px rgba(255, 210, 60, 0.6);
}

.mr-banner {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.2em;
  color: #ffd23c;
  text-shadow: 0 0 18px rgba(255, 210, 60, 0.8);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  white-space: nowrap;
}

.mr-banner.show {
  opacity: 1;
}

.mr-canvas-wrap {
  position: relative;
}

#scene {
  width: 100%;
  height: auto;
  display: block;
  border: 3px solid #4d4d96;
  border-radius: 10px;
  box-shadow: 0 0 44px rgba(110, 231, 255, 0.16), 0 10px 30px rgba(0, 0, 0, 0.6);
  background: #1d2b5e;
  cursor: crosshair;
}

.mr-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
  background: rgba(12, 10, 34, 0.88);
  backdrop-filter: blur(3px);
  border-radius: 10px;
}

.mr-overlay.hidden {
  display: none;
}

.mr-overlay h2 {
  color: #ffd23c;
  letter-spacing: 0.2em;
  font-size: 1.5rem;
  text-shadow: 0 0 16px rgba(255, 210, 60, 0.5);
}

.mr-overlay p {
  max-width: 580px;
  color: #c3c9ee;
  font-size: 0.9rem;
  line-height: 1.5;
}

#ovBtn {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  padding: 0.8rem 2rem;
  color: #060503;
  background: linear-gradient(180deg, #ffd23c, #d9a520);
  border: 2px solid #8a6a10;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 0 #8a6a10;
  transition: transform 0.05s, box-shadow 0.05s;
}

#ovBtn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #8a6a10;
}

.mr-controls {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.9rem;
  align-self: center;
}

.mr-controls button {
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  padding: 0.5rem 1.1rem;
  color: #e6e9ff;
  background: #1a1640;
  border: 2px solid #4d4d96;
  border-radius: 6px;
  cursor: pointer;
}

.mr-controls button:hover {
  border-color: #ffd23c;
  color: #ffd23c;
}

.mr-side {
  width: 300px;
  flex-shrink: 0;
  background: rgba(26, 22, 58, 0.9);
  border: 2px solid #4d4d96;
  border-radius: 10px;
  padding: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.mr-side h2 {
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: #ffb14d;
  margin: 0.7rem 0 0.5rem;
  border-bottom: 1px solid #4d4d96;
  padding-bottom: 0.3rem;
}

.mr-side h2:first-child {
  margin-top: 0;
}

.mr-note {
  font-size: 0.68rem;
  color: #9aa3d8;
  line-height: 1.55;
  margin-bottom: 0.35rem;
}

#toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 10;
}

.toast {
  background: rgba(26, 22, 58, 0.95);
  border: 2px solid #ffd23c;
  border-radius: 6px;
  color: #e6e9ff;
  font-size: 0.75rem;
  padding: 0.5rem 0.9rem;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 980px) {
  .mr-stage {
    flex-direction: column;
  }

  .mr-side {
    width: 100%;
  }
}
