/* styles.css - Improved UI v5 */
* {
  box-sizing: border-box;
}

body {
  background: #fffaf0 url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="4" fill="%23ffe4e1"/><circle cx="60" cy="60" r="4" fill="%23ffe4e1"/></svg>') repeat;
  font-family: 'M PLUS Rounded 1c', 'Rounded Mplus 1c', sans-serif;
  text-align: center;
  padding: 2rem;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 500px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 0.5rem;
}

.header h1 {
  font-size: 2rem;
  color: #6b4f9b;
  margin: 0 0 0.5rem 0;
  font-weight: 700;
}

.subtitle {
  color: #888;
  font-size: 0.9rem;
  margin: 0;
  font-weight: 400;
}

/* Card Section */
.card {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-radius: 1.25rem;
  padding: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.section-title {
  font-weight: 700;
  color: #ff9f1c;
  margin: 0 0 1rem 0;
  font-size: 1rem;
  text-align: center;
}

/* Button Group */
.button-group {
  display: flex;
  gap: 0.75rem;
}

.button-group.vertical {
  flex-direction: column;
  align-items: center;
}

/* Button Base */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 2rem;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  min-width: 220px;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  font-family: inherit;
}

.button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.button:active {
  transform: translateY(0) scale(0.98);
}

.emoji {
  font-size: 1.1rem;
}

/* Break Buttons - Different colors */
.break { 
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%); /* Sky Blue */
}
.break:hover { 
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); 
}

.lunch { 
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%); /* Orange */
}
.lunch:hover { 
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); 
}

.night { 
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); /* Indigo */
}
.night:hover { 
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%); 
}

/* Stomach Button */
.stomach { 
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #333; 
}
.stomach:hover { 
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); 
}

/* Settings Button */
.settings { 
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}
.settings:hover { 
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%); 
}

/* Service Card */
.service-card {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 2px solid;
  transition: all 0.2s ease;
}

.service-card:last-child {
  margin-bottom: 0;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Service Card Borders */
.apple-border { border-color: rgba(250, 42, 85, 0.25); }
.spotify-border { border-color: rgba(29, 185, 84, 0.25); }
.youtube-border { border-color: rgba(255, 0, 0, 0.25); }
.niconico-border { border-color: rgba(0, 0, 0, 0.15); }

/* Service Header */
.service-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.service-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.service-icon .icon {
  width: 28px;
  height: 28px;
}

.service-icon .niconico-icon {
  border-radius: 4px;
}

/* Service Icon Backgrounds */
.apple-bg { background: rgba(250, 42, 85, 0.1); }
.spotify-bg { background: rgba(29, 185, 84, 0.1); }
.youtube-bg { background: rgba(255, 0, 0, 0.1); }
.niconico-bg { background: rgba(0, 0, 0, 0.08); }

.service-info {
  text-align: left;
}

.service-info h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #333;
}

.service-info p {
  margin: 0.25rem 0 0 0;
  font-size: 0.8rem;
  color: #666;
  font-weight: 400;
}

/* Notice Box */
.notice-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff9e6;
  border: 1px solid #ffd966;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: #856404;
}

.notice-icon {
  font-size: 1rem;
}

/* Now Playing Buttons */
.button.nowplaying {
  width: 100%;
  min-width: unset;
}

.play-icon {
  font-size: 0.9rem;
}

