@font-face {
  font-family: 'Wapuro Mincho';
  src: url('wapuro-mincho.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
html,body { margin:0; height:100%; background:#000; overflow:hidden; font-family: Inter, "Noto Sans JP", "游ゴシック", YuGothic, sans-serif; -webkit-text-size-adjust: 100%; -moz-text-size-adjust: 100%; text-size-adjust: 100%; }
canvas { display:block; }

#title {
  position: fixed;
  top: 20px;
  left: 20px;
  color: #ffffff;
  font-size: 44px;
  font-family: Inter, "Noto Sans JP", "游ゴシック", YuGothic, sans-serif;
  font-weight: normal;
  letter-spacing: 10px;
  z-index: 100;
  cursor: pointer;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

#title:hover {
  opacity: 0.8;
}

#title-icon {
  width: 43px;
  height: 43px;
}

/* Presence counter */
#presence-counter {
  position: fixed;
  top: 24px;
  right: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-family: Inter, "Noto Sans JP", sans-serif;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
}

#presence-counter::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

#presence-count {
  font-weight: 500;
  color: #ffffff;
}

@media (max-width: 768px) {
  #presence-counter {
    top: 18px;
    right: 70px;
    font-size: 12px;
  }
}

/* Notification badge for unread items */
.has-unread {
  position: relative;
}

.has-unread::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #ff4444;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.8);
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

/* Mobile menu badge position adjustment */
#mobile-menu button.has-unread::after {
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
}

/* About popup */
#about-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: rgba(0, 0, 232, 0);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 2000;
}

#about-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

#about-popup h2 {
  margin: 0 0 20px;
  font-size: 24px;
  color: #ffffff;
  font-weight: normal;
  letter-spacing: 15px;
  text-align: center;
}

#about-popup .about-content {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: 1px;
}

#about-popup .about-section {
  margin-bottom: 20px;
}

#about-popup .about-section:last-child {
  margin-bottom: 0;
}

#about-popup .about-section p {
  margin: 0;
}

#about-popup .contact-section {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 13px;
}

#about-popup .close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

#about-popup .close-btn::before,
#about-popup .close-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  background: #ffffff;
}

#about-popup .close-btn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

#about-popup .close-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

#about-popup .close-btn:hover::before,
#about-popup .close-btn:hover::after {
  background: rgba(255, 255, 255, 0.7);
}

#about-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1999;
}

#about-overlay.visible {
  opacity: 1;
  visibility: visible;
}

#login-btn {
  position: fixed;
  top: 100px;
  left: 20px;
  color: #ffffff;
  font-size: 11.2px;
  font-family: Inter, "Noto Sans JP", "游ゴシック", YuGothic, sans-serif;
  font-weight: normal;
  letter-spacing: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
}

#login-btn:hover {
  background: #ffffff;
  color: #0000e8;
}

#plant-grass-btn-guest {
  position: fixed;
  top: 150px;
  left: 20px;
  color: #ffffff;
  font-size: 11.2px;
  font-family: Inter, "Noto Sans JP", "游ゴシック", YuGothic, sans-serif;
  font-weight: normal;
  letter-spacing: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
}

#plant-grass-btn-guest:hover {
  background: #ffffff;
  color: #0000e8;
}

#plant-grass-btn-guest.hidden {
  display: none;
}

#register-sensor-btn, #write-diary-btn, #plant-grass-btn, #news-btn, #board-btn, #diarylist-btn, #changelog-btn {
  margin-top: 15px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: none;
}

#register-sensor-btn:hover, #write-diary-btn:hover, #plant-grass-btn:hover, #news-btn:hover, #board-btn:hover, #diarylist-btn:hover, #changelog-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#plant-grass-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#logout-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 16px;
  font-family: Inter, "Noto Sans JP", "游ゴシック", YuGothic, sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
  display: none;
}

#logout-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* News popup */
#news-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#news-popup-overlay.visible {
  opacity: 1;
  visibility: visible;
}

#news-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: rgba(0, 0, 232, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 2000;
}

#news-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

#news-popup h3 {
  margin: 0 0 20px;
  font-family: "DotGothic16", monospace;
  font-size: 20px;
  color: #ffffff;
  font-weight: normal;
  letter-spacing: 3px;
}

#news-popup .news-list {
  margin-bottom: 20px;
}

#news-popup .news-item {
  border: 0px;
  padding: 15px;
  margin-bottom: 15px;
}

#news-popup .news-item:last-child {
  margin-bottom: 0;
}

