:root{
  --background:#effcff;
  --surface:#ffffff;
  --surface-soft:#f4fcff;
  --text:#082846;
  --text-soft:#476c7e;
  --accent:#08608f;
  --accent-light:#dff5fb;
  --border:#c7dfe5;
  --shadow:0 5px 14px rgba(24,72,92,.18);
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  background:var(--background);
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}

.wrap{
  width:min(1180px,calc(100% - 28px));
  margin:auto;
}
.word-row,
.word-card{
  cursor:pointer;
}

.word-row:focus,
.word-card:focus{
  outline:3px solid rgba(21,150,166,.25);
  outline-offset:2px;
}

.open-hint{
  margin-top:14px;
  color:#08608f;
  font-size:13px;
  font-weight:750;
}

.details-dialog{
  width:min(760px,calc(100% - 24px));
  max-height:90vh;
  padding:0;
  overflow:auto;
  background:#ffffff;
  color:#082846;
  border:1px solid #c7dfe5;
  border-radius:24px;
  box-shadow:0 25px 80px rgba(5,42,62,.28);
}

.details-dialog::backdrop{
  background:rgba(3,28,43,.68);
  backdrop-filter:blur(3px);
}

.details-box{
  position:relative;
  padding:30px;
}

.details-close{
  position:absolute;
  top:15px;
  right:17px;
  width:42px;
  height:42px;
  padding:0;
  background:#e8f7fa;
  color:#082846;
  border:1px solid #bdd9df;
  border-radius:50%;
  font-size:29px;
  line-height:1;
  cursor:pointer;
}

.detail-title{
  margin:14px 55px 24px 0;
  color:#061f3c;
  font-family:Georgia,"Times New Roman",serif;
  font-size:36px;
  -webkit-text-stroke:.3px #000000;
}

.details-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.detail-item{
  padding:16px;
  background:#f4fcff;
  border:1px solid #c7dfe5;
  border-radius:16px;
}

