@import url("https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@400;700&family=Huninn:wght@400;700&display=swap");

body,
.container,
.light,
.dark {
  font-family: "Huninn", "Zen Maru Gothic", "Noto Sans TC", "Noto Sans JP",
    "Microsoft JhengHei", "PingFang TC", "Heiti TC", "sans-serif";
}

h1,
h2,
h3,
.title {
  font-family: "Zen Maru Gothic", "Huninn", "Noto Sans TC", "Noto Sans JP",
    "sans-serif";
  letter-spacing: 1.5px;
}

.news-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.3);
  background: #fff;
  min-height: 66px;
  display: flex;
  align-items: center;
  max-height: 66px;
}

.news-container ul {
  display: flex;
  list-style: none;
  margin: 0;
  animation: scroll 25s infinite linear;
}

.news-container div {
  white-space: nowrap;
  padding: 10px 24px;
  color: #494949;
  position: relative;
  font-weight: bold;
  font-size: 2rem;
  left: 1em;
  height: 100%;
  width: 100%;
  max-height: 66px;
}

.tsunami-flip-item div {
  font-size: 1.5rem !important;
}

.news-container ul li::after {
  content: "";
  width: 1px;
  height: 100%;
  background: #b8b8b8;
  position: absolute;
  top: 0;
  right: 0;
}

.news-container ul li:last-child::after {
  display: none;
}

.news_alert ul {
  display: contents;
  list-style: none;
  margin: 0;
}

.news_alert div {
  white-space: nowrap;
  padding: 10px 24px;
  color: #ffffff;
  position: relative;
  font-weight: bold;
  font-size: 2rem;
  text-align: center;
  width: 100%;
  height: 100%;
}

.news_alert {
  display: none;
  background: #ff0000;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.3);
  z-index: 999;
  width: 175px;
  min-height: 66px;
  align-items: center;
}

button,
.btn {
  background: #1976d2;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.08);
  transition: background 0.2s, color 0.2s;
}

button:hover,
.btn:hover {
  background: #1565c0;
}

select {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #bdbdbd;
  font-size: 1.05rem;
  background: #fafafa;
  color: #222;
  margin: 0 8px 8px 0;
  transition: border 0.2s, background 0.2s;
}

select:focus {
  border: 1.5px solid #1976d2;
  outline: none;
}

label {
  font-weight: 700;
  font-size: 1.1rem;
  margin-right: 8px;
  color: #1976d2;
}

p,
.time,
.max_gal,
.epic_intensity,
.notification,
.location_intensity_1,
.location_intensity_2,
.station_1_shindo,
.station_2_shindo {
  font-size: 1.1rem;
  margin: 6px 0;
  letter-spacing: 0.5px;
}

/* dark theme for UI元件 */
.dark button,
.dark .btn {
  background: #263859;
  color: #fff;
}

.dark button:hover,
.dark .btn:hover {
  background: #1b253b;
}

.dark select {
  background: #232323;
  color: #e0e0e0;
  border: 1px solid #444;
}

.dark select:focus {
  border: 1.5px solid #90caf9;
}

.dark label {
  color: #90caf9;
}

.dark p,
.dark .time,
.dark .max_gal,
.dark .epic_intensity,
.dark .notification,
.dark .location_intensity_1,
.dark .location_intensity_2,
.dark .station_1_shindo,
.dark .station_2_shindo {
  color: #e0e0e0;
}

.light,
.light body,
.light .container {
  background: #fff;
  color: #222;
}

.dark,
.dark body,
.dark .container {
  background: #181818;
  color: #e0e0e0;
  user-select: none;
}

.dark .news-container {
  background: #181818;
}

.dark .news-container div {
  color: #fff;
}

.dark .news_alert {
  background: #b90909;
}

.container {
  margin-bottom: 5rem;
}

.roboto-font,
.roboto-font body,
.roboto-font .container,
.roboto-font .light,
.roboto-font .dark {
  font-family: "Roboto", "Noto Sans TC", "Noto Sans JP", "Microsoft JhengHei",
    "PingFang TC", "Heiti TC", "sans-serif" !important;
}