/* Apple Music カラー */
.button.nowplaying.apple-music {
  background: linear-gradient(135deg, #fc3c44 0%, #fa233b 100%);
}
.button.nowplaying.apple-music:hover {
  background: linear-gradient(135deg, #fa233b 0%, #e01f35 100%);
}

/* Spotify カラー */
.button.nowplaying.spotify {
  background: linear-gradient(135deg, #1db954 0%, #1aa34a 100%);
}
.button.nowplaying.spotify:hover {
  background: linear-gradient(135deg, #1aa34a 0%, #168d3d 100%);
}

/* YouTube カラー */
.button.nowplaying.youtube {
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
}
.button.nowplaying.youtube:hover {
  background: linear-gradient(135deg, #cc0000 0%, #aa0000 100%);
}

/* niconico カラー */
.button.nowplaying.niconico {
  background: linear-gradient(135deg, #252525 0%, #1a1a1a 100%);
}
.button.nowplaying.niconico:hover {
  background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
}

/* Footer */
.footer {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: #999;
  line-height: 1.6;
}

/* ダイアログのカスタムスタイル */
dialog {
  border: none;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-family: 'M PLUS Rounded 1c', 'Rounded Mplus 1c', sans-serif;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

select {
  font-size: 1rem;
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  border-radius: 0.5rem;
  border: 1px solid #ccc;
  font-family: inherit;
}

button[type="button"] {
  margin: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  border: none;
  background-color: #eee;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

button[type="button"]:hover {
  background-color: #ddd;
}

/* Now Playing Card */
.nowplaying-card {
  margin: 1rem auto;
  background-color: #ffffffcc;
  padding: 1rem;
  border-radius: 1.5rem;
  display: flex;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: fit-content;
  max-width: 90%;
}

.nowplaying-content {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 1rem;
}

.nowplaying-card img {
  width: 80px;
  height: 80px;
  border-radius: 1rem;
  object-fit: cover;
}

.nowplaying-text {
  text-align: left;
  font-size: 0.95rem;
  color: #333;
}

.nowplaying-text strong {
  font-size: 1.1rem;
  display: block;
  margin-top: 0.25rem;
}

.hidden {
  display: none;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

input[type="text"],
textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  margin: 0.5rem 0 1rem;
  border: 1px solid #ccc;
  border-radius: 1rem;
  font-size: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: border 0.2s ease, box-shadow 0.2s ease;
  background-color: #fff;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  border-color: #90e0ef;
  box-shadow: 0 0 0 3px rgba(144, 224, 239, 0.4);
  outline: none;
}

form button[type="submit"] {
  margin-top: 1rem;
  background: linear-gradient(135deg, #6b4f9b 0%, #5a3d8a 100%);
  color: white;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 1.5rem;
  padding: 0.75rem 2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  font-family: inherit;
}

form button[type="submit"]:hover {
  background: linear-gradient(135deg, #7d5fd2 0%, #6b4f9b 100%);
  transform: translateY(-2px);
}

label {
  font-weight: bold;
  color: #ff9f1c;
  margin-top: 2rem;
  font-size: 1.0rem;
}

.label {
  font-size: 15px;
  line-height: 1.5;
  font-weight: 700;
  color: #333;
  overflow-wrap: anywhere;
  word-break: normal;
  margin: 0 0 4px;
}

/* Toggle/Switch Styles */
.toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: #cfcfcf;
  border-radius: 999px;
  transition: .25s;
}

.slider:before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: .25s;
}

.toggle input:checked + .slider {
  background-color: #007BFF;
}

.toggle input:checked + .slider:before {
  transform: translateX(22px);
}

.row { 
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #eee;
}

.row > div {
  min-width: 0;
}

.desc {
  color: #666;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: normal;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  justify-self: end;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch input:checked + .slider {
  background: #0a66ff;
}

.switch input:checked + .slider:before {
  transform: translateX(22px);
}

.back {
  display: inline-block;
  margin-top: 16px;
}

.back-button {
  display: block;
  margin: 1rem auto;
  background: linear-gradient(135deg, #a8e0ff 0%, #91d2f7 100%);
  color: #333;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 1.5rem;
  padding: 0.75rem 2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  width: fit-content;
  font-family: inherit;
}

.back-button:hover {
  background: linear-gradient(135deg, #91d2f7 0%, #7ac4eb 100%);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 480px) {
  body {
    padding: 1rem;
  }
  
  .container {
    padding: 1rem;
  }
  
  .header h1 {
    font-size: 1.75rem;
  }
  
  .button {
    min-width: 200px;
    padding: 0.7rem 1.25rem;
    font-size: 0.95rem;
  }
}

/* うマイナ Button */
.umaina { 
  background-color: #96dede;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.umaina:hover { 
  background-color: #c8f0f0;
}

/* Button Icon (画像アイコン用) */
.button-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}