/* GENERAL */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap");

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100..900&family=Roboto+Condensed:ital,wght@0,100..900;1,100..900&display=swap');

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+Display:ital,wght@0,100..900;1,100..900&display=swap');

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* @import url('https://fonts.googleapis.com/css2?family=Cactus+Classical+Serif&display=swap'); */

@import url('https://fonts.googleapis.com/css2?family=Cactus+Classical+Serif&family=LXGW+WenKai+TC&display=swap');


body {
    font-family: "Poppins", sans-serif;
    background-color: #000;
}

* {
    margin: 0;
    padding: 0;
    color: #ddd;
    font-size: 1.0rem;

    -webkit-user-select: none; /* Safari用 */
    -ms-user-select: none;     /* IE/Edge用 */
    user-select: none;         /* 標準プロパティ */
}

canvas {
    /* canvas をブロック要素化(スクロールバーを抑制) */
    display: block;

    /* タッチ操作による移動を禁止 */
    touch-action: none;
}

h1 {
    font-size: 1.2rem;
    font-weight: normal;
}

h2 {
    font-size: 1.2rem;
    font-weight: normal;
}

p .author {
    font-size: 1.1rem;
}

p {
    margin: 0.5em 0em;
    font-size: 0.9rem;
}

a {
    display: block;
    text-decoration: none;
    /* text-decoration-color: white; */
    padding: 0.5rem 2rem;
}

button {
    padding: 0 1rem;
    border-radius: 0.2rem;
}

.toggle-switch, .between {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

a:hover, .closebox:hover,
.site:hover, .date:hover, .live:hover, .menu:hover {
    color: white;
    background-color: #444;
    // text-decoration: underline;
    // text-underline-offset: 1rem;
    // text-decoration-color: rgb(181, 181, 181);
    cursor: pointer;
}

/*
 * header, logo, site, date
 */
header, dialog, .menu-links, button {
    background-color: rgba(40, 40, 40, 0.8);
}

header {
    position: absolute;
    width: 100%;
    display: flex;
    // justify-content: space-around;
    justify-content: space-between;
    align-items: center;
    height: 2.4rem;
}

.logo {
    margin: 0px 0px 0px 20px;
}

.logo:hover {
    cursor: default;
}

.info {
    display: flex;
}

.site, .date, .time, .zone, .live, .menu {
    display: flex;
    height: 2.4rem; /* header 高さと同じ */
    padding: 0px 10px;
    align-items: center; /* 上下中央にアライン */
    font-size: 1.1rem;
}

.date {
    // font-family: "Courier New", monospace;
    // font-family: monospace;
    font-family: "Roboto Condensed", monospace;
}

.menu {
    margin: 0px 0px;
    padding: 0px 15px;
}

#wheel {
    // border: 1px solid red;

    margin: auto;
    background-color: rgba(0, 0, 0, 0.0);
    position: absolute;
    right: 0px;
    top: 50%;

    width: 25px;
    height: 15%;
    padding: 15% 10px;
    margin-right: 0;
    transform: translate(0%, -50%);

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center; /* 上下中央にアライン */
    border-radius: 0;
}

#wheel:focus {
    outline: none;
}

#wheel:hover {
    /* background-color: rgba(60, 60, 60, 0.8); */
    cursor: pointer;
}

#wheel span {
    width: 100%;
    height: 1px;
    background-color: #888;
}

/* dialog open 時の背景の dim を0.3に設定 */
dialog::backdrop {
    background: rgba(0, 0, 0, 0.1);
}

.dialog-head {
    // border: 1px solid red;
    height: 32px;
    display: flex;
    align-items: center;
    // flex-direction: row;
    justify-content: space-between;
    margin: 0;
    padding: 1.5rem 1.5rem;
}

.dialog-head:hover {
    cursor: move;
    // ダイアログの移動を実装中。
}

.dialog-body {
    // border: 1px solid green;
    margin: 0;
    padding: 0.5rem 1.5rem;
}

.dialog-title {
    // border: 1px solid orange;
    margin: 0;
    padding: 0;
}

.dialog-sub {
    margin: 2rem 0 1rem 0;
}

dialog[open] {
    /* fixedで右上に表示 */
    position: fixed;
    margin: auto;
    margin-top: 3.4rem;
    margin-right: 20px;

    width: 24rem;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    overscroll-behavior: contain;

    /* transition: all 0.3s ease-out;
       これを有効にするとダイアログのドラッグがまともに動かない。 */

    border-radius: 1rem;
    font-size: 1.0rem;
    border: 0px;
    // z-index: 1002;
    padding: 0;
}

// Gemini から
/* 1. input要素全体の調整 */
input[type="datetime-local"] {
    /* Safariでデフォルトの奇妙なパディングやサイズをリセット */
    -webkit-appearance: none;
    appearance: none;

    /* フォント、パディング、枠線の調整 */
    font-size: 16px; /* iOSでズームしないように16px以上推奨 */
    padding: 10px 12px;
    border: 0px solid #ccc;
    border-radius: 4px;

    /* 高さの安定化 */
    line-height: normal;
    height: auto;
    box-sizing: border-box;
}

/* 2. WebKit専用: 入力フィールド内部の調整 (Safari/Chrome) */
input[type="datetime-local"]::-webkit-datetime-edit {
    padding: 0; /* 内部の編集エリアのパディングをゼロにして調整 */
}

/* 3. 文字色やスタイル(必要に応じて) */
input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
    font-family: "Roboto Condensed", monospace;
    font-size: 1.2rem;
}

/* 4. カレンダー/時計アイコンの調整 */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.8;
}

/* 5. プレースホルダー(未選択時)の色 */
input[type="datetime-local"]::-webkit-datetime-edit-text {
}

// ここまで

select {
    /* iOSのSafariで select のテキストが左によりすぎる問題。
     * Gemini提案の方法を試みるも解決せず。*/

    /* なぜか空の select {} セクションを2つ用意し、2つ目でpadding を
       セットすると解決した。なぜだ。*/
    //-webkit-appearance: none; /* Safari, Chromeのデフォルト解除 */
    // appearance: none;
    // text-align: center;
    // text-align-last: center;
}

select {
    padding-left: 1rem;
    // text-align: center;
    outline: none;
}

a, button {
    transition: all 300ms ease;
    cursor: pointer;
    /* font-size: 1rem; */
}

li {
    list-style: none;
    margin: 20px 0;
}

/*
#datetime {
    margin-bottom: 1rem;
    border: 0px;
    font-family: monospace;
    // 年月日の間のスラッシュ・時分の間のコロンの両側の空白を抑制
    // => うまく動作しない。
    display: flex;
}
*/
#datetime {
    background-color: #333; /* 必要 */
}

#year, #month, #day, #hour, #min, #sec {
    margin-bottom: 2.5rem;
    /* color: white; */
    /* font-size: 1.2rem; */
    border: 0px;
    font-family: monospace;
    width: 2rem;
    background-color: #333;
    text-align: center;
}

#year {
    width: 6rem;
}

#timestep, #cs, #mp, #font {
    background-color: #333; /* 必要 */
    /* text-align: center; - 効かない */
}

.plaintext {
//    white-space: pre-wrap;
//    max-height: 300px;
//    overflow-y: auto;"
}
