*,
*::before,
*::after {
  box-sizing: border-box;
  font-family: 'Prosto One', sans-serif !important;
}

html, body {
  margin: 0;
  background: #0f0f11;
  color: #fff;
  height: 100%;
  overflow: hidden;
  max-width: 100vw;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a24;
  padding: 16px 24px;
  border-bottom: 1px solid #333;
}

.logo { font-weight:600; font-size:20px; }
.profile { display:flex; align-items:center; gap:12px; }
.user-avatar {
  font-size:20px;
  background:#2f2f48;
  border-radius:50%;
  padding:6px;
  width:34px; height:34px;
  display:flex; justify-content:center; align-items:center;
  color:#ffc107;
  border:2px solid #4f46e5;
}
.user-name { font-weight:500; font-size:16px; }
.logout {
  background:#4f46e5;
  border:none;
  padding:8px 16px;
  color:#fff;
  border-radius:6px;
  cursor:pointer;
  transition:.2s;
  font-size:14px;
}
.logout:hover { background:#6366f1; }

.layout {
  display:flex;
  height:calc(100vh - 64px);
}

.sidebar {
  width:200px;
  background:#1a1a2b;
  padding:20px;
  border-right:1px solid #333;
  display:flex;
  flex-direction:column;
}
.sidebar h3 { font-size:16px; margin-bottom:12px; }
.sidebar ul {
  list-style:none;
  padding:0; margin:0;
  overflow-y:auto; flex:1;
}
.sidebar li {
  padding:10px;
  border-radius:8px;
  cursor:pointer;
  background:#252536;
  margin-bottom:6px;
  transition: transform .2s ease, background .2s ease;
}
.sidebar li:hover {
  background:#2f2f48;
  transform: translateX(5px);
}
.sidebar li.active-topic {
  background:#3a3a3a;
  color:#4ade80;
}

.chat-area {
  flex:1;
  position:relative;
  background:#141419;
  display:flex;
  flex-direction:column;
}
.quote {
  position:absolute;
  top:50%;
  left:50%;
  transform: translate(-50%, -50%);
  opacity:0.2;
  font-size:28px;
  text-align:center;
  pointer-events:none;
}
.messages {
  flex:1;
  padding:30px;
  overflow-y:auto;
  overflow-x: hidden;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-width: 100%;
}
.message {
  max-width:100%;
  padding:12px 16px;
  border-radius:16px;
  line-height:1.4;
  animation: fadeIn .3s ease;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}
.user {
  align-self:flex-end;
  background:#4f46e5;
  color:#fff;
  border-bottom-right-radius:4px;
}
.bot {
  align-self:flex-start;
  background:#22c55e;
  color:#000;
  border-bottom-left-radius:4px;
}

.input-box {
  display: flex;
  align-items: center;
  padding: 12px;
  background: #1a1a2b;
  gap: 8px;
}
.input-box textarea {
  flex: 1;
  min-height: 48px;
  max-height: 200px;
  background: #101015;
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 16px;
  line-height: 1.3;
  resize: none;
  overflow: auto;
}
.input-box button {
  flex: 0 0 auto;
  width: 80px;
  height: 48px;
  background: #4f46e5;
  border: none;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .2s, box-shadow .3s;
}
.input-box button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}
button {
  background: #4f46e5;
  border: none;
  padding: 12px 20px;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#difficulty-buttons {
  display:flex;
  flex-direction:column;
  gap:10px;
}
#difficulty-buttons button {
  transition: transform .2s ease, box-shadow .3s ease;
  font-size:14px;
}
#difficulty-buttons button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 13px rgba(34,197,94,0.5);
}

.extra {
  width:220px;
  background:#1a1a2b;
  padding:20px;
  border-left:1px solid #333;
}
.extra h3 { font-size:16px; margin-bottom:12px; }

.hint-wrapper {
  position:relative;
  display:inline-flex;
  align-items:center;
  overflow:visible;
  margin-top:20px;
}
.hint-btn {
  background:#22c55e;
  border:none;
  padding:10px 26px;
  border-radius:10px;
  color:#000;
  font-size:15px;
  cursor:pointer;
  transition: background .2s, transform .2s;
}
.hint-btn:disabled {
  opacity:0.4;
  cursor:default;
}
.hint-btn:not(:disabled):hover {
  background:#4ade80;
  transform:scale(1.05);
}

