@charset "utf-8";

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* クリスマスカラー: 下から赤、上に向かって緑へのグラデーション */
    background: linear-gradient(to top, #C0392B 0%, #BB2528 25%, #146B3A 75%, #165B33 100%);
    /* 背景を固定してスクロールしても背景が動かないようにする */
    background-attachment: fixed;
    min-height: 100vh;
    padding: 2rem 1rem;
    position: relative;
}

/* 雪の結晶のスタイル */
.snowflake {
    position: fixed;
    top: -10vh;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 1;
    user-select: none;
    animation: snowfall linear infinite;
}

/* 雪が降るアニメーション */
@keyframes snowfall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

/* 全体包含ブロック */
.container {
    max-width: 90vw;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 2;
}

/* 入力フォームとリセットボタン包含ブロック。上段の白背景角丸。 */
.input-group {
    /* クリスマスホワイトの背景 */
    background: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 100%);
    padding: 2rem;
    border-radius: 12px;
    /* ゴールドの影 */
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
    width: 100%;
    backdrop-filter: blur(10px);
    /* ゴールドの縁取り */
    border: 2px solid rgba(212, 175, 55, 0.4);
    min-width: 280px;
}

/* 入力フォーム */
.search-input {
    flex: 1;
    padding: 12px 16px;
    min-height: 48px;
    height: auto;
    line-height: 1.2;
    box-sizing: border-box;
    /* 緑の縁取り */
    border: 2px solid #BB2528;
    border-radius: 8px;
    font-size: max(16px, 1rem);
    transition: all 0.3s ease;
    outline: none;
    min-width: 0;
    appearance: none;
    -webkit-appearance: none;
}

    .search-input:focus {
        /* フォーカス時はクリスマスレッド */
        border-color: #BB2528;
        box-shadow: 0 0 0 3px rgba(187, 37, 40, 0.2);
        transform: translateY(-2px);
    }

/* リセットボタン */
.reset-button {
    padding: 12px 24px;
    font-size: 16px;
    min-height: 48px;
    height: auto;
    line-height: 1.2;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    /* クリスマスレッドから深紅へのグラデーション */
    background: linear-gradient(135deg, #BB2528 0%, #8B0000 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
    flex-shrink: 0;
    /* ゴールドの縁取り */
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

    .reset-button:hover {
        transform: translateY(-2px);
        /* ゴールドの影を強調 */
        box-shadow: 0 4px 15px rgba(212, 175, 55, 0.6);
    }

    .reset-button:active {
        transform: translateY(0);
    }

/* 検索結果表示エリア */
.results-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.match-item {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 100%);
    padding: 1.5rem;
    border-radius: 12px;
    /* ゴールドの影 */
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
    /* クリスマスグリーンの左縁取り */
    border-left: 4px solid #146B3A;
    /* ゴールドの上下縁取り */
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
}

    .match-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
        /* ホバー時はレッドの左縁取り */
        border-left-color: #BB2528;
    }

/* 問題文章の検索結果 */
.question {
    font-weight: 500;
    /* ダークグリーン */
    color: #0F4C2E;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    line-height: 1.5;
}

/* 解答の検索結果 */
.answer {
    /* クリスマスレッド */
    color: #BB2528;
    font-weight: 600;
    font-size: 2rem;
    padding: 0.5rem;
    /* 薄いゴールドの背景 */
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-radius: 6px;
    /* ゴールドの縁取り */
    border: 1px solid rgba(212, 175, 55, 0.3);
}

/* 該当する検索結果が無い場合 */
.no-results {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 100%);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
    text-align: center;
    /* グレーグリーン */
    color: #5F7C6F;
    font-style: italic;
    font-size: 1.5rem;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

/* 正規表現エラー */
.error-message {
    /* 薄いレッドの背景 */
    background: #FED7D7;
    /* ダークレッド */
    color: #8B0000;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #BB2528;
}

footer {
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    margin: 0.8em 0;
    padding-top: 0.8em;
    position: relative;
    z-index: 2;
}

footer p {
    color: #ffffff;
    font-size: 1em;
    font-weight: 400;
    /* ゴールドの影 */
    text-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

footer p:first-child {
    margin: 0px auto 0px 0.8em;
}


/* レスポンシブ対応 - サイズに応じて相対的にスケール */
@media (max-width: 1200px) {
    html {
        font-size: 0.875rem;
    }
}

@media (max-width: 900px) {
    html {
        font-size: 0.75rem;
    }
}

@media (max-width: 600px) {
    html {
        font-size: 0.625rem;
    }
    .container {
        padding: 1rem;
    }
    .reset-button {
        padding: 14px 20px;
        font-size: 15px;
        min-height: 50px;
    }
    .search-input {
        padding: 14px 16px;
        font-size: 15px;
        min-height: 50px;
    }
    .snowflake {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 400px) {
    html {
        font-size: 0.5rem;
    }
    .reset-button {
        padding: 16px 18px;
        font-size: 14px;
        min-height: 52px;
    }
    .search-input {
        padding: 16px 16px;
        font-size: 14px;
        min-height: 52px;
    }
    .snowflake {
        font-size: 1rem !important;
    }
}


/* 上下余白のカスタムクラス例 */
.margin-small {
    padding: 1rem 1rem;
}

.margin-medium {
    padding: 3rem 1rem;
}

.margin-large {
    padding: 5rem 1rem;
}