* { box-sizing: border-box; }

:root {
    --bg: #FFF5F7; 
    --card: #FFFFFF; 
    --text: #443F41; 
    --border: #EEE;
    --active-doing: #FF4D7D; 
    --status-todo: #4FC3F7; 
    --status-done: #4CAF50; 
    --warning-red: #D50000;
    --doing-card-bg: #FFFFFF; 
    --btn-del-bg: #F0F0F0;
    --btn-del-text: #757575;
    --btn-adj-bg: transparent;
    --btn-adj-text: var(--status-todo);
    --btn-adj-border: var(--status-todo);
    --tag-started-bg: var(--active-doing);
}

body.dark-mode {
    --bg: #0D1117; 
    --card: #161B22; 
    --text: #C9D1D9; 
    --border: #30363D;
    --active-doing: #58A6FF; 
    --status-todo: #8B949E; 
    --status-done: #3FB950; 
    --doing-card-bg: #161B22;
    --btn-del-bg: #FFFFFF;    
    --btn-del-text: #0D1117;
    --btn-adj-bg: #30363D;    
    --btn-adj-text: #C9D1D9;
    --btn-adj-border: #30363D;
    --tag-started-bg: #58A6FF;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--bg); color: var(--text);
    margin: 0; padding: 20px; display: flex; justify-content: center;
}

.container { width: 100%; max-width: 500px; }

header { text-align: center; margin-bottom: 20px; }
#clock { font-family: 'JetBrains Mono', monospace; font-size: 3rem; font-weight: 700; margin: 10px 0; }

.summary-card { background: var(--card); border-radius: 20px; padding: 20px; border: 2px solid var(--active-doing); box-shadow: 0 10px 25px rgba(0,0,0,0.05); }
.value-digital { font-family: 'JetBrains Mono', monospace; font-size: 2rem; font-weight: 700; color: var(--active-doing); }
.value-digital.is-negative { color: var(--warning-red); }

.gauge-container { margin-top: 15px; }
.global-gauge { width: 100%; height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.global-gauge-fill { height: 100%; background: var(--active-doing); transition: width 0.5s ease; width: 0%; }
.gauge-labels { display: flex; justify-content: space-between; margin-top: 5px; font-family: 'JetBrains Mono'; font-size: 0.75rem; opacity: 0.6; }

.total-sum-text { font-size: 1rem; opacity: 0.5; margin-top: 8px; font-weight: 700; font-family: 'JetBrains Mono'; }

.input-section {
    background: var(--card); padding: 25px; border-radius: 20px; border: 1px solid var(--border);
    margin-bottom: 30px; display: flex; flex-direction: column; align-items: center;
}
input[type="text"] {
    width: 100%; padding: 15px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg); color: var(--text); text-align: center; margin-bottom: 20px; font-size: 1.25rem; font-weight: 700;
}
input::placeholder { color: var(--text) !important; opacity: 0.3; transition: 0.2s; }
input:focus::placeholder { opacity: 0; }

.time-adjuster-wrapper { display:flex; align-items:center; justify-content:center; gap:20px; margin-bottom:15px; }
#setting-time { font-weight: 700; font-size: 1.2rem; min-width: 70px; text-align: center; }

button { cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); border: none; outline: none; }
button:hover { 
    opacity: 0.85; 
    transform: translateY(-2px); 
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
button:active { 
    transform: translateY(0) scale(0.96); 
    filter: brightness(0.9);
}

.btn-mini { padding: 8px 14px; border-radius: 8px; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.btn-main { flex: 1; padding: 14px; border-radius: 10px; font-weight: 700; font-size: 1rem; color: white; }

.btn-to-todo { background: var(--status-todo); color: white; }
.btn-to-doing { background: var(--active-doing); color: white; }
.btn-to-done { background: var(--status-done); color: white; }

.btn-adjust-input { width: 44px; height: 44px; font-size: 1.2rem; background: transparent; border: 2px solid var(--status-todo); color: var(--status-todo); }
.btn-adjust-todo { background: var(--btn-adj-bg); color: var(--btn-adj-text); border: 1px solid var(--btn-adj-border); }
.btn-adjust-doing { background: transparent; border: 2px solid var(--active-doing); color: var(--active-doing); }

.btn-delete { background: var(--btn-del-bg); color: var(--btn-del-text); }
.btn-delete-ghost { margin-top: 12px; background: none; opacity: 0.4; font-size: 0.75rem; color: var(--text); }

.group-header { 
    border-bottom: 2px solid var(--border); 
    margin: 25px 0 15px; 
    padding-bottom: 8px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.group-title { font-size: 0.9rem; letter-spacing: 2px; font-weight: 700; margin: 0; display: flex; align-items: center; width: 100%; justify-content: space-between; }
.large-title { font-size: 1.8rem; letter-spacing: 6px; color: var(--active-doing); text-align: center; border: none; justify-content: center; margin-bottom: 1rem;}
.queue-title { color: var(--status-todo); }
.done-title { color: var(--status-done); }

/* 件数バッジの装飾を解除 */
.count-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text);
    padding: 0 10px;
    opacity: 0.5;
}

.task-card { background: var(--card); border-radius: 15px; padding: 20px; border: 1px solid var(--border); position: relative; margin-bottom: 12px; transition: opacity 0.2s, transform 0.2s; }
.task-name { font-size: 1.3rem; font-weight: 700; line-height: 1.4; }

.task-card.todo { border: 3px solid var(--status-todo); }
.task-card.done { border: 3px solid var(--status-done); }
.task-card.doing { background-color: var(--doing-card-bg); border: 4px solid var(--active-doing); padding: 35px 25px; transform: scale(1.02); z-index: 10; }

.task-card.dragging { 
    opacity: 0.4 !important; 
    transform: scale(0.95); 
    border-style: dashed !important; 
}

/* ⚠️マークのゆっくりした「つき・きえ」アニメーション */
@keyframes fade-blink {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}
.warning-blink {
    animation: fade-blink 3s infinite ease-in-out;
    display: inline-block;
    margin-right: 4px;
}

.status-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; margin-bottom: 8px; }
.status-badge.started { background-color: var(--tag-started-bg); color: white; }
.status-badge.unstarted { background-color: var(--border); color: var(--text); opacity: 0.6; }

.drop-zone { height: 10px; margin: 8px 0; background: transparent; border-radius: 5px; transition: 0.3s; }
.drop-zone.active.todo { background: var(--status-todo); box-shadow: 0 0 10px var(--status-todo); }
.drop-zone.active.done { background: var(--status-done); box-shadow: 0 0 10px var(--status-done); }

.planned-text { font-size: 1.1rem; font-weight: 700; margin: 8px 0; }
.over-label { color: var(--warning-red); font-weight: 700; font-family: 'JetBrains Mono'; font-size: 0.85rem; }
.drag-handle { cursor: grab; opacity: 0.3; padding: 5px; font-size: 1.2rem; }

.mode-switch { position: fixed; top: 20px; left: 20px; width: 48px; height: 48px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 100; box-shadow: 0 4px 15px rgba(0,0,0,0.15); transition: 0.2s; }
.mode-switch:hover { transform: rotate(15deg) scale(1.1); }

