@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;800&display=swap');

*{margin:0;padding:0;box-sizing:border-box}

:root{
  --brand-a:#b06ab3;
  --brand-b:#4568dc;

  --glass-bg: rgba(255,255,255,0.15);
  --glass-bg-2: rgba(255,255,255,0.18);
  --glass-shadow: rgba(0,0,0,0.25);
  --glass-blur: 12px;
}

html, body{
  width:100%;
  min-height:100%;
  overflow-x:hidden;
}

body{
  font-family:"Poppins",sans-serif;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b));
  min-height:100svh;
  color:#fff;
  position:relative;
  display:flex;
  flex-direction:column;
  overflow-x:hidden;
}

#back-btn{
  position:fixed;
  top:20px;
  left:20px;
  z-index:120;
  width:48px;
  height:48px;
  padding:0;
  border-radius:50%;
  border:none;
  cursor:pointer;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.25);
  display:flex;
  align-items:center;
  justify-content:center;
  transition: transform .3s ease, box-shadow .3s ease, background .3s ease;
}

#back-btn img{
  width:22px;
  height:22px;
  object-fit:contain;
  transform:scaleX(-1);
  user-select:none;
  -webkit-user-drag:none;
}

#back-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 7px 20px rgba(0,0,0,0.3);
  background:rgba(255,255,255,0.24);
}

.lava-bg{
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  overflow:hidden;
}

.lava-bg span{
  position:absolute;
  display:block;
  border-radius:50%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255,255,255,0.3),
    rgba(255,255,255,0) 70%
  );
}

.page-main{
  position:relative;
  z-index:10;
  width:100%;
  flex:1 0 auto;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:24px;
  min-height:calc(100svh + 44px);
}

/* START SCREEN */
.screen{
  position:relative;
  z-index:10;
  width:100%;
  max-width:650px;
  margin:0 auto;
  padding:35px 30px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius:20px;
  box-shadow: 0 10px 30px var(--glass-shadow);
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
}

.screen h2{
  font-size:26px;
  font-weight:600;
  margin-bottom:18px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.filters-row{
  width:80%;
  display:flex;
  gap:12px;
  margin-bottom:12px;
}

#set-select,
#type-filter,
#student-filter{
  position:absolute !important;
  left:-9999px !important;
  width:1px !important;
  height:1px !important;
  opacity:0 !important;
  pointer-events:none !important;
}

.wl-dd{
  width:80%;
  position:relative;
  z-index:12;
}

.filters-row .wl-dd{ width:100%; }

.wl-dd-btn,
.wl-dd-menu{
  position:relative;
  border-radius:22px;
  border:none;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 12px 34px rgba(0,0,0,0.28);
  overflow:hidden;
  overscroll-behavior:none;
  background-image:none !important;
}

.wl-dd-btn::before,
.wl-dd-btn::after,
.wl-dd-menu::before,
.wl-dd-menu::after{
  content:none !important;
  display:none !important;
}

.wl-dd-btn{
  width:100%;
  outline:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 16px;
  color:#fff;
  font:700 16px "Poppins",sans-serif;
  transition: transform .22s ease, box-shadow .22s ease, opacity .22s ease, background .22s ease;
}

.wl-dd-btn:hover{
  transform:translateY(-1px);
  box-shadow: 0 14px 38px rgba(0,0,0,0.34);
  background: var(--glass-bg-2);
}

.wl-dd-btn:disabled{
  opacity:0.62;
  cursor:not-allowed;
  transform:none;
}

