@charset "UTF-8";

/* --- クイズレイアウト --- */
#timer {
    position: fixed;
    top: 60px; /* ヘッダーの下 */
    left: 0;
    width: 100%;
    /* 背景色はHTML側で指定する場合と統一するためデフォルトは指定なし、または必要に応じて記述 */
    color: white;
    padding: 10px 0;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    z-index: 900;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tool-bar {
    display: flex;
    justify-content: flex-start;
    padding-left: 20px;
    margin-bottom: 20px;
    position: sticky;
    top: 100px; /* タイマーの下 */
    z-index: 800;
    pointer-events: none; /* 背景をクリック可能に */
}
.tool-bar button { pointer-events: auto; }

.question-block {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ffcdd2;
    border-left: 6px solid #d32f2f;
    border-radius: 5px;
    background-color: #ffffff;
    display: none;
}
.question-block.active { display: block; }

.options li {
    padding: 12px 15px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
}
.options li:hover { background-color: #fce4ec; }
.options li.selected { background-color: #f8bbd0; font-weight: bold; }
.options li.correct-highlight { background-color: #c8e6c9 !important; font-weight: bold; }
.options li.incorrect-highlight { background-color: #ffcdd2 !important; font-weight: bold; }

.answer-content {
    margin-top: 15px;
    padding: 15px;
    border-top: 2px solid #d32f2f;
    background-color: #ffcdd2;
    border-radius: 0 0 5px 5px;
    display: none;
}

/* --- パレット --- */
.palette-container {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}
.question-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    gap: 5px;
}
.palette-btn {
    width: 100%; aspect-ratio: 1; border: 1px solid #ccc;
    background-color: #f9f9f9; border-radius: 4px; cursor: pointer;
}
.palette-btn.answered { background-color: #bbdefb; color: #0d47a1; font-weight: bold; }
.palette-btn.current { border: 2px solid #d32f2f; transform: scale(1.1); z-index: 1; }

/* ナビゲーションボタン (二等試験用に追加) */
.nav-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 1em;
    background-color: #00796b; /* デフォルトカラー */
    transition: background 0.3s;
}
.nav-button:hover { background-color: #004d40; }
.nav-button:disabled { background-color: #ccc; cursor: not-allowed; }
/* 採点ボタン用 */
#submit-button { background-color: #d32f2f; }
#submit-button:hover { background-color: #b71c1c; }


/* --- 電卓 (アプリ版「style1.css」のデザインを移植) --- */

/* 電卓を開くボタン */
#calc-toggle-btn {
    background-color: #0d47a1; color: white; border: none;
    padding: 10px 20px; border-radius: 50px; font-weight: bold;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); cursor: pointer;
}
#calc-toggle-btn svg { width: 24px; height: 24px; }

/* 電卓本体のラッパー */
#calculator-wrapper {
    position: fixed; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%);
    width: 95%; 
    max-width: 500px; /* アプリ版と同じ最大幅 */
    background-color: #fff; 
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5); 
    z-index: 2001;
    display: none; 
    border: 1px solid #999;
    padding: 10px;
    box-sizing: border-box;
}

/* ヘッダーバー */
.calc-header-bar { 
    background: #000; 
    color: #fff; 
    padding: 5px 10px; 
    font-weight: bold; 
    font-size: 14px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    cursor: grab;
    margin: -10px -10px 10px -10px; /* パディングを相殺して端まで広げる */
}
.calc-close-btn {
    font-size: 18px;
    cursor: pointer;
}

.calc-body { 
    /* paddingは親要素で指定済なので不要 */
}

/* ディスプレイエリア */
.calc-display-container { 
    margin-bottom: 5px; 
    border: 1px solid #ccc; 
    border-radius: 3px; 
    background: #fff; 
    padding: 5px; 
    display: flex; 
    align-items: center; 
    position: relative; 
}

#calc-display { 
    flex: 1; 
    border: none; 
    background: transparent; 
    text-align: right; 
    font-size: 24px; 
    font-family: 'Arial', sans-serif; 
    color: #000; 
    height: 35px; 
    padding-left: 20px; 
    width: 100%; 
    box-shadow: none;
    outline: none;
}

#calc-mem-indicator { 
    font-size: 12px; 
    font-weight: bold; 
    color: #333; 
    position: absolute; 
    left: 5px; 
    top: 50%; 
    transform: translateY(-50%); 
}

/* コピーボタン（Web版独自機能） */
.btn-copy {
    width: 100%; 
    background: #fdd835; 
    color: #333; 
    border: 1px solid #fbc02d; 
    font-weight: bold; 
    padding: 8px; 
    margin-bottom: 10px; 
    border-radius: 4px; 
    cursor: pointer;
    font-family: inherit;
}

/* グリッドレイアウト */
.calc-grid { 
    display: grid; 
    grid-template-columns: repeat(6, 1fr); 
    gap: 6px; 
}

/* ボタン共通スタイル */
.calc-btn { 
    height: 45px; 
    border-radius: 4px; 
    font-size: 16px; 
    font-weight: bold; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.1); 
    cursor: pointer; 
    background: #f5f5f5; 
    color: #333; 
    border: 1px solid #ddd; 
    padding: 0;
    font-family: inherit;
}
.calc-btn:active { 
    transform: translateY(1px); 
    box-shadow: none; 
}

/* --- ボタン色分け (style1.css準拠) --- */
.calc-btn.red { background: #b71c1c; color: white; border: 1px solid #d32f2f; }
.calc-btn.op { background: #00897b; color: white; border: 1px solid #00695c; }
.calc-btn.equal { background: #0d47a1; color: white; border: 1px solid #002171; }
.calc-btn.mem { background: #e0e0e0; color: #555; }
.calc-btn.num { background: #fff; border: 1px solid #ccc; font-size: 18px; }
.calc-btn.func { background: #eceff1; } 

.span-2 { 
    grid-column: span 2; 
    width: 100%; 
}