* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: white;
  min-height: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 18px;
  flex-wrap: wrap;
}

.logo {
  font-size: 20px;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.nav a {
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.nav a:hover {
  opacity: 1;
}

.hero,
.page-wrap {
  padding: 40px 20px;
  display: flex;
  justify-content: center;
}

.hero-card,
.page-card {
  width: 100%;
  max-width: 1000px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.hero-card h1,
.page-card h1 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 42px;
}

.hero-card p,
.page-card p,
.section-note {
  opacity: 0.82;
  line-height: 1.5;
}

.tool-grid,
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.tool-card,
.game-card {
  display: block;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 20px;
  transition: transform 0.18s ease, background 0.18s ease;
}

.tool-card:hover,
.game-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.1);
}

.tool-card h2,
.game-card h2 {
  margin: 0 0 8px 0;
  font-size: 22px;
}

.tool-card p,
.game-card p {
  margin: 0;
}

.panel-grid {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

@media (min-width: 850px) {
  .panel-grid.two {
    grid-template-columns: 1fr 1fr;
  }

  .panel-grid.three {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.panel {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 14px;
}

.panel h2 {
  margin-top: 0;
}

input,
select,
textarea,
button {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  margin-top: 10px;
}

textarea {
  min-height: 280px;
  resize: vertical;
  font-family: Arial, sans-serif;
}

input,
select,
textarea {
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
}

button {
  background: #2563eb;
  color: white;
  cursor: pointer;
  transition: background 0.18s ease;
}

button:hover {
  background: #1d4ed8;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.output-box {
  margin-top: 12px;
  min-height: 56px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 18px;
  word-break: break-word;
}

.big-time {
  text-align: center;
  font-size: 42px;
  font-weight: 700;
  margin: 18px 0;
}

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

.button-row button {
  width: auto;
  min-width: 120px;
  flex: 1;
}

.calc-display {
  width: 100%;
  font-size: 28px;
  text-align: right;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.calc-grid button {
  font-size: 20px;
  padding: 16px;
}

.small-note {
  margin-top: 10px;
  font-size: 14px;
  opacity: 0.75;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  opacity: 0.85;
}

.save-status {
  margin-top: 10px;
  font-size: 14px;
  opacity: 0.75;
}

.notes-actions {
  margin-top: 12px;
}

.game-tag {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0.9;
}

@media (max-width: 640px) {
  .hero-card h1,
  .page-card h1 {
    font-size: 32px;
  }

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

  .calc-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .calc-grid button {
    font-size: 18px;
    padding: 14px;
  }

  .big-time {
    font-size: 34px;
  }
}