.wl-dd-label{
  flex:1;
  min-width:0;
  text-align:left;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.wl-dd-caret{
  font-size:10px;
  transform:translateY(1px);
  opacity:0.95;
}

.wl-dd-menu{
  padding:10px 0;
  display:none;
  overflow-y:auto;
  overflow-x:hidden;
  clip-path:none !important;
  -webkit-clip-path:none !important;
  -webkit-mask-image:none !important;
  mask-image:none !important;
  overscroll-behavior:none !important;
  background-image:none !important;
}

.wl-dd-menu.floating{
  position:fixed;
  z-index:999999;
  display:block;
}

.wl-dd-item{
  width:100%;
  border:0 !important;
  outline:none !important;
  box-shadow:none !important;
  background:transparent !important;
  background-image:none !important;
  cursor:pointer;
  display:block;
  padding:10px 22px;
  color:rgba(255,255,255,0.98);
  font:600 16px "Poppins",sans-serif;
  text-align:left;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  transition: transform .16s ease, opacity .16s ease;
}

.wl-dd-item:hover,
.wl-dd-item:active,
.wl-dd-item:focus,
.wl-dd-item:focus-visible,
.wl-dd-item[aria-selected="true"]{
  background:transparent !important;
  background-image:none !important;
  box-shadow:none !important;
  outline:none !important;
}

.wl-dd-item:hover{ transform:translateX(2px); opacity:1; }
.wl-dd-item[aria-selected="true"]{ font-weight:800; opacity:1; }

.wl-dd-item:disabled{
  opacity:0.52;
  cursor:not-allowed;
  transform:none !important;
}

.wl-dd[data-dd-for="set-select"]{ margin-bottom:25px; }

.wl-dd-search-wrap{
  position:sticky;
  top:0;
  z-index:5;
  padding:8px 14px 10px;
  background:transparent !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
}

.wl-dd-search{
  width:100%;
  height:36px;
  border-radius:16px;
  outline:none;
  background:transparent !important;
  border:1px solid rgba(255,255,255,0.18);
  color:rgba(255,255,255,0.96);
  padding:8px 12px;
  font:600 13px "Poppins", sans-serif;
  letter-spacing:0.2px;
  box-shadow:none !important;
}

.wl-dd-search::placeholder{
  color:rgba(255,255,255,0.62);
  font-weight:600;
}

.wl-dd-search:focus{
  border-color:rgba(255,255,255,0.30);
  background:transparent !important;
}

#start-btn{
  padding:12px 30px;
  font-size:16px;
  font-weight:600;
  border-radius:12px;
  border:none;
  cursor:pointer;
  background: linear-gradient(145deg, #9b4fff, #d85fff);
  color:#fff;
  box-shadow: 0 5px 15px rgba(0,0,0,0.25);
  transition: transform .3s ease, box-shadow .3s ease;
}

#start-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 7px 20px rgba(0,0,0,0.3);
}

.wl-dd-menu{
  scrollbar-width:thin;
  scrollbar-color: rgba(255,255,255,0.55) transparent;
}

.wl-dd-menu::-webkit-scrollbar{ width:10px; }

.wl-dd-menu::-webkit-scrollbar-track{
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
  margin:0 !important;
  border-radius:0 !important;
}

.wl-dd-menu::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,0.42) !important;
  border-radius:999px;
  border:2px solid transparent !important;
  background-clip:padding-box !important;
}

.wl-dd-menu::-webkit-scrollbar-thumb:hover{
  background:rgba(255,255,255,0.52) !important;
}

/* GAME */
.game-screen{
  position:relative;
  z-index:100;
  display:none;
  width:100%;
  min-height:calc(100svh + 44px);
  align-items:center;
  justify-content:center;
  padding:92px 24px 56px;
  flex:1 0 auto;
}

.game-card{
  width:100%;
  max-width:900px;
  padding:26px 28px 22px;
  background:rgba(255,255,255,0.15);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border-radius:24px;
  box-shadow:0 10px 30px rgba(0,0,0,0.25);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
}

