@charset "UTF-8";

/* =========================================
   Satsuki Portal & Wallet 統合スタイル
   ========================================= */

/* --- ベースレイアウト --- */
.portal-container {
    max-width: 640px;
    margin: 40px auto;
    padding: 0 16px;
    padding-bottom: 60px;
}

/* --- 1. クラフトカード（ステッチ枠） --- */
.craft-card {
    background: #fff;
    border: 2px solid #e0e0e0; /* 実線 */
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

/* 内側のステッチ装飾 */
.craft-card::after {
    content: "";
    position: absolute;
    top: 6px; left: 6px; right: 6px; bottom: 6px;
    border: 2px dashed var(--brand-border, #e9cdb1);
    border-radius: 10px;
    pointer-events: none;
    z-index: 1;
}

/* コンテンツがステッチに被らないように */
.craft-content {
    position: relative;
    z-index: 2;
}

/* --- 2. 見出しエリア（アイコン＋タイトル） --- */
.portal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f5f5f5;
}

.portal-header .material-icons-round {
    font-size: 1.6rem;
    background: #fefcf9;
    padding: 8px;
    border-radius: 50%;
    border: 1px solid #eee;
    color: inherit; /* 親のcolorを継承 */
}

.header-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--brand-brown, #584232);
}

/* --- 3. グリッドリンク（ダッシュボード用） --- */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.portal-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #fff;
    padding: 16px 8px;
    border-radius: 10px;
    color: var(--brand-brown, #584232);
    border: 1px solid #ddd;
    border-bottom: 3px solid #ddd;
    transition: all 0.1s ease;
    height: 100%;
    box-sizing: border-box;
}

.portal-link:hover {
    transform: translateY(2px);
    border-bottom-width: 1px;
    background-color: #fff9f0;
    border-color: var(--brand-orange, #d98c4d);
}

.portal-link .material-icons-round {
    font-size: 2rem;
    margin-bottom: 8px;
    color: #a08266;
    transition: color 0.2s;
}

.portal-link:hover .material-icons-round {
    color: var(--brand-active-orange, #E6A35B);
}

.link-name {
    font-size: 0.85rem;
    font-weight: bold;
    line-height: 1.3;
    text-align: center;
}

/* --- 4. ウォレットカードセクション --- */
.wallet-section {
    position: relative;
    height: 260px; /* 少し高さを増やす */
    margin: 10px 0 30px;
    perspective: 1000px;
    display: flex;
    justify-content: center;
}

/* デジタルカード基本 */
.digital-card {
    position: absolute;
    width: 300px; /* スマホ向けに少し調整 */
    height: 190px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    color: white;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    top: 20px; 
    overflow: hidden;
    /* ガラスの質感 */
    border: 1px solid rgba(255,255,255,0.3);
}

/* カードの種類ごとの色 */
.card-sun {
    background: var(--brand-active-orange, #e67e22) !important;
}
.card-moon {
    background: #6d7e9c !important;
}
.card-member {
    background: linear-gradient(135deg, #444 0%, #222 100%) !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

/* --- カードの状態（重なり調整） --- */

/* 最前面（Active） */
.digital-card.active {
    z-index: 10 !important;
    transform: scale(1.05) translateY(40px) !important; /* 手前に大きく */
    opacity: 1 !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* 2番目（後ろ） */
.digital-card.inactive-1 {
    z-index: 2;
    transform: scale(0.95) translateY(0px) translateX(20px); /* 右上に少しずらす */
    opacity: 0.8;
}

/* 3番目（一番後ろ） */
.digital-card.inactive-2 {
    z-index: 1;
    transform: scale(0.85) translateY(-40px) translateX(-20px); /* 左奥に大きくずらす */
    opacity: 0.6;
}

/* カード内要素 */
.card-logo { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-style: italic; }
.card-chip { width: 40px; height: 30px; background: rgba(255,255,255,0.2); border-radius: 6px; margin-bottom: 10px; }
.card-number { font-size: 1.1rem; letter-spacing: 2px; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.card-holder { font-size: 0.8rem; text-transform: uppercase; opacity: 0.9; }
.card-level { 
    position: absolute; top: 20px; right: 20px; 
    background: rgba(255,255,255,0.25); 
    padding: 4px 10px; border-radius: 20px; 
    font-size: 0.7rem; font-weight: bold;
    backdrop-filter: blur(5px);
}


/* --- 5. ログイン・統計情報などのパーツ --- */
.login-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #fcf9f2;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    transition: opacity 0.5s;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.stat-box {
    background: #f9f9f9;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #eee;
}
.stat-label { font-size: 0.8rem; color: #888; margin-bottom: 4px; font-weight: bold; }
.stat-value { font-size: 1.4rem; font-weight: bold; color: #2c3e50; }
.stat-unit { font-size: 0.8rem; color: #aaa; margin-left: 2px; }

/* クイックメニュー（リスト） */
.menu-list { list-style: none; padding: 0; margin: 0; }
.menu-item {
    display: flex; align-items: center; padding: 12px 0;
    border-bottom: 1px dashed #eee; 
    cursor: pointer; 
    transition: all 0.2s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { transform: translateX(4px); }
.menu-icon { margin-right: 12px; font-size: 1.2rem; }
.menu-text { flex: 1; font-weight: bold; color: var(--brand-brown, #584232); font-size: 0.95rem; }
.menu-arrow { color: #ccc; }

/* 入力フォーム（ログイン用） */
.craft-input {
    width: 100%;
    padding: 14px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    margin-bottom: 16px;
    box-sizing: border-box;
}
.craft-input:focus {
    border-color: var(--brand-active-orange, #E6A35B);
    outline: none;
}
.craft-btn {
    width: 100%;
    padding: 14px;
    background: var(--brand-active-orange, #E6A35B);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(230, 163, 91, 0.4);
    transition: transform 0.1s;
}
.craft-btn:active { transform: translateY(2px); box-shadow: none; }
.craft-btn:disabled { background: #ccc; cursor: not-allowed; }

/* ログアウトボタン */
.logout-text {
    text-align: center;
    margin-top: 30px;
    font-size: 0.85rem;
    color: #999;
    text-decoration: underline;
    cursor: pointer;
}

/* === 成績履歴（ヒストリーバー） === */
.history-row {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    overflow-x: auto; /* 横スクロール可能に */
    padding-bottom: 8px;
    align-items: center;
}

/* 履歴の丸いアイコン */
.rank-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0; /* 潰れないように */
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    border: 2px solid #fff;
}

/* 順位ごとの色 */
.rank-1 { background-color: #f1c40f; color: #fff; border-color: #f39c12; } /* 1着: 金 */
.rank-2 { background-color: #3498db; color: #fff; border-color: #2980b9; } /* 2着: 青 */
.rank-3 { background-color: #2ecc71; color: #fff; border-color: #27ae60; } /* 3着: 緑 */
.rank-4 { background-color: #e74c3c; color: #fff; border-color: #c0392b; } /* 4着: 赤 */

/* 履歴がない時のメッセージ */
.no-history {
    font-size: 0.8rem;
    color: #aaa;
    font-style: italic;
}

/* カード番号の強調（等幅フォントでデジタルっぽく） */
.card-secret-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.4rem;
    letter-spacing: 4px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}