* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  font-family: "Outfit", sans-serif;
  color: #fff;
  background: #050505;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background: #050505;
}

button,
input {
  font: inherit;
}

.room {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 500px;
  display: flex;
  overflow: hidden;
  background: #050505;
  transition: background-color 0.8s ease;
}

.room.on {
  background: #111;
}

.room-light {
  position: absolute;
  top: -30%;
  left: 0;
  width: 1000px;
  height: 1000px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: scale(0.5);
  background: radial-gradient(
    circle,
    rgba(255, 220, 100, 0.15) 0%,
    rgba(255, 214, 0, 0.05) 30%,
    transparent 70%
  );
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.room.on .room-light {
  opacity: 1;
  transform: scale(1.5);
}

.fireflies {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  overflow: hidden;
}

.firefly {
  position: absolute;
  border-radius: 50%;
  background: #ffea00;
  box-shadow:
    0 0 10px 3px rgba(255, 234, 0, 0.9),
    0 0 20px rgba(255, 179, 0, 0.6);
  animation: fireflyMove var(--duration) ease-in-out var(--delay) infinite
    alternate;
}

@keyframes fireflyMove {
  0% {
    transform: translate(var(--x1), var(--y1));
    opacity: 0.45;
  }
  25% {
    transform: translate(var(--x2), var(--y2));
    opacity: 1;
  }
  50% {
    transform: translate(var(--x3), var(--y3));
    opacity: 0.65;
  }
  75% {
    transform: translate(var(--x4), var(--y4));
    opacity: 1;
  }
  100% {
    transform: translate(var(--x5), var(--y5));
    opacity: 0.5;
  }
}

.lamp-side {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 5;
}

.lamp-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  transform: scale(1.1);
  -webkit-tap-highlight-color: transparent;
}

.lamp-head {
  width: 140px;
  height: 50px;
  background: #151515;
  border-radius: 140px 140px 4px 4px;
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.1),
    0 10px 20px rgba(0, 0, 0, 0.9);
  position: relative;
  z-index: 6;
  transition: box-shadow 0.4s ease;
  border-bottom: 2px solid #050505;
}

.room.on .lamp-head {
  box-shadow:
    inset 0 -3px 10px rgba(255, 220, 150, 0.4),
    inset 0 2px 5px rgba(255, 255, 255, 0.1);
}

.lamp-glow {
  position: absolute;
  top: 40px;
  width: 90px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow:
    0 0 40px 20px rgba(255, 230, 150, 0.9),
    0 0 80px 40px rgba(255, 200, 100, 0.6);
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  z-index: 5;
  pointer-events: none;
}

.room.on .lamp-glow {
  opacity: 1;
}

.light-beam {
  position: absolute;
  top: 45px;
  width: 500px;
  height: 350px;
  clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%);
  background: linear-gradient(
    to bottom,
    rgba(255, 230, 140, 0.8) 0%,
    rgba(255, 200, 80, 0.2) 60%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  z-index: 3;
  pointer-events: none;
  filter: blur(8px);
}

.room.on .light-beam {
  opacity: 1;
}

.lamp-stem {
  width: 6px;
  height: 290px;
  background: linear-gradient(to right, #050505 0%, #2a2a2a 50%, #050505 100%);
  position: relative;
  z-index: 4;
  transition:
    background 0.4s ease,
    box-shadow 0.4s ease;
}

.room.on .lamp-stem {
  background: linear-gradient(to right, #050505 0%, #2a2010 50%, #050505 100%);
  box-shadow: 0 0 10px rgba(255, 200, 100, 0.15);
}

.lamp-base {
  width: 100px;
  height: 16px;
  background: #151515;
  border-radius: 30px 30px 4px 4px;
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.1),
    0 10px 20px rgba(0, 0, 0, 0.9);
  position: relative;
  z-index: 5;
  transition: box-shadow 0.4s ease;
  border-bottom: 2px solid #050505;
}

.room.on .lamp-base {
  box-shadow:
    inset 0 2px 6px rgba(255, 220, 150, 0.3),
    0 10px 20px rgba(0, 0, 0, 0.9);
}

.desk-surface {
  position: absolute;
  bottom: -40px;
  width: 550px;
  height: 100px;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 220, 120, 0.25) 0%,
    rgba(255, 180, 50, 0.05) 50%,
    transparent 70%
  );
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  z-index: 1;
  pointer-events: none;
}

