/* ============================================================
   PLAYER BASE — Design System
   Version 1.0 / 2026
   配信サポート／ガチャキング統計プラットフォーム
   ============================================================ */

/* ---- Font import -------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* --- Color --- */
  --pb-primary:    #B2F728;  /* Primary  : 強調・アクション */
  --pb-primary-hover:  #9BDB16;
  --pb-primary-active: #7FB50E;
  --pb-text:       #1A1A1A;  /* Text     : 文字・暗色面 */
  --pb-container:  #CDCDCD;  /* Container: グルーピング背景 */
  --pb-background: #F0F0F0;  /* Background: 画面の地色 */
  --pb-surface:    #FFFFFF;  /* Surface  : カード面 */
  --pb-disabled:   #CDCDCD;
  --pb-muted:      #9A9A9A;

  /* --- Typography --- */
  --pb-font: 'Noto Sans JP', sans-serif;
  --pb-font-icon: 'Material Symbols Rounded';
  --pb-title:  50px;  /* TITLE  */
  --pb-header: 40px;  /* HEADER */
  --pb-body:   20px;  /* BODY   */
  --pb-line-height: 1.5;   /* 150% */
  --pb-fw-regular: 400;
  --pb-fw-medium:  500;
  --pb-fw-bold:    700;
  --pb-fw-black:   900;

  /* --- Spacing : 基本は5の倍数 --- */
  --pb-space-1: 5px;
  --pb-space-2: 10px;
  --pb-space-3: 15px;
  --pb-space-4: 20px;
  --pb-space-5: 25px;
  --pb-space-6: 30px;
  --pb-space-8: 40px;
  --pb-space-10: 50px;
  --pb-space-16: 80px;

  /* --- Radius : 角丸は10px もしくは 全丸 --- */
  --pb-radius:  10px;
  --pb-radius-full: 9999px;

  /* --- Elevation --- */
  --pb-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --pb-focus-ring: 0 0 0 4px rgba(178, 247, 40, 0.35);
}

/* ============================================================
   2. BASE / TYPOGRAPHY
   ============================================================ */
.pb-root,
body.pb {
  font-family: var(--pb-font);
  color: var(--pb-text);
  background: var(--pb-background);
  line-height: var(--pb-line-height);
}

.pb-title  { font-size: var(--pb-title);  font-weight: var(--pb-fw-bold); line-height: var(--pb-line-height); }
.pb-header { font-size: var(--pb-header); font-weight: var(--pb-fw-bold); line-height: var(--pb-line-height); }
.pb-body   { font-size: var(--pb-body);   font-weight: var(--pb-fw-regular); line-height: var(--pb-line-height); }
.pb-body-bold { font-size: var(--pb-body); font-weight: var(--pb-fw-bold); line-height: var(--pb-line-height); }

/* ============================================================
   3. ICON  (Google Material Symbols Rounded)
   塗りは FILL、太さは wght 500 を基本とする
   ============================================================ */
.pb-icon {
  font-family: var(--pb-font-icon);
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 1, 'wght' 500;
  font-size: 24px; /* 基本サイズ。20 / 24 / 40px をテキストに合わせる */
}
.pb-icon--outline { font-variation-settings: 'FILL' 0, 'wght' 500; }
.pb-icon--sm { font-size: 20px; }
.pb-icon--md { font-size: 24px; }
.pb-icon--lg { font-size: 40px; }
/* 配色ルール: 明背景=黒 / 暗背景=緑または白 / 緑背景=黒 */
.pb-icon--on-light { color: var(--pb-text); }
.pb-icon--on-dark  { color: var(--pb-primary); }
.pb-icon--on-primary { color: var(--pb-text); }

/* ============================================================
   4. BUTTON
   Primary は全丸ピル。Secondary / 補助は10px角丸も可。
   ============================================================ */