#news-popup .news-content a {
  color: #4CAF50;
  text-decoration: underline;
}

#news-popup .news-content a:hover {
  color: #81C784;
}

#news-popup .news-date {
  font-family: "DotGothic16", monospace;
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 5px;
}

#news-popup .news-title {
  font-size: 15px;
  color: #ffffff;
  font-weight: 500;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

#news-popup .news-content {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-all;
}

#news-popup .news-empty {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  text-align: center;
  padding: 20px 0;
}

#news-popup .admin-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

#news-popup .admin-form h4 {
  margin: 0 0 15px;
  font-size: 14px;
  color: #ffffff;
  font-weight: normal;
}

#news-popup .admin-form input,
#news-popup .admin-form textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 14px;
  box-sizing: border-box;
}

#news-popup .admin-form textarea {
  min-height: 100px;
  resize: vertical;
}

#news-popup .admin-form input::placeholder,
#news-popup .admin-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#news-popup .btn-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

#news-popup .cancel-btn,
#news-popup .submit-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#news-popup .submit-btn {
  background: rgba(255, 255, 255, 0.2);
}

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

#news-popup .submit-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

#news-popup .news-delete-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  margin-left: 10px;
}

#news-popup .news-delete-btn:hover {
  color: #ff6b6b;
}

/* Board popup */
#board-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#board-popup-overlay.visible {
  opacity: 1;
  visibility: visible;
}

#board-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: #f5a958;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 2000;
}

#board-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

#board-popup h3 {
  margin: 0 0 20px;
  font-family: "DotGothic16", monospace;
  font-size: 20px;
  color: #ffffff;
  font-weight: normal;
  letter-spacing: 3px;
}

#board-popup .board-list {
  margin-bottom: 20px;
}

#board-popup .board-item {
  border: 0px;
  padding: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#board-popup .board-item:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

#board-popup .board-date {
  font-family: "DotGothic16", monospace;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 5px;
}

#board-popup .board-content {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-all;
}

#board-popup .board-empty {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  text-align: center;
  padding: 20px 0;
}

#board-popup .board-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

#board-popup .board-form h4 {
  margin: 0 0 15px;
  font-size: 14px;
  color: #ffffff;
  font-weight: normal;
}

#board-popup .board-form textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 14px;
  box-sizing: border-box;
  min-height: 80px;
  resize: vertical;
}

#board-popup .board-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#board-popup .board-char-count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-align: right;
  margin-bottom: 10px;
}

#board-popup .btn-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

#board-popup .cancel-btn,
#board-popup .submit-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#board-popup .submit-btn {
  background: rgba(255, 255, 255, 0.2);
}

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

#board-popup .submit-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

#board-popup .board-delete-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  margin-left: 10px;
}

#board-popup .board-delete-btn:hover {
  color: #ff6b6b;
}

/* Admin comment styles */
#board-popup .board-admin-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  margin-left: 10px;
}

#board-popup .board-admin-btn:hover {
  color: #ffffff;
}

#board-popup .board-admin-comment {
  margin-top: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.15);
  border-left: 3px solid #ffffff;
  font-size: 14px;
  color: #ffffff;
}

#board-popup .board-admin-comment .admin-label {
  font-weight: bold;
  color: #ffffff;
}

#board-popup .admin-comment-form {
  margin-top: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
}

#board-popup .admin-comment-form textarea {
  width: 100%;
  min-height: 60px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 14px;
  resize: vertical;
  box-sizing: border-box;
}

#board-popup .admin-comment-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#board-popup .admin-comment-btns {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

#board-popup .admin-comment-btns button {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

#board-popup .admin-comment-btns button:first-child {
  background: rgba(255, 255, 255, 0.2);
}

#board-popup .admin-comment-btns button:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Changelog popup */
#changelog-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#changelog-popup-overlay.visible {
  opacity: 1;
  visibility: visible;
}

#changelog-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 24px;
  z-index: 2001;
  width: 90%;
  max-width: 500px;
  max-height: 70vh;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#changelog-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

#changelog-popup h3 {
  margin: 0 0 16px 0;
  font-size: 20px;
  color: #ffffff;
  letter-spacing: 2px;
}

#changelog-popup .changelog-list {
  margin-bottom: 16px;
}

#changelog-popup .changelog-item {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#changelog-popup .changelog-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

#changelog-popup .changelog-date {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
  font-weight: 500;
}

#changelog-popup .changelog-item ul {
  margin: 0;
  padding-left: 20px;
}

