:root{
    --bg:#0b2545;
    --bg2:#12395e;
    --card:#ffffff;
    --ink:#0b2545;
    --ink-soft:#4a6079;
    --accent:#ff8a5c;
    --accent2:#00c2d1;
    --line:#e4edf5;
    --live:#1fbf75;
    --ended:#9aa7b4;
    --soon:#ff8a5c;
    --shadow: 0 10px 30px rgba(11,37,69,0.12);
  }
  *{box-sizing:border-box;}
  html{scroll-behavior:smooth;}
  body{
    margin:0;
    font-family:"Hiragino Sans","Yu Gothic UI","Noto Sans JP","Segoe UI",sans-serif;
    color:var(--ink);
    background:
      radial-gradient(1200px 500px at 10% -10%, rgba(0,194,209,0.25), transparent 60%),
      radial-gradient(1000px 500px at 100% 0%, rgba(255,138,92,0.25), transparent 55%),
      linear-gradient(180deg, var(--bg) 0%, var(--bg2) 340px, #f4f8fb 340px, #f4f8fb 100%);
    background-attachment:fixed;
  }
  a{color:inherit;}

  /* ---------- Header ---------- */
  header{
    max-width:1220px;
    margin:0 auto;
    padding:56px 24px 40px;
    color:#fff;
    text-align:center;
  }
  .eyebrow{
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-size:13px;
    letter-spacing:.08em;
    background:rgba(255,255,255,0.12);
    border:1px solid rgba(255,255,255,0.25);
    padding:6px 14px;
    border-radius:999px;
    margin-bottom:18px;
  }
  h1{
    font-size:clamp(26px,4.2vw,42px);
    margin:0 0 12px;
    line-height:1.35;
  }
  h1 .accent{
    background:linear-gradient(90deg,#ffd08a,#ff8a5c 60%,#00c2d1);
    -webkit-background-clip:text;
    background-clip:text;
    color:transparent;
  }
  header p.lead{
    max-width:700px;
    margin:0 auto;
    color:rgba(255,255,255,0.78);
    font-size:15px;
    line-height:1.8;
  }
  .updated{
    margin-top:20px;
    font-size:12.5px;
    color:rgba(255,255,255,0.6);
  }

  /* ---------- Stats strip ---------- */
  .stats{
    max-width:1220px;
    margin:-8px auto 0;
    padding:0 24px;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
    gap:12px;
  }
  .stat{
    background:rgba(255,255,255,0.08);
    border:1px solid rgba(255,255,255,0.18);
    border-radius:14px;
    padding:16px 14px;
    text-align:center;
    color:#fff;
    backdrop-filter:blur(6px);
  }
  .stat .num{font-size:24px;font-weight:700;}
  .stat .label{font-size:12px;color:rgba(255,255,255,0.7);margin-top:2px;}

  /* ---------- 広告枠 ---------- */
  .ad-slot{
    max-width:1220px;
    margin:24px auto 0;
    padding:0 24px;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:6px;
  }
  .ad-slot .ad-label{
    font-size:10px;
    color:#b7c2cc;
    letter-spacing:.1em;
  }
  .ad-slot a{line-height:0;}
  .ad-slot img{max-width:100%;height:auto;border-radius:8px;}
  .ad-mobile-banner{display:none;}
  @media (max-width:640px){
    .ad-leaderboard{display:none;}
    .ad-mobile-banner{display:block;}
  }

  /* ---------- Filter bar ---------- */
  .filterbar-wrap{
    position:sticky;
    top:0;
    z-index:20;
    background:rgba(244,248,251,0.82);
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
    border-bottom:1px solid rgba(228,237,245,0);
    transition:border-color .2s ease, box-shadow .2s ease;
    margin-top:36px;
  }
  .filterbar-wrap.scrolled{
    border-bottom-color:var(--line);
    box-shadow:0 8px 24px rgba(11,37,69,0.06);
  }
  .filterbar{
    max-width:1220px;
    margin:0 auto;
    padding:14px 24px;
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    justify-content:center;
  }
  .chip{
    border:1px solid var(--line);
    background:#fff;
    color:var(--ink-soft);
    padding:8px 16px;
    border-radius:999px;
    font-size:13px;
    cursor:pointer;
    transition:all .15s ease;
    box-shadow:0 2px 6px rgba(11,37,69,0.05);
    flex-shrink:0;
  }
  .chip:hover{border-color:var(--accent2);color:var(--ink);transform:translateY(-1px);}
  .chip.active{
    background:var(--ink);
    border-color:var(--ink);
    color:#fff;
  }

  /* ---------- Grid ---------- */
  main{
    max-width:1220px;
    margin:0 auto;
    padding:28px 24px 40px;
  }
  .stack{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(400px, 1fr));
    align-items:start;
    gap:22px;
  }

  .card{
    background:var(--card);
    border-radius:20px;
    overflow:hidden;
    box-shadow:var(--shadow);
    border:1px solid var(--line);
    transition:transform .22s ease, box-shadow .22s ease;
  }
  .card:hover{
    transform:translateY(-5px);
    box-shadow:0 20px 44px rgba(11,37,69,0.18);
  }
  .card.hidden{display:none;}

  /* ---- Slim header strip ---- */
  .head{
    position:relative;
    padding:16px 20px;
    color:#fff;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
  }
  .head::before{
    content:"";
    position:absolute;inset:0;
    background-image:
      radial-gradient(160px 100px at 92% 0%, rgba(255,255,255,0.28), transparent 60%),
      repeating-linear-gradient(115deg, rgba(255,255,255,0.08) 0 10px, transparent 10px 26px);
  }
  .head-left{display:flex;align-items:center;gap:10px;position:relative;z-index:1;}
  .head .game-icon{font-size:24px;filter:drop-shadow(0 2px 4px rgba(0,0,0,0.3));}
  .game-name{font-size:16.5px;font-weight:700;}
  .game-sub{font-size:11px;opacity:.85;margin-top:1px;}
  .status{
    position:relative;z-index:1;
    font-size:11px;
    font-weight:700;
    padding:5px 11px;
    border-radius:999px;
    background:rgba(255,255,255,0.94);
    display:flex;
    align-items:center;
    gap:5px;
    flex-shrink:0;
  }
  .status .dot{width:7px;height:7px;border-radius:50%;}
  .status.live{color:#0e8f57;}
  .status.live .dot{background:var(--live);box-shadow:0 0 0 3px rgba(31,191,117,0.25);}
  .status.ended{color:#6b7684;}
  .status.ended .dot{background:var(--ended);}
  .status.soon{color:#c25a2c;}
  .status.soon .dot{background:var(--soon);}
  .status.tba{color:#6b7684;}
  .status.tba .dot{background:#c9d3dc;}

  .body{
    padding:18px 20px 22px;
    display:flex;
    flex-direction:column;
    gap:14px;
  }
  .event-title{
    font-size:15.5px;
    font-weight:700;
    line-height:1.5;
  }
  .period{
    font-size:12.5px;
    color:var(--ink-soft);
    display:flex;
    align-items:center;
    gap:6px;
  }
  .period::before{content:"🗓";font-size:12px;}

  .section-label{
    font-size:11.5px;
    font-weight:700;
    letter-spacing:.04em;
    display:flex;
    align-items:center;
    gap:5px;
  }
  .section-label.swim{color:#e0457b;}
  .section-label.newchar{color:#0aa0b0;}

  /* ---- Character photo gallery ---- */
  .gallery{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(108px, 1fr));
    gap:10px;
  }
  .thumb{
    position:relative;
    border-radius:12px;
    overflow:hidden;
    background:#eef3f7;
    border:1px solid var(--line);
  }
  .thumb .imgwrap{
    position:relative;
    width:100%;
    aspect-ratio: 3 / 4;
    background:linear-gradient(150deg,#c9d3dc,#eef3f7);
    overflow:hidden;
  }
  .thumb img{
    position:absolute;inset:0;
    width:100%;height:100%;
    object-fit:cover;
    object-position:center 18%;
    display:block;
    transition:transform .35s ease;
  }
  .thumb .ph-icon{
    position:absolute;inset:0;
    display:flex;align-items:center;justify-content:center;
    font-size:26px;
    opacity:0.55;
  }
  .thumb .noimg{
    position:absolute;inset:0;
    display:flex;align-items:center;justify-content:center;
    flex-direction:column;
    gap:4px;
    background:repeating-linear-gradient(135deg,#e4edf5,#e4edf5 8px,#eef3f7 8px,#eef3f7 16px);
    color:#9aa7b4;
  }
  .thumb .noimg span{
    font-size:9.5px;
    font-weight:700;
    letter-spacing:.06em;
    border:1px solid #c9d3dc;
    padding:2px 7px;
    border-radius:5px;
    background:#fff;
  }
  .thumb a.thumblink{display:block;color:inherit;text-decoration:none;}
  .thumb a.thumblink:hover .imgwrap{outline:2px solid var(--accent2);outline-offset:-2px;}
  .thumb a.thumblink:hover img{transform:scale(1.08);}
  .thumb .tagr{
    position:absolute;
    top:5px;left:5px;
    font-size:8.5px;
    font-weight:700;
    color:#fff;
    padding:2px 6px;
    border-radius:5px;
    z-index:2;
  }
  .tagr.swim{background:var(--accent);}
  .tagr.newchar{background:#0aa0b0;}
  .tagr.rerun{background:#9aa7b4;}
  .tagr.distrib{background:#3fb06a;}
  .thumb .cname{
    font-size:10.5px;
    line-height:1.35;
    padding:6px 7px 8px;
    color:var(--ink);
    font-weight:600;
    min-height:2.6em;
  }

  .notes{
    font-size:12.5px;
    color:var(--ink-soft);
    line-height:1.7;
    border-top:1px dashed var(--line);
    padding-top:12px;
  }
  .cardfoot{
    display:flex;
    flex-wrap:wrap;
    justify-content:space-between;
    align-items:center;
    gap:6px;
  }
  .official{
    font-size:12.5px;
    font-weight:600;
    color:var(--accent2);
    text-decoration:none;
    display:inline-flex;
    align-items:center;
    gap:4px;
  }
  .official:hover{text-decoration:underline;}
  .src{
    font-size:11px;
    color:#b7c2cc;
  }

  footer{
    max-width:1220px;
    margin:0 auto;
    padding:20px 24px 60px;
    color:var(--ink-soft);
    font-size:12.5px;
    line-height:1.9;
    text-align:center;
  }
  footer .disclaimer{
    max-width:700px;
    margin:0 auto;
    background:#fff;
    border:1px solid var(--line);
    border-radius:14px;
    padding:16px 20px;
    text-align:left;
  }
  footer .disclaimer b{color:var(--ink);}

  /* ---------- Scroll-to-top FAB ---------- */
  .totop{
    position:fixed;
    right:20px;
    bottom:20px;
    width:46px;
    height:46px;
    border-radius:50%;
    border:1px solid var(--line);
    background:var(--ink);
    color:#fff;
    font-size:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    box-shadow:0 10px 24px rgba(11,37,69,0.28);
    opacity:0;
    transform:translateY(10px);
    pointer-events:none;
    transition:opacity .2s ease, transform .2s ease;
    z-index:30;
  }
  .totop.show{opacity:1;transform:translateY(0);pointer-events:auto;}
  .totop:hover{background:var(--accent2);}

  /* ---------- 新着記事フィード (トップページ) ---------- */
  .newsfeed{
    max-width:1220px;
    margin:28px auto 0;
    padding:0 24px;
  }
  .newsfeed-head{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
  }
  .newsfeed-head h2{
    font-size:18px;
    margin:0;
    display:flex;
    align-items:center;
    gap:8px;
  }
  .newsfeed-head .count{font-size:12.5px;color:var(--ink-soft);font-weight:400;}
  .newsfeed-list{
    display:flex;
    flex-direction:column;
    gap:2px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:16px;
    overflow:hidden;
    box-shadow:var(--shadow);
  }
  .newsitem{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto auto;
    align-items:center;
    gap:18px;
    min-height:104px;
    padding:16px 22px;
    text-decoration:none;
    color:inherit;
    border-bottom:1px solid var(--line);
    transition:background .15s ease;
  }
  .newsfeed-list a.newsitem:last-child{border-bottom:none;}
  .newsitem:hover{background:#f7fafc;}
  .newsitem .newsdate{
    font-size:12px;
    font-weight:700;
    color:var(--ink-soft);
    white-space:nowrap;
    min-width:52px;
  }
  .newsitem .newsicon{font-size:18px;}
  .newsitem .newsbody{min-width:0;}
  .newsitem .newsgame{
    font-size:12px;
    font-weight:700;
    color:var(--accent2);
    margin-bottom:4px;
  }
  .newsitem .newsheadline{
    font-size:15px;
    font-weight:600;
    line-height:1.5;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }
  .newsitem .newsimages{
    display:flex;
    gap:8px;
    flex-shrink:0;
    justify-content:flex-end;
  }
  .newsitem .newsimg{
    width:72px;
    height:72px;
    border-radius:12px;
    overflow:hidden;
    background:#eef3f7;
    border:1px solid var(--line);
    flex-shrink:0;
  }
  .newsitem .newsimg img{
    width:100%;
    height:100%;
    object-fit:cover;
    object-position:center 18%;
    display:block;
    transition:transform .3s ease;
  }
  .newsitem:hover .newsimg img{transform:scale(1.08);}
  .newsitem .newsarrow{
    font-size:14px;
    color:var(--ink-soft);
    flex-shrink:0;
  }

  /* ---------- ゲーム別アーカイブページ ---------- */
  .archive-hero{
    max-width:900px;
    margin:0 auto;
    padding:44px 24px 24px;
    color:#fff;
  }
  .archive-back{
    display:inline-flex;
    align-items:center;
    gap:6px;
    font-size:13px;
    color:rgba(255,255,255,0.75);
    text-decoration:none;
    margin-bottom:18px;
  }
  .archive-back:hover{color:#fff;}
  .archive-title{
    display:flex;
    align-items:center;
    gap:14px;
  }
  .archive-title .archive-icon{font-size:36px;}
  .archive-title h1{font-size:clamp(22px,3.4vw,32px);margin:0;}
  .archive-title .archive-sub{font-size:13px;color:rgba(255,255,255,0.7);margin-top:2px;}
  .archive-count{
    margin-top:14px;
    font-size:13px;
    color:rgba(255,255,255,0.7);
  }

  .archive-main{
    max-width:900px;
    margin:0 auto;
    padding:28px 24px 40px;
    display:flex;
    flex-direction:column;
    gap:22px;
  }
  .article-card{
    background:var(--card);
    border-radius:18px;
    border:1px solid var(--line);
    box-shadow:var(--shadow);
    padding:20px 22px;
  }
  .article-date{
    font-size:12px;
    font-weight:700;
    color:var(--accent2);
    letter-spacing:.04em;
    margin-bottom:6px;
  }
  .article-headline{
    font-size:16px;
    font-weight:700;
    line-height:1.5;
    margin-bottom:8px;
  }
  .article-summary{
    font-size:13px;
    color:var(--ink-soft);
    line-height:1.75;
    margin-bottom:14px;
  }
  .article-source{
    margin-top:12px;
    font-size:12px;
    display:flex;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:6px;
  }
  .article-source a{color:var(--accent2);font-weight:600;text-decoration:none;}
  .article-source a:hover{text-decoration:underline;}
  .article-source span{color:#b7c2cc;}

  @media (max-width:640px){
    .newsitem{
      grid-template-columns:1fr;
      grid-template-areas:"date" "body" "images";
      min-height:0;
      gap:8px;
      padding:14px 18px;
    }
    .newsitem .newsdate{grid-area:date;}
    .newsitem .newsbody{grid-area:body;}
    .newsitem .newsimages{grid-area:images;justify-content:flex-start;}
    .newsitem .newsheadline{-webkit-line-clamp:3;}
    .newsitem .newsarrow{display:none;}
  }

  @media (max-width:768px){
    .filterbar{
      display:grid;
      grid-auto-flow:column;
      grid-template-rows:repeat(2, auto);
      justify-content:start;
      overflow-x:auto;
      scrollbar-width:none;
      -webkit-overflow-scrolling:touch;
      padding:12px 20px;
    }
    .filterbar::-webkit-scrollbar{display:none;}
    .filterbar-wrap::after{
      content:"";
      position:absolute;
      top:0;right:0;bottom:0;
      width:32px;
      background:linear-gradient(90deg, rgba(244,248,251,0), rgba(244,248,251,0.95));
      pointer-events:none;
    }
    .chip{font-size:12.5px;padding:7px 14px;white-space:nowrap;}
  }

  @media (max-width:480px){
    header{padding:40px 18px 30px;}
    .stats{margin-top:0;}
    .gallery{grid-template-columns:repeat(auto-fill, minmax(92px, 1fr));}
    .newsitem .newsimg{width:60px;height:60px;}
  }
