:root {
  --bg: #0b0f13;
  --panel: #0f1720;
  --muted: #9aa6b2;
  --accent: #8b5cf6;
  --cell-border: rgba(255, 255, 255, 0.05);

  /* Category colors (modern default) */
  --alkali: #ff7043;
  /* Group 1 except H */
  --alkaline: #ffb74d;
  /* Group 2 */
  --lanth: #8d6e63;
  /* lanthanides */
  --actin: #a1887f;
  /* actinides */
  --transition: #7c4dff;
  /* transition metals */
  --post-transition: #4dd0e1;
  /* post-transition */
  --metalloid: #c5e1a5;
  /* metalloids */
  --nonmetal: #81c784;
  /* nonmetals */
  --halogen: #f06292;
  /* halogens */
  --noble: #64b5f6;
  /* noble gases */
  --unknown: #bdbdbd;
  /* unknown/others */
}

/* Basic page */
html,
body {
  height: 100%;
  margin: 0;
  background: linear-gradient(180deg, var(--bg), #071018 120%);
  color: #e6eef6;
  font-family: Inter, "Segoe UI", Roboto, system-ui, -apple-system, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 28px 18px;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: 0.6px;
}

p.lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Table styling */
.periodic {
  width: 100%;
  overflow: auto;
  margin-top: 20px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  min-width: 1100px;

}

td,
th {
  border: 1px solid var(--cell-border);
  padding: 6px;
  vertical-align: top;
  background: transparent;
}

/* element cell */
.element {
  height: 96px;
  padding: 8px;
  border-radius: 6px;
  color: #0b0f13;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
}

.element:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 12px 28px rgba(139, 92, 246, 0.14);
}

.el-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(11, 15, 19, 0.85);
  font-weight: 600;
}