#changelog-popup .changelog-item li {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
  line-height: 1.5;
}

#changelog-popup .btn-group {
  display: flex;
  justify-content: center;
}

#changelog-popup .cancel-btn {
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 6px;
}

#changelog-popup .cancel-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Diary List popup */
#diarylist-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#diarylist-popup-overlay.visible {
  opacity: 1;
  visibility: visible;
}

#diarylist-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(20, 20, 40, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 24px;
  z-index: 2001;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#diarylist-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

#diarylist-popup h3 {
  margin: 0 0 16px 0;
  font-size: 20px;
  color: #ffffff;
  letter-spacing: 2px;
  flex-shrink: 0;
}

#diarylist-popup .diarylist-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 16px;
}

#diarylist-popup .diarylist-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#diarylist-popup .diarylist-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

#diarylist-popup .diarylist-date {
  font-family: Inter, "Noto Sans JP", sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
}

#diarylist-popup .diarylist-text {
  font-family: Inter, "Noto Sans JP", sans-serif;
  font-size: 15px;
  color: #ffffff;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

#diarylist-popup .diarylist-image {
  max-width: 100%;
  margin-top: 12px;
  border-radius: 4px;
}

#diarylist-popup .diarylist-empty {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  text-align: center;
  padding: 40px 0;
}

#diarylist-popup .btn-group {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

#diarylist-popup .cancel-btn {
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 6px;
}

#diarylist-popup .cancel-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Privacy button */
#privacy-btn {
  position: fixed;
  bottom: 60px;
  left: 20px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 16px;
  font-family: Inter, "Noto Sans JP", "游ゴシック", YuGothic, sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
  display: none;
}

#privacy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Privacy popup */
#privacy-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#privacy-popup-overlay.visible {
  opacity: 1;
  visibility: visible;
}

#privacy-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: rgba(0, 0, 232, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 2000;
}

#privacy-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

#privacy-popup h3 {
  margin: 0 0 20px;
  font-family: "DotGothic16", monospace;
  font-size: 20px;
  color: #ffffff;
  font-weight: normal;
  letter-spacing: 3px;
}

#privacy-popup h4 {
  font-size: 15px;
  margin: 15px 0 8px;
  color: #ffffff;
  font-weight: normal;
}

#privacy-popup p {
  font-size: 12px;
  margin: 0 0 10px;
  line-height: 1.7;
}

#privacy-popup .privacy-content {
  color: #ffffff;
}

#privacy-popup .privacy-section {
  margin-bottom: 20px;
}

#privacy-popup .privacy-section:last-child {
  margin-bottom: 0;
}

#privacy-popup .privacy-section p {
  margin: 0 0 10px;
}

#privacy-popup .privacy-email {
  color: #4CAF50;
}

#privacy-popup .btn-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

#privacy-popup .cancel-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

/* Plant grass popup */
#grass-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#grass-popup-overlay.visible {
  opacity: 1;
  visibility: visible;
}

#grass-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: rgba(0, 0, 232, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 30px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 2000;
}

#grass-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

#grass-popup h3 {
  margin: 0 0 20px;
  font-size: 18px;
  color: #ffffff;
  font-weight: normal;
  letter-spacing: 3px;
}

#grass-popup p {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 20px;
}

#grass-popup .btn-group {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

#grass-popup button {
  padding: 10px 20px;
  font-size: 14px;
  letter-spacing: 2px;
  border: 1px solid #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
}

#grass-popup .cancel-btn {
  background: transparent;
  color: #ffffff;
}

#grass-popup .confirm-btn {
  background: #ffffff;
  color: #0000e8;
}

#grass-popup .cancel-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#grass-popup .confirm-btn:hover {
  background: rgba(255, 255, 255, 0.8);
}

#grass-popup .confirm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Sensor Power Reminder Popup */
#sensor-reminder-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#sensor-reminder-overlay.visible {
  opacity: 1;
  visibility: visible;
}

#sensor-reminder-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: rgba(255, 165, 0, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  padding: 30px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 3000;
  text-align: center;
}

#sensor-reminder-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

#sensor-reminder-popup h3 {
  margin: 0 0 20px;
  font-size: 20px;
  color: #000;
  font-weight: bold;
}

#sensor-reminder-popup p {
  color: #000;
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 15px;
}

#sensor-reminder-popup .reminder-note {
  font-size: 13px;
  opacity: 0.8;
}

#sensor-reminder-popup .btn-group {
  margin-top: 20px;
}

