/* =========================================================
   GuildDrama ページ — ゲーム本編の「PCデスクトップUI」風
   ========================================================= */

.gd-page {
  --gd-night: #231D33;
  --gd-night-2: #2F2744;
  --gd-line: #4A4066;
  background: var(--gd-night);
}

/* ---------- Intro ---------- */
.gd-intro {
  padding: calc(var(--header-h) + 56px) 0 40px;
  text-align: center;
  color: var(--cream);
  background:
    radial-gradient(circle at 20% 30%, #3B3158 0 12%, transparent 13%),
    radial-gradient(circle at 85% 70%, #3B3158 0 16%, transparent 17%),
    var(--gd-night);
}
.gd-page .site-header::before { background: color-mix(in srgb, var(--bg) 92%, transparent); }
.gd-crumb { font-family: var(--font-pixel); font-size: .85rem; letter-spacing: .1em; opacity: .75; margin-bottom: 20px; }
.gd-crumb a { color: inherit; }
.gd-flag { width: 64px; margin: 0 auto 10px; }
.gd-title { font-size: clamp(2.4rem, 8vw, 4rem); font-weight: 900; line-height: 1.1; letter-spacing: .02em; }
.gd-title span { font-size: .4em; opacity: .7; margin-left: 6px; }
.gd-catch { margin-top: 14px; font-size: clamp(1.05rem, 2.6vw, 1.3rem); font-weight: 700; color: var(--sky); }
.gd-tags { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.gd-tags li { font-family: var(--font-pixel); font-size: .8rem; letter-spacing: .1em; padding: 3px 14px; border: 2px solid var(--cream); border-radius: 999px; }
.gd-lead { margin-top: 26px; font-size: .92rem; opacity: .8; }

/* ---------- Desktop ---------- */
.gd-desktop-wrap { padding: 0 16px 64px; }
.gd-desktop {
  position: relative;
  max-width: 1120px; margin: 0 auto;
  height: 700px;
  border: 3px solid var(--gd-line); border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(var(--gd-line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--gd-line) 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(circle at 70% 40%, #3F3561, var(--gd-night-2) 60%);
  background-blend-mode: overlay, overlay, normal;
  box-shadow: 0 20px 60px rgb(0 0 0 / .35);
}
.gd-wallpaper {
  position: absolute; right: 28px; bottom: 60px;
  font-family: var(--font-pixel); font-size: .8rem; letter-spacing: .15em;
  color: rgb(255 255 255 / .12); pointer-events: none; user-select: none;
}

/* アイコン */
.gd-icons { position: absolute; top: 18px; left: 14px; display: grid; gap: 6px; z-index: 1; }
.gd-icon {
  position: relative;
  display: grid; justify-items: center; gap: 4px;
  width: 88px; padding: 8px 4px; border: 0; border-radius: 10px;
  background: transparent; color: var(--cream); cursor: pointer;
  font: inherit; font-size: .78rem; font-weight: 700; text-shadow: 0 1px 2px rgb(0 0 0 / .6);
}
.gd-icon:hover, .gd-icon:focus-visible { background: rgb(255 255 255 / .12); outline: none; }
.ico {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px;
  font-family: var(--font-pixel); font-size: .8rem; color: var(--white);
  border: 2px solid rgb(0 0 0 / .25); box-shadow: 3px 3px 0 rgb(0 0 0 / .3);
}
.ico-txt { background: #F4F1E8; color: var(--ink); }
.ico-sns { background: var(--sky-deep); font-size: 1.2rem; }
.ico-chat { background: #6C63C8; font-size: 1.2rem; }
.ico-members { background: var(--red); }
.ico-trash { background: #9A9AA8; font-size: 1.2rem; }
.ico-form { background: var(--cream); font-size: 1.1rem; }
.ico-folder { background: #F2C14E; font-size: 1.1rem; }
.badge-dot { position: absolute; top: 4px; right: 18px; width: 14px; height: 14px; border-radius: 50%; background: #FF4D6D; border: 2px solid var(--gd-night); animation: twinkle 1.2s infinite; }

/* ウィンドウ */
.win {
  position: absolute; left: var(--x); top: var(--y);
  width: min(var(--w), calc(100% - 24px));
  max-height: calc(100% - var(--y) - 60px);
  display: flex; flex-direction: column;
  background: var(--white); color: var(--ink);
  border: 3px solid var(--red-deep); border-radius: 12px;
  box-shadow: 6px 6px 0 rgb(0 0 0 / .35);
  z-index: 2;
}
.win[hidden] { display: none; }
.win.is-front { z-index: 20; }
.win.is-pop { animation: winPop .25s ease; }
@keyframes winPop { from { transform: scale(.92); opacity: .4; } to { transform: none; opacity: 1; } }
.win-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 8px 6px 14px; background: var(--red); color: var(--cream);
  font-family: var(--font-pixel); font-size: .85rem; letter-spacing: .04em;
  border-radius: 8px 8px 0 0; cursor: grab; user-select: none; touch-action: none;
}
.win-bar:active { cursor: grabbing; }
.win-close {
  width: 26px; height: 26px; border: 2px solid var(--cream); border-radius: 6px;
  background: transparent; color: var(--cream); font-size: 1rem; line-height: 1; cursor: pointer;
}
.win-close:hover { background: var(--cream); color: var(--red); }
.win-body { padding: 16px 18px; overflow: auto; font-size: .92rem; line-height: 1.8; }

.win-text h2 { font-size: 1.3rem; font-weight: 900; color: var(--red); margin-bottom: 8px; }
.win-text p { margin-bottom: 10px; }
.win-text em { font-style: normal; color: var(--red); font-weight: 700; }
.win-text dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; margin: 14px 0 0; padding-top: 12px; border-top: 2px dashed color-mix(in srgb, var(--red) 40%, transparent); }
.win-text dt { font-family: var(--font-pixel); font-size: .8rem; color: var(--ink-soft); padding-top: 2px; }
.win-text dd { margin: 0; font-weight: 700; }

/* SNS */
.sns { padding: 0; }
.post { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #EEE3E3; }
.post p { margin: 0; }
.post-head b { color: var(--ink); }
.post-head span { font-size: .78rem; color: var(--ink-soft); }
.av {
  flex: none; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--white);
  background: var(--c); color: var(--white); font-weight: 900; font-size: .8rem;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--c);
}
button.av { cursor: pointer; font-family: inherit; transition: transform .15s; }
button.av:hover { transform: scale(1.1); }
.av-lg { width: 64px; height: 64px; font-size: 1.2rem; margin: 0 auto 8px; }
.sns-back { margin: 10px 14px 0; border: 0; background: none; color: var(--red); font: inherit; font-weight: 700; cursor: pointer; }
.profile-card { padding: 10px 20px 20px; text-align: center; }
.pf-name { font-weight: 900; font-size: 1.1rem; }
.pf-id { font-size: .8rem; color: var(--ink-soft); }
.pf-bio { margin-top: 8px; }
.pf-sub { margin-top: 12px; border: 0; background: none; color: var(--sky-deep); font: inherit; font-size: .85rem; font-weight: 700; text-decoration: underline dotted; cursor: pointer; }
.sns-ura { background: #2B2B33; color: #DDD; min-height: 100%; }
.sns-ura .sns-back { color: #F0A5C5; }
.ura-head { padding: 8px 16px 0; }
.ura-head span { font-size: .8rem; color: #999; }
.ura-bio { padding: 0 16px 10px; font-size: .82rem; color: #aaa; border-bottom: 1px solid #444; }
.sns-ura .post { border-color: #444; }
.sns-ura .post-head b { color: #EEE; }
mark { background: #FFE58A; color: var(--ink); padding: 0 4px; border-radius: 4px; }

/* チャット */
.chat { background: #36324A; color: #E9E6F5; }
.msg { margin-bottom: 10px; }
.msg b { color: var(--c); font-size: .85rem; }
.msg p { margin: 0; }
.deleted-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.deleted-text { font-style: italic; color: #9A95B5; }
.deleted-text.is-restored { font-style: normal; color: #FFD1E3; }
.mod-label { display: block; font-size: .72rem; color: #9A95B5; font-style: normal; }
.mod-btn {
  border: 1px solid #5B5578; border-radius: 6px; background: #2A2638; color: #C9C4E5;
  font: inherit; font-size: .72rem; padding: 1px 8px; cursor: pointer;
}
.mod-btn:hover { background: #3B3552; color: #fff; }
.mod-btn[hidden] { display: none; }
.dm { margin-top: 16px; padding: 12px; border: 2px solid #FF4D6D; border-radius: 10px; background: #2A2638; animation: winPop .3s ease; }
.dm-head { font-size: .8rem; color: #FF9AB0; margin-bottom: 6px; }
.dm-msg { margin: 0; line-height: 1.8; }
.dm-file {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 6px 12px; border: 2px solid #6C63C8; border-radius: 8px; background: #36324A;
  color: #fff; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
}
.dm-file span { font-size: .72rem; color: #B9B3E8; font-weight: 400; }
.dm-file:hover { background: #45406A; }
.post-head .you { font-size: .7rem; background: var(--red); color: var(--cream); padding: 0 6px; border-radius: 999px; }
.gd-lead b { color: var(--sky); }

/* メンバー管理 */
.roster { width: 100%; border-collapse: collapse; font-size: .88rem; }
.roster th { font-family: var(--font-pixel); font-weight: 400; font-size: .78rem; color: var(--ink-soft); text-align: left; border-bottom: 2px solid var(--red); padding: 4px 6px; }
.roster td { padding: 8px 6px; border-bottom: 1px dashed #E5D5D5; }
.roster .secret { font-family: var(--font-pixel); color: var(--ink-soft); }
.roster .secret.is-known { color: var(--red); font-family: var(--font-body); font-weight: 900; }
.roster-note { margin-top: 10px; font-size: .78rem; color: var(--ink-soft); }

/* ゴミ箱 */
.files { display: grid; gap: 6px; }
.file { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; border-radius: 8px; background: none; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left; }
.file:hover { background: var(--cream); }
.file .ico { width: 34px; height: 34px; font-size: .7rem; box-shadow: 2px 2px 0 rgb(0 0 0 / .2); }
.files-note { margin-top: 10px; min-height: 3.2em; font-size: .82rem; line-height: 1.7; color: var(--ink-soft); }

/* 申請書 */
.form-lock { font-weight: 900; color: var(--red); }
.form-msg { margin: 4px 0 14px; font-weight: 700; }
.field { display: flex; gap: 10px; }
.gd-page input[type="text"] {
  width: 100%; min-width: 0; font: inherit; font-weight: 700;
  padding: 10px 16px; border: 3px solid var(--red); border-radius: 999px; background: var(--white); color: var(--ink); outline: none;
}
.gd-page input[type="text"]:focus { box-shadow: 0 0 0 4px var(--sky); }
.field .btn, .form-submit .btn, .campaign-actions .btn { padding: 10px 22px; font: inherit; font-weight: 700; cursor: pointer; }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.form-row { margin-bottom: 16px; border: 0; padding: 0; }
.form-row label, .form-row legend { display: block; font-family: var(--font-pixel); font-size: .82rem; color: var(--red); margin: 0 0 6px 6px; padding: 0; }
.form-row .hint { font-size: .76rem; color: var(--ink-soft); margin: 4px 0 0 8px; }
.emblems { display: flex; gap: 10px; flex-wrap: wrap; }
.emblems label { margin: 0; cursor: pointer; }
.emblems input { position: absolute; opacity: 0; pointer-events: none; }
.emblems span { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; border: 3px solid color-mix(in srgb, var(--red) 25%, transparent); background: var(--white); transition: .15s; }
.emblems img { width: 32px; }
.emblems input:checked + span { border-color: var(--red); box-shadow: 3px 3px 0 var(--red); transform: translate(-2px, -2px); }
.emblems input:focus-visible + span { outline: 3px solid var(--sky-deep); outline-offset: 2px; }
.form-submit { text-align: center; }

.charter { position: relative; text-align: center; border: 3px solid var(--red); border-radius: 14px; padding: 20px 18px 18px; background: #FFFDF7; animation: issue .6s cubic-bezier(.2, 1.3, .4, 1); }
.charter::before { content: ""; position: absolute; inset: 6px; border: 2px dashed color-mix(in srgb, var(--red) 35%, transparent); border-radius: 10px; pointer-events: none; }
@keyframes issue { from { transform: rotate(-8deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.charter-org { font-family: var(--font-pixel); font-size: .7rem; letter-spacing: .2em; color: var(--red); }
.charter-title { font-weight: 900; color: var(--ink-soft); letter-spacing: .3em; margin-bottom: 10px; }
.charter-emblem { width: 72px; margin: 0 auto 4px; }
.charter-name { font-size: 1.6rem; font-weight: 900; color: var(--red); line-height: 1.3; word-break: break-all; margin-bottom: 12px; }
.charter dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0 auto; width: fit-content; max-width: 100%; text-align: left; }
.charter dt { font-family: var(--font-pixel); font-size: .76rem; color: var(--ink-soft); padding-top: 2px; }
.charter dd { margin: 0; font-weight: 900; word-break: break-all; }
.stamp { position: absolute; right: 14px; top: 64px; width: 60px; height: 60px; border-radius: 50%; border: 3px solid var(--red); color: var(--red); display: grid; place-items: center; rotate: -14deg; font-family: var(--font-pixel); font-size: .6rem; line-height: 1.25; opacity: .8; }

.campaign { margin-top: 18px; padding: 16px; border-radius: 14px; background: var(--sky); }
.campaign-label { display: inline-block; background: var(--red); color: var(--cream); font-family: var(--font-pixel); font-size: .72rem; letter-spacing: .15em; padding: 2px 12px; border-radius: 999px; margin-bottom: 6px; }
.campaign h3 { font-size: 1.05rem; font-weight: 900; color: var(--red); margin-bottom: 4px; }
.campaign p { font-size: .88rem; }
.hashtag { font-family: var(--font-pixel); background: var(--white); color: var(--red); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.campaign-actions { margin: 12px 0 4px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.rules { margin-top: 8px; font-size: .78rem; }
.rules summary { cursor: pointer; font-weight: 700; color: var(--red-deep); }
.rules ul { list-style: disc; padding-left: 1.3em; margin-top: 6px; line-height: 1.7; }

/* 通知 */
.gd-notify { position: absolute; right: 14px; bottom: 58px; z-index: 9100; display: grid; gap: 8px; width: min(320px, calc(100% - 28px)); }
.toast-note {
  display: block; width: 100%; text-align: left; padding: 12px 14px; border: 3px solid var(--red-deep); border-radius: 12px;
  background: var(--white); color: var(--ink); font: inherit; font-size: .85rem; line-height: 1.6; cursor: pointer;
  box-shadow: 4px 4px 0 rgb(0 0 0 / .3); animation: notePop .4s cubic-bezier(.2, 1.4, .4, 1);
}
.toast-note b { color: var(--red); }
.toast-note small { display: block; color: var(--ink-soft); }
@keyframes notePop { from { transform: translateX(110%); } to { transform: none; } }

/* タスクバー */
.gd-taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 46px; z-index: 9000;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px;
  background: rgb(20 16 32 / .88); color: var(--cream); font-family: var(--font-pixel); font-size: .85rem;
  border-top: 2px solid var(--gd-line);
}
.tb-start { padding: 4px 12px; border-radius: 8px; background: var(--red); }
.tb-memo { display: flex; align-items: center; gap: 6px; border: 0; background: none; color: inherit; font: inherit; cursor: default; }
.tb-memo i { font-style: normal; min-width: 30px; padding: 1px 8px; border-radius: 6px; background: rgb(255 255 255 / .1); color: rgb(255 255 255 / .35); text-align: center; }
.tb-memo i.is-found { background: #FFE58A; color: var(--ink); }

/* ---------- More ---------- */
.gd-more { padding: 24px 0 96px; color: var(--cream); }
.gd-more p { margin-bottom: 24px; opacity: .85; }

/* ---------- スマホ：ウィンドウを縦に並べる ---------- */
@media (max-width: 860px) {
  .gd-desktop { height: auto; padding: 12px 12px 60px; display: flex; flex-direction: column; gap: 14px; }
  /* スマホは「1画面に1ウィンドウ」：アイコン列を上に固定して、アプリを切り替える感覚で */
  .gd-icons {
    position: sticky; top: var(--header-h); z-index: 30;
    display: flex; gap: 2px; overflow-x: auto; padding: 6px 4px;
    margin: -12px -12px 0; background: rgb(35 29 51 / .95); border-bottom: 1px solid var(--gd-line);
  }
  .gd-icon { width: 68px; flex: none; font-size: .64rem; white-space: nowrap; letter-spacing: -.02em; }
  .gd-icon .ico { width: 38px; height: 38px; }
  .gd-icon.is-current { background: rgb(255 255 255 / .16); }
  .win { position: relative; left: auto; top: auto; width: 100%; max-height: none; animation: none; }
  .win.is-pop { animation: none; }
  .win-bar { cursor: default; }
  .win-body { max-height: none; }
  .gd-desktop { min-height: 70svh; }
  .chat-ch { position: static; }
  .sns-search { position: static; }
  .gd-wallpaper { display: none; }
  .gd-notify { position: fixed; left: 12px; right: 12px; bottom: 12px; width: auto; }
  .tb-start { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .win, .toast-note, .dm, .charter { animation: none !important; }
}

/* =========================================================
   追加：SNS検索・チャットのチャンネル・管理者ログ・ゴミ箱の閲覧
   ========================================================= */
.sns-search { position: sticky; top: 0; z-index: 1; padding: 10px 12px; background: var(--white); border-bottom: 1px solid #EEE3E3; }
.sns-search input[type="text"] { padding: 6px 14px; border-width: 2px; font-size: .85rem; font-weight: 500; }
.sns-miss { margin: 10px 16px 0; font-size: .82rem; color: var(--ink-soft); }
.sns-ura .ura-head { padding-top: 10px; }

.chat { padding-top: 0; }
.chat-ch {
  position: sticky; top: 0; z-index: 1; display: flex; gap: 4px; flex-wrap: wrap;
  margin: 0 -18px 12px; padding: 8px 12px; background: #2C2940; border-bottom: 1px solid #4A4466;
}
.chat-ch button {
  position: relative; border: 0; border-radius: 6px; padding: 3px 10px; background: transparent;
  color: #A9A3C9; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer;
}
.chat-ch button:hover { background: #3B3552; color: #fff; }
.chat-ch button.is-active { background: #4A4466; color: #fff; }
.chat-ch button[hidden] { display: none; }
.chat-ch .badge-dot { top: -2px; right: -2px; }
.chat .deleted-text { font-style: italic; color: #9A95B5; }

.chat-log .log-note { font-size: .75rem; color: #9A95B5; margin-bottom: 8px; }
.log-list { display: grid; gap: 8px; font-size: .82rem; }
.log-list li { padding: 8px 10px; border-radius: 8px; background: #2C2940; }
.log-list time { display: inline-block; min-width: 88px; margin-right: 6px; font-family: var(--font-pixel); color: #8C86AE; font-size: .75rem; }
.log-open {
  margin-left: 6px; border: 1px solid #5B5578; border-radius: 6px; background: #36324A; color: #C9C4E5;
  font: inherit; font-size: .72rem; padding: 0 8px; cursor: pointer;
}
.log-open:hover { background: #45406A; color: #fff; }
.log-open[hidden] { display: none; }
.log-body { margin-top: 8px; padding: 8px 10px; border-left: 3px solid #E58FB5; background: #36324A; border-radius: 0 6px 6px 0; }
.log-body b { color: var(--c); font-size: .82rem; }
.log-body p { margin: 0; }

.chat .dm-head { margin-bottom: 8px; }
.chat .dm { margin-top: 0; }

.file.is-open { background: var(--butter); }
.files-note { padding: 0 4px; }
.files-note b { color: var(--red); }
.files-note .aside { color: var(--ink-soft); font-size: .78rem; }
.roster .secret.is-known { font-size: .82rem; line-height: 1.5; }
.roster th:nth-child(-n+3), .roster td:nth-child(-n+3) { white-space: nowrap; }
.toast-note small { margin-top: 2px; }
@media (max-width: 860px) {
  /* スマホ：ウィンドウが固定アイコン列の上に重ならないように */
  .gd-desktop .win { z-index: 1 !important; }
}
@media (max-width: 860px) {
  /* overflow:hidden があると、sticky のアイコン列が画面ではなくデスクトップ枠基準で固定されてしまう */
  .gd-desktop { overflow: visible; }
  .gd-icons { margin: -12px -12px 0; border-radius: 15px 15px 0 0; }
}

/* SNS：検索結果とプロフィール投稿 */
.sns-results-head { margin: 6px 16px 4px; font-size: .8rem; color: var(--ink-soft); }
.sns-results { display: grid; }
.sns-hit {
  display: flex; gap: 12px; width: 100%; padding: 10px 16px; border: 0; border-bottom: 1px solid #EEE3E3;
  background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.sns-hit:hover { background: var(--butter); }
.sns-hit-text { display: grid; line-height: 1.5; min-width: 0; }
.sns-hit-text small { color: var(--ink-soft); font-size: .78rem; }
.sns-hit-text span { font-size: .82rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-stats { margin-top: 6px; font-size: .78rem; color: var(--ink-soft); }
.pf-posts { border-top: 1px solid #EEE3E3; }

/* 結成証のシェア */
.share-note { margin-top: 8px; font-size: .74rem; color: var(--ink-soft); text-align: center; line-height: 1.6; }
.share-note.is-done { color: var(--red); font-weight: 700; }
.redo-wrap { text-align: center; margin-top: 6px; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: .8rem; color: var(--red-deep); text-decoration: underline; cursor: pointer; }

/* デスクトップアイコン：絵文字は使わず文字だけ */
.ico { font-family: var(--font-pixel); font-size: .7rem !important; letter-spacing: 0; line-height: 1; }
.ico-members, .ico-trash { font-family: var(--font-body); font-weight: 900; font-size: .72rem !important; }
.dm-file-label { font-size: .7rem; padding: 1px 6px; border-radius: 4px; background: #6C63C8; color: #fff !important; font-weight: 700 !important; }

/* デスクトップ用ピクセルアイコン（img/icons/） */
.px-ico { width: 44px; height: 44px; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 rgb(0 0 0 / .35)); }
.px-ico-sm { width: 32px; height: 32px; flex: none; filter: none; }
@media (max-width: 860px) { .gd-icon .px-ico { width: 38px; height: 38px; } }