.pb-btn {
  font-family: var(--pb-font);
  font-size: 24px;
  font-weight: var(--pb-fw-bold);
  padding: 16px 40px;
  border: none;
  border-radius: var(--pb-radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
  transition: background-color .15s ease, transform .05s ease;
}
.pb-btn:disabled,
.pb-btn--disabled {
  background: var(--pb-disabled);
  color: var(--pb-background);
  cursor: not-allowed;
}

/* Primary */
.pb-btn--primary { background: var(--pb-primary); color: var(--pb-text); }
.pb-btn--primary:hover  { background: var(--pb-primary-hover); }
.pb-btn--primary:active { background: var(--pb-primary-active); transform: translateY(2px); }

/* Secondary */
.pb-btn--secondary { background: var(--pb-text); color: var(--pb-surface); }
.pb-btn--secondary:hover  { background: #000; }
.pb-btn--secondary:active { transform: translateY(2px); }

/* Outline (10px) */
.pb-btn--outline {
  background: transparent;
  color: var(--pb-text);
  border: 2px solid var(--pb-text);
  border-radius: var(--pb-radius);
  padding: 14px 38px;
}
.pb-btn--outline:hover { background: var(--pb-text); color: var(--pb-surface); }

/* Sizes */
.pb-btn--lg { font-size: 26px; padding: 18px 44px; }
.pb-btn--md { font-size: 22px; padding: 13px 34px; }
.pb-btn--sm { font-size: 18px; padding: 10px 26px; }

/* ============================================================
   5. TAG / CHIP / BADGE
   ============================================================ */
/* --- Tag --- */
.pb-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: var(--pb-fw-bold);
  padding: 8px 26px;
  border-radius: var(--pb-radius-full);
  line-height: 1.2;
}
.pb-tag--active   { background: var(--pb-text); color: var(--pb-primary); }   /* 選択中 */
.pb-tag--primary  { background: var(--pb-primary); color: var(--pb-text); }
.pb-tag--default  { background: var(--pb-container); color: var(--pb-text); }
.pb-tag--outline  { background: transparent; color: var(--pb-text); border: 2px solid var(--pb-text); padding: 6px 24px; }

/* --- Filter chip (10px) --- */
.pb-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: var(--pb-fw-bold);
  padding: 8px 24px;
  border-radius: var(--pb-radius);
  background: var(--pb-surface);
  color: var(--pb-text);
  border: 2px solid var(--pb-container);
  cursor: pointer;
  line-height: 1.2;
}
.pb-chip--active { background: var(--pb-text); color: var(--pb-primary); border-color: var(--pb-text); }

/* --- Status badge --- */
.pb-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: var(--pb-fw-bold);
  padding: 8px 20px;
  border-radius: var(--pb-radius-full);
  line-height: 1.2;
}
.pb-badge--live  { background: var(--pb-text); color: var(--pb-surface); padding-left: 16px; }
.pb-badge--live::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: var(--pb-primary); display: inline-block;
}
.pb-badge--ended { background: var(--pb-container); color: var(--pb-text); }
.pb-badge--new   { background: var(--pb-primary); color: var(--pb-text); font-weight: var(--pb-fw-black); border-radius: 8px; padding: 8px 18px; letter-spacing: .05em; }

/* --- Count badge --- */
.pb-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 15px;
  font-size: 18px;
  font-weight: var(--pb-fw-black);
  background: var(--pb-primary);
  color: var(--pb-text);
}
.pb-count--dark { background: var(--pb-text); color: var(--pb-primary); }
/* 通知アイコンに重ねる場合 */
.pb-count--float {
  position: absolute; top: -6px; right: -6px;
  border: 3px solid var(--pb-background);
}

/* ============================================================
   6. FORM
   角丸10px。フォーカスはグリーン枠＋リング。
   ============================================================ */
.pb-input,
.pb-select {
  font-family: var(--pb-font);
  font-size: 22px;
  color: var(--pb-text);
  background: var(--pb-surface);
  border: 2px solid var(--pb-container);
  border-radius: var(--pb-radius);
  padding: 16px 22px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
}
.pb-input::placeholder { color: var(--pb-muted); }
.pb-input:focus,
.pb-select:focus {
  border-color: var(--pb-primary);
  box-shadow: var(--pb-focus-ring);
}
.pb-select {
  font-weight: var(--pb-fw-bold);
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%231A1A1A'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 18px center;
}

