* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  color: #e4eef7;
  background:
    radial-gradient(circle at top left, rgba(55, 199, 177, 0.2), transparent 28%),
    radial-gradient(circle at top right, rgba(106, 169, 255, 0.16), transparent 24%),
    linear-gradient(180deg, #04101b 0%, #071521 55%, #050b12 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.24;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.layout {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

.left,
.right {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(8, 17, 28, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  border-radius: 28px;
}

.left {
  flex: 1 1 360px;
  min-width: 320px;
  padding: 28px;
}

.right {
  flex: 1 1 520px;
  min-width: 320px;
  padding: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(55, 199, 177, 0.28);
  background: rgba(55, 199, 177, 0.08);
  color: #c9f7f0;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#intro-wrapper {
  color: #a8b7c9;
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 16px;
}

#ttt-text {
  white-space: pre-line;
  text-align: justify;
  text-justify: inter-word;
}

#textBox {
  width: 100%;
  margin-top: 0;
  padding: 14px 18px;
  color: #dce8f4;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  font-size: 0.98rem;
  line-height: 1.55;
}

#board {
  width: min-content;
  padding: 18px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 22px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.row {
  display: flex;
}

.cell {
  width: clamp(82px, 12vw, 104px);
  height: clamp(82px, 12vw, 104px);
  margin: 5px;
  font-size: clamp(48px, 7vw, 64px);
  cursor: pointer;
  color: #0e1724;
  background: linear-gradient(180deg, #eff4fb 0%, #dde7f5 100%);
  border: 1px solid rgba(14, 23, 36, 0.08);
  border-radius: 14px;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
  font-family: 'JetBrains Mono', monospace;
}

.cell:hover {
  background: linear-gradient(180deg, #f8fbff 0%, #d6e3f6 100%);
  box-shadow: 0 10px 18px rgba(6, 17, 27, 0.08);
}

.cell:active {
  transform: scale(0.96);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgb(0, 0, 0);
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  border-radius: 5px;
}

.close-button {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close-button:hover,
.close-button:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

@media (max-width: 960px) {
  .page-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 14px;
  }

  .left,
  .right {
    border-radius: 22px;
  }
}

@media (max-width: 640px) {
  .layout {
    gap: 16px;
  }

  .left,
  .right {
    padding: 20px;
  }

  #board {
    padding: 12px;
  }

  .cell {
    margin: 4px;
  }
}
