:root {
  --bg: #0f172a;
  /* slate-900 */
  --panel: #111827;
  /* gray-900 */
  --text: #e5e7eb;
  /* gray-200 */
  --muted: #94a3b8;
  /* slate-400 */
  --accent: #22c55e;
  /* green-500 */
  --accent2: #60a5fa;
  /* blue-400 */
  --danger: #ef4444;
  /* red-500 */
  --ring: #1f2937;
  /* gray-800 */

}



* {
  box-sizing: border-box
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans,
    "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", Meiryo, Arial, sans-serif;

  /* 既存のグラデーション背景 */
  background: radial-gradient(1000px 1000px at 20% 20%, #111827, #0b1222) no-repeat fixed, var(--bg);

  /* ★ 追加：背景画像を100%フィットさせる設定 */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  color: var(--text);
  display: grid;
  place-items: center;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;

  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1; /* 背景画像と同じ層に重ねる */
  pointer-events: none;

  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
background-color: rgba(0, 0, 0, 0.1); /* 20% の薄い黒 */

  background-size: 15px 15px; /* 格子の大きさ */
}

body[data-phase="focus"] {
  background: radial-gradient(1000px 1000px at 20% 20%, #111827, #0b1222) no-repeat fixed, var(--bg);
}

body[data-phase="break"] {
   background: radial-gradient(1000px 1000px at 20% 20%, #111827, #0b1222) no-repeat fixed, var(--bg);
  /*background: radial-gradient(1000px 1000px at 20% 20%, #1a2c3a, #14222f) no-repeat fixed, var(--bg);*/
}

body[data-phase="break"] .digits {
  color: #bae6fd; 
}




/* またはクラス版 */
body.break-mode {
  background: radial-gradient(circle at center, #cceeff, #aaddcc);
}

#loading {
  position: fixed;
  z-index: 9999;
  background: linear-gradient(135deg, #22c55e, #60a5fa);
  width: 100vw;
  height: 100vh;
  top: 0; left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader {
  position: relative;
  width: 100px;
  height: 100px;
}

.loader::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 6px solid rgba(255, 255, 255, 0.3);
  border-top: 6px solid #fff;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

.loader-text {
  position: absolute;
  top: 55%; left: 58%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  font-weight: bold;
  color: white;
  letter-spacing: 1px;
  animation: fadeIn 1.5s ease-in-out infinite;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.app {
  width: 100%;
  max-width: 720px;
  padding: 20px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px
}

h1 {
  font-size: clamp(18px, 2.6vw, 22px);
  margin: 0;
  letter-spacing: .4px;
  color: #f8fafc
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

button,
select {
  background: #ffffff;

  color: #1e293b;
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;

  letter-spacing: .2px;
  transition: .15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 3px rgba(0, 0, 0, .15)
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none
}


#toggleTaskInputBtn{
border: 1px solid #3a3a3a;
width: 100%;
text-align: center;
padding: 8px;
margin: 0 auto;
margin-bottom: 20px;
}

#toggleBtn {
  display: flex;
  justify-content: center; /* 横方向の中央揃え */
  align-items: center;     /* 縦方向の中央揃え */
  padding: 8px;            /* 必要に応じて余白調整 */
  width: 48px;             /* ボタンサイズを固定する場合 */
  height: 48px;
}

#resetBtn {
  display: flex;
  justify-content: center; /* 横方向の中央揃え */
  align-items: center;     /* 縦方向の中央揃え */
  padding: 8px;            /* 必要に応じて余白調整 */
  width: 48px;             /* ボタンサイズを固定する場合 */
  height: 48px;
}


#soundControl {
  display: inline-block;
  position: relative;
}

#volumeWrapper {
  max-height: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .25s ease, max-width .25s ease, opacity .25s ease;
  margin-top: 8px;
}

#volumeWrapper.show {
  max-height: 60px;
  max-width: 150px; /* ← ここを広げる */
  opacity: 1;
}

#volumeWrapper input[type="range"] {
  width: 120px; /* ← スライダーの実際の幅 */
}