/* --- Checkbox --- */
.pb-check {
  display: inline-flex; align-items: center; gap: 14px;
  font-size: 21px; cursor: pointer;
}
.pb-check__box {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--pb-surface); border: 2px solid var(--pb-container);
  display: inline-flex; align-items: center; justify-content: center;
}
.pb-check--checked .pb-check__box {
  background: var(--pb-primary); border-color: var(--pb-primary);
}

/* --- Radio --- */
.pb-radio { display: inline-flex; align-items: center; gap: 14px; font-size: 21px; cursor: pointer; }
.pb-radio__dot {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--pb-container);
  display: inline-flex; align-items: center; justify-content: center;
}
.pb-radio--checked .pb-radio__dot { border-color: var(--pb-text); }
.pb-radio--checked .pb-radio__dot::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  background: var(--pb-primary);
}

/* --- Toggle --- */
.pb-toggle {
  width: 72px; height: 38px; border-radius: 19px;
  background: var(--pb-container);
  display: inline-flex; align-items: center; padding: 4px;
  cursor: pointer; transition: background .15s ease;
}
.pb-toggle__knob {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--pb-surface); transition: transform .15s ease;
}
.pb-toggle--on { background: var(--pb-primary); justify-content: flex-end; }
.pb-toggle--on .pb-toggle__knob { background: var(--pb-text); }

/* ============================================================
   7. CARD / CONTAINER
   コンテナは #CDCDCD、コンテンツカードは白。角丸10px。
   ============================================================ */
.pb-container {
  background: var(--pb-container);
  border-radius: var(--pb-radius);
  padding: var(--pb-space-6);
}
.pb-card {
  background: var(--pb-surface);
  border-radius: var(--pb-radius);
  padding: var(--pb-space-6);
  box-shadow: var(--pb-shadow);
}
.pb-card--dark {
  background: var(--pb-text);
  color: var(--pb-surface);
  border-radius: var(--pb-radius);
  padding: var(--pb-space-6);
}

/* ============================================================
   8. TABLE / STATS
   ヘッダーは黒。1位など強調行はグリーン。偶数行は地色。
   ============================================================ */
.pb-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--pb-surface);
  border-radius: var(--pb-radius);
  overflow: hidden;
  font-size: 22px;
  box-shadow: var(--pb-shadow);
}
.pb-table thead th {
  background: var(--pb-text);
  color: var(--pb-surface);
  font-weight: var(--pb-fw-bold);
  font-size: 19px;
  text-align: left;
  padding: 18px 28px;
}
.pb-table tbody td { padding: 16px 28px; }
.pb-table tbody tr:nth-child(even) { background: var(--pb-background); }
.pb-table tbody tr.pb-table__rank-1 {
  background: var(--pb-primary);
  font-weight: var(--pb-fw-bold);
}
.pb-table .pb-num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Stat figure --- */
.pb-stat__value { font-size: 60px; font-weight: var(--pb-fw-black); line-height: 1; color: var(--pb-primary); }
.pb-stat__label { font-size: 18px; color: var(--pb-container); }

/* --- Progress bar --- */
.pb-bar { height: 16px; background: var(--pb-container); border-radius: 8px; overflow: hidden; }
.pb-bar__fill { height: 100%; background: var(--pb-primary); }
.pb-bar__fill--dark { background: var(--pb-text); }

/* ============================================================
   9. HEADER / NAV
   ヘッダーバーはグリーン地。アクティブ項目は黒ピル。
   ============================================================ */
.pb-navbar {
  background: var(--pb-primary);
  border-radius: var(--pb-radius);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.pb-navbar__brand { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: var(--pb-fw-bold); }
.pb-navbar__item  { font-size: 24px; font-weight: var(--pb-fw-bold); color: var(--pb-text); }
.pb-navbar__item--active {
  background: var(--pb-text); color: var(--pb-primary);
  padding: 8px 26px; border-radius: var(--pb-radius-full);
}
