/* ==========================================================================
   カトサンラボのおもちゃ箱（Katosan Lab Toybox）スタイルシート
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. デザインシステム・CSS変数
   -------------------------------------------------------------------------- */
:root {
  /* ベースカラー（温かみのある白・クリーム） */
  --color-bg-base: #FDFBF7;
  --color-bg-card: #FFFFFF;
  --color-bg-alt: #F7F5F0;
  
  /* テキストカラー */
  --color-text-main: #2D3748;
  --color-text-muted: #718096;
  --color-text-light: #A0AEC0;
  --color-border: #E8E5DF;
  --color-border-light: #F0EDE6;

  /* トイボックス アクセントカラー */
  --toy-orange: #ED8936;
  --toy-orange-dark: #DD6B20;
  --toy-orange-light: #FEEBC8;

  --toy-blue: #3182CE;
  --toy-blue-dark: #2B6CB0;
  --toy-blue-light: #BEE3F8;

  --toy-yellow: #ECC94B;
  --toy-yellow-dark: #D69E2E;
  --toy-yellow-light: #FEFCBF;

  --toy-red: #E53E3E;
  --toy-red-dark: #C53030;
  --toy-red-light: #FED7D7;

  --toy-green: #38A169;
  --toy-green-dark: #2F855A;
  --toy-green-light: #C6F6D5;

  --toy-purple: #805AD5;
  --toy-purple-light: #E9D8FD;

  /* タイポグラフィ */
  --font-family-base: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-display: "M PLUS Rounded 1c", "Noto Sans JP", sans-serif;

  /* サイジング & 角丸 */
  --max-width: 1140px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* シャドウ */
  --shadow-sm: 0 2px 4px rgba(160, 140, 110, 0.08);
  --shadow-md: 0 6px 14px rgba(160, 140, 110, 0.1);
  --shadow-lg: 0 12px 28px rgba(160, 140, 110, 0.14);
  --shadow-card-hover: 0 14px 30px rgba(237, 137, 54, 0.2);

  /* トランジション */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   2. リセット & 基本スタイル
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-main);
  background-color: var(--color-bg-base);
  background-image: 
    radial-gradient(#E8E5DF 1.2px, transparent 1.2px);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all var(--transition-fast);
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* --------------------------------------------------------------------------
   3. Header
   -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(253, 251, 247, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  border-bottom: 2px dashed var(--color-border);
  transition: all var(--transition-fast);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-icon {
  font-size: 1.75rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(237, 137, 54, 0.3));
  transition: transform var(--transition-bounce);
}

.brand-link:hover .brand-logo-icon {
  transform: rotate(-10deg) scale(1.15);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-family-display);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--color-text-main);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-title .toy-accent {
  color: var(--toy-orange);
}

.brand-sub {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

/* ヘッダー右側ナビゲーションボタン */
.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font-family-display);
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-btn-blog {
  background-color: var(--color-bg-card);
  color: var(--color-text-main);
  border: 1.5px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.nav-btn-blog:hover {
  background-color: var(--toy-yellow-light);
  border-color: var(--toy-yellow-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.nav-btn-kobo {
  background-color: var(--color-bg-card);
  color: #2C7A7B;
  border: 1.5px solid #81E6D9;
  box-shadow: var(--shadow-sm);
}

.nav-btn-kobo:hover {
  background-color: #E6FFFA;
  border-color: #2C7A7B;
  color: #234E52;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   4. Hero
   -------------------------------------------------------------------------- */
.hero {
  padding: 50px 0 36px 0;
  text-align: center;
  position: relative;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #FFFFFF;
  border: 2px dashed var(--toy-orange);
  color: var(--toy-orange-dark);
  font-family: var(--font-family-display);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.hero-title {
  font-family: var(--font-family-display);
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1.35;
  color: var(--color-text-main);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.hero-title .highlight {
  position: relative;
  display: inline-block;
  color: var(--toy-orange);
}

.hero-title .highlight::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 100%;
  height: 10px;
  background-color: var(--toy-yellow-light);
  z-index: -1;
  border-radius: 4px;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--color-text-main);
  font-weight: 500;
  max-width: 640px;
  margin: 0 auto 24px auto;
  line-height: 1.8;
}

.hero-sub strong {
  color: var(--toy-orange-dark);
  font-weight: 800;
}

.hero-features-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.ribbon-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-main);
  background-color: #FFFFFF;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.ribbon-item i {
  color: var(--toy-orange);
}

/* --------------------------------------------------------------------------
   5. Category Filter Tabs
   -------------------------------------------------------------------------- */
.filter-section {
  padding: 10px 0 30px 0;
}

.tabs-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-family-display);
  font-size: 0.95rem;
  font-weight: 800;
  background-color: #FFFFFF;
  color: var(--color-text-main);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-bounce);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tab-btn:hover {
  transform: translateY(-2px);
  border-color: var(--toy-orange);
  background-color: var(--toy-orange-light);
  color: var(--toy-orange-dark);
}

