
:root {
  --page: #f7f8fb;
  --surface: #ffffff;
  --text: #303746;
  --muted: #858da0;
  --accent: #7b9fce;
  --accent-light: #edf3fb;
  --border: #e4e8f0;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

body {
  overflow-x: clip;
  background: var(--page);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI",
    "Noto Sans JP", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px max(20px, calc((100% - 1100px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
}

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 8px 13px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  background: var(--accent-light);
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.page-heading {
  margin-bottom: 26px;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
}

h1 {
  margin: 4px 0;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.3;
}

.description,
.help-text {
  color: var(--muted);
  font-size: 13px;
}

.filter-panel {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field > span {
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

input:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.button {
  margin-top: 16px;
  padding: 9px 14px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.button-light {
  background: var(--accent-light);
  color: var(--accent);
}

.result-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

/* スキン一覧 */
.skin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  min-width: 0;
}

/* カード全体 */
.skin-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.18s, box-shadow 0.18s;
}

.skin-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px #293b5710;
}

/* 画像：元画像390 × 576pxの比率を維持 */
.skin-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 390 / 576;
  overflow: hidden;
  background: linear-gradient(145deg, #eaf0f8, #f7f8fb);
  color: #a1aec1;
  font-size: 13px;
}

/* 画像を枠いっぱいに表示 */
.skin-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.skin-image.has-image {
  cursor: zoom-in;
}

/* 画像の下のスキン情報 */
.skin-info {
  min-width: 0;
  padding: 13px;
}

.skin-name {
  margin: 0 0 5px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.skin-character {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.tag {
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--accent-light);
  color: #5879a8;
  font-size: 10px;
}

.skin-date {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.empty-message {
  padding: 35px 12px;
  color: var(--muted);
  text-align: center;
}

/* ランキング */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rank-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}

.rank-character {
  font-weight: 700;
}

.rank-detail {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.rank-days {
  text-align: right;
  white-space: nowrap;
}

.rank-days strong {
  display: block;
  font-size: 23px;
}

.rank-days span {
  color: var(--muted);
  font-size: 11px;
}

/* フッター */
.site-footer {
  padding: 24px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.site-footer p {
  margin: 3px;
}


/* 画像拡大ダイアログ */
.image-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(900px, calc(100% - 28px));
  max-width: calc(100% - 28px);
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}


.image-dialog::backdrop {
  background: #151b29cc;
}

.image-dialog img {
  display: block;
  max-width: 100%;
  max-height: 75vh;
  margin: 0 auto;
  object-fit: contain;
}

.image-dialog p {
  text-align: center;
}

.dialog-close {
  display: block;
  margin-left: auto;
  margin-bottom: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 28px;
  cursor: pointer;
}

/* タブレット */
@media (max-width: 800px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skin-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

/* スマートフォン */
@media (max-width: 520px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
  }

  .container {
    padding-top: 24px;
  }

  .filter-panel {
    padding: 15px;
  }

  .skin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .skin-info {
    padding: 10px;
  }

  .ranking-item {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  .rank-number {
    width: 36px;
    height: 36px;
  }

  .rank-days strong {
    font-size: 19px;
  }
}

/* レア度：高級（薄緑背景・緑文字） */
.tag-rarity-high {
  background-color: #E3F3E5;
  color: #397849;
}

/* レア度：レア（薄青背景・青文字） */
.tag-rarity-rare {
  background-color: #E2F0FF;
  color: #2865A8;
}

/* レア度：英雄（薄紫背景・紫文字） */
.tag-rarity-hero {
  background-color: #F0E5FF;
  color: #7946A8;
}

/* 分類：薄灰色背景・黒文字 */
.tag-category {
  background-color: #EEEEEE;
  color: #222222;
}


/* スマートフォン：画像ポップアップ */
@media (max-width: 520px) {
  .image-dialog {
    width: calc(100% - 24px);
    max-width: none;
    max-height: 85dvh;
    padding: 12px;
    border-radius: 12px;
  }

  .image-dialog img {
    max-width: 100%;
    max-height: 65dvh;
    width: auto;
    height: auto;
  }

  .dialog-close {
    position: sticky;
    top: 0;
    z-index: 1;
    margin-left: auto;
    margin-bottom: 4px;
    background: var(--surface);
  }

  .image-dialog p {
    margin: 8px 0 4px;
    font-size: 13px;
    overflow-wrap: anywhere;
  }
}

/* ========================================
   KAWORIA DESIGN SYSTEM
   Shared Header / Footer / Color Theme
======================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;600;700&display=swap');


/* 共通カラー */
:root {
  --page: #f4f2f7;
  --surface: #ffffff;

  --text: #55536a;
  --muted: #9290a3;

  --accent: #a38bbd;
  --accent-light: #f0edf7;

  --border: #eeeaf2;

  --radius: 14px;

  --kaworia-blue: #dff1fb;
  --kaworia-pink: #f9e5ef;
}


/* 全体 */
html {
  scroll-behavior: smooth;
}

body {
  padding-top: 66px;
  padding-bottom: 92px;

  background: var(--page);
  color: var(--text);

  font-family: 'DM Sans', 'Noto Sans JP', sans-serif;
  line-height: 1.7;
}


/* ========================================
   HEADER
======================================== */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;

  display: flex;
  align-items: center;
  justify-content: space-between;

  height: 66px;
  padding: 0 clamp(20px, 4vw, 64px);

  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid #f0edf3;
}

.topbar-brand {
  color: #8c78a7;

  font-size: 17px;
  font-weight: 700;
  letter-spacing: .06em;

  text-decoration: none;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  color: #777187;

  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;

  text-decoration: none;

  transition: color .2s, transform .2s;
}

.top-nav a:hover {
  color: #a184bd;
  transform: translateY(-2px);
}

.top-nav a.active {
  color: #a38bbd;
}

.material-symbols-rounded {
  font-size: 22px;
  line-height: 1;

  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
}


/* ========================================
   PAGE HEADING
======================================== */

.eyebrow {
  color: #a18ab8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
}

.page-heading h1 {
  color: #69647e;
  letter-spacing: .04em;
}

.description {
  color: #9290a3;
  line-height: 2;
}


/* ========================================
   FILTER PANEL
======================================== */

.filter-panel {
  background: #fff;
  border: 1px solid #eeeaf2;
  border-radius: 13px;
  box-shadow: 0 5px 22px rgba(89, 75, 110, .035);
}

.field > span {
  color: #69647e;
  font-weight: 600;
}

input,
select {
  border: 1px solid #eae4f0;
  border-radius: 9px;

  background: #fff;
  color: #55536a;

  font-family: 'DM Sans', 'Noto Sans JP', sans-serif;

  transition: border-color .2s, box-shadow .2s;
}

input::placeholder {
  color: #b2aabb;
}

input:focus,
select:focus {
  outline: none;
  border-color: #b49fc8;
  box-shadow: 0 0 0 3px rgba(163, 139, 189, .12);
}


/* ========================================
   BUTTONS
======================================== */

.button {
  border-radius: 9px;
  font-family: 'DM Sans', 'Noto Sans JP', sans-serif;
  font-weight: 600;

  transition:
    background .2s,
    color .2s,
    transform .2s;
}

.button-light {
  background: #f0edf7;
  color: #817092;
}

.button-light:hover {
  background: #e9e0f1;
  color: #8c78a7;
}

.button:active {
  transform: translateY(1px);
}


/* ========================================
   RESULT BAR
======================================== */

.result-bar {
  color: #9290a3;
  align-items: center;
}

.load-all-button {
  margin-top: 0;
}


/* ========================================
   SKIN CARDS
   レイアウト・画像比率は変更しない
======================================== */

.skin-card {
  background: #fff;
  border-color: #eeeaf2;
  border-radius: 13px;

  transition:
    transform .2s,
    box-shadow .2s,
    border-color .2s;
}

.skin-card:hover {
  border-color: #e2d6ed;
  box-shadow: 0 8px 24px rgba(89, 75, 110, .08);
}

.skin-image {
  background:
    linear-gradient(
      145deg,
      #e7f4fc 0%,
      #f1edfa 58%,
      #fcecf3 100%
    );

  color: #a39ab0;
}

.skin-info {
  color: #55536a;
}

.skin-name {
  color: #625773;
  font-weight: 600;
}

.skin-character {
  color: #9290a3;
}

.tags {
  gap: 5px;
}

.tag {
  background: #f0edf7;
  color: #817092;
  border-radius: 6px;
}

.skin-date {
  color: #9290a3;
}


/* ========================================
   RANKING
======================================== */

.ranking-item {
  background: #fff;
  border-color: #eeeaf2;
  border-radius: 13px;
}

.rank-number {
  background: #f0edf7;
  color: #a38bbd;
}

.rank-character {
  color: #625773;
}

.rank-detail,
.rank-days span {
  color: #9290a3;
}

.rank-days strong {
  color: #8c78a7;
}


/* ========================================
   EMPTY MESSAGE
======================================== */

.empty-message {
  color: #9290a3;
}


/* ========================================
   IMAGE DIALOG
======================================== */

.image-dialog {
  background: #fff;
  color: #55536a;
  border: 1px solid #eeeaf2;
  border-radius: 13px;

  box-shadow: 0 15px 50px rgba(50, 40, 70, .15);
}

.image-dialog::backdrop {
  background: rgba(35, 30, 45, .72);
}

.dialog-close {
  color: #8c78a7;
  transition: color .2s;
}

.dialog-close:hover {
  color: #b18fc9;
}


/* ========================================
   FOOTER
======================================== */

.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;

  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 92px;
  padding: 16px 20px;

  background: rgba(255, 255, 255, .97);
  border-top: 1px solid #f0edf3;

  text-align: center;
}

.bottombar small {
  display: block;

  color: #9290a3;
  font-size: 10px;
  font-weight: 500;

  letter-spacing: .02em;
  line-height: 1.8;
}

.bottombar strong {
  font-weight: 600;
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 800px) {
  body {
    padding-top: 60px;
    padding-bottom: 92px;
  }

  .topbar {
    height: 60px;
    padding: 0 18px;
  }

  .bottombar {
    min-height: 92px;
    padding: 12px;
  }

  .bottombar small {
    font-size: 8px;
    line-height: 1.7;
  }
}


/* ========================================
   SMARTPHONE
======================================== */

@media (max-width: 520px) {

  .topbar {
    padding: 0 14px;
    gap: 10px;
  }

  .topbar-brand {
    font-size: 15px;
    flex-shrink: 0;
  }

  .top-nav {
    gap: 10px;
    justify-content: flex-end;
  }

  .top-nav a {
    gap: 4px;
    font-size: 9px;
    letter-spacing: .03em;
  }

  .top-nav .material-symbols-rounded {
    font-size: 18px;
  }

  .container {
    padding-top: 24px;
  }

  .page-heading h1 {
    font-size: 27px;
  }

  .description {
    font-size: 12px;
  }

  .filter-panel {
    padding: 15px;
  }

  .bottombar {
    min-height: 92px;
    padding: 12px 10px;
  }

  .bottombar small {
    font-size: 8px;
  }
}

/* レアリティカラーは従来どおり維持 */
.tag-rarity-high {
  background-color: #E3F3E5;
  color: #397849;
}

.tag-rarity-rare {
  background-color: #E2F0FF;
  color: #2865A8;
}

.tag-rarity-hero {
  background-color: #F0E5FF;
  color: #7946A8;
}

.tag-category {
  background-color: #EEEEEE;
  color: #222222;
}

