/* 
큰 제목: .panel-title
섹션 제목: .panel-title2
씨앗 이름: .cropName
타이머 이름: .timerLeft b
큰 숫자: .bigNum
버튼: .btn, .miniBtn, .iconText 
*/

:root{
  --stroke:#e7e8ee;

  --blue:#4966ff;
  --blue2:#2d47ff;

  /* 위험도 색 */
  --violet:#a855f7;
  --red:#ff3b30;

  --r26:26px;
  --r22:22px;
  --r20:20px;
  --r16:16px;

  --shadow: 0 14px 44px rgba(15, 18, 28, 0.10);
  --shadow2: 0 10px 26px rgba(15, 18, 28, 0.10);
}

/* THEME TOKENS */
html[data-theme="light"]{
  --bgA: rgba(73,102,255,0.12);
  --bgB: rgba(180,110,255,0.10);
  --bgBase1: #f6f7fb;
  --bgBase2: #eef1f7;

  --panel:#ffffffcc;
  --text:#0b0d12;
  --muted:#5b6270;

  --card:#ffffffee;
  --card2:#ffffffd6;
  --soft: rgba(0,0,0,0.06);
}

html[data-theme="dark"]{
  --bgA: rgba(73,102,255,0.18);
  --bgB: rgba(180,110,255,0.14);
  --bgBase1: #0c0f1b;
  --bgBase2: #0b0d16;

  --panel:#111428cc;
  --text:#f3f5ff;
  --muted:#b2b8c9;

  --card:#141a33ee;
  --card2:#12172edd;
  --soft: rgba(255,255,255,0.08);
  --stroke: rgba(255,255,255,0.10);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
               "SF Pro Display","SF Pro Text","Apple SD Gothic Neo","Noto Sans KR",
               "Segoe UI", Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:
    radial-gradient(1200px 700px at 70% 10%, var(--bgA), transparent 60%),
    radial-gradient(900px 600px at 20% 35%, var(--bgB), transparent 60%),
    linear-gradient(180deg, var(--bgBase1) 0%, var(--bgBase2) 60%, var(--bgBase1) 100%);
  overflow:hidden;
}

.app{
  height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 18px;
  display:grid;
  grid-template-columns: 1fr 1fr; /* 1:1 */
  gap: 18px;
}

.credit{
  text-align:center;
  font-size:11px;
  opacity:0.45;
  margin-top:24px;
}



.panel{
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--r26);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 22px;
  display:flex;
  flex-direction:column;
  min-height: 0;
}

.panel-head{ margin-bottom: 10px; }
.head-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}

.panel-title{
  margin:0;
  font-size: 22px;
  letter-spacing:-0.02em;
  line-height:1.15;
  font-weight: 1100;
}
.panel-title2{
  margin:0;
  font-size: 18px;
  letter-spacing:-0.01em;
  font-weight: 1100;
}
.panel-sub{
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height:1.55;
}


/* theme toggle */
.iconBtn{
  border: 1px solid var(--stroke);
  background: var(--card2);
  border-radius: 999px;
  padding: 10px 12px;
  cursor:pointer;
  display:flex;
  gap: 10px;
  align-items:center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  color: var(--text);
  user-select:none;
}
.iconDot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--blue), var(--blue2));
  box-shadow: 0 8px 18px rgba(73,102,255,0.28);
}
.iconText{ font-weight: 1000; font-size: 13px; }

/* buttons */
.btn{
  border:none;
  cursor:pointer;
  border-radius: var(--r16);
  padding: 12px 14px;
  font-weight: 1000;
  letter-spacing:-0.01em;
  transition: transform .06s ease, box-shadow .2s ease;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue2) 100%);
  color:white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.btn-ghost{
  background: var(--card2);
  border: 1px solid var(--stroke);
  color: var(--text);
   box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.btn-small{ padding: 10px 12px; border-radius: 14px; font-size: 13px; }
.danger-outline{ border-color: rgba(255, 59, 48, 0.25) !important; }

.actions{ display:flex; gap:10px; margin-top: 14px; }
.actions .btn{ flex:1; }
.actions-slim{ margin-top: 12px; }

.cropGrid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  overflow:auto;
  padding-right: 4px;
  min-height: 0;
}
.timerList{
  display:flex;
  flex-direction:column;
  gap: 12px;
  overflow:auto;
  min-height: 0;
  padding-right: 4px;
}

/* crop cards */
.cropCard{
  border-radius: var(--r20);
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);

  display:flex;
  flex-direction:column;
  gap: 8px;
  cursor:pointer;
  transition: transform .08s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
  user-select:none;
}