.game-title{
  font-size:26px;
  font-weight:600;
  text-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.game-subtitle{
  font-size:15px;
  opacity:0.9;
  text-align:center;
}

.words-game{
  width:100%;
  display:flex;
  gap:26px;
  justify-content:space-between;
  margin-top:8px;
  align-items:stretch;
}

.column{
  flex:1 1 50%;
  background:rgba(255,255,255,0.16);
  border-radius:18px;
  padding:14px 16px 12px;
  box-shadow:0 6px 18px rgba(0,0,0,0.2);
  min-height:260px;
}

.column h3{
  text-align:center;
  margin-bottom:10px;
  font-size:17px;
  text-shadow: 0 2px 5px rgba(0,0,0,0.25);
}

.words-list{
  display:flex;
  flex-direction:column;
  gap:7px;
}

.word-item{
  padding:10px 12px;
  border-radius:12px;
  background:rgba(255,255,255,0.9);
  color:#3b3562;
  text-align:center;
  font-size:17px;
  cursor:pointer;
  user-select:none;
  transition:transform .2s ease, box-shadow .2s ease, background .2s ease;
  word-break:break-word;
  line-height:1.28;
  min-height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.word-item:hover{
  transform:translateY(-2px);
  box-shadow:0 4px 10px rgba(0,0,0,0.25);
  background:#f6e6ff;
}

.word-item.selected{
  background:#ffd580;
  transform:translateY(-2px) scale(1.03);
}

.word-item.matched{
  cursor:default;
  box-shadow:0 0 0 2px rgba(255,255,255,0.6);
}

.word-item.wrong{
  background:#ff6b6b !important;
  color:#fff;
}

/* FINISH / ROUND */
.finish-screen{
  position:relative;
  z-index:100;
  width:100%;
  min-height:calc(100svh + 44px);
  background:transparent;
  display:none;
  justify-content:center;
  align-items:center;
  padding:92px 24px 56px;
  flex:1 0 auto;
}

.finish-card{
  background:rgba(255,255,255,0.15);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border-radius:20px;
  box-shadow:0 10px 30px rgba(0,0,0,0.25);
  padding:34px 48px;
  text-align:center;
  color:#fff;
  max-width:92vw;
}

.finish-card h2{
  margin-bottom:22px;
  font-size:1.8rem;
}

#finish-return-btn,
#round-continue-btn{
  padding:12px 30px;
  font-size:16px;
  font-weight:600;
  border-radius:12px;
  border:none;
  cursor:pointer;
  background: linear-gradient(145deg, #9b4fff, #d85fff);
  color:#fff;
  transition:.3s;
  box-shadow:0 7px 20px rgba(0,0,0,0.25);
}

#finish-return-btn:hover,
#round-continue-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 26px rgba(0,0,0,0.3);
}

/* FOOTER */
.site-footer{
  position:relative;
  z-index:10;
  width:100%;
  margin-top:0;
  padding:0;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.10);
  flex:0 0 auto;
}

.footer-glass{
  width:100%;
  max-width:1200px;
  margin:0 auto;
  padding:20px 24px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:40px;
}

.footer-left,
.footer-right{
  min-width:0;
}

.footer-left{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.footer-owner{
  font-size:15px;
  font-weight:600;
  line-height:1.5;
  color:rgba(255,255,255,0.96);
}

.footer-email{
  font-size:14px;
  line-height:1.5;
  color:rgba(255,255,255,0.88);
  text-decoration:none;
  word-break:break-word;
  transition: opacity .2s ease;
}

.footer-email:hover{
  opacity:0.82;
}

.footer-copy{
  margin-top:4px;
  font-size:13px;
  line-height:1.5;
  color:rgba(255,255,255,0.72);
}

.footer-right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}

.footer-doc-link{
  font-size:14px;
  line-height:1.5;
  color:rgba(255,255,255,0.93);
  text-decoration:none;
  transition: opacity .2s ease, transform .2s ease;
  text-align:right;
}

.footer-doc-link:hover{
  opacity:0.82;
  transform: translateX(-2px);
}

/* TABLET */
@media (max-width: 900px){
  .game-screen{
    padding:92px 18px 50px;
  }

  .game-card{
    max-width:760px;
    padding:24px 20px 20px;
  }

  .words-game{
    gap:18px;
  }

  .column{
    padding:12px 14px 10px;
    min-height:240px;
  }

  .word-item{
    font-size:16px;
    min-height:44px;
  }
}

