/* หน้าเกม (/play): ซ่อนเครื่องมือของตัวแก้ฉากทั้งหมดตั้งแต่แรก + หน้าโหลด/หน้าเริ่มเกม */
body.rms-game-page .topbar,
body.rms-game-page #tools,
body.rms-game-page .cozy-toolbar,
body.rms-game-page #inspector,
body.rms-game-page #catalog,
body.rms-game-page .view-buttons,
body.rms-game-page .viewport-footer,
body.rms-game-page #walk-preview-panel,
body.rms-game-page #spring-placement-hint,
body.rms-game-page #loading,
body.rms-game-page #toast { display: none !important; }
body.rms-game-page { background: #1c1634; overflow: hidden; }

.rms-title {
  position: fixed; inset: 0; z-index: 4000; display: grid; align-items: end; justify-items: start;
  padding: clamp(18px, 5vw, 64px); padding-bottom: clamp(48px, 9vh, 96px);
  color: #fff; font-family: inherit;
  /* ม่านไล่สีทับฉาก 3 มิติที่หมุนอยู่ด้านหลัง: ทึบที่มุมซ้ายล่างให้อ่านตัวหนังสือออก */
  background: linear-gradient(90deg, #1c1634e0 0%, #2a1f5aa6 30%, #2a1f5a00 64%), linear-gradient(0deg, #1c163499, #1c163400 45%);
  transition: opacity .45s ease, background-color .6s ease;
}
.rms-title.is-loading { background: linear-gradient(150deg, #2a1f5a, #6a4fd0 55%, #ff6fb5); }
.rms-title.is-hidden { opacity: 0; pointer-events: none; }
.rms-title[hidden] { display: none; }

.rms-title-card { width: min(430px, 100%); display: grid; gap: 14px; }
.rms-title-kicker { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .04em; color: #ffd9ef; }
.rms-title h1 { margin: 0; font-size: clamp(40px, 7.4vw, 76px); line-height: 1.02; font-weight: 800; text-shadow: 0 4px 0 #2a1f5a, 0 10px 28px #1c163499; }
.rms-title h1 span { display: block; font-size: .56em; letter-spacing: .14em; color: #ffb3dc; }
.rms-title-status { margin: 0; min-height: 22px; font-size: 15px; font-weight: 600; color: #efe8ff; display: flex; align-items: center; gap: 9px; }
.rms-title-status i { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #ffffff55; border-top-color: #fff; animation: rms-title-spin .8s linear infinite; }
.rms-title-status:not(.busy) i { display: none; }
@keyframes rms-title-spin { to { transform: rotate(360deg); } }

.rms-title-menu { display: grid; gap: 10px; }
.rms-title-menu[hidden] { display: none; }
.rms-title button, .rms-title select { font: inherit; color: inherit; cursor: pointer; border: 0; }
.rms-title-start {
  padding: 16px 22px; border-radius: 22px; font-size: 22px; font-weight: 800; text-align: left;
  background: linear-gradient(135deg, #ff6fb5, #b48cff); box-shadow: 0 5px 0 #6a3fb8, 0 12px 26px #1c163466;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.rms-title-start small { font-size: 13px; font-weight: 600; opacity: .92; }
.rms-title-start:hover { filter: brightness(1.06); }
.rms-title-start:active { transform: translateY(3px); box-shadow: 0 2px 0 #6a3fb8, 0 8px 18px #1c163466; }
.rms-title-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rms-title-option {
  display: grid; gap: 2px; padding: 10px 14px; border-radius: 16px; text-align: left; font-weight: 700; font-size: 15px;
  background: #ffffff24; backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1.5px #ffffff3d;
}
.rms-title-option small { font-size: 12px; font-weight: 600; color: #e6dcff; }
.rms-title-option:hover { background: #ffffff38; }
.rms-title-option select { width: 100%; margin-top: 2px; padding: 4px 6px; border-radius: 9px; background: #ffffffea; color: #2a1f5a; font-size: 13px; font-weight: 600; }
.rms-title-foot { display: flex; gap: 14px; flex-wrap: wrap; }
.rms-title-link { padding: 4px 2px; background: none; font-size: 13px; font-weight: 600; color: #e6dcff; text-decoration: underline; text-underline-offset: 3px; }
.rms-title-link:hover { color: #fff; }
.rms-title :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.rms-title-hint { position: absolute; right: clamp(14px, 3vw, 36px); bottom: 16px; margin: 0; font-size: 12px; color: #ffffffc4; text-align: right; max-width: 60vw; }
.rms-title-hint[hidden] { display: none; }

@media (max-width: 640px) {
  .rms-title { justify-items: stretch; background: linear-gradient(#1c163422 20%, #1c1634e0 62%); }
  .rms-title-card { width: 100%; }
  .rms-title-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { .rms-title, .rms-title-status i { transition: none; animation: none; } }
