/* ルームズ — HOME'S風UI + 深度で壊れていくテーマ */

:root {
  --brand: #ed6103;
  --brand-dark: #d2560a;
  --price: #ed4b03;
  --ink: #425258;
  --sub: #626262;
  --line: #d2d2d2;
  --bg: #f4f4f4;
  --card: #fff;
  --link: #0052e8;
  --backrooms: #d9c86a;
}

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

body {
  font-family: "Yu Gothic", YuGothic, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  transition: filter 1.2s ease;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
button { font-family: inherit; cursor: pointer; }

/* ===== 深度テーマ ===== */
body[data-depth="2"] { filter: sepia(0.06); }
body[data-depth="3"] { filter: sepia(0.18) saturate(0.95); }
body[data-depth="4"] { filter: sepia(0.35) saturate(0.9); }
body[data-depth="5"] {
  filter: sepia(0.55) saturate(0.85) brightness(0.97);
  --bg: #e6dda4;
  --card: #efe7bb;
  --line: #c9bd7e;
}

html.yellow-flash body { filter: sepia(0.8) saturate(1.4) !important; transition: none; }

body.flicker { animation: flicker 0.5s steps(2) 2; }
@keyframes flicker {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(0.75) sepia(0.3); }
}

/* ノークリップ演出 */
body.noclipping { overflow: hidden; }
body.noclipping .page { animation: fallthrough 1.6s ease-in forwards; }
@keyframes fallthrough {
  0% { transform: none; opacity: 1; }
  30% { transform: translateY(6px) rotate(0.4deg); }
  100% { transform: translateY(120vh) rotate(3deg); opacity: 0.4; }
}
.noclip-veil {
  position: fixed; inset: 0; z-index: 999;
  background: var(--backrooms);
  display: flex; align-items: center; justify-content: center;
  animation: veilin 1.6s ease forwards;
  color: #6b5e1e; font-size: 20px; font-weight: bold; letter-spacing: 0.2em;
}
@keyframes veilin { from { opacity: 0; } 60% { opacity: 0; } to { opacity: 1; } }