@media (max-width: 768px){
  .game-card{
    max-width:94vw;
  }

  .words-game{
    flex-direction:column;
    gap:18px;
  }

  .column{
    width:100%;
  }

  .footer-glass{
    gap:24px;
    padding:18px 18px;
  }
}

/* MOBILE */
@media (max-width: 520px){
  html, body{
    min-height:100%;
  }

  body{
    min-height:100svh;
  }

  .filters-row{
    flex-direction:column;
    gap:10px;
    margin-bottom:10px;
    width:100%;
  }

  .wl-dd{
    width:100%;
  }

  #start-screen{
    max-width:360px;
    padding:24px 16px;
  }

  #start-screen h2{
    font-size:22px;
    margin-bottom:14px;
  }

  .wl-dd-btn{
    font-size:15px;
    padding:11px 14px;
    border-radius:18px;
  }

  .wl-dd[data-dd-for="set-select"]{
    margin-bottom:10px;
  }

  #start-btn{
    width:100%;
    max-width:220px;
    padding:12px 20px;
    font-size:15px;
  }

  .page-main{
    min-height:calc(100svh + 52px);
    padding:84px 14px 52px;
    align-items:center;
    justify-content:center;
  }

  .screen{
    margin:0 auto;
  }

  .game-screen{
    min-height:calc(100svh + 52px);
    padding:84px 14px 52px;
    align-items:flex-start;
    justify-content:center;
  }

  .game-card{
    width:100%;
    max-width:100%;
    padding:22px 14px 18px;
    gap:12px;
    margin:0 auto;
    border-radius:20px;
  }

  .game-title{
    font-size:22px;
  }

  .game-subtitle{
    font-size:14px;
  }

  .words-game{
    gap:14px;
    margin-top:4px;
  }

  .column{
    padding:12px 10px 10px;
    border-radius:16px;
    min-height:auto;
  }

  .column h3{
    font-size:15px;
    margin-bottom:8px;
  }

  .words-list{
    gap:8px;
  }

  .word-item{
    font-size:15px;
    padding:10px 10px;
    min-height:42px;
    border-radius:11px;
  }

  .finish-screen{
    min-height:calc(100svh + 52px);
    padding:84px 14px 52px;
    align-items:center;
    justify-content:center;
  }

  .finish-card{
    width:100%;
    max-width:360px;
    padding:28px 20px;
    margin:0 auto;
  }

  .finish-card h2{
    font-size:1.45rem;
  }

  #finish-return-btn,
  #round-continue-btn{
    width:100%;
  }

  .footer-glass{
    flex-direction:column;
    gap:14px;
    padding:16px 14px 14px;
  }

  .footer-right{
    align-items:flex-start;
    gap:4px;
  }

  .footer-doc-link{
    text-align:left;
    font-size:10.5px;
    line-height:1.28;
    opacity:0.9;
  }

  .footer-owner,
  .footer-email{
    font-size:12px;
  }

  .footer-copy{
    font-size:11px;
  }
}

@media (max-width: 390px){
  #start-screen{
    max-width:340px;
    padding:22px 14px;
  }

  #start-screen h2{
    font-size:20px;
  }

  .wl-dd-btn{
    font-size:14px;
    padding:10px 13px;
  }

  .game-card{
    padding:20px 12px 16px;
  }

  .game-title{
    font-size:20px;
  }

  .game-subtitle{
    font-size:13px;
  }

  .column{
    padding:10px 8px 8px;
  }

  .column h3{
    font-size:14px;
  }

  .word-item{
    font-size:14px;
    min-height:40px;
    padding:9px 8px;
  }

  .finish-card{
    max-width:340px;
  }
}

@media (max-height: 800px){
  .game-card{
    padding:20px 20px 18px;
    gap:10px;
  }

  .game-title{
    font-size:24px;
  }

  .game-subtitle{
    font-size:14px;
  }

  .column h3{
    font-size:16px;
    margin-bottom:8px;
  }

  .word-item{
    padding:8px 10px;
    font-size:16px;
  }
}