/* 游戏大厅：机柜卡片、今日推荐、贴纸墙、换团子 */

.lobby-bar { gap: 8px; }
.lobby-bar .brand { margin-right: 0; }

.wallet {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 2px solid #D9B23A;
  background: #FFF7DC;
  border-radius: 999px;
  padding: 4px 12px 4px 6px;
  margin-left: auto;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.wallet__coin {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #FFD65A;
  border: 2px solid #B98217;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 900; color: #8A5E0A;
}
.wallet b { font-size: 15px; font-variant-numeric: tabular-nums; }
.wallet i { font-style: normal; font-size: 10.5px; color: #8A6A18; font-weight: 800; }

.charbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 2px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 3px 12px 3px 3px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  max-width: 220px;
}
.charbtn:active { transform: translate(2px, 2px); box-shadow: none; }
.charbtn img { width: 34px; height: 34px; object-fit: contain; }
.charbtn span { display: flex; flex-direction: column; line-height: 1.2; text-align: left; min-width: 0; }
.charbtn b { font-size: 12.5px; }
.charbtn small {
  font-size: 10px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
@media (max-width: 720px) {
  .charbtn span { display: none; }
  .charbtn { padding: 3px; }
  .wallet i { display: none; }
}

/* ---------- 问候 ---------- */
.hall {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  gap: clamp(16px, 3vw, 34px);
  align-items: stretch;
  padding-top: clamp(24px, 5vw, 46px);
}
.hall__hello h1 {
  font-size: clamp(30px, 5.6vw, 52px);
  letter-spacing: -.035em;
  margin: 10px 0 12px;
}
.hall__hello h1 em { font-style: normal; color: var(--red); }
.hall__sub { color: var(--ink-2); font-size: clamp(13.5px, 1.7vw, 16px); }
.hall__stats {
  list-style: none;
  display: flex;
  gap: clamp(16px, 3vw, 34px);
  padding: 16px 0 0;
  margin: 20px 0 0;
  border-top: 2px dashed var(--paper-4);
}
.hall__stats li { display: flex; flex-direction: column; }
.hall__stats b { font-size: clamp(20px, 2.6vw, 26px); line-height: 1; letter-spacing: -.02em; }
.hall__stats span { font-size: 11px; color: var(--ink-3); font-weight: 800; margin-top: 4px; }

.daily {
  border: 2.5px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper-2);
  padding: 14px;
  text-decoration: none;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transform: rotate(.5deg);
  transition: transform .18s var(--ease);
}
.daily:hover { transform: rotate(0) translateY(-2px); }
.daily__k {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 3;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--red);
  background: var(--paper);
  border: 2px solid var(--red);
  border-radius: 999px;
  padding: 2px 8px;
}
.daily__art {
  position: relative;
  height: 120px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--wash, #FCE7E1), #FFFDF8);
  border: 2px solid var(--line);
  overflow: hidden;
}
.daily__art img { position: absolute; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); }
.daily__body { display: flex; flex-direction: column; gap: 2px; }
.daily__body b { font-size: 15.5px; }
.daily__body span { font-size: 12px; color: var(--ink-2); }
.daily__body em { font-style: normal; font-size: 12px; font-weight: 900; color: var(--red); margin-top: 4px; }