/* ホバー時のアニメーション */
#volumeWrapper input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.1);
}


#resetStreakBtn{
  cursor: pointer;
margin: 0px auto;
width: 130px;
color: #ffffff;
text-align: center;
font-size: 15px;
}

.primary {
  background: linear-gradient(135deg, var(--accent2), var(--accent2));
  border-color: transparent;
  color: #052e13;
  font-weight: bold;
}

.task-input-wrapper {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

.task-input-wrapper.show {
  max-height: 100px;
  opacity: 1;
}


#taskSection {

  padding: 1em;
  border-radius: 12px;
  width: 75%;
  margin: 0 auto;


}


.settings-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ring);
  padding-bottom: 10px;
}

.settings-tab {
  background: transparent;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
  border-radius: 6px;
}

.settings-tab.active {
  background: var(--accent2);
  color: #fff;
}

.tab-content.hidden {
  display: none;
}


#taskSection h3 {
  margin-bottom: 0.5em;
  font-size: 1.2em;
  color: #ffffff;
  text-align: center;
}

.task-input-group {
  display: flex;
  gap: 0.5em;
  margin-bottom: 1em;
}

.custom-select {
  position: relative;
  display: inline-block;
}

.custom-select select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  padding: 8px 36px 8px 14px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);

  color: #000000;
  cursor: pointer;

  transition: all 0.25s ease;
}

/* ホバー時の軽い浮遊感 */
.custom-select select:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.35);
}

/* フォーカス時の光のリング */
.custom-select select:focus {
  outline: none;
  border-color: rgba(255,255,255,0.6);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
}

/* ▼ カスタム矢印 */
.custom-select::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  transition: 0.25s ease;
}

/* 開いたときの矢印アニメーション */
.custom-select select:focus + .custom-select::after {
  transform: translateY(-50%) rotate(180deg);
}



#taskInput {
  flex: 1;

  width: 90%;
  padding: 0.5em;
  border: 1px solid #ccc;
  border-radius: 6px;
}

#addTaskBtn {
  padding: 0.5em 1em;
  margin-left: 0.5em;
  background: #34d399;
  color: #000000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#taskList {
  margin-top: 1em;
  list-style: none;
  padding-left: 0;
}

#taskList li {
  display: flex;
  justify-content: space-between;
  align-items: center; /* ← ここを変更！ */
  padding: 0.5em;
  margin-bottom: 0.4em;
  background: #ffffff;
  color: #000000;
  border-radius: 4px;
  font-size: 0.95em;
  word-break: break-word;
  white-space: normal;
  flex-wrap: nowrap; /* 折り返しを防ぐ場合はこれ */
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.task-item {
  animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeOutDown {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
}

.fade-out {
  animation: fadeOutDown 0.4s ease forwards;
}




.task-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.5em;
  margin-bottom: 0.4em;
  background: #1f2937;
  color: #e5e7eb;
  border-radius: 4px;
  font-size: 0.95em;
  word-break: break-word;
}

.task-item.completed {
  background-color: #e5e7eb; /* グレー背景 */
}

.task-text.completed {
  text-decoration: line-through;
  color: #6b7280; /* グレー文字 */
  
}

.task-check {
  width: 1.8em;
  height: 1.8em;
  accent-color: #34d399;
  margin-right: 15px;
}


.task-text {
  flex: 1;
  white-space: normal;
  word-break: break-word;
  font-size: 15px;
}


.delete-task {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1em;
  cursor: pointer;
  margin-left: 1em;
}

.delete-task:hover {
  color: #ef4444;
}


#taskInput {
  width: 100%;
  max-width: 400px;
  padding: 0.75em 1em;
  font-size: 1rem;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  background-color: #f9fafb;
  color: #374151;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 2px rgba(0,0,0,0.04);
}

#taskInput::placeholder {
  color: #9ca3af;
  font-style: italic;
}

#taskInput:focus {

  background-color: #ffffff;
}