.room.on .desk-surface {
  opacity: 1;
}

.string-svg {
  position: absolute;
  top: 45px;
  left: calc(50% + 55px);
  width: 2px;
  height: 2px;
  overflow: visible;
  z-index: 5;
  pointer-events: none;
}

.string-svg path {
  stroke: #222;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

.string-handle {
  position: absolute;
  top: 125px;
  left: calc(50% + 49px);
  width: 10px;
  height: 20px;
  background: linear-gradient(to bottom, #ebd17a, #aa8529);
  border-radius: 5px;
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.5),
    0 3px 5px rgba(0, 0, 0, 0.7);
  cursor: grab;
  z-index: 6;
  touch-action: none;
  user-select: none;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.string-handle.dragging {
  cursor: grabbing;
  transition: none;
}

.login-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding-right: 10%;
}

.login-card {
  padding: 48px;
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateX(50px);
  filter: blur(10px);
  pointer-events: none;
  transition:
    opacity 0.6s ease 0s,
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.6s ease;
}

.room.on .login-card {
  opacity: 1;
  transform: translateX(0);
  filter: blur(0);
  pointer-events: auto;
  transition-delay: 0.2s;
}

.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
}

.login-heading {
  text-align: center;
  margin-bottom: 8px;
}

.login-heading h2 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
  letter-spacing: -0.5px;
}

.login-heading p {
  color: #aaa;
  font-size: 15px;
}

.inputs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-wrap {
  position: relative;
  display: block;
}

.input-wrap input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition:
    border-color 0.3s,
    box-shadow 0.3s,
    background-color 0.3s;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.input-wrap input:focus {
  border-color: rgba(255, 220, 100, 0.45);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.5),
    0 0 0 3px rgba(255, 220, 100, 0.06);
}

.input-wrap input::placeholder {
  color: #888;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  z-index: 2;
  opacity: 0.8;
}

.user-icon::before {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border: 2px solid #888;
  border-radius: 50%;
  left: 4px;
  top: 1px;
}
.user-icon::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 8px;
  border: 2px solid #888;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  left: 1px;
  bottom: 1px;
}

.mail-icon::before {
  content: "";
  position: absolute;
  inset: 3px 1px;
  border: 2px solid #888;
  border-radius: 3px;
}
.mail-icon::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-left: 2px solid #888;
  border-bottom: 2px solid #888;
  transform: rotate(-45deg);
  left: 5px;
  top: 1px;
}

.lock-icon::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 10px;
  border: 2px solid #888;
  border-radius: 3px;
  left: 2px;
  bottom: 1px;
}
.lock-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 9px;
  border: 2px solid #888;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  left: 4px;
  top: 0;
}

.sign-in {
  padding: 16px;
  border-radius: 16px;
  border: none;
  background: #ffd600;
  color: #000;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition:
    transform 0.2s,
    background-color 0.3s,
    box-shadow 0.3s;
}

.sign-in:hover {
  transform: scale(1.02);
  background: #ffdc64;
  box-shadow: 0 0 20px rgba(255, 220, 100, 0.4);
}

.sign-in:active {
  transform: scale(0.98);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}
.divider span {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}
.divider b {
  color: #888;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.socials {
  display: flex;
  gap: 16px;
}

.social-btn {
  flex: 1;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition:
    transform 0.2s,
    background-color 0.3s;
}

.social-btn:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.15);
}
.social-btn:active {
  transform: scale(0.95);
}

.google-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 700;
  font-family: Arial, sans-serif;
  color: #4285f4;
}

.github-icon {
  font-size: 18px;
  color: white;
}

