/* =============================================
   CSS変数定義
   ============================================= */
:root {
    /* カラーパレット */
    --primary: #d4a574;
    --primary-light: #e8c7a0;
    --primary-dark: #b8904c;
    
    /* テキストカラー */
    --text-primary: #3a3a3a;
    --text-secondary: #666666;
    --text-muted: #888888;
    
    /* 背景カラー */
    --bg-primary: #fafafa;
    --bg-secondary: #f5f5f5;
    --bg-white: #ffffff;
    
    /* ボーダーカラー */
    --border-light: #e0e0e0;
    --border-medium: #cccccc;
    
    /* ステータスカラー */
    --error: #e74c3c;
    --error-bg: #fdf2f2;
    --error-border: #f5c6cb;
    --success: #27ae60;
    --warning: #f39c12;
    --warning-bg: #fefbf3;
    --warning-border: #ffeaa7;
}

/* =============================================
   リセットと基本スタイル
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 明朝体フォントの設定 */
body {
    font-family: 'Yu Mincho', 'YuMincho', 'Hiragino Mincho Pro', 'MS PMincho', 'MS Mincho', Georgia, 'Times New Roman', serif;
    background-color: #fafafa;
    color: #3a3a3a;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    font-weight: 400;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* =============================================
   アニメーション背景
   ============================================= */
.animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
    transform: translateZ(0);
    will-change: transform;
    mask: linear-gradient(to bottom,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,1) calc(100% - 150px),
        rgba(0,0,0,0) 100%);
    -webkit-mask: linear-gradient(to bottom,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,1) calc(100% - 150px),
        rgba(0,0,0,0) 100%);
}

/* 落下する極太角丸の中空四角形 */
.falling-square {
    position: absolute;
    border: 18px solid;
    border-radius: 14px;
    background: transparent;
    opacity: var(--max-opacity, 0.7);
    animation: fall linear infinite;
    transform: rotate(45deg);
}

/* 小さいサイズの落下四角形 */
.falling-square.small {
    width: 25px;
    height: 25px;
    border-width: 16px;
    border-radius: 12px;
}

/* 中サイズの落下四角形 */
.falling-square.medium {
    width: 45px;
    height: 45px;
    border-width: 17px;
    border-radius: 13px;
}

/* 大サイズの落下四角形 */
.falling-square.large {
    width: 65px;
    height: 65px;
    border-width: 18px;
    border-radius: 14px;
}

/* 各色の四角形（極太ボーダーカラー） */
.square-coral { border-color: #ff9999; }
.square-blue { border-color: #87ceeb; }
.square-green { border-color: #90ee90; }
.square-yellow { border-color: #ffe066; }
.square-purple { border-color: #dda0dd; }
.square-gray { border-color: #999999; }

/* 落下アニメーション */
@keyframes fall {
    0% {
        transform: translateY(calc(100vh + 150px)) rotate(0deg);
        opacity: var(--max-opacity, 0.7);
    }
    100% {
        transform: translateY(-200px) rotate(360deg);
        opacity: var(--max-opacity, 0.7);
    }
}

/* =============================================
   ページコンテナ
   ============================================= */
.page-container {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* =============================================
   ヘッダーセクション
   ============================================= */
.header-section {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0 30px;
    margin-bottom: 20px;
}

.title-logo-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-square {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    position: relative;
}

.logo-square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.title-link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.title-link:hover {
    opacity: 0.7;
}

.header-section h1 {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: 2px;
}

/* =============================================
   ページヘッダー共通スタイル
   ============================================= */
.page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    animation: fadeIn 1.5s ease-out;
}

/* .page-header .icon-square のスタイルは基本の .icon-square を使用 */

.page-title {
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: #1a1a1a;
    font-feature-settings: "palt";
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .page-header {
        gap: 15px;
        margin-bottom: 30px;
    }

    .page-title {
        font-size: 1.6rem;
    }
}

/* =============================================
   アイコン四角形のスタイル
   ============================================= */
.icon-square {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid;
    border-radius: 6px;
    margin-right: 10px;
    vertical-align: middle;
}

.icon-coral { border-color: #ff9999; background-color: transparent; }
.icon-blue { border-color: #87ceeb; background-color: transparent; }
.icon-green { border-color: #90ee90; background-color: transparent; }
.icon-yellow { border-color: #ffe066; background-color: transparent; }
.icon-yellow-green { border-color: #adff2f; background-color: transparent; }
.icon-purple { border-color: #dda0dd; background-color: transparent; }
.icon-brown { border-color: #d4a574; background-color: transparent; }

/* =============================================
   レスポンシブ対応
   ============================================= */
@media (max-width: 768px) {
    .page-container {
        padding: 15px;
    }

    .header-section h1 {
        font-size: 28px;
    }

    .logo-square {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .header-section h1 {
        font-size: 24px;
    }

    .title-logo-container {
        gap: 15px;
    }
}