/* ======================================================= */
/* 0. 基本設定 (Base Setup) */
/* ======================================================= */
body {
    font-family: 'Georgia', 'Times New Roman', serif; 
    background-color: #333333; 
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23333333"/><line x1="0" y1="0" x2="100" y2="100" stroke="%23444444" stroke-width="1"/><line x1="0" y1="100" x2="100" y2="0" stroke="%23444444" stroke-width="1"/></svg>'); 
    color: #f0f0f0; 
    margin: 0;
    padding: 0;
}

.container {
    max-width: 900px;
    margin: 40px auto;
    /* メインウィンドウ */
    background-color: #4a3d31; 
    padding: 30px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(0, 0, 0, 0.8);
    border: 5px solid #8b4513; 
    border-radius: 12px;
}

header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #8b4513;
    margin-bottom: 25px;
}

h1 {
    color: #ffd700; 
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.7);
    font-size: 2.5em;
    margin: 0;
}

h2 {
    color: #c0c0c0; 
    border-bottom: 1px solid #6b5c51;
    padding-bottom: 5px;
    margin-top: 20px;
    font-size: 1.5em;
}

a {
    color: #87cefa; 
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #ffffff;
}

/* ======================================================= */
/* 1. フォーム/ボタン (Form/Buttons) */
/* ======================================================= */
.login-box, .clock-section, .history-section, .shop-content, .inventory-content, .monster-list, .rpg-status-box {
    margin-top: 20px;
    padding: 20px;
    background-color: #5c4b41; 
    border: 3px solid #6b5c51; 
    border-radius: 8px;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #e0e0e0;
}

