@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

.tn-root {
  --void: #0a0908;
  --panel: #171313;
  --panel-2: #1e1919;
  --line: #322a29;
  --red: #c81e1e;
  --red-bright: #ff3b30;
  --red-dim: #5c1414;
  --text: #ece6e2;
  --text-muted: #9a8f8b;
  --text-faint: #665c59;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(rgba(10, 9, 8, 0.78), rgba(10, 9, 8, 0.78)), url("../img/backgroung.png") center center / cover no-repeat fixed;
  background-color: var(--void);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--red-dim); color: #fff; }

button { font: inherit; }
button:focus-visible,
.tn-btn:focus-visible,
.tn-plate:focus-visible,
.tn-back:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 2px;
}

.tn-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 1;
}

.tn-glow {
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(ellipse at center, rgba(200,30,30,0.16) 0%, rgba(200,30,30,0) 70%);
  pointer-events: none;
  z-index: 0;
}

.tn-content {
  position: relative;
  z-index: 2;
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 120px;
}

/* HEADER */
.tn-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -28px -20px 32px;
  padding: 22px 20px 18px;
  background: rgba(10, 9, 8, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}
.tn-brand { display: flex; align-items: center; gap: 12px; cursor: pointer; transition: opacity 0.15s ease; }
.tn-brand:hover { opacity: 0.85; }
.tn-brand-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(155deg, var(--panel-2), var(--panel));
  border: 1px solid var(--red-dim);
  color: var(--red-bright);
  box-shadow: 0 2px 10px rgba(200, 30, 30, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.tn-brand-text h1 {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
}
.tn-brand-text span {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.tn-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tn-btn {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.tn-btn:hover { border-color: var(--red-dim); }
.tn-btn:active { transform: translateY(1px); }

.tn-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text-faint);
  padding: 10px 14px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: border-color 0.15s ease;
}
.tn-search:focus-within { border-color: var(--red-dim); color: var(--text); }
.tn-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  width: 140px;
}
.tn-search input::placeholder { color: var(--text-faint); }

/* BACK */
.tn-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; color: var(--text-muted);
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer; margin-bottom: 22px; padding: 6px 0;
  transition: color 0.15s ease;
}
.tn-back:hover { color: var(--red-bright); }

/* CATEGORY GRID */
.tn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.tn-plate {
  position: relative;
  background: linear-gradient(160deg, var(--panel-2) 0%, var(--panel) 100%);
  border: 1px solid var(--line);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  padding: 22px 18px 18px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  text-align: left;
}
.tn-plate:hover {
  border-color: var(--red);
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(200, 30, 30, 0.15);
}
.tn-plate:active { transform: translateY(-1px); }
.tn-plate-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  color: var(--red-bright);
  background: linear-gradient(155deg, rgba(200, 30, 30, 0.14), rgba(200, 30, 30, 0.03));
  border: 1px solid var(--red-dim);
  margin-bottom: 16px;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.tn-plate-name {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 4px 0;
  color: #ece6e2;
}
.tn-plate-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-faint);
}

/* VIEW TRANSITION */
@keyframes tn-view-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.tn-view { animation: tn-view-fade-in 0.25s ease; }

.tn-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--red-bright);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}
.tn-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 12px 0;
}
/* WHEEL GRID (dentro de uma categoria) */
.tn-wheel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.tn-wheel-card {
  background: linear-gradient(160deg, var(--panel-2) 0%, var(--panel) 100%);
  border: 1px solid var(--line);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.tn-wheel-card:hover {
  border-color: var(--red);
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(200, 30, 30, 0.15);
}
.tn-wheel-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  margin-bottom: 12px;
  overflow: hidden;
}
.tn-wheel-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.tn-wheel-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.tn-wheel-code {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.tn-wheel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.tn-wheel-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--red-dim);
  border-radius: 2px;
  background: rgba(200, 30, 30, 0.1);
  color: var(--red-bright);
}
.tn-empty-cat {
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 60px 0;
  text-align: center;
}

/* FOOTER */
.tn-footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

@media (max-width: 700px) {
  .tn-search input { width: 90px; }
}

@media (max-width: 560px) {
  .tn-title { font-size: 22px; }
  .tn-brand-text h1 { font-size: 18px; }
  .tn-content { padding: 20px 14px 100px; }
  .tn-header { margin: -20px -14px 24px; padding: 16px 14px 14px; flex-wrap: wrap; }
  .tn-btn span.label { display: none; }
  .tn-search { display: none; }
}