.color-grid {
  display: flex;
  justify-content: center;   /* 中央揃え */
  flex-wrap: wrap;           /* 折り返し */
  gap: 20px;                 /* 丸同士の間隔 */
  margin-top: 20px;
}

.color-option {
  width: 48px;               /* 大きくする */
  height: 48px;              /* 大きくする */
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid rgba(255,255,255,0.6);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.color-option:hover {
  transform: scale(1.15);
  border-color: #fff;
}

.color-option.selected {
  transform: scale(1.25);
  border-color: #fff;
}


.ghost {
  background: transparent
}

.danger {
  background: linear-gradient(135deg, var(--danger), #b91c1c);
  border-color: transparent
}

.card {
 /* background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .0));*/
  /* border: 1px solid #1e293b;*/
 /*  border-radius: 22px;*/
  padding: 20px;
  margin-bottom: 0px;
  padding-top: 50px;
}

.center {
  display: grid;
  place-items: center
}

.timer-wrap {
  position: relative;
  width: min(78vw, 420px);
  aspect-ratio: 1/1;
}

svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .20))
}

.time {
  position: absolute;
  top:50px;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center
  
}

#time{
  
  position: absolute;
  top:37%;
}

.bg-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.bg-option {
  width: 100%;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity .2s, transform .2s, outline .2s;
}

.bg-option:hover {
  opacity: 1;
  transform: scale(1.03);
}

.bg-option.selected {
  outline: 3px solid var(--accent2);
  opacity: 1;
}

#phaseLabel{
  position: absolute;
  top:75%;
}

.digits {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 1px;
  font-size: min(18vw, 72px)
}

.label {
  margin-top: 6px;
  font-size: 18px;
  color: #ffffff;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 30px;
  margin-top: 40px;
}

#themeBtn {
  display: none;
}


.muted {
  color: #ffffff;
  font-size: 14px;
}

.footer_pomodoro {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);

}



.pill {
  padding: 8px 12px;
  border: 1px solid #1e293b;
  border-radius: 999px
}

.ad-placeholder {
  margin-top: 16px;
  height: 120px;
  border: 1px dashed #334155;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #64748b;
  font-size: 12px
}


.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
  z-index: 1000;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #111827;
  border-radius: 16px;
  padding: 24px;
  width: min(90vw, 400px);
  color: var(--text);
  box-shadow: 0 5px 5px rgba(0, 0, 0, .4);

  transform: translateY(30px) scale(0.97);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.modal.show .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}


.modal-content h2 {
  margin-top: 0;
  font-size: 18px;
  margin-bottom: 35px;
  text-align: center;
}

.modal-content label {
  display: block;
  margin-bottom: 16px;
  font-size: 14px;
}

.modal-content input[type="range"] {
  width: 100%;
}



/* モーダル中はスクロール禁止 */
body.modal-open {
  overflow: hidden;
}

/* スクロールバーも消す（Chrome / Edge / Safari） */
body.modal-open::-webkit-scrollbar {
  display: none;
}

/* Firefox 用 */
body.modal-open {
  scrollbar-width: none;
}


.txt_center{
  width:110px;
  margin: 0 auto;
  text-align: center;

}



.hidden2 {
  display: none;
}


#focusSlider{
  margin: 20px 0px 15px;
}

#breakSlider{
  margin: 20px 0px 15px;
}

#longBreakSlider{
  margin: 20px 0px 15px;
}

.txt_cener{
  text-align: center;
}

label {
  display: block;
  margin: 1rem 0;
  font-size: 1rem;
  color: #e5e7eb;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 12px;
  background: linear-gradient(to right, var(--accent), var(--accent2));
  border-radius: 6px;
  outline: none;
  transition: background 0.3s ease;
  cursor: pointer;
}

/* トラックの影 */
input[type="range"]::-webkit-slider-runnable-track {
  height: 12px;
  background: transparent;
}

input[type="range"]::-moz-range-track {
  height: 12px;
  background: transparent;
}

