body {
  margin: 0;
  font-family: Arial, "Microsoft JhengHei", sans-serif;
  background: #111827;
  color: #f9fafb;
}

.card {
  width: 360px;
  margin: 12vh auto;
  padding: 28px;
  background: #1f2937;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.container {
  max-width: 980px;
  margin: 40px auto;
  padding: 0 20px;
}

h1, h2 { margin-top: 0; }

.muted { color: #9ca3af; }

label {
  display: block;
  margin: 16px 0 6px;
}

input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #374151;
  background: #111827;
  color: #fff;
  box-sizing: border-box;
}

button, .lesson-link, .logout {
  display: inline-block;
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 0;
  background: #4f46e5;
  color: white;
  text-decoration: none;
  cursor: pointer;
}

.error { color: #f87171; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.course-card {
  margin-top: 24px;
  padding: 22px;
  background: #1f2937;
  border-radius: 16px;
}

.lesson-link {
  display: block;
  margin: 10px 0;
  background: #374151;
}

.player-wrap {
  position: relative;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
}

video {
  width: 100%;
  display: block;
  background: #000;
}

.watermark {
  position: absolute;
  color: rgba(255,255,255,0.38);
  font-size: 18px;
  font-weight: bold;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 1px 1px 2px rgba(0,0,0,.75);
}

.wm1 { animation: drift1 18s linear infinite alternate; }
.wm2 { animation: drift2 23s linear infinite alternate; }

.static-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.045);
  font-size: 46px;
  font-weight: bold;
  pointer-events: none;
  transform: rotate(-22deg);
}

@keyframes drift1 {
  0% { left: 5%; top: 10%; }
  25% { left: 55%; top: 20%; }
  50% { left: 18%; top: 62%; }
  75% { left: 62%; top: 72%; }
  100% { left: 10%; top: 35%; }
}

@keyframes drift2 {
  0% { right: 8%; bottom: 12%; }
  25% { right: 55%; bottom: 22%; }
  50% { right: 16%; bottom: 64%; }
  75% { right: 66%; bottom: 70%; }
  100% { right: 12%; bottom: 34%; }
}

.fullscreen-btn {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 10;
  background: rgba(255,255,255,0.08);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.wm-main {
  position: absolute;
  color: rgba(255,255,255,0.32);
  font-size: 22px;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
  line-height: 1.6;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  animation: driftMain 26s linear infinite alternate;
}

.player-wrap:fullscreen .wm-main {
  font-size: 36px;
}

.player-wrap:fullscreen video {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
}

@keyframes driftMain {
  0% { left: 20%; top: 20%; }
  20% { left: 55%; top: 25%; }
  40% { left: 25%; top: 45%; }
  60% { left: 58%; top: 52%; }
  80% { left: 35%; top: 35%; }
  100% { left: 22%; top: 55%; }
}

@media (max-width: 768px) {
  .wm-main {
    font-size: 16px;
    padding: 8px 10px;
    line-height: 1.45;
  }

  .player-wrap:fullscreen .wm-main {
    font-size: 24px;
  }
}

@media (min-width: 769px) and (max-width: 1180px) {
  .wm-main {
    font-size: 28px;
    padding: 10px 12px;
    line-height: 1.5;
  }

  .player-wrap:fullscreen .wm-main {
    font-size: 36px;
  }
}