.prompt {
  position: absolute;
  top: 15%;
  left: 18%;
  transform: translateX(-50%);
  color: #555;
  font-size: 18px;
  font-weight: 500;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 1;
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.room.on .prompt {
  opacity: 0;
  transform: translate(-50%, -20px);
}

.prompt i {
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, #555, transparent);
  animation: promptArrow 2s infinite;
}

@keyframes promptArrow {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

@media (max-width: 900px) {
  .room {
    flex-direction: column;
    overflow-y: auto;
  }
  .lamp-side {
    flex: 0 0 55vh;
    min-height: 430px;
  }
  .login-side {
    padding: 30px 24px 50px;
    flex: 0 0 auto;
  }
  .login-card {
    max-width: 440px;
  }
  .prompt {
    left: 50%;
    top: 7%;
    font-size: 14px;
    text-align: center;
  }
}

@media (max-height: 650px) and (min-width: 901px) {
  .lamp-container {
    transform: scale(0.8);
  }
  .login-card {
    padding: 30px;
    gap: 16px;
  }
}

/* TIE DeKUT chat additions. The lamp animation styles above are retained. */
:root { color-scheme: dark; }
.room { min-height: 100vh; height: 100vh; }
.lamp-side { min-width: 280px; }
.lamp-hint { position: relative; z-index: 5; margin-top: 22px; color: #d6d3c8; font-size: 13px; text-align: center; }
.login-side { flex: 1.15; min-width: 0; padding: 28px; }
.gate-card, .chat-card { width: min(100%, 520px); max-height: calc(100vh - 56px); overflow: hidden; }
.gate-card { overflow-y: auto; }
.login-heading h1, .chat-header h1 { margin: 5px 0 8px; font-size: clamp(27px, 3vw, 36px); line-height: 1.1; }
.eyebrow { color: #f5d76e; font-size: 10px; font-weight: 700; letter-spacing: 2px; }
.status { min-height: 18px; margin-top: 10px; font-size: 13px; color: #f5d76e; }
.small-note { margin-top: 16px; color: #b8b8bd; font-size: 12px; line-height: 1.5; }
.back-link { display: inline-block; margin-top: 18px; color: #f5d76e; text-decoration: none; font-size: 13px; }
.back-link:hover { text-decoration: underline; }
.phrase-wrap { position: relative; }
.phrase-wrap input { padding-right: 58px; }
.show-phrase { position: absolute; right: 10px; border: 0; background: transparent; color: #f5d76e; cursor: pointer; font-size: 12px; }
.hidden { display: none !important; }
.chat-card { display: flex; flex-direction: column; height: min(760px, calc(100vh - 56px)); }
.chat-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.12); }
.chat-identity { color: #c4c4cb; font-size: 12px; }
.icon-button { flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; background: rgba(255,255,255,.08); color: white; cursor: pointer; font-size: 22px; }
.chat-notice { min-height: 20px; padding: 10px 0 6px; color: #f5d76e; font-size: 12px; }
.messages { flex: 1; min-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 3px 14px; scrollbar-width: thin; }
.message { max-width: 88%; align-self: flex-start; padding: 10px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px 14px 14px 4px; background: rgba(255,255,255,.075); overflow-wrap: anywhere; }
.message.own { align-self: flex-end; border-color: rgba(245,215,110,.28); background: rgba(245,215,110,.12); border-radius: 14px 14px 4px 14px; }
.message-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; color: #f5d76e; font-size: 11px; font-weight: 600; }
.message-time { color: #a9a9b1; font-weight: 400; }
.message-body { color: #f5f5f7; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.message-form { padding: 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(0,0,0,.18); }
.message-form textarea { display: block; width: 100%; min-height: 52px; resize: vertical; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; font-size: 14px; }
.message-form textarea::placeholder { color: #aaaab2; }
.composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; color: #aaaab2; font-size: 11px; }
.send-button { padding: 9px 15px; border: 0; border-radius: 10px; background: #f5d76e; color: #181818; font-weight: 700; cursor: pointer; }
.send-button:disabled { opacity: .55; cursor: not-allowed; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  html, body { height: auto; min-height: 100%; overflow: auto; }
  .room { width: 100%; min-height: 100vh; height: auto; flex-direction: column; overflow: visible; padding: 12px 0 24px; }
  .lamp-side { flex: 0 0 auto; min-width: 0; height: 180px; overflow: hidden; }
  .lamp-container { transform: scale(.55); transform-origin: center top; }
  .lamp-hint { margin-top: -38px; font-size: 11px; }
  .login-side { flex: 1; padding: 12px; }
  .gate-card, .chat-card { width: 100%; max-height: none; }
  .chat-card { height: min(72vh, 720px); min-height: 460px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }


/* Added in the updated package: delete controls for a student's own messages. */
.delete-message-button {
  margin-top: 7px;
  border: 1px solid rgba(255, 145, 145, 0.45);
  border-radius: 8px;
  padding: 5px 9px;
  color: #ffc2c2;
  background: rgba(120, 20, 30, 0.22);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.delete-message-button:hover { background: rgba(150, 25, 40, 0.42); }
.delete-message-button:disabled { opacity: 0.55; cursor: wait; }