/* 씨앗 글자변경 */
.cropName{
  font-size: 16px;     
  font-weight: 900;    
  letter-spacing: -0.3px;  
  display:flex;
  gap:8px;
  align-items:center;
}
.cropMeta{ color: var(--muted); font-size: 12px; }

/* 커스텀 씨앗 삭제 버튼 */
.cropTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
}
.cropDel{
  border:none;
  cursor:pointer;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: var(--soft);
  color: var(--text);
  font-size: 18px;
  font-weight: 1100;
  line-height: 0;
}
.cropDel:hover{ filter: brightness(0.98); }

.cropCard.selected{
  background: color-mix(in srgb, var(--blue) 10%, var(--card));
  border-color: color-mix(in srgb, var(--blue) 85%, var(--stroke));
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);

  outline: 3px solid rgba(46, 81, 255, 0.22);
}

/* 타이머 */
.timerEmpty{
  padding: 16px;
  border-radius: var(--r20);
  border: 1px dashed color-mix(in srgb, var(--muted) 35%, transparent);
  color: var(--muted);
  background: color-mix(in srgb, var(--card2) 70%, transparent);
  font-size: 13px;
  line-height:1.6;
}

.timerCard{
  border-radius: var(--r22);
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow2);
  display:flex;
  justify-content:space-between;
  gap: 12px;
  position: relative;
  overflow:hidden;
}

/* 전체 폭 + 더 두껍게 */
.progress{
  position:absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  background: var(--soft);
  border-top: 1px solid color-mix(in srgb, var(--stroke) 60%, transparent);
  border-radius: 0 0 var(--r22) var(--r22);
  overflow: hidden;
}
.progress > i{
  display:block;
  height: 100%;
  width: 100%;
  border-radius: 0 0 var(--r22) var(--r22);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: width 0.45s linear, background 0.30s ease;
}

/* 왼쪽 폰트 디자인 */
.timerLeft b{
  display:flex;
  gap: 8px;
  align-items:center;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.4px;
  line-height: 1.2;
}



.timerLeft small{
  display:block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
  line-height:1.5;
}

.timerRight{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap: 8px;
  min-width: 170px;
  padding-bottom: 18px;
}

.timeParts{
  display:flex;
  align-items:baseline;
  gap: 6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.bigNum{
  font-size: 42px;      
  font-weight: 800;     
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums; 
  font-feature-settings: "tnum";
}

.unit{
  font-size: 12px;
  color: var(--muted);
  font-weight: 1100;
  margin-right: 4px;
}
.sub{ font-size: 12px; color: var(--muted); }

.miniRow{ display:flex; gap: 8px; }
.miniBtn{
  border:none;
  cursor:pointer;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 1000;
}
.miniBtn.danger{
  background: rgba(255, 59, 48, 0.12);
  color: #b71d1d;
}

.footnote{
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height:1.6;
}

.modal{ position:fixed; inset:0; display:none; }
.modal.open{ display:block; }
.modal-backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,0.38);
}
.modal-card{
  position:relative;
  width: min(520px, calc(100% - 28px));
  margin: 10vh auto 0;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--r26);
  box-shadow: var(--shadow);
  padding: 18px;
}
.modal-head{
  display:flex; align-items:center; justify-content:space-between;
  gap: 10px; margin-bottom: 12px;
}
.modal-head h3{ margin:0; font-size: 16px; font-weight: 1100; }
.iconX{
  border:none; cursor:pointer;
  width: 38px; height: 38px;
  border-radius: 14px;
  background: var(--soft);
  color: var(--text);
  font-size: 22px;
  line-height: 0;
}
.modal-body{ display:flex; flex-direction:column; gap: 12px; }
.field{ display:flex; flex-direction:column; gap: 8px; }
.label{ font-size: 12px; color: var(--muted); font-weight: 1000; }
.field input{
  border: 1px solid var(--stroke);
  background: var(--card2);
  border-radius: 14px;
  padding: 12px 12px;
  color: var(--text);
  outline:none;
}
.row2{ display:grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.hint{ margin:0; font-size: 12px; color: var(--muted); line-height:1.55; }
.modal-actions{ display:flex; gap: 10px; margin-top: 14px; }
.modal-actions .btn{ flex:1; }

@media (max-width: 980px){
  body{ overflow:auto; }
  .app{ height:auto; grid-template-columns: 1fr; }
  .cropGrid{ grid-template-columns: repeat(2, minmax(0,1fr)); max-height: 44vh; }
  .timerList{ max-height: 40vh; }
}
@media (max-width: 520px){
  .cropGrid{ grid-template-columns: 1fr; }
}
