:root {
  --ok: #22c55e;
  --partial: #eab308;
  --bad: #ef4444;
  --bg: #111827;
}

body {
  height: 100%;
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, "Noto Sans SC", sans-serif;
  background: #f9fafb;
  color: #111827;
  display: flex;
  flex-direction: column;
}

.header {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.sub {
  color: #6b7280;
  margin-top: 6px;
}

/* 2/3 屏幕宽度 */
.wrap {
  width: min(66vw, 980px);
  min-width: 720px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ===== 顶部栏 ===== */

.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.mode-tabs{
  display: flex;
  gap: 8px;
}

.tab{
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #111827;
  cursor: pointer;
  font-size: 14px;
}

.tab.active{
  background: var(--bg);
  color: white;
  border-color: var(--bg);
}

.status{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill{
  padding: 8px 10px;
  border-radius: 999px;
  background: white;
  border: 1px solid #e5e7eb;
  font-size: 13px;
  color: #374151;
}

/* ===== 输入 + 自动补全 ===== */

.autocomplete {
  position: relative;
  flex: 1;
}

input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  font-size: 16px;
}

button {
  padding: 12px 18px;
  font-size: 16px;
  background: var(--bg);
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 10px;
}

button:disabled{
  opacity: .6;
  cursor: not-allowed;
}

/* 候选下拉 */
.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  max-height: 320px;
  overflow: auto;
  z-index: 50;
}

.suggestions li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.suggestions li:hover,
.suggestions li.active {
  background: #f3f4f6;
}

.sug-title {
  font-weight: 700;
  color: #111827;
}

.sug-sub {
  font-size: 12px;
  color: #6b7280;
}

.card {
  margin: 12px 0;
  padding: 12px;
  border-radius: 8px;
  background: #e5e7eb;
}

.muted {
  color: #6b7280;
}

/* ===== 表格区域：独立横向滚动 ===== */

.board {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  padding-bottom: 6px;
}

.row-cells {
  display: grid;
  grid-template-columns:
    minmax(90px, 1.2fr)   /* 名字 */
    minmax(110px, 1fr)    /* 乐队 */
    minmax(120px, 1.2fr)  /* 担当 */
    minmax(150px, 1.4fr)  /* 学校 */
    minmax(80px, 0.8fr)   /* 年级 */
    minmax(80px, 0.8fr)   /* 发色 */
    minmax(80px, 0.8fr)   /* 瞳色 */
    minmax(90px, 0.9fr);  /* 身高 */
  gap: 6px;
  margin-bottom: 6px;
  min-width: 920px;
}

/* 所有格子：水平+垂直居中 */
.cell {
  display: flex;
  justify-content: center;
  align-items: center;

  padding: 10px 6px;
  border-radius: 6px;
  font-size: 13px;
  color: white;
  user-select: none;
  white-space: nowrap;
  text-align: center;
}

/* 表头行 */
.header-row {
  margin-top: 16px;
  margin-bottom: 10px;
}

.header-cell {
  background: #e5e7eb;
  color: #374151;
  font-weight: 600;
}

/* 名字列头像在上名字在下 */
.cell.name-cell {
  padding: 8px 6px;
}

.name-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.name-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.22);
}

.name-text {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
}

/* ban 格子 */
.ban {
  background: #9ca3af !important;
  color: white !important;
  font-weight: 800;
}

/* 颜色 */
.ok { background: var(--ok); }
.partial { background: var(--partial); }
.bad { background: var(--bad); }

/* 小屏 */
@media (max-width: 900px) {
  .wrap { width: 100%; min-width: 0; }
  .topbar{ flex-direction: column; align-items: stretch; }
  .status{ justify-content: flex-start; }
}

/* Challenge HUD: hearts bar  */

.hearts-wrap{
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: white;
  border: 1px solid #e5e7eb;
}

.hearts-bar{
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  max-width: 420px; 
}

.heart{
  font-size: 18px;
  line-height: 1;
  transform-origin: center;
  display: inline-block;
}

.heart.gain{
  animation: heartPop 320ms ease-out both;
}

.heart.lose{
  animation: heartLose 360ms ease-in both;
}

@keyframes heartPop{
  0% { transform: scale(0.2); filter: brightness(1.4); opacity: 0.2; }
  70% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes heartLose{
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.2); opacity: 0; }
}

/* ===== Divider between characters (challenge mode) ===== */
.divider-row{
  margin: 10px 0;
  min-width: 920px;
}