.hint-help {
  display:flex;
  align-items:center;
  justify-content:center;
  width:24px; height:24px;
  margin-left:8px;
  border-radius:50%;
  background:#333;
  color:#fff;
  font-size:14px;
  cursor:help;
  user-select:none;
}

.hint-tooltip {
  position:absolute;
  top:calc(100% + 4px);
  text-align:center;
  left:65%;
  transform: translateX(-50%) translateY(-10px);
  color:#fff;
  padding:8px 12px;
  border-radius:6px;
  white-space:normal;
  min-width:200px;
  font-size:14px;
  opacity:0;
  pointer-events:none;
  animation: fadeInTooltip .3s ease-out forwards, fadeOutTooltip .3s ease-in forwards 2.7s;
  z-index:10;
}

@keyframes fadeInTooltip {
  from { opacity:0; transform: translateX(-50%) translateY(-10px); }
  to { opacity:1; transform: translateX(-50%) translateY(0); }
}
@keyframes fadeOutTooltip {
  from { opacity:1; transform: translateX(-50%) translateY(0); }
  to { opacity:0; transform: translateX(-50%) translateY(-10px); }
}

.message.user pre {
  display: block;
  white-space: pre-wrap;
  width: 100%;
  max-width: 100%;
  background: #101015;
  padding: 8px 12px;
  border-radius: 8px;
  overflow-x: auto;
  word-break: break-all;
  margin: 0;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal.hidden { display: none; }

.modal-content {
  background: #1a1a24;
  padding: 32px 40px;
  border-radius: 16px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}
.modal-close {
  position: absolute;
  right: 16px;
  top: 12px;
  font-size: 22px;
  cursor: pointer;
  color: #888;
  transition: color .2s;
}
.modal-close:hover { color: #fff; }

.tab-selector { display: flex; justify-content: center; gap: 16px; }
.tab {
  background: #252536;
  border: none;
  padding: 8px 24px;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s;
}
.tab:hover   { background: #2f2f48; }
.tab.active  { background: #4f46e5; }

.login-form           { display: flex; flex-direction: column; gap: 12px; }
.login-form input     {
  padding: 10px 14px; border-radius: 8px; border: none;
  background: #101015; color: #fff; font-size: 15px;
}
.login-submit {
  margin-top: 6px; background: #22c55e; color: #000; font-weight: 600;
  border: none; padding: 12px; border-radius: 10px;
  cursor: pointer; transition: transform .2s;
}
.login-submit:hover { transform: scale(1.05); }

.attempts-info { font-size: 14px; color: #e11d48; min-height: 18px; text-align: center; }

.right-controls { display: flex; align-items: center; gap: 16px; }

.login-btn {
  background: #22c55e; color: #000; padding: 8px 20px;
  border-radius: 10px; border: none; cursor: pointer; font-size: 14px;
  transition: background .2s, transform .2s;
}
.login-btn:hover { background: #4ade80; transform: scale(1.05); }

.admin-banner {
  width: 100%; background: #3b82f6; color: #000;
  text-align: center; padding: 6px 0; font-size: 14px; font-weight: 600;
}
.admin-banner.hidden { display: none; }

.upload-btn {
  width: 100%; margin-bottom: 14px; background: #22c55e;
  color: #000; font-weight: 600; border: none;
  border-radius: 10px; padding: 10px 12px; cursor: pointer;
  transition: background .2s, transform .2s;
}
.upload-btn:hover { background: #4ade80; transform: scale(1.05); }

.hidden { display: none !important; }
.subtab-selector { display:flex; gap:14px; justify-content:center; }
.subtab {
  background:#252536; border:none; padding:6px 26px; border-radius:8px;
  color:#fff; cursor:pointer; transition:background .2s;
}
.subtab.active { background:#4f46e5; }
.link {
  color: #4f46e5;
  text-decoration: underline;
  cursor: pointer;
  transition: transform 0.2s, color 0.2s;
}
.link:hover {
  transform: scale(1.05);
  color: #6366f1;
}
.link:active {
  transform: scale(0.98);
}

.login-form input {
  margin-bottom: 8px;
}

.switch-text {
  font-size: 14px;
  margin-top: 4px;
  text-align: center;
}

.login-submit {
  background: #4f46e5;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}
.login-submit:hover {
  background: #6366f1;
  transform: scale(1.05);
}
.login-submit:active {
  transform: scale(0.98);
}
.homepage {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(180deg, #1a1a24, #221f47, #221f36, #1a1a24);
  background-size: 600% 600%;
  animation: gradientShift 20s ease infinite;
}

.home-content {
  position: relative;
  text-align: center;
  z-index: 1;
  padding: 0 20px;
}

.home-title {
  /* your existing sizing… */
  font-size: clamp(2.5rem, 8vw, 5rem);
  margin-bottom: 12px;
  line-height: 1.2;
  background: linear-gradient(
    120deg,
    #4ade80 50%,
    #a7f3d0 100%,
    #22c55e 60%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShiftText 5s ease infinite;
}

.particle-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.particle {
  position: absolute;
  bottom: -10px;
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  animation: drift 12s linear infinite;
}
@keyframes drift {
  0% {
    transform: translateX(0) translateY(0) scale(0.5);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  50% {
    transform: translateX(100vw) translateY(-60vh) scale(1);
    opacity: 0.1;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateX(200vw) translateY(-120vh) scale(0.5);
    opacity: 0;
  }
}
/* stagger each particle */
.particle:nth-child(1)  { left: 10%;  animation-delay: 0s; }
.particle:nth-child(2)  { left: 25%;  animation-delay: 3s; }
.particle:nth-child(3)  { left: 40%;  animation-delay: 6s; }
.particle:nth-child(4)  { left: 55%;  animation-delay: 1.5s; }
.particle:nth-child(5)  { left: 70%;  animation-delay: 4.5s; }
.particle:nth-child(6)  { left: 85%;  animation-delay: 7.5s; }
.particle:nth-child(7)  { left: 50%;  animation-delay: 2s; }
.particle:nth-child(8)  { left: 30%;  animation-delay: 5s; }


.home-tagline {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 32px;
}

.home-btn {
  position: relative;
  background-image: linear-gradient(90deg, #4338ca, #4f46e5, #6366f1);
  color: #fff;
  padding: 20px 40px;
  font-size: 1.25rem;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: transform .3s ease, filter .3s ease;
}
.home-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.home-features {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 48px;
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #e5e7eb;
  opacity: 0.9;
  transition: transform .3s ease, opacity .3s ease;
}
.feature-item:hover {
  transform: translateY(-6px);
  opacity: 1;
}
.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.feature-label {
  font-size: 1rem;
  letter-spacing: .5px;
}
/* Utility & animations */
@keyframes gradientShiftText {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes floatUp {
  0%   { transform: translateY(0)   translateX(0)   scale(1); opacity: 0.6; }
  50%  { transform: translateY(-20px) translateX(10px) scale(1.1); opacity: 0.8; }
  100% { transform: translateY(0)   translateX(-10px) scale(1); opacity: 0.6; }
}
@keyframes slideUpAndFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-30px); }
}
@keyframes slideDownAndFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

.homepage.animate-out {
  animation: slideUpAndFadeOut 0.6s ease-in-out forwards;
}
.top-bar.animate-in,
.layout.animate-in,
#admin-banner.animate-in {
  animation: slideDownAndFadeIn 0.6s ease-in-out forwards;
}
.pp-skip-home .homepage        { display:none !important; }
.pp-skip-home .top-bar,
.pp-skip-home .layout          { display:flex !important; }
.score-btn{
  background:#22c55e;
  color:#000;
  padding:8px 20px;
  border-radius:10px;
  border:none;
  cursor:pointer;
  font-size:14px;
  transition:background .2s,transform .2s;
}
.score-btn:hover{
  background:#4ade80;
  transform:scale(1.05);
}