.form-group input[type="text"], 
.form-group input[type="password"] {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #6b5c51;
    background-color: #2e241c; 
    color: #ffffff;
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* 共通ボタンスタイル */
.in-button, .out-button, .btn-rpg, .buy-button, .equip-button, .unequip-button, .battle-button {
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    box-shadow: 0 4px 0 #3b3026; 
    transition: all 0.1s;
    font-family: inherit;
    font-size: 1em;
}

.in-button:active, .out-button:active, .btn-rpg:active, .buy-button:active, .equip-button:active, .unequip-button:active, .battle-button:active {
    transform: translateY(2px); 
    box-shadow: 0 2px 0 #3b3026;
}

/* ログイン/新規登録/出勤ボタン (成功・進む系) */
.in-button, .btn-rpg {
    background-color: #4CAF50; 
    box-shadow: 0 4px 0 #388e3c;
}
.in-button:active, .btn-rpg:active {
    box-shadow: 0 2px 0 #388e3c;
}
.in-button { margin-right: 10px; }

/* 退勤ボタン (停止・終了系) */
.out-button {
    background-color: #f44336; 
    box-shadow: 0 4px 0 #d32f2f;
}
.out-button:active {
    box-shadow: 0 2px 0 #d32f2f;
}

.button-group {
    text-align: center;
    margin-top: 20px;
}

.inline-form {
    display: inline-block;
}

.mt-15 { 
    margin-top: 15px; 
    text-align: center; 
}

/* ======================================================= */
/* 2. ステータス/メッセージ (Status/Messages) */
/* ======================================================= */

/* RPGステータス (ゴールドフレーム風) */
.rpg-status-box {
    border: 3px solid #ffd700; 
    background-color: #6d5b4e; 
    padding: 15px;
    margin-bottom: 25px;
    text-align: center;
}
.rpg-status-box strong {
    color: #ffd700;
}
.rpg-status-box p {
    margin: 5px 0;
}

/* メッセージボックス */
.status-message {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
    color: #333; 
}

.success-message {
    background-color: #c8e6c9;
    border: 1px solid #4CAF50;
    color: #1b5e20;
}

.error, .error-message {
    background-color: #ffcdd2;
    border: 1px solid #f44336;
    color: #b71c1c;
}

/* ======================================================= */
/* 3. テーブル (Tables) */
/* ======================================================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}
th, td {
    border: 1px solid #6b5c51;
    padding: 10px;
    text-align: left;
}
th {
    background-color: #8b4513; 
    color: white;
}
td {
    background-color: #5c4b41;
}

/* ======================================================= */
/* 4. ショップ/インベントリ (Shop/Inventory) */
/* ======================================================= */

/* 購入ボタン */
.buy-button {
    background-color: #ff9800; 
    box-shadow: 0 4px 0 #f57c00;
}
.buy-button:active {
    box-shadow: 0 2px 0 #f57c00;
}

.disabled-button {
    background-color: #888;
    color: #444;
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    cursor: not-allowed;
    box-shadow: none;
}

/* 装備タグ */
.equipped-tag {
    background-color: #1976d2;
    color: white;
    padding: 3px 8px;
    font-size: 0.8em;
    border-radius: 3px;
    margin-left: 5px;
    font-weight: bold;
}

/* 装備/解除ボタン */
.equip-button {
    background-color: #28a745; 
    box-shadow: 0 4px 0 #1e7e34;
    font-size: 0.9em;
}
.equip-button:active {
    box-shadow: 0 2px 0 #1e7e34;
}

.unequip-button {
    background-color: #dc3545; 
    box-shadow: 0 4px 0 #bd2130;
    font-size: 0.9em;
}
.unequip-button:active {
    box-shadow: 0 2px 0 #bd2130;
}


/* ======================================================= */
/* 5. 戦闘 (Battle) */
/* ======================================================= */
.battle-log-box {
    background-color: #2e241c;
    color: #c0c0c0;
    padding: 15px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    white-space: pre-wrap;
    max-height: 250px;
    overflow-y: auto;
    border: 1px dashed #795548;
}

.battle-button {
    background-color: #cc0000; 
    box-shadow: 0 4px 0 #990000;
}
.battle-button:active {
    box-shadow: 0 2px 0 #990000;
}
.battle-button[disabled] {
    background-color: #666;
    box-shadow: 0 4px 0 #444;
    cursor: not-allowed;
}

.battle-button[disabled]:active {
    transform: none;
    box-shadow: 0 4px 0 #444;
}

/* ======================================================= */
/* 6. スマホ/レスポンシブ対応 (Mobile/Responsive) */
/* ======================================================= */

/* スマホサイズのビューポートに適用 (幅768px以下) */
@media (max-width: 768px) {
    
    /* メインコンテナの余白調整 */
    .container {
        margin: 0; 
        padding: 15px;
        border-radius: 0; 
        max-width: 100%;
        width: auto;
        border: none; 
        box-shadow: none;
    }

    /* ヘッダーの文字を調整 */
    h1 {
        font-size: 2em;
    }

    /* フォーム入力欄のパディングを大きくしてタップしやすく */
    .form-group input[type="text"], 
    .form-group input[type="password"] {
        padding: 12px;
        font-size: 1.1em;
    }

    /* ボタンサイズを大きく、幅をいっぱいに広げる */
    .in-button, .out-button, .btn-rpg, .buy-button, .equip-button, .unequip-button, .battle-button {
        padding: 15px 10px; 
        width: 100%; 
        display: block;
        margin: 10px 0 !important; 
        font-size: 1.1em;
        box-shadow: 0 3px 0 #3b3026; 
    }
    
    .in-button:active { box-shadow: 0 1px 0 #388e3c; }
    .out-button:active { box-shadow: 0 1px 0 #d32f2f; }
    
    /* ログイン/新規登録ページのボタン群をブロック化 */
    .button-group, .inline-form {
        display: block;
        width: 100%;
    }
    
    /* RPGナビゲーションのボタンも全てブロック化 */
    .rpg-nav a {
        display: block;
        margin: 10px 0;
    }

    /* テーブルの調整 (横スクロールで表示崩れを避ける) */
    table {
        width: 100%;
        display: block;
        overflow-x: auto; 
        white-space: nowrap; 
    }
}