.el-symbol {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.el-name {
  font-size: 0.72rem;
  opacity: 0.9;
  color: rgba(11, 15, 19, 0.7);
}

.el-mass {
  font-size: 0.68rem;
  color: rgba(11, 15, 19, 0.62);
}

.numbered-cell {
  padding: 0;
  border: none;
  height: 70px;
  text-align: center;
  vertical-align: bottom;
  font-weight: bold;
  color: #fff;
  font-size: 14px;
  padding-bottom: 3px;

}

.empty {
  border: none;
}

/* category backgrounds */
.alkali {
  background: linear-gradient(180deg, var(--alkali), #ff8a65);
}

.alkaline {
  background: linear-gradient(180deg, var(--alkaline), #ffc46f);
}

.transition {
  background: linear-gradient(180deg, var(--transition), #9a7dff);
  color: #fff;
}

.post-transition {
  background: linear-gradient(180deg, var(--post-transition), #6fe6ee);
}

.metalloid {
  background: linear-gradient(180deg, var(--metalloid), #d9f0b2);
  color: #0b0f13;
}

.nonmetal {
  background: linear-gradient(180deg, var(--nonmetal), #a6e3a4);
  color: #0b0f13;
}

.halogen {
  background: linear-gradient(180deg, var(--halogen), #ff83b7);
  color: #0b0f13;
}

.noble {
  background: linear-gradient(180deg, var(--noble), #9fd4ff);
  color: #0b0f13;
}

.lanth {
  background: linear-gradient(180deg, var(--lanth), #a1887f);
  color: #fff;
}

.actin {
  background: linear-gradient(180deg, var(--actin), #b59a8e);
  color: #fff;
}

.alkali-h {
  background: linear-gradient(180deg, #29b6f6, #4fc3f7);
}

/* hydrogen special */
.unknown {
  background: linear-gradient(180deg, var(--unknown), #e0e0e0);
  color: #0b0f13;
}

/* small helpers */
.number {
  font-weight: 700;
  font-size: 0.74rem;
  opacity: 0.95;
}

.symbol {
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: 6px;
}

.name {
  font-size: 0.72rem;
  margin-top: 4px;
  opacity: 0.9;
}

.mass {
  font-size: 0.66rem;
  opacity: 0.85;
}

/* labels for lanthanide/actinide */
.footnote {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  gap: 10px;
  align-items: center;
}

.legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.legend .key {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.legend .swatch {
  width: 18px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Special style for Lanthanide and Actinide category cells */
.element.series {
  height: 96px;
  padding: 8px;
  text-align: center;
  justify-content: center;
  align-items: center;
  display: flex;
  flex-direction: column;
  color: #fff;
  font-family: Inter, "Segoe UI", Roboto, system-ui, -apple-system, "Helvetica Neue", Arial;
}

/* Top label (57–71 / 89–103) */
.element.series .el-top {
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(11, 15, 19, 0.85);
  font-weight: 600;
}

.el-top-small span.number {
  font-size: 0.63em;
  color: rgba(11, 15, 19, 0.85);
}

.el-name-small {
  font-size: 0.7rem;
  color: rgba(11, 15, 19, 0.7);
}

.el-name-xsmall {
  font-size: 0.6rem;
  color: rgba(11, 15, 19, 0.7);
}

/* Element symbol */
.element.series .el-symbol {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  margin: 4px 0;
}

/* Category name */
.element.series .el-name {
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.95;
  margin-top: 2px;
}

/* Period number column */
.period-number {
  width: 40px;
  text-align: center;
  vertical-align: middle;
  font-weight: 600;
  color: #fff;
  border: none;
  background: transparent;
  font-size: 14px;
  letter-spacing: 0.5px;
  padding-right: 5px;
}

.spacer-row {
  height: 20px;
  border: none;
}

.spacer-row td {
  border: none;
  padding: 0;
}

.series-label {
  border: none;
  padding: 8px 0;
  font-weight: bold;
  color: var(--muted);
  font-size: 0.80rem;
  text-align: left;
  vertical-align: middle;
}

/* Footer styles */
.footer {
  text-align: center;
  margin-top: 40px;
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.92rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 400;
}

.footer .heart {
  color: #E81224;
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
  font-size: 1.1rem;
}

.footer .author-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

.footer .author-link:hover {
  color: #a78bfa;
  text-decoration: none;
}

.footer .author-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  transition: width 0.3s ease;
}

.footer .author-link:hover::after {
  width: 100%;
}

@keyframes heartbeat {

  0%,
  100% {
    transform: scale(1);
  }

  10%,
  30% {
    transform: scale(1.1);
  }

  20%,
  40% {
    transform: scale(1);
  }
}


/* Responsive Design */
@media (max-width:1400px) {
  .wrap {
    max-width: 100%;
  }
}

@media (max-width:1200px) {
  table {
    min-width: 1100px;
  }
  
  .wrap {
    padding: 0 10px;
  }
  
  td, th {
    padding: 8px;
  }
  
  .element {
    height: 90px;
    padding: 8px;
  }
}

@media (max-width:1000px) {
  :root {
    --panel: #091015;
  }

  table {
    min-width: 950px;
  }

  .element {
    height: 80px;
    padding: 6px;
  }

  .el-symbol {
    font-size: 1.3rem;
  }
  
  .el-name {
    font-size: 0.65rem;
  }
  
  .el-mass {
    font-size: 0.6rem;
  }
  
  td, th {
    padding: 6px;
  }
  
  h1 {
    font-size: 1.4rem;
  }
  
  p.lead {
    font-size: 0.85rem;
  }
}

@media (max-width:768px) {
  body {
    padding: 15px 8px;
  }
  
  table {
    min-width: 700px;
  }

  .element {
    height: 70px;
    padding: 5px;
  }

  .el-symbol {
    font-size: 1.1rem;
  }
  
  .el-name {
    font-size: 0.58rem;
  }
  
  .el-mass {
    font-size: 0.55rem;
  }
  
  .el-top {
    font-size: 0.65rem;
  }
  
  td, th {
    padding: 4px;
  }
  
  .numbered-cell {
    font-size: 11px;
    height: 50px;
  }
  
  .period-number {
    font-size: 11px;
    width: 30px;
  }
  
  h1 {
    font-size: 1.2rem;
  }
  
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .legend {
    gap: 6px;
  }
  
  .legend .key {
    font-size: 0.72rem;
  }
  
  .footer {
    font-size: 0.82rem;
    padding: 18px 0;
    margin-top: 25px;
  }
}

@media (max-width:600px) {
  table {
    min-width: 600px;
  }
  
  .element {
    height: 60px;
    padding: 4px;
  }
  
  .el-symbol {
    font-size: 0.95rem;
  }
  
  .el-name {
    font-size: 0.5rem;
  }
  
  .el-mass {
    font-size: 0.48rem;
  }
  
  .el-top {
    font-size: 0.55rem;
  }
  
  td, th {
    padding: 3px;
  }
  
  .numbered-cell {
    font-size: 10px;
    height: 40px;
  }
  
  .period-number {
    font-size: 10px;
    width: 25px;
  }
  
  h1 {
    font-size: 1.1rem;
  }
  
  p.lead {
    font-size: 0.75rem;
  }
  
  .periodic {
    padding: 8px;
  }
  
  .series-label {
    font-size: 0.7rem;
  }
  
  .element.series .el-symbol {
    font-size: 0.85rem;
  }
  
  .element.series .el-name {
    font-size: 0.7rem;
  }
}

@media (max-width:480px) {
  body {
    padding: 10px 5px;
  }
  
  table {
    min-width: 550px;
  }
  
  .element {
    height: 55px;
    padding: 3px;
  }
  
  .el-symbol {
    font-size: 0.85rem;
  }
  
  .el-name {
    font-size: 0.45rem;
  }
  
  .el-mass {
    font-size: 0.42rem;
  }
  
  .el-top {
    font-size: 0.5rem;
  }
  
  td, th {
    padding: 2px;
  }
  
  .numbered-cell {
    font-size: 9px;
    height: 35px;
  }
  
  .period-number {
    font-size: 9px;
    width: 20px;
  }
  
  h1 {
    font-size: 1rem;
  }
  
  .footer {
    font-size: 0.75rem;
    padding: 15px 0;
  }
  
  .legend .key {
    font-size: 0.65rem;
  }
  
  .legend .swatch {
    width: 14px;
    height: 12px;
  }
}

/* Designed and Developed By Hassan Javed */