/* アカウント・タブ・雑談・プロフィール・マイページ (style.css の色の変数を使う) */
:root {
  /* 雑談は縛りサバイバーの雑談チャンネルと同じ配色 */
  --c-bg: #070a16; --c-ink: #dfe8ff; --c-muted: #8fa3c8; --c-cyan: #1ee3ff; --c-gold: #ffd24a; --c-green: #2effa8;
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); margin-left: 6px; vertical-align: middle; }
.icon-btn { position: relative; }
.icon-btn .dot, .acMy .dot { position: absolute; top: 4px; right: 4px; margin: 0; }

/* ---------- タイトル ---------- */
.warnBox { background: #241423; border: 1.5px solid #ff9f1c66; color: #ffd9b0; border-radius: 12px; padding: 9px 12px; font-size: .84rem; line-height: 1.6; margin: 0 0 12px; }
.warnBox b { color: #ffb45a; }
.restoreBox, .createBox { margin-top: 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 12px 14px; }
.restoreBox summary, .createBox summary { cursor: pointer; font-weight: 800; color: var(--ink); }
.restoreBox[open] summary, .createBox[open] summary { margin-bottom: 10px; }
.codeIn { width: 100%; font: inherit; font-size: 1.15rem; font-weight: 800; letter-spacing: .12em; text-align: center; text-transform: uppercase; color: var(--ink);
  background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.18); border-radius: 12px; padding: .6em .6em; margin-bottom: 8px; font-family: ui-monospace, Menlo, monospace; }
.acctCard { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; color: var(--ink); text-align: left; margin-bottom: 12px;
  background: linear-gradient(180deg, #1f3a57, #172d45); border-radius: 16px; padding: 10px 12px; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.1); }
.acctCard .av { width: 38px; height: 38px; font-size: 1.05rem; }
.acTxt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acTxt b { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acTxt small { color: var(--muted); font-size: .72rem; }
.acCoins { font-weight: 800; white-space: nowrap; }
.acCoins b { color: var(--gold); font-size: 1.1rem; }
.acMy { position: relative; font-size: 1.2rem; width: 34px; height: 34px; display: grid; place-items: center; background: rgba(255,255,255,.08); border-radius: 10px; }
.btn.quick { flex-direction: column; gap: 2px; padding: .8em 1em; margin-bottom: 12px; }
.btn.quick span { font-size: 1.25rem; }
.btn.quick small { font-weight: 500; font-size: .76rem; opacity: .8; }
#backSeat { margin-bottom: 12px; }
#chatOpen { margin-top: 14px; }
.field .row, .box .row { display: flex; gap: 8px; }
.field .row input { flex: 1; letter-spacing: .4em; text-align: center; font-size: 1.4rem; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 2px rgba(255,255,255,.1); height: 100%; }
.seg span small { color: var(--muted); font-size: .72rem; line-height: 1.4; }
.seg input:checked + span { box-shadow: inset 0 0 0 2px var(--gold); background: rgba(245,200,76,.1); }

/* ---------- テーブル上部のタブ ---------- */
#topbar { justify-content: space-between; }
.tabs { display: flex; background: rgba(255,255,255,.07); border-radius: 12px; padding: 3px; gap: 2px; }
.tab { border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: .85rem; padding: 8px 12px; border-radius: 9px; white-space: nowrap; }
.tab.on { background: #2b4a6b; color: var(--ink); box-shadow: 0 2px 0 #18304a; }
#tableArea { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#chatSlot { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#tblLbl { position: absolute; left: 2%; top: 1%; z-index: 4; display: flex; flex-direction: column; gap: 2px; font-size: .72rem; color: var(--muted); pointer-events: none; }
#tblLbl #handNo { text-align: left; flex: none; }
.coinTag, .practiceTag { font-size: .66rem; padding: 1px 6px; border-radius: 999px; margin-left: 4px; }
.coinTag { background: rgba(245,200,76,.18); color: var(--gold); }
.practiceTag { background: rgba(255,255,255,.1); color: var(--ink); }
.seat .sBox { cursor: pointer; }
#lobbyList li[data-uc] { cursor: pointer; }
#codeNag { position: absolute; left: 50%; top: 54px; transform: translateX(-50%); z-index: 21; background: #10263a; color: var(--c-cyan); border: 1.5px solid #1ee3ff66;
  border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: .82rem; white-space: nowrap; cursor: pointer; box-shadow: 0 0 14px rgba(30,227,255,.25); animation: rise .4s ease-out; }
#codeNag small { color: var(--c-muted); font-weight: 500; }
@media (max-width: 400px) { .tab { padding: 8px 9px; font-size: .8rem; } }

/* ---------- 雑談 ---------- */
#chatScreen { height: 100%; height: 100dvh; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
#game.chatViewport, #chatScreen.chatViewport { position: fixed; top: var(--chat-top); left: 0; right: 0; height: var(--chat-height); overflow: hidden; }
#game.chatViewport ~ #tip, #chatScreen.chatViewport ~ #tip { display: none; }
.chat { flex: 1 1 auto; min-height: 0; height: 100%; display: flex; flex-direction: column; background: var(--c-bg); color: var(--c-ink); max-width: 760px; width: 100%; margin: 0 auto; position: relative; border-radius: 14px 14px 0 0; }
#chatSlot .chat { margin: 4px auto 0; width: calc(100% - 16px); }
.chHead { display: flex; flex-shrink: 0; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #ffffff14; }
.chHead b { font-size: 1rem; }
.chHead small { color: var(--c-muted); font-size: .72rem; flex: 1; }
#chatSlot #chBack { display: none; }
@keyframes breathe2 { 50% { filter: brightness(1.25); } }
#chList { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 10px 4px; overscroll-behavior: contain; }
.chOlder { display: block; margin: 4px auto 10px; border: 0; background: #ffffff12; color: var(--c-muted); border-radius: 999px; padding: 6px 14px; font-size: .78rem; }
.chEmpty { color: var(--c-muted); text-align: center; font-size: .85rem; margin-top: 30px; }
.chDay { text-align: center; color: var(--c-muted); font-size: .7rem; margin: 10px 0 6px; }
.chDay::before, .chDay::after { content: ' ─── '; opacity: .4; }
.chRow { margin-top: 8px; display: flex; flex-direction: column; align-items: flex-start; }
.chRow.grp { margin-top: 2px; }
.chH { display: flex; align-items: baseline; gap: 6px; margin: 0 0 2px 2px; }
.chName { border: 0; background: none; padding: 0; color: var(--c-cyan); font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.chName.fw { color: var(--c-green); }
.chTag { font-size: 10px; color: var(--c-muted); opacity: .7; }
.chTime { font-size: 10.5px; color: var(--c-muted); }
.authorBadge { display: inline-block; color: var(--gold); background: #ffd24a1a; border-radius: 5px; padding: 1px 6px; font-size: 10px; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.chH { flex-wrap: wrap; }
.chLine { display: flex; align-items: flex-end; gap: 4px; max-width: 100%; position: relative; }
.chBub { background: #ffffff0d; border-radius: 4px 12px 12px 12px; padding: 7px 11px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; max-width: 88%; width: fit-content; }
.chMore { border: 0; background: none; color: var(--c-muted); font-size: 1rem; padding: 2px 4px; opacity: .6; cursor: pointer; }
.chRow.mine { align-items: flex-end; }
.chRow.mine .chH { flex-direction: row-reverse; }
.chRow.mine .chLine { flex-direction: row-reverse; }
.chRow.mine .chBub { background: #1ee3ff1a; border-radius: 12px 4px 12px 12px; }
.chPop { position: absolute; bottom: 100%; right: 0; z-index: 5; background: #16203a; border: 1px solid #ffffff22; border-radius: 10px; padding: 4px; display: flex; flex-direction: column; min-width: 120px; box-shadow: 0 8px 20px rgba(0,0,0,.5); }
.chRow.mine .chPop { right: auto; left: 0; }
.chPop button { border: 0; background: none; color: var(--c-ink); text-align: left; padding: 8px 10px; font: inherit; font-size: .85rem; border-radius: 6px; }
.chPop button:hover { background: #ffffff12; }
.chPop span { color: var(--c-muted); font-size: .75rem; padding: 6px 8px; }
#chNew { position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%); border: 0; background: var(--c-cyan); color: #04222a; font-weight: 800; font-size: .8rem; padding: 6px 14px; border-radius: 999px; box-shadow: 0 4px 12px rgba(0,0,0,.5); z-index: 3; }
#chForm { display: flex; flex-shrink: 0; gap: 8px; align-items: flex-end; padding: 8px 10px; border-top: 1px solid #ffffff14; }
#chText { flex: 1; min-width: 0; resize: none; font: inherit; font-size: 16px; color: var(--c-ink); background: #ffffff0f; border: 1.5px solid #ffffff22; border-radius: 12px; padding: 9px 11px; max-height: 118px; outline: none; line-height: 1.4; }
#chText:focus { border-color: var(--c-cyan); }
.chatViewport #chText { max-height: min(118px, calc(var(--chat-height) * .25)); }
#chForm .send { width: 44px; height: 40px; border: 0; border-radius: 12px; background: linear-gradient(135deg, var(--c-cyan), #3effc8); color: #04222a; font-size: 1.1rem; font-weight: 800; }
#chForm .send:disabled { opacity: .5; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#chReply, #chErr { flex-shrink: 0; }
#chErr { color: #ff9aa2; font-size: .8rem; padding: 0 12px 8px; min-height: 0; }
#chErr:empty { display: none; }

/* ---------- シートの中身 ---------- */
.sheetBox .x.back { left: 12px; right: auto; }
.sheetBox:has(.x.back:not([hidden])) h2 { padding-left: 40px; }
.pfHead { display: flex; align-items: center; gap: 12px; margin: 4px 40px 10px 0; }
.pfHead .av { width: 48px; height: 48px; font-size: 1.3rem; }
.pfName { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pfName b { font-size: 16px; font-weight: 800; }
.pfName small { color: var(--muted); font-size: .75rem; }
.tagS { display: inline-block; width: fit-content; font-size: .7rem; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.1); color: var(--ink); }
.tagS.mutual { background: rgba(46,255,168,.15); color: var(--c-green); }
.followBtn { border: 1.5px solid var(--c-green); background: transparent; color: var(--c-green); font-weight: 800; border-radius: 999px; padding: 7px 14px; font-size: .85rem; white-space: nowrap; }
.followBtn.on { background: var(--c-green); color: #04261a; }
.followBtn.small { padding: 4px 10px; font-size: .75rem; }
.fwLine { border: 0; background: rgba(255,255,255,.06); color: var(--ink); width: 100%; text-align: left; border-radius: 10px; padding: 9px 12px; font-size: .88rem; margin-bottom: 10px; }
.fwLine b { color: var(--gold); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.tile { background: rgba(255,255,255,.05); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tile span { font-size: .75rem; color: var(--muted); }
.tile b { font-size: 1.2rem; color: var(--ink); }
.tile small { font-size: .65rem; color: var(--muted); }
.box { background: rgba(255,255,255,.04); border-radius: 14px; padding: 12px; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.box .row input { flex: 1; font: inherit; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.18); border-radius: 10px; padding: 8px 10px; }
.codeCard h2 { color: var(--c-cyan) !important; }
.bigXfer { font-family: ui-monospace, Menlo, monospace; font-size: clamp(22px, 7vw, 32px); letter-spacing: .12em; text-align: center; color: #fff; text-shadow: 0 0 12px #1ee3ff;
  background: #04121c; border: 1.5px solid #1ee3ff66; border-radius: 14px; padding: 14px 8px; margin: 10px 0; user-select: all; -webkit-user-select: all; }
.codeCard p { line-height: 1.7; font-size: .9rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row2 .btn.gold { background: linear-gradient(135deg, var(--c-cyan), #3effc8); color: #04222a; box-shadow: 0 3px 0 #0b7f88; }
ul.rules { padding-left: 1.2em; line-height: 1.75; font-size: .88rem; margin: 0; }
ul.rules li { margin-bottom: 6px; }
.inbox, .fwList { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.inbox li { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: rgba(255,255,255,.05); border-radius: 12px; padding: 10px; }
.inbox li small { display: block; color: var(--muted); font-size: .72rem; margin-top: 2px; }
.inbox li span { display: flex; gap: 6px; flex: 0 0 auto; }
.gold { color: var(--gold); }
.nmBtn { color: var(--c-cyan); cursor: pointer; font-weight: 800; }
.fwList li { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.04); border-radius: 10px; padding: 8px 10px; }
.fwList li .nmBtn { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fwList li small { color: var(--muted); font-size: .7rem; flex: 1; }
.fwList li .me { flex: 0; }
.fwList li.empty { color: var(--muted); justify-content: center; }
.fwList .av { width: 28px; height: 28px; font-size: .8rem; }
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: rgba(255,255,255,.06); border-radius: 10px; padding: 3px; }
.tabs2 button { border: 0; background: transparent; color: var(--muted); font-weight: 800; padding: 8px; border-radius: 8px; font-size: .85rem; }
.tabs2 button.on { background: #2b4a6b; color: var(--ink); }
.chipsSel { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chipsSel button { border: 0; background: rgba(255,255,255,.08); color: var(--ink); border-radius: 999px; padding: 8px 14px; font-weight: 800; font-size: .9rem; }
.chipsSel.msgs button { font-weight: 500; font-size: .82rem; }
.chipsSel button.on { background: var(--gold); color: #3a2500; }
table.hist td:nth-child(2) { text-align: left; font-size: .8rem; }
table.hist td:first-child { font-size: .72rem; color: var(--muted); }
/* 中央寄せ (translateX) を消さない出方。共通の rise は transform を上書きしてしまう */
@keyframes popX { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
#toast.pop, #codeNag { animation: popX .3s ease-out; }
#toast { white-space: normal; text-align: center; width: max-content; max-width: min(92vw, 520px); border-radius: 14px; }
.menu .btn { justify-content: flex-start; text-align: left; } .menu .btn .dot { margin-left: auto; }
/* PC: テーブルの入れ物を2列の格子にする (style.css の同じ指定は、上の display:flex に負けるのでここで上書き) */
@media (min-width: 900px) and (min-height: 600px) {
  #tableArea { display: grid; }
  #tableArea[hidden] { display: none; }
}
/* 返信 (縛りサバイバーと同じ: 引用はひかえめな色・タップで元へ) */
.chRe { border: 0; background: none; color: var(--c-muted); font-size: .95rem; padding: 2px 4px; opacity: .6; cursor: pointer; }
.chQuote { border: 0; background: none; color: var(--c-muted); opacity: .8; font: inherit; font-size: 11.5px; text-align: left; padding: 0 0 2px 4px;
  max-width: 88%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-left: 2px solid #ffffff2a; margin: 2px 0 2px 2px; }
.chRow.mine .chQuote { text-align: right; border-left: 0; border-right: 2px solid #ffffff2a; padding: 0 4px 2px 0; }
.chRow.flash .chBub { animation: flashB 1.6s ease-out; }
@keyframes flashB { 0%, 40% { box-shadow: 0 0 0 2px var(--c-cyan), 0 0 16px rgba(30,227,255,.6); } 100% { box-shadow: none; } }
#chReply { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px 0; color: var(--c-cyan); font-size: .8rem; }
#chReply button { border: 0; background: #ffffff14; color: var(--c-ink); width: 26px; height: 26px; border-radius: 50%; }

/* ホームの主導線と、下部のプロフィール */
#chatOpen { margin-top: 0; }
.homeSecondary { margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.homeSecondary > .btn { font-size: .9rem; }
.profileHeading { font-size: .9rem; color: var(--muted); margin: 22px 0 10px; }
#signupBack { margin-bottom: 14px; }
.field .row input, .box .row input { min-width: 0; width: 0; flex: 1 1 0; }
.field .row .btn, .box .row .btn { flex: 0 0 auto; white-space: nowrap; }
#onlineCount { min-height: 1.4em; }

#friends { min-height: 100%; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); display: grid; justify-items: center; align-content: start; }
#friends .titleBox { max-width: 440px; }
.friendsHeading { font-size: 1.8rem; margin-top: 22px; }
.friendChoices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 20px 0 14px; }
.friendChoices .btn { padding: 12px 6px; font-size: .92rem; }
#ownedRoom .btn { margin: 4px 0; }
#friendCode { text-align: center; letter-spacing: .2em; }
.matchWinner { color: var(--gold); font-size: 1.2rem; font-weight: 800; }

.ownedRoomRow { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1); }
.doneNote { margin: 0 44px 10px 0; padding: 8px 12px; border-radius: 10px; background: rgba(60,200,120,.15); color: #8ef0b4; font-weight: 800; }
/* Claude (祈りに返事を書くAI) */
.aiBadge { display: inline-block; color: #c9b6ff; background: #a78bfa22; border-radius: 5px; padding: 1px 6px; margin-left: 4px; font-size: 10px; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.chRow.ai .chBub { background: linear-gradient(135deg, #a78bfa24, #1ee3ff14); box-shadow: inset 0 0 0 1px #a78bfa40; }
.chRow.ai .chName { color: #c9b6ff; }
.chTabs { display: flex; flex: 1; min-width: 0; gap: 4px; background: #ffffff0d; border-radius: 999px; padding: 3px; }
.chTabs button { flex: 1; min-width: 0; border: 0; background: none; color: var(--c-muted); border-radius: 999px; padding: 6px 6px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.chTabs button.on { background: #ffffff1f; color: #fff; }
.chTabs button[data-chan="1"].on { background: linear-gradient(135deg, #a78bfa55, #1ee3ff33); }
.chPrayInfo { flex-shrink: 0; margin: 8px 10px 0; padding: 8px 10px; border-radius: 10px; font-size: .74rem; line-height: 1.55; color: #d8ccff; background: #a78bfa1a; }
.chPrayInfo button { border: 0; background: none; color: #c9b6ff; text-decoration: underline; font-size: inherit; padding: 0 2px; }
#chat.pray #chText:disabled { opacity: .7; }
