/* Netlify Identityで本人確認した管理人だけが入る、公開配置の編集・公開室。 */
.admin-room-page {
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #5D3517 0%, #241005 55%, #120805 100%);
}
.admin-room { max-width: 820px; margin: 0 auto; padding: 70px 22px 94px; }
.admin-room-card {
  padding: clamp(26px, 5vw, 54px);
  border: 2px solid #C79439;
  border-radius: 10px;
  color: #3A2515;
  background: repeating-linear-gradient(0deg, rgba(106,66,25,.035) 0 1px, transparent 1px 4px), #FFF7E4;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .62), inset 0 0 0 6px rgba(191, 139, 55, .15);
}
.admin-room-kicker { margin: 0; color: #8A6028; font: 700 12px/1.4 "Noto Serif JP", serif; letter-spacing: .16em; }
.admin-room h1 { margin: 9px 0 18px; color: #603510; font-size: clamp(27px, 5vw, 44px); }
.admin-room h2 { margin: 28px 0 10px; color: #603510; font-size: 20px; }
.admin-room p { line-height: 1.85; }
.admin-room-status { padding: 12px 15px; border-left: 4px solid #B77A25; background: rgba(239, 214, 160, .45); }
.admin-room-form { display: grid; gap: 14px; max-width: 510px; }
.admin-room-form label { display: grid; gap: 5px; color: #56320F; font-weight: 700; }
.admin-room-form input { min-height: 42px; padding: 7px 10px; border: 1px solid #9C6C2A; border-radius: 4px; background: #FFFDF6; color: #2E1C0C; font: inherit; }
.admin-room-form button,
.admin-room-open,
.admin-room-logout button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid #8D5B20;
  border-radius: 4px;
  color: #FFF6DA;
  background: linear-gradient(#8C5922, #4A280D);
  box-shadow: inset 0 0 0 1px rgba(255,225,151,.25), 0 2px 5px rgba(25,10,2,.32);
  font: 700 15px/1.3 "Noto Sans JP", sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.admin-room-open { margin-top: 4px; }
.admin-room-logout { display: inline-block; margin: 0 0 0 10px; }
.admin-room-note { color: #725127; font-size: 13px; }
.admin-room [hidden] { display: none !important; }
.sg-gimmick-layout-panel {
  position: fixed;
  z-index: 10020;
  top: 12px;
  left: 50%;
  width: min(940px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 3px solid #D5A94D;
  border-radius: 8px;
  color: #3B2411;
  background: linear-gradient(150deg, #FFF8E7, #EBCF96);
  box-shadow: 0 12px 36px rgba(10, 4, 1, .72), inset 0 0 0 2px rgba(255,255,255,.58);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  translate: -50% 0;
}
.sg-gimmick-layout-panel[hidden],
.sg-gimmick-layout-overlay[hidden] { display: none; }
.sg-gimmick-layout-panel > strong {
  display: block;
  margin-bottom: 8px;
  color: #6A3B12;
  font-size: 18px;
  letter-spacing: .08em;
}
.sg-gimmick-layout-panel-title {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.sg-gimmick-layout-panel-title::after {
  content: "✥ ドラッグで移動";
  float: none;
  margin: 1px 0 0;
  color: #8A642F;
  font: 700 12px/1.4 "Noto Sans JP", sans-serif;
  letter-spacing: .04em;
}
.sg-gimmick-layout-panel.is-panel-dragging .sg-gimmick-layout-panel-title { cursor: grabbing; }
.sg-gimmick-layout-select { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.sg-gimmick-layout-room-select,
.sg-gimmick-layout-category-select { margin-bottom: 7px; }
.sg-gimmick-layout-select select {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #9F6D2B;
  border-radius: 4px;
  background: #FFFCF2;
  color: #38210E;
  font: inherit;
}
.sg-gimmick-layout-fields,
.sg-gimmick-layout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.sg-gimmick-layout-fields label { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; }
.sg-gimmick-layout-fields input {
  width: 76px;
  min-height: 32px;
  padding: 3px 6px;
  border: 1px solid #AA7934;
  border-radius: 3px;
  background: #FFFDF7;
  color: #2F1B0B;
  font: inherit;
}
.sg-gimmick-layout-text-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
}
.sg-gimmick-layout-text-editor[hidden] { display: none; }
.sg-gimmick-layout-text-editor input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid #AA7934;
  border-radius: 3px;
  background: #FFFDF7;
  color: #2F1B0B;
  font: inherit;
}
.sg-gimmick-layout-actions button,
.sg-gimmick-layout-move,
.sg-gimmick-layout-resize,
.sg-gimmick-layout-rotate {
  border: 1px solid #8D5B20;
  border-radius: 3px;
  color: #FFF4D4;
  background: linear-gradient(#885621, #4A280D);
  box-shadow: inset 0 0 0 1px rgba(255,225,151,.25), 0 2px 5px rgba(25,10,2,.32);
  font: 700 13px/1.3 "Noto Sans JP", sans-serif;
  cursor: pointer;
}
.sg-gimmick-layout-actions button { min-height: 34px; padding: 5px 10px; }
.sg-gimmick-layout-values { margin: 7px 0 0; color: #725127; font-size: 12px; }
.sg-gimmick-layout-overlay {
  position: fixed;
  z-index: 10010;
  box-sizing: border-box;
  border: 3px dashed #FFD84D;
  background: rgba(255, 216, 77, .08);
  box-shadow: 0 0 0 2px rgba(55, 30, 3, .92), 0 0 18px rgba(255, 216, 77, .82);
  pointer-events: none;
}
.sg-gimmick-layout-move {
  position: absolute;
  left: 50%;
  top: -100px;
  max-width: min(440px, 78vw);
  min-height: 30px;
  padding: 4px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  translate: -50% 0;
  pointer-events: auto;
  cursor: move;
}
.sg-gimmick-layout-resize,
.sg-gimmick-layout-rotate {
  /* 細い時計針や文字の位置合わせを隠すため、丸型ハンドルは表示しない。
     大きさと角度は上の数値欄、位置はドラッグと矢印キーで調整できる。 */
  display: none;
}
.is-gimmick-layout-adjusting [data-sg-layout-key] { cursor: move; }
/* 調整中は部屋単位の強制スナップを止め、選択対象を画面中央に留める。 */
.is-gimmick-layout-adjusting .pano { scroll-snap-type: none !important; }
.is-gimmick-layout-adjusting [data-sg-layout-key]:hover {
  outline: 2px dotted rgba(255, 216, 77, .72) !important;
  outline-offset: 2px;
}
.is-gimmick-layout-adjusting .is-sg-layout-selected {
  outline: 4px solid #FFD84D !important;
  outline-offset: 4px;
}
@media (max-width: 720px) {
  .sg-gimmick-layout-panel { top: 4px; width: calc(100vw - 8px); max-height: 45vh; overflow: auto; }
  .sg-gimmick-layout-fields input { width: 62px; }
}
/* ==================================================================
   どの画面幅でも使えるページTop。書斎・本・過去問のどこにいても
   右下の青い栞から、現在のページの先頭へ戻れるようにする。
   ================================================================== */
.mobile-top-button {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 94px;
  min-height: 54px;
  padding: 9px 18px;
  border: 2px solid #E8F5FF;
  border-radius: 28px;
  color: #FFFFFF;
  background: linear-gradient(160deg, #3A9BE8 0%, #1870C4 55%, #0C488E 100%);
  box-shadow: 0 5px 13px rgba(8,45,92,.48), inset 0 1px 0 rgba(255,255,255,.55);
  font: 800 18px/1.2 var(--serif);
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform .16s cubic-bezier(.23,1,.32,1), box-shadow .16s cubic-bezier(.23,1,.32,1);
}
.mobile-top-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 16px rgba(8,45,92,.54), inset 0 1px 0 rgba(255,255,255,.55);
}
.mobile-top-button:active { transform: translateY(1px) scale(.97); }
.mobile-top-button:focus-visible { outline: 3px solid #FFDC70; outline-offset: 3px; }
@media (max-width: 700px) {
  /* 「管理人」と同じ大きさで、少し間を空けて右方向をはっきり示す。 */
  .profile-board h2 { display: flex; align-items: baseline; gap: 18px; flex-wrap: nowrap; white-space: nowrap; }
  .mobile-top-button {
    right: 14px;
    bottom: calc(env(safe-area-inset-bottom) + 16px);
    min-width: 76px;
    min-height: 50px;
    padding: 8px 15px;
    font-size: 17px;
  }
  /* 模擬テストだけは下部に固定の採点欄があるため、Topボタンをその上へ逃がす。 */
  .page-moshi .mobile-top-button {
    bottom: calc(env(safe-area-inset-bottom) + 96px);
  }
}

/* 現在のページを離れてサイト入口へ戻るための、パンくず内の大きな道しるべ。 */
.breadcrumb .breadcrumb-site-top {
  min-height: 52px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  color: #FFFFFF;
  background: #B42329;
  border-radius: 4px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: .02em;
  text-decoration: none;
  text-shadow: 0 1px rgba(70,14,17,.38);
  box-shadow: 0 2px 0 rgba(80,12,15,.34);
}
.breadcrumb .breadcrumb-site-top:hover {
  background: #971D22;
}
.breadcrumb .breadcrumb-site-top:focus-visible {
  outline: 3px solid #FFDC70;
  outline-offset: 3px;
}

/* スマホでは右壁の羊皮紙を、写真の下に浮かぶ小さな旅の案内書へ切り替える。
   横に長い書斎を動かさなくても、景色と説明を同じ画面で読めるようにする。 */
@media (max-width: 700px) {
  .world-landmark-scroll {
    position: fixed;
    z-index: 70;
    top: auto;
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom) + 120px);
    left: 12px;
    display: none;
    width: auto;
    height: min(250px, 31dvh);
    max-height: 250px;
  }
  .world-landmark-scroll.is-filled { display: block; }
  .world-scroll-page {
    inset: 12px 9px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 31px 24px 25px;
  }
  .world-scroll-roll {
    left: -5px;
    width: calc(100% + 10px);
    height: 22px;
  }
  .world-scroll-roll::before,
  .world-scroll-roll::after {
    top: 4px;
    width: 12px;
    height: 12px;
  }
  .world-scroll-kicker {
    margin: 0 0 7px;
    font-size: 13px;
    letter-spacing: .16em;
  }
  .world-scroll-kicker::before { margin-right: 5px; }
  .world-scroll-country {
    margin: 0 0 5px;
    padding: 2px 8px 3px;
    font-size: 13px;
  }
  .world-scroll-name {
    margin: 0 0 6px;
    padding-right: 14px;
    font-size: 24px;
    line-height: 1.22;
  }
  .world-scroll-category {
    margin: 0 0 7px;
    padding: 2px 7px;
    font-size: 12px;
  }
  .world-scroll-description {
    padding-top: 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.65;
  }
  .world-scroll-credit {
    position: static;
    margin: 10px 0 0;
    padding: 8px 0 0;
    border-top: 1px solid rgba(107,65,27,.30);
    font-size: 11px;
    line-height: 1.45;
  }
}

/* 窓辺の旧ソファーを、大きな三人掛けビロードソファーへ差し替える。 */
.floor-sofa {
  left: -20px;
  bottom: 58px;
  width: 700px;
  height: 394px;
  object-fit: contain;
  filter: drop-shadow(10px 14px 15px rgba(20, 9, 2, .64)) saturate(.98);
}
/* 閲覧室・目録机・演習室で共通に見える、戻り札とページ栞。
   青や赤の汎用UIを避け、木と真鍮の館内備品として統一する。 */
body:not(.page-library) .breadcrumb .breadcrumb-site-top {
  color: #FFF2C7;
  border: 1px solid #C79A4F;
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(255,221,139,.14), transparent 26% 74%, rgba(0,0,0,.16)),
    linear-gradient(180deg, #86562A, #3D210D);
  box-shadow: inset 0 1px 0 rgba(255,235,176,.38), inset 0 -2px 0 rgba(27,12,4,.54), 0 3px 7px rgba(46,21,5,.28);
  text-shadow: 0 1px 2px #160803;
}
@media (hover: hover) {
  body:not(.page-library) .breadcrumb .breadcrumb-site-top:hover {
    color: #FFF9E3;
    border-color: #F1CB77;
    background: linear-gradient(180deg, #A8723B, #573016);
  }
}
