* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #263449;
    --border: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #22c55e;
    --accent-dark: #15803d;
    --accent-blue: #38bdf8;
    --accent-amber: #f59e0b;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* =========================================
   ヘッダー
========================================= */
.site-header {
    background: rgba(15, 23, 42, 0.94);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(8px);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

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

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #22c55e, #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
    flex-shrink: 0;
}

.brand-text h1 {
    font-size: 19px;
    font-weight: 900;
    letter-spacing: 0.8px;
    line-height: 1.2;
}

.brand-text p {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-pill {
    background: #1e293b;
    border: 1px solid #475569;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    color: #e2e8f0;
}

.stat-pill strong {
    color: #4ade80;
}

.stat-pill.muted strong {
    color: #fbbf24;
}

/* =========================================
   ピックアップヒーローカード
========================================= */
.hero-section {
    padding: 20px 0 10px;
}

.featured-card {
    background: linear-gradient(135deg, #14532d 0%, #0f172a 55%, #1e3a8a 100%);
    border: 2px solid #22c55e;
    border-radius: 18px;
    padding: 22px 24px;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
    align-items: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #facc15;
    color: #713f12;
    font-size: 11px;
    font-weight: 900;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
}

.featured-title {
    font-size: 25px;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 8px;
}

.featured-desc {
    font-size: 13.5px;
    color: #dcfce7;
    margin-bottom: 14px;
}

.featured-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.meta-chip {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
}

.play-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(180deg, #22c55e, #16a34a);
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 900;
    padding: 12px 26px;
    border-radius: 12px;
    border: 2px solid #86efac;
    box-shadow: 0 4px 0 #14532d;
    transition: transform 0.12s, filter 0.12s;
}

.play-cta-btn:hover {
    filter: brightness(1.08);
}

.play-cta-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #14532d;
}

.featured-visual {
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: #0b1120;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-visual svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* =========================================
   フィルター・検索バー
========================================= */
.filter-section {
    padding: 12px 0;
}

.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.category-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cat-tab {
    background: var(--bg-card);
    color: #cbd5e1;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
}

.cat-tab:hover {
    background: var(--bg-card-hover);
    color: #ffffff;
}

.cat-tab.active {
    background: var(--accent);
    border-color: #86efac;
    color: #052e16;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 5px 12px;
    min-width: 240px;
    flex: 0 1 280px;
}

.search-icon {
    font-size: 13px;
    margin-right: 6px;
    opacity: 0.75;
}

#search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 13px;
    width: 100%;
}

/* =========================================
   ゲームカードグリッド
========================================= */
.main-content {
    flex: 1;
    padding-top: 6px;
    padding-bottom: 36px;
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-heading h2 {
    font-size: 18px;
    font-weight: 900;
}

.result-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

.game-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.game-card.playable:hover {
    transform: translateY(-4px);
    border-color: var(--accent-blue);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
}

.game-card.upcoming {
    opacity: 0.78;
    border-style: dashed;
}

.card-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #0b1120;
    overflow: hidden;
}

.card-thumb svg {
    width: 100%;
    height: 100%;
    display: block;
}

.status-ribbon {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 10.5px;
    font-weight: 900;
    padding: 3px 9px;
    border-radius: 999px;
    letter-spacing: 0.4px;
}

.status-ribbon.new {
    background: #ef4444;
    color: #fff;
}

.status-ribbon.playable {
    background: #16a34a;
    color: #fff;
}

.status-ribbon.upcoming {
    background: #475569;
    color: #e2e8f0;
}

.device-badges {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}

.device-badge {
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #f8fafc;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 5px;
}

.card-body {
    padding: 14px 15px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-category {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-blue);
    margin-bottom: 4px;
}

.card-title {
    font-size: 17px;
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 6px;
}

.card-desc {
    font-size: 12.5px;
    color: #cbd5e1;
    margin-bottom: 12px;
    flex: 1;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 14px;
}

.tag-chip {
    background: #0f172a;
    color: #94a3b8;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 5px;
}

.card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btn-play {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 900;
    padding: 9px 12px;
    border-radius: 9px;
    transition: background 0.15s;
}

.btn-play:hover {
    background: #1d4ed8;
}

.btn-play.disabled {
    background: #334155;
    color: #94a3b8;
    pointer-events: none;
}

.play-count-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    white-space: nowrap;
}

/* 空状態 */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
}

.reset-btn {
    margin-top: 12px;
    background: var(--accent-blue);
    color: #0f172a;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 900;
    cursor: pointer;
}

/* =========================================
   フッター
========================================= */
.site-footer {
    background: #0b1120;
    border-top: 1px solid var(--border);
    padding: 18px 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-note {
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.85;
}

.footer-note code {
    background: #1e293b;
    padding: 2px 6px;
    border-radius: 4px;
    color: #e2e8f0;
}

/* =========================================
   スマホ対応レスポンシブ
========================================= */
@media (max-width: 760px) {
    .featured-card {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 14px;
    }

    .featured-title {
        font-size: 20px;
    }

    .search-box {
        width: 100%;
        flex: 1 1 100%;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }
}