.tab-btn.active {
  background-color: var(--toy-orange);
  color: #FFFFFF;
  border-color: var(--toy-orange-dark);
  box-shadow: 0 4px 12px rgba(237, 137, 54, 0.35);
  transform: translateY(-2px) scale(1.03);
}

.tab-count {
  font-size: 0.75rem;
  background-color: rgba(0, 0, 0, 0.08);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}

.tab-btn.active .tab-count {
  background-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   6. Works Grid
   -------------------------------------------------------------------------- */
.works-section {
  padding: 10px 0 70px 0;
  flex-grow: 1;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  transition: opacity var(--transition-fast);
}

/* カードスタイル */
.work-card {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), opacity var(--transition-normal);
  animation: cardFadeIn 0.35s ease forwards;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.work-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(237, 137, 54, 0.4);
}

.work-card.is-hidden {
  display: none !important;
}

/* サムネイル枠 (アスペクト比 16:9) */
.thumbnail-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background-color: #EDF2F7;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1.5px solid var(--color-border-light);
}

.thumbnail-canvas {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-normal);
  position: relative;
}

.work-card:hover .thumbnail-canvas {
  transform: scale(1.05);
}

/* サムネイル内ビジュアル装飾（手作り感のあるSVG/CSSグラフィック） */
.thumb-icon-main {
  font-size: 3.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
  margin-bottom: 6px;
}