/* ハンドル（つまみ） */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: #052e13;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
  margin-top:-5px ;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #052e13;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  margin-top:-5px ;
}

/* ホバー時のアニメーション */
input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.4);
}


.slant-bg {
    width: 100%;
    height: 92%;
    margin: 0;
    margin-top: 180px;
    padding: 100px 0 20px;
    position: relative;
    top: 0px;
    left: 0px;
    color: #000000;
}

/*
.pomo_clock{
  position: absolute;
  top:-90px;
  z-index: -30px;
  left: 23%;
}
*/

.slant-bg::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #f8f8f8;
    transform: skewY(-7deg);
    z-index: -1;
}


.slant-bg2 {
    width: 100%;
     height: 73%;
    margin: 0;
    padding: 50px 0px 0px;
    margin-top:-50px;
    position: relative;
    top: 0px;
    left: 0px;
}


.slant-bg2::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    transform: skewY(-7deg);
    z-index: -1;
}


.footer{

 transform: skewY(-7deg);
 margin-top: 20px;
 margin-bottom: 20px;
 color: #ffffff;
 text-align: center;
}

.explanation {
  display: flex;
  align-items: flex-start;
  gap: 4rem; /* 要素間の余白 */
  flex-wrap: wrap; /* 画面が狭いときは折り返す */
  margin: 2rem 0;
  width: 70%;
  margin: 0px auto;
  line-height: 1.7;
  letter-spacing: 0.03em;
  padding-top: 100px;
}

.explanation > div {
  flex: 1 1 400px; /* 最小幅を確保しつつ、均等に広がる */
}

.explanation img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px; /* 角丸でやさしい印象に */
}

.txt_center2{
  text-align: center;
  font-size: 38px;
  width: 100%;
}

.explanation2{
  width: 70%;
  margin: 0px auto;
  padding-top: 100px;
  line-height: 1.7;
  letter-spacing: 0.03em;
}

.img_center {
  text-align: center;
}

.img_center img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}

#explanation_txt03{
  margin-bottom: 60px;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 3rem 0 0.8rem;
}

.time-box {
  aspect-ratio: 1 / 1;
  background-color: rgba(31, 41, 55, 0.4); /* ← 透明度 70% */

  color: #ffffff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 4px rgba(0,0,0,0.2);
width: 100%;
height: 75%;
 margin: 0 auto; /* ← 自動マージンで中央揃え */

}



.label2 {
  font-size: 0.9rem;
  color: #ffffff;
  margin-bottom: 0.3rem;
  letter-spacing: 0.05em;
}

.value {
  font-size: 1.5rem;
  color: #ffffff;
  font-weight: bold;
  letter-spacing: 0.03em;
}

  #muteBtn{
background: transparent;
padding: 0px 5px;
border: none;
  }

#muteBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0px 0px rgba(0, 0, 0, 0)
}

#customBtn{
background: transparent;
padding: 0px 5px;
border: none;
}

#customBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0px 0px rgba(0, 0, 0, 0)
}


#time {
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

@media screen and (min-width: 768px) and (max-width: 1199px) {



  
}




@media screen and (max-width: 767px) {
  .digits {
    font-size: 16vw
  }
  #pomo_txt{
    font-size: 16px;
  }

  #soundSelect{
    display: none;
  }

  #muteBtn{
    display: none;
  }

#taskSection {

  width: 100%;

}

.explanation {

  padding-top: 50px;
}

.explanation2{

  padding-top: 50px;

}

.label2 {
  font-size: 0.7rem;
  text-align: center;
}

.value {
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 0.03em;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 1rem;
  margin: 2rem 0 2rem;

}



.time-box {

width: 100%;
height: 100%;

}

.slant-bg {


    margin-top: 40px;
    padding: 40px 0 50px;

}

.slant-bg2 {
     width: 100%;
     height: 64%;
    margin: 0;
    padding: 50px 0 80px;
    margin-top:-70px;
    margin-bottom:90px;
}

.footer{


 color: #ffffff;
}

/*
.pomo_clock img{
  width: 200px;
}
*/

}