#sensor-reminder-popup .confirm-btn {
  padding: 12px 40px;
  font-size: 16px;
  background: #000;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

#sensor-reminder-popup .confirm-btn:hover {
  background: #333;
}

#popup {
  position: fixed;
  background: rgba(0, 0, 232, 0);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0;
  padding: 20px;
  max-width: 400px;
  min-width: 320px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

#popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#amedas-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: rgba(0, 0, 232, 0);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 20px;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

#amedas-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

#amedas-popup h3 {
  margin: 0 0 15px;
  font-size: 18px;
  color: #ffffff;
  font-weight: normal;
  letter-spacing: 3px;
}

#popup .popup-header {
  flex-shrink: 0;
}

#popup .popup-scrollable {
  flex: 1;
  min-height: 0; /* Allow shrinking below content size for scroll to work */
  overflow-y: auto;
  overflow-x: hidden;
}

#popup .popup-scrollable::-webkit-scrollbar {
  width: 6px;
}

#popup .popup-scrollable::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

#popup .popup-scrollable::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
}

#popup .popup-scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

#popup h3 {
  margin: 0 0 10px;
  font-size: 30px;
  color: #ffffff;
  font-weight: normal;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#popup #sensor-id {
  font-family: "Roboto", sans-serif;
}

#popup .location {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 15px;
}

#popup .weather-data {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0;
  border: none;
}

#popup .weather-item {
  display: flex;
  flex-direction: column;
  gap: 0;
}

#popup .weather-item label {
  font-family: "DotGothic16", monospace;
  font-size: 13px;
  color: #ffffff;
  letter-spacing: 0;
  margin-bottom: -4px;
}

#popup .weather-item value {
  font-family: "DotGothic16", monospace;
  font-size: 30px;
  color: #ffffff;
  font-weight: normal;
  letter-spacing: 2px;
  text-align: right;
  display: block;
}

#popup .diary {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

#popup .diary h4 {
  margin: 0 0 8px;
  font-size: 15.6px;
  color: #ffffff;
  font-weight: normal;
}


#popup .diary-entry {
  margin-bottom: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

#popup .diary-entry:last-child {
  margin-bottom: 0;
}

#popup .diary-date {
  font-family: "DotGothic16", monospace;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
}

#popup .diary-text {
  font-size: 15px;
  color: #ffffff;
  line-height: 1.5;
}

#popup .diary-text.ai-diary-text {
  font-size: 15px !important;
}

#popup .diary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

#popup .delete-diary-btn {
  position: relative;
  width: 18px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

#popup .delete-diary-btn::before,
#popup .delete-diary-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  background: rgba(255, 255, 255, 0.7);
}

#popup .delete-diary-btn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

#popup .delete-diary-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

#popup .delete-diary-btn:hover::before,
#popup .delete-diary-btn:hover::after {
  background: #ffffff;
}

#popup .delete-diary-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#popup .delete-diary-btn:disabled::before,
#popup .delete-diary-btn:disabled::after {
  background: rgba(255, 255, 255, 0.5);
}

/* Loading screen */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0000e8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
  animation: breathe 5s ease-in-out infinite;
}

/* Gaussian fog effect around center flower */
#loading-screen::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(255, 255, 255, 0.15) 20%,
    rgba(255, 255, 255, 0.05) 40%,
    rgba(255, 255, 255, 0) 70%
  );
  border-radius: 50%;
  filter: blur(30px);
  pointer-events: none;
  animation: fog-pulse 4s ease-in-out infinite;
}

@keyframes fog-pulse {
  0%, 100% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

@keyframes breathe {
  0%, 100% { background-color: #000040; }
  50% { background-color: #0000a0; }
}

#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 150px;
}

.loading-spinner svg {
  width: 100%;
  height: 100%;
  animation: spin 8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 30px;
  color: #ffffff;
  font-size: 28px;
  letter-spacing: 4px;
  font-family: Inter, "Noto Sans JP", "游ゴシック", YuGothic, sans-serif;
}

#popup .close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

#popup .close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Mobile styles for popup */
@media (max-width: 767px) {
  #popup {
    padding: 16px;
    max-width: 85vw;
    box-sizing: border-box;
  }

  #popup img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
  }

  #popup h3 {
    font-size: 30px;
    letter-spacing: 0;
  }

  #popup .location {
    font-size: 16px;
  }

  #popup .weather-data {
    gap: 12px;
    padding: 16px;
  }

  #popup .weather-item label {
    font-size: 12px;
    letter-spacing: 2px;
  }

  #popup .weather-item value {
    font-size: 30px;
    letter-spacing: 2px;
  }

  #popup .diary-entry {
    padding: 14px;
  }

  #popup .diary-date {
    font-size: 20px;
  }

  #popup .diary-text {
    font-size: 20px;
  }

  #popup .close-btn {
    width: 32px;
    height: 32px;
    font-size: 24px;
    top: 16px;
    right: 16px;
  }


  #popup .diary-entry {
    box-sizing: border-box;
  }
}

