/* .skills/base_style.css */
/* モバイルファースト・ゲーム用ベースCSSテンプレート */

:root {
    --bg-dark: #0a0a0f;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --neon-blue: #00f3ff;
    --neon-purple: #bc13fe;
    --neon-pink: #ff007f;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 243, 255, 0.1), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(188, 19, 254, 0.1), transparent 25%);
    background-attachment: fixed;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
}

/* メインコンテナ */
#app-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
}

/* ヘッダー */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

.portal-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
    margin-bottom: 8px;
}

.portal-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ゲームグリッド */
.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    padding-bottom: 40px;
}

/* グラスモーフィズムカード */
.game-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-main);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.game-card:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

.thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    background: linear-gradient(135deg, #2a2a35, #1a1a24);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

/* ネオングローのバリエーション */
.card-blue .thumbnail { box-shadow: 0 0 15px rgba(0, 243, 255, 0.2), inset 0 0 10px rgba(0,0,0,0.5); }
.card-pink .thumbnail { box-shadow: 0 0 15px rgba(255, 0, 127, 0.2), inset 0 0 10px rgba(0,0,0,0.5); }
.card-purple .thumbnail { box-shadow: 0 0 15px rgba(188, 19, 254, 0.2), inset 0 0 10px rgba(0,0,0,0.5); }

.game-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.game-category {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 共通ボタン */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    border: none;
    border-radius: 25px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
    width: 100%;
    margin: 10px 0;
    pointer-events: auto;
    box-shadow: 0 4px 15px rgba(188, 19, 254, 0.3);
}

.btn:active {
    transform: scale(0.95);
    filter: brightness(1.2);
}

/* -------------------------------------
 * ゲームプレイ画面 (play.php) 用スタイル
 * ------------------------------------- */

/* プレイ画面のメインコンテナ (レスポンシブ2カラム) */
.play-layout {
    display: flex;
    flex-direction: row;
    gap: 24px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 0;
}

/* ゲーム描画エリア (左側) */
.game-area {
    flex: 2;
    background: var(--bg-dark);
    border: 2px solid var(--neon-blue);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3), inset 0 0 10px rgba(0, 243, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    position: relative;
    overflow: hidden;
}

/* ゲーム内プレースホルダーテキスト */
.game-placeholder {
    text-align: center;
    color: var(--neon-blue);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

/* サイド情報エリア (右側) */
.info-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 情報パネル共通 (ランキング、説明) */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.panel-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ランキングリスト */
.ranking-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.3);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.ranking-rank {
    font-weight: bold;
    color: var(--neon-purple);
    width: 24px;
}

.ranking-name {
    flex: 1;
    margin-left: 10px;
    color: #ddd;
}

.ranking-score {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--neon-blue);
}

/* トップへ戻るヘッダーナビ */
.nav-header {
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-back {
    background: transparent;
    border: 1px solid var(--neon-pink);
    color: var(--neon-pink);
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.2);
}

.btn-back:hover, .btn-back:active {
    background: var(--neon-pink);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.5);
}

/* スマホ表示対応 (縦積み) */
@media (max-width: 768px) {
    .play-layout {
        flex-direction: column;
    }
    
    .game-area {
        flex: none; /* Flex子要素としての縮小を防止 */
        width: 100%;
        height: 60vh; /* 画面高さの60%を確保 */
        min-height: 450px;
        aspect-ratio: auto; /* アスペクト比指定を解除し、高さを優先 */
    }
}

/* -------------------------------------
 * 遊び方モーダル用スタイル
 * ------------------------------------- */
.btn-how-to-play {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--neon-blue);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-how-to-play:hover, .btn-how-to-play:active {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-dark);
    border: 2px solid var(--neon-blue);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.3), inset 0 0 20px rgba(0, 243, 255, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    color: #fff;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.3);
    padding-bottom: 10px;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: var(--neon-pink);
}

.modal-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #ddd;
}

.modal-body ul {
    list-style-type: none;
    padding: 0;
}

.modal-body li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
}

.modal-body li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: var(--neon-blue);
    font-size: 0.8rem;
    top: 2px;
}

.modal-body strong {
    color: var(--neon-blue);
    font-weight: bold;
}

/* -------------------------------------
 * リストレイアウト用スタイル (1カラム横長)
 * ------------------------------------- */
.game-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    padding-bottom: 40px;
}

.game-list-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    display: flex;
    flex-direction: row;
    text-decoration: none;
    color: var(--text-main);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
    pointer-events: auto;
    overflow: hidden;
    min-height: 160px;
}

.game-list-card:active {
    transform: scale(0.98);
}

.gl-left {
    flex: 0 0 140px;
    position: relative;
    border-right: 1px solid var(--card-border);
}

.gl-thumb {
    width: 100%;
    height: 100%;
    background-size: cover !important;
    background-position: center !important;
}

.gl-right {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gl-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.gl-desc {
    font-size: 0.85rem;
    color: #ccc;
    margin-bottom: 12px;
    line-height: 1.4;
}

.gl-top-player {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.gl-crown {
    color: #FFD700;
    font-weight: bold;
}

.gl-name {
    color: #fff;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gl-score {
    color: var(--neon-blue);
    font-family: monospace;
    font-weight: bold;
    font-size: 1rem;
}

.gl-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.gl-btn {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
    transition: filter 0.2s;
    border: 1px solid transparent;
}

.gl-btn:active {
    filter: brightness(1.2);
}

.gl-btn-play {
    background: linear-gradient(90deg, #00f3ff, #0088ff);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.gl-btn-rank {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #bc13fe;
    box-shadow: 0 0 10px rgba(188, 19, 254, 0.2);
}

@media (max-width: 480px) {
    .gl-left {
        flex: 0 0 100px;
    }
    .gl-title {
        font-size: 1.1rem;
    }
    .gl-desc {
        font-size: 0.75rem;
    }
    .gl-right {
        padding: 12px 10px;
    }
    .gl-top-player {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
    .gl-actions {
        flex-direction: column;
        gap: 6px;
    }
}