.detail-item span{
  display:block;
  margin-bottom:7px;
  color:#476c7e;
  font-size:12px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.detail-item p{
  margin:0;
  color:#082846;
  line-height:1.6;
  white-space:pre-wrap;
}

.detail-wide{
  grid-column:1/-1;
}

@media(max-width:600px){
  .details-box{
    padding:24px 18px;
  }

  .detail-title{
    font-size:30px;
  }

  .details-grid{
    grid-template-columns:1fr;
  }

  .detail-wide{
    grid-column:auto;
  }
}
.top{
  padding:22px 0;
  background:#ffffff;
  border-bottom:1px solid #d6e5e9;
}

.head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

.eyebrow{
  color:#12618f;
  font-size:12px;
  font-weight:800;
  letter-spacing:.14em;
}

h1{
  margin:4px 0;
  color:#061f3c;
  font-size:clamp(30px,6vw,52px);
  font-weight:800;
  -webkit-text-stroke:.3px #000000;
  text-shadow:0 1px 0 rgba(0,0,0,.15);
}

.top p{
  margin:0;
  color:var(--text-soft);
}

.hero{
  margin:24px 0 0;
  padding:32px 28px;
  background:linear-gradient(
    135deg,
    #d9ffed 0%,
    #d6f9f5 45%,
    #d9e7ff 100%
  );
  border:1px solid #c8e1e4;
  border-bottom:0;
  border-radius:24px 24px 0 0;
}

.hero h2{
  margin:0 0 14px;
  color:#061f3c;
  font-family:Georgia,"Times New Roman",serif;
  font-size:clamp(27px,5vw,45px);
  font-weight:800;
  line-height:1.12;
  -webkit-text-stroke:.35px #000000;
  text-shadow:0 1px 0 rgba(0,0,0,.16);
}

.hero p{
  margin:0;
  color:#385f74;
  font-size:18px;
  line-height:1.7;
}

.stats{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
  margin:0 0 34px;
  padding:20px 28px 36px;
  background:linear-gradient(
    135deg,
    #d9ffed 0%,
    #d6f9f5 45%,
    #d9e7ff 100%
  );
  border:1px solid #c8e1e4;
  border-top:0;
  border-radius:0 0 24px 24px;
}

.stat{
  min-height:145px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:24px;
  background:rgba(247,253,255,.91);
  border:1px solid #c6dce3;
  border-radius:26px;
  box-shadow:var(--shadow);
}

.stat b{
  display:block;
  color:#08608f;
  font-size:38px;
  font-weight:800;
  -webkit-text-stroke:.2px #063451;
  text-shadow:0 1px 0 rgba(0,0,0,.12);
}

.stat span{
  margin-top:8px;
  color:#476c7e;
  font-size:17px;
}

.tools{
  display:grid;
  grid-template-columns:2fr repeat(3,1fr);
  gap:14px;
  margin:20px 0;
  padding:28px;
  background:#ffffff;
  border:1px solid var(--border);
  border-radius:22px;
  box-shadow:var(--shadow);
}

input,
select{
  width:100%;
  padding:14px;
  background:#ffffff;
  color:var(--text);
  border:1px solid #bdd9df;
  border-radius:14px;
  box-shadow:0 3px 8px rgba(26,79,97,.10);
  font-size:15px;
  outline:none;
}

input::placeholder{
  color:#668391;
}

input:focus,
select:focus{
  border-color:#1596a6;
  box-shadow:0 0 0 3px rgba(21,150,166,.15);
}

.resultbar{
  margin:10px 0 16px;
  color:var(--text-soft);
}

.resultbar strong{
  color:var(--text);
}

h3{
  color:#061f3c;
  font-size:24px;
  -webkit-text-stroke:.2px #000000;
}

.tablebox{
  overflow:auto;
  background:#ffffff;
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:var(--shadow);
}

table{
  width:100%;
  min-width:1000px;
  border-collapse:collapse;
}

th,
td{
  padding:13px 12px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:top;
}

th{
  position:sticky;
  top:0;
  background:#eaf9fc;
  color:var(--text);
  font-size:13px;
}

tbody tr:hover{
  background:#f0fcff;
}

td:nth-child(2){
  font-weight:750;
}

.badge{
  display:inline-block;
  padding:5px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:750;
}

/* Istorizm — moviy */
.badge-history{
  background:#dcefff;
  color:#075e91;
  border:1px solid #98c8e5;
}

/* Arxaizm — yashil */
.badge-archaic{
  background:#e4f7ec;
  color:#176b52;
  border:1px solid #9fd5bb;
}

.cards{
  display:none;
}

.foot{
  padding:30px 0;
  color:var(--text-soft);
  font-size:14px;
}

@media(max-width:850px){
  main.wrap{
    width:100%;
  }

  .hero{
    margin:0;
    padding:34px 29px 24px;
    border:0;
    border-radius:0;
  }

  .stats{
    grid-template-columns:repeat(2,1fr);
    gap:22px;
    margin:0 0 45px;
    padding:20px 29px 58px;
    border:0;
    border-radius:0;
  }

  .stat{
    min-height:164px;
    padding:29px;
    border-radius:30px;
  }

  .stat b{
    font-size:43px;
  }

  .stat span{
    font-size:20px;
  }

  .tools{
    grid-template-columns:1fr;
    margin:0 29px 25px;
    padding:29px;
    border-radius:25px;
  }

  .tools input{
    grid-column:auto;
  }

  input,
  select{
    min-height:66px;
    font-size:18px;
  }

  .resultbar{
    margin:0 29px 18px;
  }

  main.wrap > section:last-of-type{
    margin-right:29px;
    margin-left:29px;
  }

  .tablebox{
    display:none;
  }

  .cards{
    display:grid;
    gap:12px;
  }

  .card{
    padding:18px;
    background:#ffffff;
    border:1px solid var(--border);
    border-radius:20px;
    box-shadow:var(--shadow);
  }

  .card h4{
    margin:0 0 9px;
    color:#061f3c;
    font-size:20px;
    -webkit-text-stroke:.2px #000000;
  }

  .card p{
    color:var(--text);
    line-height:1.55;
  }

  .meta{
    margin-top:10px;
    color:var(--text-soft);
    font-size:13px;
  }
}

@media(max-width:520px){
  .stats{
    grid-template-columns:1fr 1fr;
  }

  .stat{
    min-height:145px;
    padding:20px;
  }

  .stat b{
    font-size:38px;
  }

  .stat span{
    font-size:17px;
  }

  .hero h2{
    font-size:39px;
  }
}