/* Login Modal */
#login-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

#login-modal.visible {
  display: flex;
}

#login-modal .modal-content {
  background: rgba(0, 0, 232, 0);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 40px;
  min-width: 400px;
  position: relative;
}

#login-modal h2 {
  margin: 0 0 30px;
  font-size: 24px;
  color: #ffffff;
  font-weight: normal;
  letter-spacing: 5px;
  text-align: center;
}

#login-modal input {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-family: Inter, "Noto Sans JP", "游ゴシック", YuGothic, sans-serif;
  font-size: 14px;
  box-sizing: border-box;
}

#login-modal input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#login-modal input:focus {
  outline: none;
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

#login-modal button {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid #ffffff;
  color: #ffffff;
  font-family: Inter, "Noto Sans JP", "游ゴシック", YuGothic, sans-serif;
  font-size: 14px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#login-modal button:hover:not(:disabled) {
  background: #ffffff;
  color: #0000e8;
}

#login-modal button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#login-modal .message {
  margin-top: 20px;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  color: #ffffff;
}

#login-modal .message.success {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#login-modal .message.error {
  color: #ff6b6b;
}

#login-modal .close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

#login-modal .close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}


/* User info display */
#user-info {
  position: fixed;
  top: 100px;
  left: 20px;
  color: #ffffff;
  font-size: 20px;
  font-family: Inter, "Noto Sans JP", "游ゴシック", YuGothic, sans-serif;
  z-index: 100;
  display: none;
}

#user-info.visible {
  display: block;
}

#user-email {
  position: fixed;
  bottom: 20px;
  right: 100px;
  color: #ffffff;
  font-size: 20px;
  font-family: Inter, "Noto Sans JP", "游ゴシック", YuGothic, sans-serif;
  z-index: 100;
  display: none;
}

/* Sensor Registration Modal */
#sensor-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

#sensor-modal.visible {
  display: flex;
}

#sensor-modal .modal-content {
  background: rgba(89, 163, 244, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0;
  min-width: 600px;
  max-width: 800px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

#sensor-modal h2 {
  margin: 0 0 10px;
  font-family: "DotGothic16", monospace;
  font-size: 20px;
  color: #ffffff;
  font-weight: normal;
  letter-spacing: 3px;
  text-align: left;
}

#sensor-modal .subtitle {
  text-align: left;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  margin-bottom: 30px;
  letter-spacing: 2px;
}

#sensor-modal label {
  display: block;
  margin-bottom: 15px;
  color: #ffffff;
}

#sensor-modal label .label-text {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 5px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

#sensor-modal input,
#sensor-modal select {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-family: Inter, "Noto Sans JP", "游ゴシック", YuGothic, sans-serif;
  font-size: 14px;
  box-sizing: border-box;
}

#sensor-modal input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#sensor-modal input:focus,
#sensor-modal select:focus {
  outline: none;
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

#sensor-modal select {
  cursor: pointer;
}

#sensor-modal select option {
  background: #0000e8;
  color: #ffffff;
}

#sensor-modal .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

#sensor-modal .form-row-3 {
  display: grid;
  grid-template-columns: 2fr auto;
  gap: 10px;
  align-items: end;
}

#sensor-modal button {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid #ffffff;
  color: #ffffff;
  font-family: Inter, "Noto Sans JP", "游ゴシック", YuGothic, sans-serif;
  font-size: 14px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

#sensor-modal button:hover:not(:disabled) {
  background: #ffffff;
  color: #0000e8;
}

#sensor-modal button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#sensor-modal button.secondary {
  padding: 10px;
  font-size: 12px;
  margin-top: 0;
}

#sensor-modal .message {
  margin-top: 15px;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: #ffffff;
}

#sensor-modal .message.success {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#sensor-modal .message.error {
  color: #ff6b6b;
}

#sensor-modal .modal-content .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  cursor: pointer;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 2100;
}

#sensor-modal .modal-content .close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Diary Modal */
#diary-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

