/* Doodle District — 账号面板（Supabase）样式。
 *
 * 手绘纸面风：墨色 / 纸色 / 红色点缀，边框用不规则圆角 + 轻微旋转，和主菜单 .panel 一致。
 * 与 account.js 配套；不写行内 style。由 index.html 通过 <link rel="stylesheet" href="./account.css"> 引入。
 */

#acctbox {
  display: flex;
  justify-content: center;
  width: 100%;
}

.acct {
  --acct-ink: #1b1b1b;
  --acct-paper: #f6f3e6;
  --acct-red: #d02030;
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
  margin: 12px auto 0;
  padding: 12px 20px 14px;
  color: var(--acct-ink);
  text-align: center;
  background: rgba(250, 248, 238, .8);
  border: 2.5px solid var(--acct-ink);
  border-radius: 11px 16px 9px 14px / 15px 9px 14px 11px;
  box-shadow: 4px 4px 0 rgba(27, 27, 27, .12);
  transform: rotate(-.35deg);
  font-size: 19px;
  line-height: 1.3;
}

.accthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 4px;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--acct-ink);
  font-size: 23px;
}

.accttag {
  font-size: 15px;
  opacity: .65;
  letter-spacing: 1px;
}

.acctform {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.acctrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

/* 输入框：和 .namebox 同风格的手绘边框 */
.acctbox {
  font: inherit;
  font-size: 19px;
  width: 220px;
  color: var(--acct-ink);
  background: rgba(246, 243, 230, .6);
  border: 2px solid var(--acct-ink);
  border-radius: 6px 9px 5px 8px / 9px 6px 8px 5px;
  padding: 4px 10px;
  outline: none;
  transform: rotate(-.3deg);
}

.acctbox:focus {
  border-color: var(--acct-red);
  box-shadow: 2px 2px 0 rgba(208, 32, 48, .18);
}

.acctbox,
.acct .namebox,
.acctname {
  cursor: text;
}

.acct .namebox,
.acctname {
  font: inherit;
  font-size: 19px;
  width: 170px;
  color: var(--acct-ink);
  background: rgba(246, 243, 230, .6);
  border: 2px solid var(--acct-ink);
  border-radius: 6px 8px 5px 7px / 8px 5px 7px 6px;
  padding: 4px 10px;
  outline: none;
}

.acct .namebox:focus,
.acctname:focus {
  border-color: var(--acct-red);
  box-shadow: 2px 2px 0 rgba(208, 32, 48, .18);
}

/* 按钮：墨底纸字；.alt 反过来。与 .online button 同风格。 */
.acct button {
  font: inherit;
  font-size: 19px;
  color: var(--acct-paper);
  background: var(--acct-ink);
  border: 2.5px solid var(--acct-ink);
  border-radius: 7px 10px 6px 9px / 10px 6px 9px 7px;
  padding: 4px 16px;
  cursor: pointer;
  transform: rotate(-.5deg);
}

.acct button.alt {
  color: var(--acct-ink);
  background: transparent;
}

.acct button.big {
  font-size: 21px;
  padding: 5px 22px;
}

.acct button:disabled {
  opacity: .38;
  cursor: default;
}

.acct button:hover:not(:disabled) {
  filter: brightness(1.12);
}

.acctstatus {
  min-height: 24px;
  margin-top: 7px;
  font-size: 18px;
  color: var(--acct-ink);
  opacity: .85;
}

.accterror {
  min-height: 22px;
  font-size: 17px;
  color: var(--acct-red);
}

.accthello {
  margin: 2px 0 8px;
  font-size: 22px;
}

.accthello b {
  color: var(--acct-red);
}

.acctstats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  margin: 2px 0 10px;
}

.acctstat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 17px;
  white-space: nowrap;
}

.acctstat span {
  opacity: .7;
}

.acctstat b {
  font-size: 24px;
  color: var(--acct-red);
  min-width: 30px;
  text-align: left;
}

.accthint {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.35;
  opacity: .7;
}

.acctnote {
  margin: 10px 0 6px;
  font-size: 21px;
  color: var(--acct-red);
}

.acct-off {
  border-style: dashed;
}

/* 排行榜折叠区 */
.acctlb {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 2px solid var(--acct-ink);
  text-align: left;
}

.acctlb[hidden] {
  display: none !important;
}

.acctlbhead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 19px;
}

.acctlbhead > span {
  margin-right: auto;
}

.acctlbhead .acctk {
  font-size: 16px;
  padding: 2px 10px;
  opacity: .55;
}

.acctlbhead .acctk.on {
  opacity: 1;
  color: var(--acct-paper);
  background: var(--acct-ink);
}

.acctlbrows {
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.acctlbrow {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 4px;
  font-size: 17px;
  border-bottom: 1px dashed rgba(27, 27, 27, .22);
}

.acctlbrow:last-child {
  border-bottom: none;
}

.acctlbrow .rank {
  width: 26px;
  font-size: 15px;
  opacity: .65;
  text-align: right;
}

.acctlbrow .who {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acctlbrow .wave {
  color: var(--acct-red);
  white-space: nowrap;
}

.acctlbrow .score {
  font-size: 15px;
  opacity: .7;
  white-space: nowrap;
}

.acctlbrow.top .who {
  font-weight: bold;
  color: var(--acct-red);
}

.acctlbempty {
  padding: 8px 4px;
  font-size: 16px;
  opacity: .65;
}

/* 主菜单右上角的小状态行（accountBadgeHTML） */
.acctbadge {
  display: inline-block;
  padding: 1px 10px;
  font-size: 16px;
  color: var(--ink, #1a30c0);
  background: rgba(246, 243, 230, .55);
  border: 2px solid currentColor;
  border-radius: 8px 11px 7px 10px / 11px 7px 10px 8px;
  transform: rotate(-1deg);
  white-space: nowrap;
}

/* main.js 里用 <div class="acctbadge"><span>${accountBadgeHTML()}</span></div> 包了一层，
   内层 #acctBadge 同样带 .acctbadge 类：把内层重置掉，只让外层画边框，避免双重描边。 */
.acctbadge .acctbadge {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  transform: none;
  font-size: inherit;
  white-space: normal;
}

.acctbadge.on {
  color: #1b1b1b;
}

.acctbadge.off {
  opacity: .55;
}

/* 外层 .acctbadge 上的 on/off 也要生效（内层被重置时） */
.acctbadge .acctbadge.on {
  color: #1b1b1b;
}

.acctbadge .acctbadge.off {
  opacity: .55;
}

/* 手机竖屏：单列、缩小字号，别把主菜单撑爆 */
@media (max-width: 640px) {
  .acct {
    padding: 10px 12px 12px;
    font-size: 17px;
    max-width: 100%;
  }

  .accthead {
    font-size: 20px;
  }

  .acctbox {
    width: 100%;
    max-width: 300px;
    font-size: 17px;
  }

  .acct .namebox,
  .acctname {
    width: 100%;
    max-width: 220px;
    font-size: 17px;
  }

  .acct button {
    font-size: 17px;
    padding: 4px 12px;
  }

  .acctstat b {
    font-size: 21px;
  }

  .acctlbrows {
    max-height: 180px;
  }
}