/* ===== ヘッダー（白ベース・カテゴリリンク型） ===== */
.header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 20px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  color: var(--brand); font-weight: 800; font-size: 26px; letter-spacing: 0.01em;
  font-family: Futura, "Century Gothic", "Yu Gothic", sans-serif;
}
.logo-mark::before { content: "⌂ "; font-weight: normal; }
body[data-depth="5"] .logo-mark { color: #8a7b20; }
.logo-tagline { font-size: 10.5px; color: var(--sub); border-left: 1px solid var(--line); padding-left: 10px; line-height: 1.4; }

.cat-links { display: flex; gap: 26px; margin-left: 20px; }
.cat-links a { text-align: center; line-height: 1.25; padding: 2px 0; border-bottom: 3px solid transparent; }
.cat-links a:hover { border-bottom-color: var(--brand); }
.cat-links .cat-label { display: block; font-size: 14px; font-weight: bold; color: var(--ink); }
.cat-links .cat-sub { display: block; font-size: 10px; color: var(--sub); }

.header-nav { margin-left: auto; display: flex; gap: 4px; font-size: 12px; align-items: center; }
.header-nav a { padding: 6px 10px; border-radius: 4px; text-align: center; line-height: 1.3; }
.header-nav a:hover { background: #fdf0e6; color: var(--brand-dark); }
.header-nav a.accent { color: #fff; background: var(--brand); font-weight: bold; padding: 9px 14px; }
.header-nav a.accent:hover { background: var(--brand-dark); }
.header-nav .nav-count { color: var(--brand); font-weight: bold; }

.gnav { background: #fff; border-bottom: 1px solid var(--line); }
.gnav-inner { max-width: 1120px; margin: 0 auto; display: flex; font-size: 12px; color: var(--sub); padding: 6px 16px; gap: 4px; }
.gnav span { color: var(--sub); }

/* ===== ヒーロー・検索 ===== */
.hero { background: #fff; border-bottom: 1px solid var(--line); }
.hero-inner { max-width: 1120px; margin: 0 auto; padding: 30px 16px 30px; }
.hero h1 { font-size: 26px; margin-bottom: 10px; font-weight: bold; }
.hero-stats { display: flex; gap: 26px; margin-bottom: 18px; }
.hero-stat {
  font-size: 12.5px; color: var(--sub); background: var(--bg);
  border-radius: 6px; padding: 8px 18px;
}
.hero-stat strong { color: var(--price); font-size: 22px; font-weight: 800; margin: 0 3px; font-family: Arial, sans-serif; }

.method-tabs { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: 8px 8px 0 0; overflow: hidden; }
.method-tabs button {
  flex: 1; min-width: 110px; background: #fff; border: none; border-right: 1px solid var(--line);
  padding: 12px 6px; font-size: 13px; font-weight: bold; color: var(--ink);
}
.method-tabs button:last-child { border-right: none; }
.method-tabs button.active { background: var(--brand); color: #fff; }
.method-tabs button:hover:not(.active) { background: #fdf0e6; }

.type-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px;
  border: 1px solid var(--line); border-top: none; padding: 14px; border-radius: 0 0 8px 8px; background: #fff;
}
.type-grid a {
  border: 1px solid var(--line); border-radius: 6px; padding: 10px 8px; text-align: center;
  font-size: 13px; font-weight: bold; color: var(--ink); background: #fff; line-height: 1.3;
}
.type-grid a small { display: block; font-size: 10px; color: var(--sub); font-weight: normal; }
.type-grid a:hover { border-color: var(--brand); color: var(--brand-dark); background: #fdf0e6; }

.search-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.search-tabs { display: flex; gap: 2px; margin-bottom: 14px; }
.search-tabs button {
  border: 1px solid var(--line); border-bottom: none; background: #f0f0ee;
  padding: 8px 20px; font-size: 13px; font-weight: bold; border-radius: 6px 6px 0 0; color: var(--sub);
}
.search-tabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.search-row { display: flex; gap: 8px; position: relative; }
.search-row input {
  flex: 1; padding: 12px 14px; font-size: 15px;
  border: 2px solid var(--brand); border-radius: 6px; outline: none;
}
.search-row .btn-search {
  background: var(--brand); color: #fff; border: none; border-radius: 6px;
  padding: 0 34px; font-size: 15px; font-weight: bold;
}
.search-row .btn-search:hover { background: var(--brand-dark); }
.suggest {
  display: none; position: absolute; top: 100%; left: 0; right: 130px; z-index: 20;
  background: #fff; border: 1px solid var(--line); border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.1);
}
.suggest-item { padding: 10px 14px; font-size: 14px; cursor: pointer; }
.suggest-item:hover { background: #fff3e6; }

.search-conditions { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 13px; color: var(--sub); }
.search-conditions label { display: flex; gap: 5px; align-items: center; cursor: pointer; }

/* ===== ニュース ===== */
.news { max-width: 1080px; margin: 14px auto 0; padding: 0 16px; }
.news ul {
  list-style: none; background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 16px; font-size: 12.5px; color: var(--sub);
}
.news li { padding: 3px 0; }
.news li::before { content: "・"; color: var(--brand); }

/* ===== セクション / カード ===== */
.section { max-width: 1080px; margin: 26px auto; padding: 0 16px; }
.section-title {
  font-size: 19px; border-left: 5px solid var(--brand);
  padding-left: 10px; margin-bottom: 14px;
}
.section-title small { font-size: 12px; color: var(--sub); font-weight: normal; margin-left: 10px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; transition: box-shadow 0.15s, transform 0.15s; display: block;
}
.card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.12); transform: translateY(-2px); }
.card-photo { aspect-ratio: 4 / 3; background: #eee; }
.card-body { padding: 10px 12px 14px; }
.card-kana { font-size: 11px; color: var(--sub); }
.card-name { font-size: 15px; margin: 1px 0 4px; }
.card-rent { color: var(--price); font-size: 18px; font-weight: 800; }
.card-admin { font-size: 11px; color: var(--sub); font-weight: normal; }
.card-spec, .card-access { font-size: 12px; color: var(--sub); }
.card-tags { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 4px; }
.card-tags span {
  font-size: 10.5px; border: 1px solid var(--brand); color: var(--brand-dark);
  border-radius: 3px; padding: 1px 6px; background: #fff8f0;
}
.card-fav {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: rgba(255,255,255,0.9); border: 1px solid var(--line); border-radius: 50%;
  width: 34px; height: 34px; font-size: 16px; color: var(--price);
}

/* ===== パンくず ===== */
.breadcrumb { max-width: 1080px; margin: 12px auto 0; padding: 0 16px; font-size: 12px; color: var(--sub); }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== 物件詳細 ===== */
.detail { max-width: 1080px; margin: 16px auto 40px; padding: 0 16px; }
.detail-head {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px;
}
.detail-kana { font-size: 12px; color: var(--sub); }
.detail-name { font-size: 24px; margin: 2px 0 6px; }
.detail-rent { color: var(--price); font-size: 30px; font-weight: 800; }
.detail-rent small { font-size: 13px; color: var(--sub); font-weight: normal; margin-left: 8px; }

.detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-photo, .detail-madori {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.detail-photo figcaption, .detail-madori figcaption {
  font-size: 12px; color: var(--sub); padding: 8px 12px; border-top: 1px solid var(--line);
}
.madori-frame { aspect-ratio: 4 / 3; overflow: hidden; position: relative; }
.madori-embed { width: 100%; height: 100%; border: none; display: block; }
.photo-thumbs { display: flex; gap: 6px; padding: 8px 10px; background: #fafafa; border-top: 1px solid var(--line); }
.photo-thumbs img {
  width: 72px; height: 54px; object-fit: cover; border-radius: 4px;
  border: 2px solid transparent; cursor: pointer;
}
.photo-thumbs img:hover { border-color: var(--brand); }
.madori-frame.infinite img { animation: madoriscroll 14s linear infinite; }
@keyframes madoriscroll {
  from { transform: translateY(0); }
  to { transform: translateY(-40%); }
}
.madori-frame.infinite::after {
  content: "図面を生成しています…（終わりません）";
  position: absolute; bottom: 8px; right: 10px; font-size: 11px;
  background: rgba(255,255,255,0.85); padding: 2px 8px; border-radius: 3px; color: var(--sub);
}

.spec-table { width: 100%; border-collapse: collapse; background: var(--card); font-size: 13.5px; margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.spec-table th, .spec-table td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.spec-table th { background: #faf6ef; width: 160px; color: var(--sub); font-weight: bold; }
body[data-depth="5"] .spec-table th { background: #e6dda4; }

.detail-copy { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; margin-top: 14px; font-size: 14.5px; }
.notice {
  margin-top: 14px; border: 2px solid var(--price); background: #fff5f5;
  border-radius: 8px; padding: 14px 18px; font-size: 13.5px;
}
.notice strong { color: var(--price); }

/* 入居者の声・Q&A・更新履歴 */
.reviews { display: grid; gap: 10px; }
.review { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; font-size: 13.5px; }
.review .stars { color: #f5a623; letter-spacing: 2px; margin-bottom: 4px; }
.review-who { font-size: 11.5px; color: var(--sub); margin-top: 6px; text-align: right; }
.qa-list { display: grid; gap: 8px; }
.qa { background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 13.5px; }
.qa-q { padding: 11px 16px; font-weight: bold; background: #faf6ef; border-bottom: 1px solid var(--line); }
body[data-depth="5"] .qa-q { background: #e6dda4; }
.qa-a { padding: 11px 16px; }
.update-log { list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; font-size: 13px; }
.update-log li { padding: 4px 0; border-bottom: 1px dashed #eee; }
.update-log li:last-child { border-bottom: none; color: var(--sub); }
.update-date { display: inline-block; width: 90px; color: var(--sub); font-family: Arial, sans-serif; }
.safety-table th { white-space: nowrap; }

.detail-cta { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.btn-primary {
  background: var(--price); color: #fff; border: none; border-radius: 8px;
  padding: 15px 30px; font-size: 16px; font-weight: bold; flex: 1; text-align: center; min-width: 220px;
}
.btn-primary:hover { background: #c4000f; }
.btn-secondary {
  background: #fff; color: var(--brand-dark); border: 2px solid var(--brand); border-radius: 8px;
  padding: 15px 30px; font-size: 16px; font-weight: bold; flex: 1; text-align: center; min-width: 220px;
}
.btn-secondary:hover { background: #fff3e6; }
.btn-hum { background: none; border: 1px dashed var(--sub); color: var(--sub); border-radius: 6px; padding: 8px 14px; font-size: 12px; }

/* ===== お問い合わせ ===== */
.contact-wrap { max-width: 720px; margin: 20px auto 60px; padding: 0 16px; }
.contact-form {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 24px;
}
.contact-form .form-row { margin-bottom: 16px; }
.contact-form label { display: block; font-size: 13px; font-weight: bold; margin-bottom: 5px; }
.contact-form label .req {
  background: var(--price); color: #fff; font-size: 10px; border-radius: 3px;
  padding: 1px 6px; margin-left: 6px; vertical-align: 1px;
}
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; padding: 11px 12px; font-size: 14px; border: 1px solid #bbb; border-radius: 6px; background: #fff;
}
.contact-form textarea { min-height: 90px; resize: vertical; }

.chat { margin-top: 26px; }
.chat-log {
  background: #857c53; border-radius: 10px; padding: 18px 14px;
  display: flex; flex-direction: column; gap: 10px; min-height: 120px;
}
.msg { max-width: 78%; padding: 10px 14px; border-radius: 12px; font-size: 14px; position: relative; }
.msg.agent { background: #fff; align-self: flex-start; border-top-left-radius: 2px; }
.msg.user { background: #a4e05b; align-self: flex-end; border-top-right-radius: 2px; }
.msg.system { background: none; color: rgba(255,255,255,0.85); font-size: 11.5px; align-self: center; }
.msg .who { display: block; font-size: 10.5px; color: var(--sub); margin-bottom: 2px; }
.msg.typing::after { content: "…"; animation: dots 1s steps(3) infinite; }
@keyframes dots { 0% { content: "."; } 50% { content: ".."; } 100% { content: "..."; } }
.chat-input { display: flex; gap: 8px; margin-top: 10px; }
.chat-input input { flex: 1; padding: 11px 12px; border: 1px solid #bbb; border-radius: 6px; font-size: 14px; }
.chat-input button { background: var(--brand); color: #fff; border: none; border-radius: 6px; padding: 0 22px; font-weight: bold; }

/* ===== 3D内見 ===== */
.walk-body { background: #000; overflow: hidden; }
#walk-canvas { display: block; width: 100vw; height: 100vh; }
.walk-hud {
  position: fixed; top: 14px; left: 14px; z-index: 10; color: #efe6b0;
  font-size: 13px; background: rgba(20,18,4,0.55); border: 1px solid rgba(239,230,176,0.4);
  border-radius: 8px; padding: 10px 14px; line-height: 1.7; pointer-events: none;
}
.walk-hud strong { color: #fff; }
.walk-start {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: rgba(10,9,2,0.82); color: #efe6b0; text-align: center; padding: 20px;
}
.walk-start h1 { font-size: 22px; }
.walk-start p { font-size: 13px; opacity: 0.85; }
.walk-start button {
  background: var(--brand); border: none; color: #fff; font-size: 16px; font-weight: bold;
  padding: 14px 40px; border-radius: 8px;
}
.walk-exit {
  position: fixed; bottom: 18px; right: 18px; z-index: 10;
  background: rgba(20,18,4,0.6); color: #efe6b0; border: 1px solid rgba(239,230,176,0.4);
  border-radius: 8px; padding: 10px 18px; font-size: 13px;
}

/* ===== フッター ===== */
.footer { background: #3b3b3b; color: #ccc; margin-top: 50px; }
body[data-depth="5"] .footer { background: #4a4322; }
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 26px 16px; font-size: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 14px; }
.footer-links a:hover { text-decoration: underline; }
.footer small { display: block; color: #999; line-height: 1.8; }
.footer .disclaimer { color: #8f8f8f; border-top: 1px solid #555; margin-top: 12px; padding-top: 12px; }