.cute-font,
.cute-font body,
.cute-font .container,
.cute-font .light,
.cute-font .dark {
  font-family: "Huninn", "Zen Maru Gothic", "Noto Sans TC", "Noto Sans JP",
    "Microsoft JhengHei", "PingFang TC", "Heiti TC", "sans-serif" !important;
}

input[type="color"] {
  border: none;
  background: none;
  padding: 0;
  width: 40px;
  height: 40px;
  box-shadow: none;
  outline: none;
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 8px;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}

input#alertColorText {
  width: 90px;
  height: 45px;
  vertical-align: middle;
  margin: 0 8px;
  text-align: center;
  font-size: 1.1rem;
  border-radius: 6px;
  border: 1px solid #bdbdbd;
  background: #fafafa;
  color: #222;
  transition: border 0.2s, background 0.2s;
  text-transform: uppercase;
}

.dark input#alertColorText {
  background: #232323;
  color: #e0e0e0;
  border: 1px solid #444;
}

.dark input#alertColorText:focus {
  border: 1.5px solid #90caf9;
}

.dropdown-list {
  position: absolute;
  background: #fff;
  border: 1px solid #bdbdbd;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  max-height: 220px;
  overflow-y: auto;
  min-width: 180px;
  display: none;
}

.dropdown-list.active {
  display: block;
}

.dropdown-list .dropdown-item {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 1.05rem;
  color: #222;
  background: #fff;
}

.dropdown-list .dropdown-item:hover,
.dropdown-list .dropdown-item.active {
  background: #1976d2;
  color: #fff;
}

.dark .dropdown-list {
  background: #232323;
  color: #e0e0e0;
  border: 1px solid #444;
}

.dark .dropdown-list .dropdown-item {
  background: #232323;
  color: #e0e0e0;
}

.dark .dropdown-list .dropdown-item:hover,
.dark .dropdown-list .dropdown-item.active {
  background: #90caf9;
  color: #232323;
}

.station_1_search,
.station_2_search {
  width: 220px;
  height: 45px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1.5px solid #bdbdbd;
  background: #fafafa;
  color: #222;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.08);
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
  margin-right: 8px;
}

.station_1_search:focus,
.station_2_search:focus {
  border: 1.5px solid #1976d2;
  background: #fff;
  box-shadow: 0 0 0 2px #1976d233;
}

.station_1_search:hover,
.station_2_search:hover {
  border: 1.5px solid #1976d2;
}

.dark .station_1_search,
.dark .station_2_search {
  background: #232323;
  color: #e0e0e0;
  border: 1.5px solid #444;
}

.dark .station_1_search:focus,
.dark .station_2_search:focus {
  border: 1.5px solid #90caf9;
  background: #181818;
  box-shadow: 0 0 0 2px #90caf933;
}

.tsunami-flip-item {
  text-align: center;
  color: #d32f2f;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.08);
  margin: 0 auto;
}

.flip-in {
  animation: flipInX 0.6s;
}

@keyframes flipInX {
  from {
    transform: perspective(400px) rotateX(90deg);
    opacity: 0;
  }

  40% {
    transform: perspective(400px) rotateX(-20deg);
  }

  60% {
    transform: perspective(400px) rotateX(10deg);
  }

  80% {
    transform: perspective(400px) rotateX(-5deg);
  }

  to {
    transform: perspective(400px) rotateX(0deg);
    opacity: 1;
  }
}

/* --- 津波翻牌動畫 --- */
.tsunami-flip-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 60px;
  min-width: 320px;
  position: relative;
  overflow: hidden;
  padding: 0 !important;
  font-size: 1.1rem !important;
}

.tsunami-flip-item {
  min-width: 260px;
  min-height: 40px;
  color: #d32f2f;
  border-radius: 8px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.2s;
  will-change: transform;
  font-size: 1.1rem !important;
}

.tsunami-flip-item.flip-in {
  animation: tsunamiFlipIn 0.6s;
}

@keyframes tsunamiFlipIn {
  0% {
    transform: rotateX(90deg);
    opacity: 0;
  }

  40% {
    transform: rotateX(-20deg);
    opacity: 1;
  }

  60% {
    transform: rotateX(10deg);
  }

  80% {
    transform: rotateX(-5deg);
  }

  100% {
    transform: rotateX(0deg);
    opacity: 1;
  }
}