* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0e0e10;
  color: #e0e0e0;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

header h1 {
  font-family: 'VT323', monospace;
  font-size: 3rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.05em;
}

.subtitle {
  color: #888;
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* --- Tool grid --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #1a1a1e;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  display: block;
  background: #252528;
}

.card-thumb-link {
  display: block;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.card-thumb-text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'VT323', monospace;
  font-size: 2.8rem;
  color: #fff;
  padding: 1rem;
  text-align: center;
  line-height: 1.2;
}

.card-body {
  padding: 1rem 1.2rem 1.2rem;
}

.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.card-body h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

.card-type {
  font-style: italic;
  font-size: 0.75rem;
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-desc {
  font-size: 0.85rem;
  color: #999;
  line-height: 1.5;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.card-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  background: #2a2a2e;
  color: #aaa;
  border-radius: 5px;
  font-size: 0.75rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.card-link-btn:hover {
  background: #333;
  color: #fff;
}

.card-link-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.card-info-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* --- Empty state --- */
.empty {
  text-align: center;
  color: #666;
  padding: 4rem 1rem;
  font-size: 0.95rem;
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 2rem;
  color: #555;
  font-size: 0.8rem;
}

footer a {
  color: #2a6df0;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* --- Form gate modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #1a1a1e;
  border-radius: 12px;
  padding: 2rem 2.5rem;
  max-width: 400px;
  width: 90%;
  position: relative;
  text-align: center;
}

.modal-form {
  max-width: 620px;
  width: 95%;
  height: 85vh;
  padding: 0.5rem 1rem 1rem;
  display: flex;
  flex-direction: column;
}

.modal-form-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0 0.5rem;
  flex-shrink: 0;
}

.modal h3 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.modal p {
  color: #999;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.modal-btn {
  display: inline-block;
  background: #2a6df0;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  margin: 0.3rem;
}

.modal-btn:hover {
  background: #1b5ad4;
}

.modal-btn-confirm {
  background: #27ae60;
}

.modal-btn-confirm:hover {
  background: #1e8e4e;
}

.modal-skip {
  background: none;
  border: none;
  color: #666;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.modal-skip:hover {
  color: #999;
}

.modal-close {
  background: none;
  border: none;
  color: #666;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

/* --- Info modal --- */
.modal-info {
  max-width: 600px;
  width: 95%;
  max-height: 80vh;
  text-align: left;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-info .modal-close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
}

.modal-info h3 {
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.info-body {
  overflow-y: auto;
  color: #ccc;
  font-size: 0.9rem;
  line-height: 1.7;
}

.info-body h2 { font-size: 1.1rem; color: #fff; margin: 1rem 0 0.4rem; }
.info-body h3 { font-size: 1rem; color: #fff; margin: 0.8rem 0 0.3rem; text-align: left; }
.info-body h4 { font-size: 0.95rem; color: #ddd; margin: 0.6rem 0 0.3rem; }
.info-body p { margin-bottom: 0.8rem; }
.info-body ul { margin: 0.5rem 0 0.8rem 1.2rem; }
.info-body li { margin-bottom: 0.3rem; }
.info-body strong { color: #fff; }
.info-body a { color: #2a6df0; }