.divider-line{
  height: 6px;
  border-radius: 999px;
  background: rgba(156,163,175,0.55);
}

/* ===== Screen edge flash overlay ===== */
.fx-overlay{
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 999;
  box-shadow: inset 0 0 0 0 rgba(0,0,0,0);
}

.fx-overlay.flash-red{
  animation: flashRed 220ms ease-out both;
}

.fx-overlay.flash-green{
  animation: flashGreen 220ms ease-out both;
}

@keyframes flashRed{
  0% { opacity: 0; box-shadow: inset 0 0 0 0 rgba(239,68,68,0); }
  40% { opacity: 1; box-shadow: inset 0 0 0 14px rgba(239,68,68,0.65); }
  100% { opacity: 0; box-shadow: inset 0 0 0 0 rgba(239,68,68,0); }
}

@keyframes flashGreen{
  0% { opacity: 0; box-shadow: inset 0 0 0 0 rgba(34,197,94,0); }
  40% { opacity: 1; box-shadow: inset 0 0 0 14px rgba(34,197,94,0.55); }
  100% { opacity: 0; box-shadow: inset 0 0 0 0 rgba(34,197,94,0); }
}

/* ===== Shake (wrong guess feedback) ===== */
.wrap.shake{
  animation: shake 220ms ease-in-out both;
}

@keyframes shake{
  0% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

/* Band filter dropdown  */

.filters{
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.filter-btn{
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #111827;
  cursor: pointer;
  font-size: 14px;
}

.dropdown{
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 280px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  padding: 10px;
  z-index: 80;
}

.dropdown .opt{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}

.dropdown .opt:hover{
  background: #f3f4f6;
}

.dropdown .opt input{
  width: 16px;
  height: 16px;
}

.dropdown .all{
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 6px;
  padding-bottom: 10px;
}

.dropdown .options{
  max-height: 260px;
  overflow: auto;
  padding-top: 4px;
}

/* jigo专区按钮 */
.mode-card{
  display: block;
  padding: 28px;
  border-radius: 16px;
  background: white;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  color: inherit;
  margin-top: 20px;
}

.mode-card:hover{
  background: #f3f4f6;
}

.image-box{
  height: 260px;
  border-radius: 16px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.entry-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #111827;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}

.entry-btn:hover{
  background: #f3f4f6;
}

/* 表头说明 tooltip  */

.header-cell{
  position: relative;
  gap: 6px;
}

.h-title{
  pointer-events: none;
}

.info-wrap{
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-icon{
  font-size: 12px;
  color: #6b7280;
  cursor: help;
  user-select: none;
}

.info-icon:hover{
  color: #111827;
}

.info-pop{
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 220px;

  background: white;
  color: #374151;
  font-size: 12px;
  line-height: 1.4;

  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);

  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 200;
}

/* hover */
.info-wrap:hover .info-pop{
  opacity: 1;
  pointer-events: auto;

  width: max-content;
  max-width: 320px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/*  Footer  */
.site-footer{
  margin-top: 32px;
  padding: 16px 12px;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.4;
}

.footer-inner{
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-text{
  line-height: 1.4;
}

.footer-link{
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover{
  text-decoration: underline;
}

/* 小屏适配 */
@media (max-width: 640px){
  .footer-inner{
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }
}

.header{
  position: relative;
}

/* 贴纸公告 */
.announce-sticker{
  position: absolute;

  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  width: 320px;
  height: 160px;         
  padding: 12px 14px;

  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;

  box-shadow: 0 8px 24px rgba(0,0,0,0.08);

  z-index: 5;

  pointer-events: none;
}

.announce-sticker .announce-badge{
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
}

.announce-sticker .announce-text{
  font-size: 14px;       
  line-height: 1.6;
  color: #374151;
  text-align: center;

  white-space: normal;
  overflow: visible;
}

/* 公告关闭按钮 */
.announce-close{
  position: absolute;
  top: 6px;
  right: 8px;

  width: 28px;
  height: 28px;
  border-radius: 50%;

  border: none;
  background: rgba(0,0,0,0.05);
  color: #374151;

  font-size: 18px;
  line-height: 1;
  cursor: pointer;

  display: none;   /* 默认不显示 */
}

@media (max-width: 640px){
  .announce-close{
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.announce-close{
  pointer-events: auto;
}

@media (max-width: 640px){
  .announce-sticker{
    pointer-events: auto;
  }
}

