* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--theme-bg, #000000);
  color: #ffffff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #000000;
  font-size: 16px;
  font-weight: 600;
  height: 44px;
}

.status-icons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.status-icons span {
  font-size: 14px;
  color: #ffffff;
}

.lte {
  background: #ffffff;
  color: #000000 !important;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

/* Main container */
.container {
  width: 100%;
  min-height: 100vh;
  background: #000000;
}

/* Main screen */
.main-screen .main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 44px);
  padding: 20px;
}

.tree-logo {
  margin-bottom: 10px;
}

.tree-logo svg {
  width: 150px;
  height: 150px;
}

.app-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 10px;
  text-align: center;
  color: #ffffff;
}

.main-menu {
  display: flex;
  flex-direction: column;
  margin-top: 5px;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  text-decoration: none;
  color: #ffffff;
  margin-bottom: 0px;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.menu-item:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.08);
}

.menu-icon {
  font-size: 22px;
  margin-right: 18px;
  width: 28px;
  text-align: center;
}

.menu-text {
  font-size: 17px;
  font-weight: 500;
}

/* Detail screen header */
.detail-screen .header {
  display: flex;
  align-items: center;
  padding: 16px;
  background: #000000;
  height: 60px;
}

.back-btn {
  position: absolute;
  color: rgb(68, 255, 68);
  text-decoration: none;
  font-size: 32px;
  left: 20px;
  top: 5px;
  font-weight: 300;
}

.tresh-btn {
  position: absolute;
  color: rgb(255, 68, 68) !important;
  text-decoration: none;
  font-size: 32px;
  right: 20px;
  top: 5px;
  font-weight: 300;
}

.screen-title {
  flex: 1;
  font-size: 16px;
  margin-top: 10px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 1px;
}

.header-spacer {
  width: 44px;
}

.header-right {
  width: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-left {
  width: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.habits-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.habit-card {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #ffffff;
  transition: background 0.2s;
}

.habit-card:hover {
  background: #2a2a2a;
}

.habit-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.habit-info {
  flex: 1;
}

.habit-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.habit-details {
  font-size: 14px;
  color: #888888;
}

.fab {
  position: static;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  background: #4CAF50;
  color: #000000;
  font-size: 38px;
  line-height: 56px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.15);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.5);
  background: #58c35c;
}

.fab:active {
  transform: translateY(0);
}

/* Detail screen */
.detail-screen .header {
  display: flex;
  align-items: center;
  padding: 16px;
  background: #000000;
}

.detail-screen .main-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.progress-ring {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 20px 0 30px;
}

.ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-background {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 12;
}

.ring-progress {
  fill: none;
  stroke: #ff8800;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 690;
  stroke-dashoffset: 690;
  transition: stroke-dashoffset 0.5s ease;
}

.tree-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tree-icon {
  width: 100px;
  height: 100px;
}

.tree-svg {
  filter: none;
}

.target-info {
  text-align: center;
  margin-bottom: 10px;
}

.target-label {
  font-size: 16px;
  color: #888888;
  margin-bottom: 8px;
}

.target-value {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
}

.timer {
  text-align: center;
  margin-bottom: 50px;
}

.timer-labels {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #888888;
}

.timer-value {
  font-size: 42px;
  font-weight: 700;
  color: var(--accent-color, #ff8800);
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 50px;
  width: 100%;
  max-width: 320px;
}

.stat {
  text-align: center;
}

.stat-label {
  font-size: 16px;
  color: #888888;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #ff8800;
}

.record-unit {
  font-size: 16px;
  font-weight: 400;
  color: #888888;
}

.stat-center {
  display: flex;
  justify-content: center;
}

.relapse-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 16px 32px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.relapse-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.relapse-btn:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.08);
}

