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

body.laststand {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, #101a33 0%, #070b16 55%, #04060d 100%);
  color: #c8d6e5;
  font-family: "Courier New", ui-monospace, monospace;
}

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

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

.ls-header h1 {
  font-size: 1.6rem;
  letter-spacing: 0.25em;
  color: #35f0d0;
  text-shadow: 0 0 18px rgba(53, 240, 208, 0.45);
}

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

.ls-sub {
  color: #7d92ad;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  font-style: italic;
}

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

.ls-back:hover {
  color: #9ff5ff;
}

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

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

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

.chip {
  background: rgba(10, 18, 36, 0.92);
  border: 2px solid #1c3a5a;
  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(53, 240, 208, 0.05);
}

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

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

.chip.big b {
  font-size: 1.35rem;
  color: #35f0d0;
  text-shadow: 0 0 10px rgba(53, 240, 208, 0.6);
}

.cc-chip {
  min-width: 130px;
}

.cc-bar {
  margin-top: 3px;
  height: 5px;
  background: #131c30;
  border-radius: 3px;
  overflow: hidden;
}

#ccFill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff5347, #ffd23c, #5df08a);
  background-size: 130px 100%;
  background-position: right;
  transition: width 0.15s;
}

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

#scene {
  width: 100%;
  height: auto;
  display: block;
  border: 3px solid #1c3a5a;
  border-radius: 10px;
  box-shadow: 0 0 44px rgba(53, 240, 208, 0.1), 0 10px 30px rgba(0, 0, 0, 0.6);
  background: #070b16;
  cursor: crosshair;
}

.ls-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(4, 6, 13, 0.82);
  backdrop-filter: blur(3px);
  border-radius: 10px;
}

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

.ls-overlay h2 {
  color: #35f0d0;
  letter-spacing: 0.2em;
  font-size: 1.5rem;
  text-shadow: 0 0 16px rgba(53, 240, 208, 0.5);
}

.ls-overlay p {
  max-width: 560px;
  color: #9db4c8;
  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: #04060d;
  background: linear-gradient(180deg, #35f0d0, #1fb89b);
  border: 2px solid #0e6e5c;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 0 #0e6e5c;
  transition: transform 0.05s, box-shadow 0.05s;
}

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

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

.ls-controls button {
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  padding: 0.5rem 1.1rem;
  color: #c8d6e5;
  background: #101a33;
  border: 2px solid #1c3a5a;
  border-radius: 6px;
  cursor: pointer;
}

.ls-controls button:hover {
  border-color: #35f0d0;
  color: #35f0d0;
}

.ls-side {
  width: 300px;
  flex-shrink: 0;
  background: rgba(10, 18, 36, 0.85);
  border: 2px solid #1c3a5a;
  border-radius: 10px;
  padding: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.ls-side h2 {
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: #3aa0ff;
  margin: 0.7rem 0 0.5rem;
  border-bottom: 1px solid #1c3a5a;
  padding-bottom: 0.3rem;
}

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

.ls-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: #c8d6e5;
  background: #0d1526;
  border: 2px solid #1c3a5a;
  border-radius: 7px;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.45rem;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
}

.ls-btn:hover:not(:disabled) {
  border-color: #35f0d0;
  background: #12203a;
}

.ls-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ls-btn.selected {
  border-color: #ffd23c;
  background: #1d2a18;
  box-shadow: 0 0 10px rgba(255, 210, 60, 0.25);
}

.b-icon {
  font-size: 1.15rem;
  width: 1.6rem;
  text-align: center;
}

.b-main {
  flex: 1;
  min-width: 0;
}

.b-name {
  display: block;
  font-size: 0.78rem;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.b-desc {
  display: block;
  font-size: 0.62rem;
  color: #7d92ad;
}

.b-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.b-side kbd {
  font-family: inherit;
  font-size: 0.6rem;
  color: #04060d;
  background: #35f0d0;
  border-radius: 3px;
  padding: 0 4px;
}

.b-extra {
  font-size: 0.62rem;
  color: #ffd23c;
}

.b-cost {
  font-size: 0.72rem;
  font-weight: bold;
  color: #35f0d0;
}

.ls-note {
  font-size: 0.68rem;
  color: #7d92ad;
  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(10, 18, 36, 0.95);
  border: 2px solid #35f0d0;
  border-radius: 6px;
  color: #c8d6e5;
  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) {
  .ls-stage {
    flex-direction: column;
  }

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