/*
 * Windows98風テーマ (body.win98-theme が付いている場合のみ有効)
 * 既存のTailwindユーティリティクラスを部分一致セレクタで上書きすることで、
 * 各ページのHTML/クラスを個別に書き換えずに全体の見た目を切り替える。
 * 印刷(denpyo.php等)には影響させないため @media screen で囲む。
 */
@media screen {

    body.win98-theme {
        background: #008080 !important; /* クラシックな背景色 */
        font-family: Tahoma, "MS Sans Serif", "Yu Gothic", sans-serif !important;
        color: #000 !important;
        font-size: 13px !important;
    }

    body.win98-theme * {
        font-family: Tahoma, "MS Sans Serif", "Yu Gothic", sans-serif !important;
        text-shadow: none !important;
    }

    /* 角丸を全廃 */
    body.win98-theme [class*="rounded"] {
        border-radius: 0 !important;
    }

    /* 影 → クラシックな立体(ベベル)枠に */
    body.win98-theme [class*="shadow"] {
        box-shadow:
            inset -1px -1px 0 #000000,
            inset 1px 1px 0 #ffffff,
            inset -2px -2px 0 #808080,
            inset 2px 2px 0 #dfdfdf !important;
    }

    /* 白/薄グレー背景 → クラシックシルバー */
    body.win98-theme [class*="bg-white"],
    body.win98-theme [class*="bg-gray-50"],
    body.win98-theme [class*="bg-gray-100"] {
        background-color: #c0c0c0 !important;
    }

    /* ヘッダーはタイトルバー風に */
    body.win98-theme header {
        background: linear-gradient(90deg, #000080, #1084d0) !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        color: #fff !important;
    }
    body.win98-theme header h1,
    body.win98-theme header h2,
    body.win98-theme header p,
    body.win98-theme header span,
    body.win98-theme header div {
        color: #fff !important;
    }
    body.win98-theme header a,
    body.win98-theme header button,
    body.win98-theme header select {
        color: #000 !important;
    }

    body.win98-theme h1,
    body.win98-theme h2,
    body.win98-theme h3 {
        font-weight: bold !important;
    }

    /* 色付きの背景を持つボタン/リンク → クラシックな立体ボタン */
    body.win98-theme a[class*="bg-"],
    body.win98-theme button[class*="bg-"] {
        background: #c0c0c0 !important;
        color: #000 !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow:
            inset -1px -1px 0 #0a0a0a,
            inset 1px 1px 0 #ffffff,
            inset -2px -2px 0 #808080,
            inset 2px 2px 0 #dfdfdf !important;
        font-weight: normal !important;
        transform: none !important;
    }
    body.win98-theme a[class*="bg-"]:hover,
    body.win98-theme button[class*="bg-"]:hover {
        background: #c0c0c0 !important;
    }
    body.win98-theme a[class*="bg-"]:active,
    body.win98-theme button[class*="bg-"]:active {
        box-shadow:
            inset 1px 1px 0 #0a0a0a,
            inset -1px -1px 0 #ffffff,
            inset 2px 2px 0 #808080,
            inset -2px -2px 0 #dfdfdf !important;
    }

    /* 入力系フォーム部品 → 沈み込んだクラシック枠 */
    body.win98-theme input,
    body.win98-theme select,
    body.win98-theme textarea {
        background: #ffffff !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow:
            inset 1px 1px 0 #808080,
            inset -1px -1px 0 #ffffff,
            inset 2px 2px 0 #0a0a0a,
            inset -2px -2px 0 #dfdfdf !important;
    }

    /* テーブル */
    body.win98-theme table {
        border-collapse: collapse !important;
    }
    body.win98-theme th {
        background: #c0c0c0 !important;
        color: #000 !important;
        border: 1px solid #808080 !important;
    }
    body.win98-theme td {
        border: 1px solid #808080 !important;
    }

    /* バッジ/ピル形状 */
    body.win98-theme [class*="rounded-full"] {
        border-radius: 0 !important;
        border: 1px solid #000 !important;
    }

    /* パネル系コンテナ */
    body.win98-theme main,
    body.win98-theme section,
    body.win98-theme .page {
        background: #c0c0c0 !important;
        box-shadow:
            inset -1px -1px 0 #0a0a0a,
            inset 1px 1px 0 #ffffff,
            inset -2px -2px 0 #808080,
            inset 2px 2px 0 #dfdfdf !important;
    }

    /* クラシックスクロールバー (Chrome/Edge) */
    body.win98-theme ::-webkit-scrollbar {
        width: 16px;
        height: 16px;
    }
    body.win98-theme ::-webkit-scrollbar-track {
        background: #dfdfdf;
    }
    body.win98-theme ::-webkit-scrollbar-thumb {
        background: #c0c0c0;
        box-shadow:
            inset -1px -1px 0 #0a0a0a,
            inset 1px 1px 0 #ffffff,
            inset -2px -2px 0 #808080,
            inset 2px 2px 0 #dfdfdf;
    }

    /* テーマ切替ボタン自体は常に最前面 */
    #theme-toggle-btn {
        transition: none !important;
    }
}