.thumb-tagline {
  font-family: var(--font-family-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: #FFFFFF;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
}

/* サムネイル右上のおもちゃタグ */
.thumb-corner-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #FFFFFF;
  font-family: var(--font-family-display);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

/* テーマ別サムネイル背景 */
.theme-breakout {
  background: linear-gradient(135deg, #FF6B6B 0%, #FFA07A 100%);
  color: #FFFFFF;
}

.theme-runner {
  background: linear-gradient(135deg, #4A00E0 0%, #8E2DE2 100%);
  color: #FFFFFF;
}

.theme-puzzle {
  background: linear-gradient(135deg, #11998E 0%, #38EF7D 100%);
  color: #FFFFFF;
}

.theme-textcounter {
  background: linear-gradient(135deg, #2B5876 0%, #4E4376 100%);
  color: #FFFFFF;
}

.theme-pomodoro {
  background: linear-gradient(135deg, #F857A6 0%, #FF5858 100%);
  color: #FFFFFF;
}

.theme-memory {
  background: linear-gradient(135deg, #FF6B8B 0%, #FFA07A 50%, #FED7AA 100%);
  color: #FFFFFF;
}

.theme-poker {
  background: linear-gradient(135deg, #0F5132 0%, #198754 50%, #0D6EFD 100%);
  color: #FFFFFF;
}

.theme-24timer {
  background: linear-gradient(135deg, #1A202C 0%, #2C5282 60%, #D69E2E 100%);
  color: #ECC94B;
}

.theme-interval {
  background: linear-gradient(135deg, #2B6CB0 0%, #319795 100%);
  color: #FFFFFF;
}

.theme-nurikabe {
  background: linear-gradient(135deg, #2D3748 0%, #4A5568 50%, #718096 100%);
  color: #FFFFFF;
}

.theme-nurikabe-ice {
  background: linear-gradient(135deg, #1A365D 0%, #2B6CB0 50%, #63B3ED 100%);
  color: #FFFFFF;
}

.theme-court {
  background: linear-gradient(135deg, #742A2A 0%, #9B2C2C 50%, #D69E2E 100%);
  color: #FFFFFF;
}

/* カード本文 */
.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-catchphrase {
  font-family: var(--font-family-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--toy-orange-dark);
  background-color: var(--toy-orange-light);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  line-height: 1.45;
  border-left: 3px solid var(--toy-orange);
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.badge {
  font-family: var(--font-family-display);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-game {
  background-color: var(--toy-red-light);
  color: var(--toy-red-dark);
}

.badge-tool {
  background-color: var(--toy-blue-light);
  color: var(--toy-blue-dark);
}

.badge-mobile {
  background-color: var(--toy-green-light);
  color: var(--toy-green-dark);
}

.badge-unity {
  background-color: var(--toy-purple-light);
  color: var(--toy-purple);
}

.badge-unityroom {
  background-color: #EBF8FF;
  color: #2B6CB0;
  border: 1px solid #BEE3F8;
}

.card-title {
  font-family: var(--font-family-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-text-main);
  margin-bottom: 8px;
  line-height: 1.4;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  flex-grow: 1;
}

/* コントロール操作案内 */
.card-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
  margin-bottom: 16px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.control-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-item i {
  color: var(--toy-orange);
}

/* アクションボタン */
.card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  font-family: var(--font-family-display);
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  color: #FFFFFF;
  background-color: var(--toy-orange);
  box-shadow: 0 3px 8px rgba(237, 137, 54, 0.25);
  transition: all var(--transition-fast);
}

.card-btn:hover {
  background-color: var(--toy-orange-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(237, 137, 54, 0.35);
  color: #FFFFFF;
}

.card-btn.btn-tool {
  background-color: var(--toy-blue);
  box-shadow: 0 3px 8px rgba(49, 130, 206, 0.25);
}

.card-btn.btn-tool:hover {
  background-color: var(--toy-blue-dark);
  box-shadow: 0 6px 14px rgba(49, 130, 206, 0.35);
}

.card-btn.btn-unityroom {
  background-color: #4A5568;
  box-shadow: 0 3px 8px rgba(74, 85, 104, 0.25);
}

.card-btn.btn-unityroom:hover {
  background-color: #2D3748;
  box-shadow: 0 6px 14px rgba(45, 55, 72, 0.35);
}

/* 作品が0件のときの表示 */
.empty-state {
  display: none;
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background-color: #FFFFFF;
  border-radius: var(--radius-md);
  border: 2px dashed var(--color-border);
}

.empty-state.show {
  display: block;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  color: var(--toy-orange);
}

/* --------------------------------------------------------------------------
   7. Footer Banners
   -------------------------------------------------------------------------- */
.banners-section {
  padding: 40px 0 60px 0;
  border-top: 2px dashed var(--color-border);
  background-color: var(--color-bg-alt);
}

.banners-header {
  text-align: center;
  margin-bottom: 30px;
}

.banners-badge {
  font-family: var(--font-family-display);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--toy-orange);
  background-color: #FFFFFF;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 8px;
  border: 1px solid var(--color-border);
}

.banners-title {
  font-family: var(--font-family-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-text-main);
}

.banners-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.banner-card {
  background-color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1.5px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.banner-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.banner-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
}

.banner-udemy::before { background-color: #A435F0; }
.banner-youtube::before { background-color: #FF0000; }
.banner-kobo::before { background-color: #2C7A7B; }

.banner-label {
  font-family: var(--font-family-display);
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.banner-udemy .banner-label { color: #A435F0; }
.banner-youtube .banner-label { color: #E53E3E; }
.banner-kobo .banner-label { color: #2C7A7B; }

.banner-heading {
  font-family: var(--font-family-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-text-main);
  margin-bottom: 8px;
  line-height: 1.4;
}

.banner-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
  flex-grow: 1;
}

.banner-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family-display);
  font-size: 0.875rem;
  font-weight: 800;
  transition: color var(--transition-fast);
  margin-top: auto;
}

.banner-udemy .banner-link { color: #A435F0; }
.banner-youtube .banner-link { color: #E53E3E; }
.banner-kobo .banner-link { color: #2C7A7B; }

.banner-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   8. Footer
   -------------------------------------------------------------------------- */
.footer {
  background-color: #2D3748;
  color: #E2E8F0;
  padding: 36px 0 24px 0;
  text-align: center;
  font-size: 0.875rem;
}

.footer-produced {
  font-family: var(--font-family-display);
  font-weight: 700;
  margin-bottom: 8px;
  color: #CBD5E0;
}

.footer-produced a {
  color: #81E6D9;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-produced a:hover {
  color: #FFFFFF;
}

.footer-copy {
  font-size: 0.8rem;
  color: #A0AEC0;
}

/* --------------------------------------------------------------------------
   9. レスポンシブ対応 (メディアクエリ)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .works-grid,
  .banners-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .header-container {
    gap: 8px;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .brand-sub {
    display: none;
  }

  .nav-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .hero {
    padding: 36px 0 24px 0;
  }

  .hero-title {
    font-size: 1.65rem;
  }

  .hero-sub {
    font-size: 0.95rem;
  }

  .tab-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .works-grid,
  .banners-grid {
    grid-template-columns: 1fr;
  }

  .card-body {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .brand-logo-icon {
    font-size: 1.4rem;
  }

  .nav-btn span {
    font-size: 0.72rem;
  }

  .hero-features-ribbon {
    flex-direction: column;
    gap: 8px;
  }
}