.history-section {
  width: 100%;
  max-width: 400px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.history-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.add-comment-btn {
  background: none;
  border: none;
  color: #ff8800;
  font-size: 16px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.add-comment-btn:hover {
  background: rgba(255, 136, 0, 0.1);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  grid-template-columns: 50px 1fr 40px;
  gap: 16px;
  align-items: center;
  transition: all 0.2s ease;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.menu-text-habit {
  color: #44ff44;
  width: 700;
}

.history-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-color, #ff8800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #000000;
}

.history-content {
  flex: 1;
}

.history-date {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.history-text {
  font-size: 14px;
  color: #888888;
}

.history-delete {
  background: none;
  border: none;
  color: #ff0000;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  float: inline-end;
}

.history-delete:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Create habit screen */
.create-screen .main-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.create-screen .tree-logo {
  margin-bottom: 40px;
}

.create-screen .tree-logo svg {
  width: 120px;
  height: 120px;
}

.question-text {
  font-size: 20px;
  margin-bottom: 20px;
  color: #ffffff;
  font-weight: 600;
}

.exclude-text {
  font-size: 18px;
  color: #ffffff;
  margin-bottom: 20px;
}

.exclude-highlight {
  color: #ff4444;
  font-weight: 600;
}

.form-section {
  width: 100%;
  max-width: 320px;
  margin-bottom: 40px;
}

.title-input-section {
  margin-bottom: 40px;
}

.habit-title-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  color: #ffffff;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.habit-title-input::placeholder {
  color: #888888;
}

.habit-title-input:focus {
  border-color: #ff8800;
  background: rgba(255, 255, 255, 0.12);
}

.date-section {
  margin-bottom: 50px;
  text-align: left;
}

.date-label {
  font-size: 16px;
  color: #888888;
  margin-bottom: 12px;
}

.date-value {
  font-size: 18px;
  font-weight: 600;
  color: #ff4444;
  margin-bottom: 12px;
}

.edit-date-btn {
  background: none;
  border: none;
  color: #888888;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s;
}

.edit-date-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.color-section {
  text-align: left;
}

.color-label {
  font-size: 16px;
  color: #888888;
  margin-bottom: 20px;
}

.color-picker {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.color-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 5px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.color-red { background: #ff4444; }
.color-orange { background: #ff8800; }
.color-yellow { background: #ffff00; color: #000000; }
.color-green { background: #44ff44; }
.color-blue { background: #4488ff; }
.color-purple { background: #8844ff; }

.color-btn.active {
  border-color: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

.color-btn:hover {
  transform: scale(1.05);
}

.start-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 18px 60px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 280px;
}

.start-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.start-btn:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.08);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: flex-end;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.modal-content {
  background: rgba(26, 26, 26, 0.95);
  border-radius: 24px 24px 0 0;
  padding: 24px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
}

.modal-header {
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.comment-input {
  width: 100%;
  height: 120px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 20px;
  color: #ffffff;
  font-size: 16px;
  margin-bottom: 24px;
  resize: none;
  font-family: inherit;
}

.comment-input::placeholder {
  color: #888888;
}

.comment-input:focus {
  outline: none;
  border-color: #ff8800;
  background: rgba(255, 255, 255, 0.12);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.btn-cancel {
  background: none;
  border: none;
  color: #888888;
  font-size: 16px;
  cursor: pointer;
  padding: 12px 20px;
  border-radius: 12px;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.btn-save {
  background: #ff8800;
  border: none;
  border-radius: 16px;
  padding: 14px 28px;
  color: #000000;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-save:hover {
  background: var(--accent-color, #ff8800);
  transform: translateY(-1px);
}

.btn-save:active {
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

.content-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  text-align: center;
  padding: 40px;
}

.content-placeholder p {
  font-size: 18px;
  color: #888888;
  line-height: 1.5;
}

/* Auth styles */
.auth-form {
  width: 100%;
  max-width: 320px;
  margin-top: 40px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  color: #ffffff;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.form-group input::placeholder {
  color: #888888;
}

.form-group input:focus {
  border-color: #ff8800;
  background: rgba(255, 255, 255, 0.12);
}

.form-group textarea {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  color: #ffffff;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.form-group textarea::placeholder {
  color: #888888;
}

.form-group textarea:focus {
  border-color: #ff8800;
  background: rgba(255, 255, 255, 0.12);
}

.auth-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 16px 32px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.auth-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.auth-btn:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.08);
}

.verify-info {
  text-align: center;
  margin-bottom: 30px;
}

.verify-info p {
  color: #ffffff;
  font-size: 16px;
  margin-bottom: 8px;
}

.email-text {
  font-weight: 600;
  color: #ff8800 !important;
}

.test-code {
  background: rgba(255, 136, 0, 0.1);
  border: 1px solid var(--accent-color, #ff8800);
  border-radius: 8px;
  padding: 12px;
  margin: 16px 0;
  color: var(--accent-color, #ff8800);
  font-size: 14px;
  text-align: center;
}

.test-code strong {
  font-size: 18px;
  font-weight: 700;
}

.resend-section {
  text-align: center;
  margin-top: 20px;
}

.resend-section p {
  color: #888888;
  font-size: 14px;
  margin-bottom: 10px;
}

.resend-btn {
  background: none;
  border: none;
  color: var(--accent-color, #ff8800);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.resend-btn:hover {
  background: rgba(255, 136, 0, 0.1);
  color: #ff9900;
}

/* Profile menu button */
.profile-button {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.profile-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.profile-menu {
  position: absolute;
  top: 60px;
  right: 16px;
  background: rgba(26, 26, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 8px;
  min-width: 150px;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.profile-menu-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  color: #ffffff;
  text-decoration: none;
  font-size: 16px;
  border-radius: 8px;
  transition: all 0.2s;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
}

.profile-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.profile-menu-item:last-child {
  color: #ff4444;
}

.profile-menu-item:last-child:hover {
  background: rgba(255, 68, 68, 0.1);
}

.freedom-svg {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  display: block;
}

.auth-btn {
  background: var(--accent-color, #ff8800);
  transition: transform 0.2s;
}

.auth-btn:hover {
  transform: translateY(-2px);
}

.fa-sign-out-alt {
  color: #ff8800;
}

#pwaInstallBtn {
  color: #44ff44;
}