/* ---------- 筛选 ---------- */
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(26px, 4vw, 40px);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filters__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.fchips {
  border: 2px solid var(--paper-4);
  background: var(--paper);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 900;
  cursor: pointer;
  color: var(--ink-2);
  transition: all .15s;
}
.fchips:hover { border-color: var(--ink-3); }
.fchips[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.filters__count { margin-left: auto; font-size: 11.5px; color: var(--ink-3); font-weight: 800; }

/* ---------- 机柜网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2.2vw, 22px);
}
.machine {
  border: 2.5px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  position: relative;
}
.machine:hover { transform: translateY(-5px) rotate(-.35deg); box-shadow: 8px 11px 0 rgba(43, 33, 27, .15); }
.machine:active { transform: translateY(-1px); }
.machine__screen {
  position: relative;
  aspect-ratio: 16 / 10;
  border-bottom: 2.5px solid var(--line);
  background:
    radial-gradient(100% 80% at 50% 118%, var(--wash), transparent 72%),
    linear-gradient(180deg, #FFFDF8 0%, var(--wash) 100%);
  overflow: hidden;
}
.machine__screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(43, 33, 27, .1) 1px, transparent 1.2px);
  background-size: 15px 15px;
  opacity: .55;
  z-index: 1;
}
.machine__screen::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 26%;
  background: linear-gradient(180deg, transparent, rgba(43, 33, 27, .05));
  z-index: 1;
}
.machine__art {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  filter: drop-shadow(0 8px 9px rgba(43, 33, 27, .16));
  z-index: 2;
  transition: transform .32s var(--bounce);
}
.machine:hover .machine__art { transform: translate(-50%, -55%) rotate(calc(var(--rot, 0deg) * .4)) scale(1.05); }
.machine__no {
  position: absolute;
  top: 9px; left: 11px;
  z-index: 3;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--ink-3);
}
.machine__sticker {
  position: absolute;
  right: 9px; bottom: 10px;
  z-index: 3;
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--paper);
  border: 2px solid var(--line);
  transform: rotate(-4deg);
  box-shadow: 2px 2px 0 rgba(43, 33, 27, .12);
}
.machine__best {
  position: absolute;
  left: 10px; bottom: 10px;
  z-index: 3;
  font-size: 10.5px;
  font-weight: 900;
  color: var(--ink-2);
  background: rgba(255, 251, 245, .86);
  border-radius: 999px;
  padding: 2px 8px;
  border: 1.5px solid rgba(43, 33, 27, .14);
}
.machine__body {
  padding: 13px 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.machine__title { display: flex; align-items: baseline; gap: 7px; }
.machine__title h3 { font-size: 16.5px; }
.machine__en { font-size: 9.5px; letter-spacing: .1em; color: var(--ink-3); font-weight: 800; text-transform: uppercase; }
.machine__joke { font-size: 12px; color: var(--ink-2); line-height: 1.55; flex: 1; }
.machine__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 800;
}
.machine__play {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 900;
  color: #fff;
  background: var(--red);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  box-shadow: 2px 2px 0 rgba(43, 33, 27, .18);
}
.machine__meter { display: inline-flex; gap: 2px; }
.machine__meter i { width: 5px; height: 5px; border-radius: 50%; background: var(--paper-4); }
.machine__meter i[data-on="1"] { background: var(--red); }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-3);
  font-size: 14px;
}

/* 脚本没跑起来之前的占位，避免先看到一片空白 */
.machine--skeleton {
  min-height: 300px;
  background:
    linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .75) 50%, transparent 70%) 0 0 / 220% 100% no-repeat,
    linear-gradient(180deg, var(--paper-2), var(--paper-3));
  animation: shimmer 1.4s linear infinite;
  border-style: dashed;
  opacity: .8;
}
@keyframes shimmer {
  from { background-position: 140% 0, 0 0; }
  to { background-position: -60% 0, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .machine--skeleton { animation: none; }
}

/* ---------- 贴纸墙 ---------- */
.wall { margin-top: clamp(40px, 7vw, 70px); }
.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.sec-head h2 { font-size: clamp(22px, 3.6vw, 30px); margin-top: 4px; }
.sec-head__note { font-size: 12px; font-weight: 900; color: var(--ink-3); }
.wall__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.sticker {
  border: 2px solid var(--paper-4);
  border-radius: 14px;
  background: var(--paper-2);
  padding: 10px 6px 9px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  transition: transform .15s var(--ease), border-color .15s;
}
.sticker img { width: 46px; height: 46px; object-fit: contain; }
.sticker b { font-size: 10.5px; line-height: 1.25; }
.sticker span { font-size: 9px; color: var(--ink-3); line-height: 1.3; }
.sticker[data-on="1"] {
  border-color: var(--line);
  background: #FFF7DC;
  box-shadow: var(--shadow-sm);
}
.sticker[data-on="1"]::after {
  content: "✓";
  position: absolute;
  top: 5px; right: 6px;
  font-size: 10px;
  font-weight: 900;
  color: #1A6E33;
}
.sticker[data-on="0"] img { filter: grayscale(1); opacity: .35; }
.sticker[data-on="0"] b { color: var(--ink-3); }
.sticker:hover { transform: translateY(-3px); }

/* ---------- 重置 ---------- */
.reset { margin-top: clamp(30px, 5vw, 50px); }
.reset details {
  border: 2px dashed var(--paper-4);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.reset summary { cursor: pointer; font-weight: 800; }
.reset p { margin: 8px 0 10px; }

/* ---------- 每日挑战 ---------- */
.dailychal {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 12px 16px;
  border: 2.5px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(100deg, #FFF7DC, #FDF2E6);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.dailychal__stamp {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  color: #fff;
  background: var(--red);
  border-radius: 8px;
  padding: 5px 9px;
  transform: rotate(-3deg);
  box-shadow: 2px 2px 0 rgba(43, 33, 27, .18);
}
.dailychal__body { flex: 1 1 240px; min-width: 0; }
.dailychal__text { font-size: 14px; font-weight: 900; }
.dailychal__sub { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.dailychal.is-done { background: linear-gradient(100deg, #E6F3DC, #FFFBF5); }
.dailychal.is-done .dailychal__stamp { background: var(--success, #1A6E33); }

/* ---------- 本机排行榜 ---------- */
.records { display: flex; flex-direction: column; gap: 12px; }
.record {
  border: 2px solid var(--paper-4);
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--paper-2);
}
.record__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 6px;
}
.record__head span { font-size: 10px; color: var(--ink-3); letter-spacing: .1em; }
.record__head em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--ink-3); font-weight: 800; }
.record ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.record li {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-2);
  background: var(--paper);
  border-radius: 999px;
  padding: 2px 10px;
  border: 1.5px solid var(--paper-4);
}
.record li b { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.record li i { font-style: normal; font-size: 10px; color: var(--ink-3); }
.records__empty { font-size: 13px; color: var(--ink-3); padding: 10px 0 18px; }
.modal__foot { margin-top: 14px; font-size: 12px; color: var(--ink-3); text-align: center; }
.about-p { font-size: 13.5px; color: var(--ink-2); line-height: 1.75; margin-bottom: 10px; }

@media (max-width: 980px) {
  .hall { grid-template-columns: 1fr; }
  .daily { flex-direction: row; align-items: center; gap: 12px; }
  .daily__art { width: 140px; height: 96px; flex: 0 0 auto; }
  .daily__body { flex: 1; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
  .wall__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hall__stats { gap: 16px; }
  .filters__count { display: none; }
  .machine__screen { aspect-ratio: 16 / 9; }
}

/* ---------- 秘密图鉴 ---------- */
.secrets { display: flex; flex-direction: column; gap: 8px; }
.secret {
  display: flex; align-items: center; gap: 10px;
  border: 2px dashed var(--paper-4);
  border-radius: 12px; padding: 9px 11px;
  background: var(--paper-2);
  opacity: .78;
}
.secret.is-found { border-style: solid; border-color: var(--red); background: var(--red-soft); opacity: 1; }
.secret__k {
  flex: 0 0 auto; font-size: 10px; font-weight: 900; letter-spacing: .08em;
  background: var(--ink); color: var(--paper); border-radius: 6px; padding: 3px 6px;
}
.secret.is-found .secret__k { background: var(--red); }
.secret__body { flex: 1; min-width: 0; }
.secret__body b { font-size: 13px; }
.secret__body p { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.secret i { font-style: normal; font-weight: 900; color: var(--red); }

.secrethint {
  margin: 18px 0 10px;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
}
.secrethint .linklike { color: var(--red); margin-left: 4px; font-size: 12.5px; }

/* 窄屏：顶栏只留搜索与声音，其余交给底部 Dock */
@media (max-width: 620px) {
  #recordsBtn, #secretsBtn { display: none; }
  .iconbtn--search span { display: none; }
  .topbar__brand b { font-size: 15px; }
}
