@charset "UTF-8";

/* ===================================================
   1. テーマカラー・デザイントークン定義
   =================================================== */
:root {
    /* 標準カラーパレット（各実習アプリ共通） */
    --text: #374151;
    --main: #2563EB;
    --sub1: #DBEAFE;
    --sub2: #1E3A8A;
    --muted: #9CA3AF;
    --accent: #EF4444;
    --icon: #646565;
    --bg: #f9fafb;
    --canvas-bg: #f9fafb;
    --success: #10B981;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --white: #FFFFFF;

    /* ポータル・すごろく等で使用される変数名エイリアス */
    --textColor: var(--text);
    --mainColor: var(--main);
    --subColor1: var(--sub1);
    --subColor2: var(--sub2);
    --accentColor: var(--accent);
    --baseColor: #F0F2F5;

    /* エフェクト・トランジション */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================================
   2. 基本リセット・ベーススタイル
   =================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    color: var(--text);
    background-color: var(--bg);
    margin: 0;
    padding: 0;
}

/* ===================================================
   3. 共通ヘッダー・レイアウトコンテナ
   =================================================== */
header {
    background-color: var(--sub1);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--main);
}

header h1 {
    margin: 0 0 0 10px;
    color: var(--sub2);
    font-size: 1.5rem;
}

.container {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.column {
    flex: 1;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===================================================
   4. 共通コンポーネント（カード・ボタン・フォーム・表示枠）
   =================================================== */
/* ポータル等カード枠 */
.card {
    background-color: var(--white);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-decoration: none;
    color: var(--textColor);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--mainColor), var(--subColor1));
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.card:hover::before {
    height: 8px;
    background: linear-gradient(90deg, var(--accentColor), var(--mainColor));
}

.card-title {
    color: var(--subColor2);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.4;
    display: block;
}

.card-desc {
    font-size: 0.95rem;
    color: #4A5568;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid #EDF2F7;
    padding-top: 1.25rem;
}

.card-tag {
    display: inline-block;
    background-color: var(--subColor1);
    color: var(--mainColor);
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.card-arrow {
    color: var(--mainColor);
    font-size: 1.25rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.card:hover .card-arrow {
    transform: translateX(6px);
    color: var(--accentColor);
}

/* 共通ボタン */
.btn,
.btn-primary,
.action-btn,
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--main);
    color: var(--white);
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.15s ease, transform 0.1s ease, opacity 0.3s ease;
    user-select: none;
}

.btn:hover:not(:disabled),
.btn-primary:hover:not(:disabled),
.action-btn:hover:not(:disabled),
.btn-action:hover:not(:disabled) {
    background-color: var(--sub2);
}

.btn:active:not(:disabled),
.btn-primary:active:not(:disabled),
.action-btn:active:not(:disabled),
.btn-action:active:not(:disabled) {
    transform: scale(0.98);
}

.nav-btn {
    font-size: 1.5rem;
    padding: 10px 30px;
    background-color: var(--main);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

/* 入力フォーム共通 */
select {
    padding: 0.5rem;
    font-size: 1rem;
    color: var(--text);
    border: 1px solid var(--muted);
    border-radius: 4px;
    background-color: var(--white);
    font-family: inherit;
}

select:disabled {
    background-color: #f3f4f6;
    color: var(--muted);
    cursor: not-allowed;
}

textarea {
    width: 100%;
    resize: vertical;
    padding: 0.5rem;
    border: 1px solid var(--muted);
    border-radius: 4px;
    color: var(--text);
    font-family: monospace;
    box-sizing: border-box;
}

input[type="file"] {
    font-family: inherit;
}

/* 設定エリア・ビューア共通パーツ */
.settings-area {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--muted);
}

.setting-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-title {
    font-weight: bold;
    color: var(--main);
}

.viewer-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.viewer-title {
    font-weight: bold;
    color: var(--main);
}

.error {
    color: var(--accent);
    font-weight: bold;
    font-size: 0.9rem;
}

/* ミニゲーム（こどもたんけん）共通ボックス */
.setup-box,
.ready-box {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    max-width: 400px;
    margin: 40px auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.records {
    background: var(--white);
    max-width: 300px;
    margin: 15px auto;
    padding: 10px;
    border-radius: 8px;
    text-align: left;
}

.hint-box {
    display: none;
    background: var(--warning-bg);
    border: 3px dashed var(--warning);
    padding: 15px;
    border-radius: 12px;
    max-width: 500px;
    margin: 20px auto;
    font-size: 1.3rem;
    font-weight: bold;
}

.keyword-display {
    font-size: 2.2rem;
    color: var(--accent);
    font-weight: bold;
    background: var(--white);
    border-radius: 8px;
    display: inline-block;
    padding: 5px 20px;
    margin-top: 10px;
    border: 2px solid var(--accent);
}

/* ===================================================
   5. 共通ユーティリティ
   =================================================== */
.grid-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { align-items: center; justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none; }
