:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#475569;
  --line:rgba(15,23,42,.10);

  --accent:#2563eb;   /* 青 */
  --accent2:#16a34a;  /* 緑 */
  --danger:#dc2626;

  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(37,99,235,.10), transparent 60%),
    radial-gradient(820px 520px at 82% 10%, rgba(22,163,74,.08), transparent 60%),
    var(--bg);
}

a{color:inherit;text-decoration:none}
.container{width:min(1100px, 92vw); margin:0 auto}

/* Topbar */
.topbar{
  position:sticky; top:0; z-index:50;
  background: rgba(246,247,251,.82);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.topbar__inner{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 0; gap:10px;
}
.brand{font-weight:900; letter-spacing:.2px}
.nav{display:flex; gap:12px; flex-wrap:wrap}
.nav a{
  padding:8px 10px;
  border:1px solid transparent;
  border-radius:999px;
  color:var(--muted);
}
.nav a:hover{border-color:var(--line); color:var(--text); background: rgba(15,23,42,.03)}

/* Layout */
.hero{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:18px;
  padding:20px 0 24px;
}
@media (max-width: 900px){
  .hero{grid-template-columns:1fr}
}

/* Typography */
.title{
  font-size: clamp(26px, 3.6vw, 40px);
  margin: 12px 0 6px;
  letter-spacing: .2px;
}
.subtitle{margin:0 0 14px; color:var(--muted)}
.h2{margin:0; font-size:18px}
.h3{margin:0 0 10px; font-size:16px}
.small{color:var(--muted); line-height:1.7}
.hint{color:var(--muted); margin:12px 0 0}

/* Cards */
.card, .timerCard, .taskCard, .miniCard{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow:
    0 10px 30px rgba(15,23,42,.08),
    0 1px 0 rgba(255,255,255,.8) inset;
}

.timerCard{padding:16px}

/* Mode chips */
.modeRow{display:flex; gap:10px; flex-wrap:wrap}
.chip{
  border:1px solid var(--line);
  background: rgba(15,23,42,.02);
  color:var(--muted);
  padding:9px 12px;
  border-radius:999px;
  font-weight:800;
}
.chip:hover{background: rgba(15,23,42,.04)}
.chip.is-active{
  color:var(--text);
  border-color: rgba(37,99,235,.35);
  background: rgba(37,99,235,.10);
}

/* Timer */
.time{
  font-variant-numeric: tabular-nums;
  font-size: clamp(56px, 10vw, 92px);
  text-align:center;
  margin: 10px 0;
  letter-spacing:1px;
  text-shadow: 0 10px 30px rgba(37,99,235,.10);
}
.colon{opacity:.6}

/* Controls */
.controls{
  display:grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap:10px;
}
@media (max-width: 520px){
  .controls{grid-template-columns: 1fr 1fr; }
  #btnStart{grid-column: 1 / -1}
}

.btn{
  border:1px solid var(--line);
  background: rgba(15,23,42,.02);
  color:var(--text);
  padding:12px 12px;
  border-radius: 14px;
  font-weight:900;
}
.btn:hover{background: rgba(15,23,42,.04)}
.btn:active{transform: translateY(1px)}
.btn-primary{
  border-color: rgba(22,163,74,.35);
  background: rgba(22,163,74,.12);
}
.btn-primary:hover{background: rgba(22,163,74,.16)}
.btn-small{padding:10px 12px; border-radius:12px; font-weight:900}

/* Mini row */
.miniRow{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; margin-top:10px
}
.toggle{display:flex; align-items:center; gap:10px; color:var(--muted); font-weight:800}
.toggle input{transform: scale(1.05)}
.linkBtn{
  border:none;
  background:transparent;
  color:var(--accent);
  font-weight:900;
  padding:10px;
}
.linkBtn:hover{text-decoration:underline}

/* Progress */
.progressWrap{margin-top:12px}
.progressBar{
  height:10px; border-radius:999px;
  background: rgba(15,23,42,.05);
  overflow:hidden;
  border:1px solid var(--line);
}
.progressFill{height:100%; width:0%}
.progressMeta{
  display:flex; justify-content:space-between;
  color:var(--muted);
  margin-top:8px;
  font-weight:800;
}

/* Tasks */
.taskCard{padding:16px; margin-top:14px}
.taskHeader{display:flex; align-items:center; justify-content:space-between; gap:10px}

.taskList{
  list-style:none; padding:0; margin:12px 0 0;
  display:flex; flex-direction:column; gap:10px
}
.taskItem{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  display:grid;
  grid-template-columns: 1fr auto;
  gap:10px;
  background: rgba(15,23,42,.02);
}
.taskItem .name{font-weight:950}
.taskItem .meta{
  color:var(--muted);
  font-weight:800;
  font-size:13px;
  margin-top:4px
}
.taskItem .actions{display:flex; gap:8px; align-items:center}

.iconBtn{
  border:1px solid var(--line);
  background: rgba(15,23,42,.02);
  color:var(--text);
  width:40px; height:40px;
  border-radius:12px;
  display:grid; place-items:center;
  font-weight:950;
}
.iconBtn:hover{background: rgba(15,23,42,.04)}
.iconBtn.danger{
  border-color: rgba(220,38,38,.25);
  color: var(--danger);
}

/* Ads / right column */
.adCard{padding:16px}
.adBox{
  min-height: 180px;
  display:grid; place-items:center;
  border:1px dashed rgba(15,23,42,.20);
  border-radius: 14px;
  margin:10px 0 14px;
  background: rgba(15,23,42,.02);
}

/* Settings grid */
.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:10px}
@media (max-width: 420px){ .grid2{grid-template-columns:1fr} }

.field{
  display:flex; flex-direction:column; gap:6px;
  color:var(--muted); font-weight:900
}
.field input{
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(15,23,42,.02);
  color:var(--text);
  font-weight:950;
}

.row{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}

/* Pages */
.page{padding:22px 0}
.bullets{color:var(--muted); line-height:1.9}

/* Footer */
.footer{
  border-top:1px solid var(--line);
  padding:18px 0 26px;
  color:var(--muted);
}
.footer__inner{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; flex-wrap:wrap
}
.footer__links{display:flex; gap:14px; flex-wrap:wrap}
.footer__links a:hover{color:var(--text)}

/* Focus mode (白→夜に切り替え：差別化ポイント) */
body.focus{
  background: #0b1220;
  color: #e8eefc;
}
body.focus .topbar,
body.focus .hero__right,
body.focus .taskCard{display:none}
body.focus .hero{grid-template-columns:1fr}

/* focus中のカードは少しだけ暗く */
body.focus .timerCard{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
}
body.focus .chip{
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: rgba(232,238,252,.80);
}
body.focus .chip.is-active{
  border-color: rgba(122,167,255,.55);
  background: rgba(122,167,255,.18);
  color: #e8eefc;
}
body.focus .btn{
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: #e8eefc;
}
body.focus .btn-primary{
  border-color: rgba(125,255,168,.55);
  background: rgba(125,255,168,.14);
}
body.focus .progressBar{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
}
body.focus .progressMeta{color: rgba(232,238,252,.75)}