#diary-modal.visible {
  display: flex;
}

#diary-modal .modal-content {
  background: rgba(89, 163, 244, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0;
  min-width: 600px;
  max-width: 800px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

#diary-modal .modal-content .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  cursor: pointer;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 2100;
}

#diary-modal .modal-content .close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* AI Diary Ticker - Vertical */
#ai-diary-ticker {
  position: fixed;
  bottom: 0;
  right: 20px;
  width: 60px;
  height: 100vh;
  background: transparent;
  overflow: hidden;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}


#ai-diary-ticker .ticker-content {
  overflow: hidden;
  position: relative;
  height: 100%;
  width: 100%;
}

#ai-diary-ticker .ticker-text {
  position: absolute;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  width: 100%;
  display: flex;
  justify-content: center;
  color: #ffffff;
  font-family: 'Wapuro Mincho', serif;
  font-size: 28px;
  letter-spacing: 1px;
  animation: ticker-scroll-vertical 30s linear infinite;
  padding-top: 100vh;
}

@keyframes ticker-scroll-vertical {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-100%);
  }
}

#ai-diary-ticker .ticker-text:hover {
  animation-play-state: paused;
}

/* 縦中横 (tate-chu-yoko) for numbers in vertical text */
#ai-diary-ticker .tcy {
  text-combine-upright: all;
  -webkit-text-combine: horizontal;
}

#ai-diary-ticker .ticker-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 20px;
}

/* AI Diary Ticker - Mobile: smaller font size */
@media (max-width: 768px) {
  #ai-diary-ticker .ticker-text {
    font-size: 17px;
  }
  #ai-diary-ticker .ticker-time {
    font-size: 9px; /* 11px * 0.8 */
  }
}

/* Mobile menu toggle button (flower icon for logged-in users) */
#mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 75px;
  left: 20px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 101;
  padding: 0;
  transition: transform 0.3s ease;
}

#mobile-menu-toggle:hover {
  transform: scale(1.1);
}

#mobile-menu-toggle.menu-open {
  transform: rotate(45deg);
}

#mobile-menu-toggle svg {
  width: 100%;
  height: 100%;
}

/* Mobile collapsible menu container */
#mobile-menu {
  display: none;
  position: fixed;
  top: 120px;
  left: 20px;
  z-index: 100;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

#mobile-menu.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#mobile-menu button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  padding: 10px 16px;
  font-size: 12.8px;
  font-family: Inter, dnp-shuei-gothic-gin-std, "Noto Sans JP", sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

#mobile-menu button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Mobile button styles - must be at the end to override defaults - v2 */
@media (max-width: 767px) {
  #login-btn {
    font-size: 14.4px !important;
    padding: 12px 20px !important;
  }

  /* Hide desktop user-info buttons on mobile when logged in */
  #user-info.visible #register-sensor-btn,
  #user-info.visible #write-diary-btn,
  #user-info.visible #plant-grass-btn,
  #user-info.visible #news-btn,
  #user-info.visible #board-btn,
  #user-info.visible #diarylist-btn,
  #user-info.visible #changelog-btn {
    display: none !important;
  }

  /* Show mobile menu toggle when logged in */
  #mobile-menu-toggle.logged-in {
    display: block;
  }

  /* Show mobile menu container when logged in */
  #mobile-menu.logged-in {
    display: flex;
  }

  /* Hide title icon on mobile when logged in (replaced by menu toggle) */
  #title.logged-in #title-icon {
    display: none;
  }

  /* Hide fixed LOGOUT and PRIVACY buttons on mobile - they're in hamburger menu */
  #logout-btn,
  #privacy-btn {
    display: none !important;
  }

  #user-info {
    font-size: 16px !important;
  }

  #user-email {
    right: 20px !important;
  }

  /* Sensor modal mobile styles */
  #sensor-modal .modal-content {
    min-width: auto !important;
    max-width: calc(100vw - 32px) !important;
    width: calc(100vw - 32px) !important;
    padding: 0 !important;
  }

  /* Diary modal mobile styles */
  #diary-modal .modal-content {
    min-width: auto !important;
    max-width: calc(100vw - 32px) !important;
    width: calc(100vw - 32px) !important;
    padding: 0 !important;
  }

  /* Login modal mobile styles */
  #login-modal .modal-content {
    min-width: auto !important;
    max-width: calc(100vw - 32px) !important;
    width: calc(100vw - 32px) !important;
    padding: 24px 16px !important;
  }
}
