/* Base Styles */
body {
  margin: 0;
  padding: 0;
  background: #000 !important;
  font-family: "Hiragino Kaku Gothic ProN", sans-serif;
  color: #eee;
  line-height: 1.5;
}

a {
  text-decoration: none !important;
}

.spacer-neg20 {
  margin-top: -20px;
}

.highlight {
  color: #b8860b; /* or any color like #facc15 (yellow-ish) */
  font-weight: bold;
}

/* Header */
.kw-header {
  text-align: center;
  padding: 10px 0;
}

.kw-logo {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.2em;
  font-size: 2.3rem;
  font-weight: 600;
  font-family: 'Marcellus', serif; /* or whatever you use */
  margin-bottom: 0.2em;
}

/* Color styles */
.kakishibu {
  color: #904012;  /* Wabi-sabi orange */
}

.sabi {
  color: #9f8672;  /* Soft brown-gray */
}

/* Optional: Make "World" slightly smaller */
.small {
  font-size: 0.7em;
  font-weight: 700;
  margin-left: 0.1em; /* tweak spacing if needed */
}

.kw-banner {
  background: linear-gradient(to right, #222, #777) !important;
  padding: 10px 16px;
  text-align: center;
  font-style: normal !important;  /* removes italic */
  font-weight: 700;
  font-size: 1.4rem !important;
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}
.kw-banner {
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s;
}

.kw-banner:hover {
  background: linear-gradient(to right, #ca952e 0%, #debd7d 100%);
  color: black;
  box-shadow: 0 0 10px #ca952e;
}

.kw-title {
  text-align: center;
  margin-top: 1.2em;
  font-size: 1.2rem;
  color: #ca9; /* optional, matches your style */
}

.kw-subtitle {
  font-weight: 400;
  font-size: 0.5em;
  color: #fff;
  margin-left: 0.5em;
}

.voice-banner:hover {
  filter: brightness(1.05);
}

@media screen and (max-width: 420px) {
  .voice-banner {
    font-size: 1.1em;
    padding: 10px 12px;
  }
}

/* Page Container */
.kw-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 8px;
  background-color: #000;
}

/* Audio Button */
.play-audio {
  display: block;
  margin: 0.6em auto;
  padding: 6px 0;
  width: 160px;
  font-size: 0.95rem;
  background-color: #516121;
  color: #fff;
  border: 1px solid #555;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.play-audio:hover {
  background-color: #5e9935; /* slightly darker olive green */
  cursor: pointer;
}

/* 4 x 2 grid */
.kanji-grid-4x2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 2px;      /* reduced from 10px */
  column-gap: 10px;
  margin: 20px 0;
  padding: 0 10px;
  text-align: center;
}

/* Shared button base styles */
.full-btn,
.pick9-btn {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 0;
  font-family: inherit;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
}

/* Top button: Full — rounded top only */
.full-btn {
  height: 50px;
  background: #e9d0a5 !important;
  color: #222;
  font-size: 0.85rem;
  border-radius: 10px 10px 0 0;
	margin-bottom: -1px;
}

/* Bottom button: Pick 9 — rounded bottom only */
.pick9-btn {
  height: 80px !important;
  background: #b97e35 !important;
  color: #222;
  font-size: 0.95rem;
  font-weight: bold;
  border-radius: 0 0 10px 10px;
  margin-top: 0;
}

.pick9-subtext {
  font-size: 0.75rem;
  color: #333;
  margin-top: 1px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Hover effect (optional) */
.full-btn:hover,
.pick9-btn:hover {
  filter: brightness(1.05);
}

/* Pick 9: Taller + Emphasis */
.pick9-btn {
  height: 100px;
  background: #facc15;
  color: #222;
  font-size: 0.95rem;
  font-weight: bold;
}

.full-btn:hover,
.pick9-btn:hover {
  filter: brightness(1.1);
  border: 1px solid #fea701;
  box-sizing: border-box; /* ensures layout isn't shifted by border */
}

.kw-footer {
  text-align: center;
  font-size: 1em;
  color: #9f8e72; /* sabi tone */
  padding: 16px 12px;
  border-top: 1px solid #444;
  margin-top: 1.5em;
  line-height: 1.5;
  font-family: "Hiragino Kaku Gothic ProN", sans-serif;
}

.kw-footer a {
  display: inline-block;
  text-decoration: none;
  color: inherit;
}

.kw-footer a:hover {
  text-decoration: underline;
}

.footer-kakishibu {
  color: #c36d3c;
  font-weight: 800;
}

.footer-sabi {
  color: #9f8672;
  font-size: 0.7em;
  font-weight: 600;
}

.compact-footer {
  margin-top: 0px !important; /* or whatever spacing looks best */
}

/* ================================
   Kanji World Top Page Extensions
   ================================ */

/* ========================
   Top 3 Voice Tab Grid
   ======================== */

.kw-tab-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0 10px;
}

.kw-tab {
  background-color: #333 !important;  /* Darker brown for better contrast */
  color: #f0f0f0;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;  /* Thin white border */
  border-radius: 6px;
  padding: 5px 6px !important;
  min-height: 40px !important;
  font-size: 0.9rem;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.kw-tab:hover {
  background-color: #444 !important;  /* or your preferred brown */
  color: #f0f0f0 !important;              /* keeps text light */
  border-color: #e9d0a5;                  /* optional: subtle highlight */
  transition: all 0.2s ease;
}

.kw-tab .tab-label {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 2px;
  display: block;
}

.kw-tab .tab-sub {
  font-size: 0.85rem;
  color: #bbb;
	padding-bottom: 1px; /* reduce from default */
}

/* 101 Series Tab Grid */
.kw-tab-container.kw-tab-101 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 4px auto 12px auto; /* Much smaller top & bottom margin */
  max-width: 700px;
}

.kw-tab-container.kw-tab-101 .kw-tab {
  background-color: #333 !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 8px 4px 8px; /* Top, right, bottom, left — reduced bottom padding */
  min-height: 50px;
  font-size: 0.9rem;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.kw-tab-container.kw-tab-101 .kw-tab:hover {
  background-color: #555 !important;
  border-color: #666;
}

.kw-tab-container.kw-tab-101 .tab-label {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0px; /* remove vertical space under the label */
  display: block;
  color: #e9d0a5 !important;
}

.kw-tab-container.kw-tab-101 .tab-sub {
  font-weight: 500;
  font-size: 0.8rem;
  color: #b97e35 !important;
  line-height: 1.1; /* tighter spacing */
  margin-top: 0.2em;
}

.kw-tab {
  display: inline-block;
  /* common styles: padding, font, background, etc. */
  text-align: center;
  text-decoration: none;
  /* add hover, active, etc. if needed */
}

.special-tab {
  color: #ca952e; /* or any color you want */
}

.special-tab a {
  color: inherit; /* ensure anchor adopts button color */
  text-decoration: none;
}

/* Special color for E-voice tab */
.kana-tabs .evoice-tab {
  background-color: #896011;  /* kakishibu orange */
  color: bisque;                /* black text */
  font-weight: normal;
}

.kana-tabs .evoice-tab:hover {
  filter: brightness(1.1);
}

.kana-tabs .jvoice-tab {
  background-color: #5d7317;  /* olive green */
  color: #fff8e1;             /* soft ivory or light cream */
  font-weight: normal;
}

.kana-tabs .jvoice-tab:hover {
  filter: brightness(1.1);
}

/* Subtext style (e.g., 101) */
.kw-tab-container.kw-tab-101 .tab-sub {
  font-weight: 500;
  font-size: 0.8rem;
  color: #b97e35 !important;
}

.spin9 .kw-tab-container {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 30px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.kanji-single .kw-tab-container {
  display: flex;
  justify-content: center;  /* or flex-end for right alignment */
  gap: 12px;
  margin: 16px 0 0px;
  flex-wrap: wrap;
}

/* Top Visual Image */
.kanji-top-image {
  width: 100%;
  max-width: 480px;
  border-radius: 8px;
  display: block;
  margin: 12px auto;
  cursor: pointer;
}
.search-box {
  margin-top: 40px;
  text-align: center;
  position: relative;
  z-index: 5;
}

.search-box form {
  display: inline-flex;          /* aligns input + button horizontally */
  justify-content: center; 
  align-items: center;
  gap: 8px;                      /* spacing between input and button */
}

.search-box input[type="text"] {
  font-size: 1em;
  padding: 8px;
  width: 180px;
  box-sizing: border-box;
}

.search-box input[type="submit"] {
  font-size: 1em;
  padding: 8px 16px;
  background-color: #d2903c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.3s ease;
}

.search-box input[type="submit"]:hover {
  background-color: #b77a2f;
}

.search-bar-container {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  text-align: center;
  position: relative;
  z-index: 5;
}

.advanced-tab {
  background-color: #4a1a00;
  color: white;
  padding: 5px 15px;
  border: 1px solid #333;
  border-radius: 4px;
  text-decoration: none;
  font-size: 1em;
  transition: background-color 0.3s ease;
}

.advanced-tab:hover {
  background-color: #9c2f0a;
  border-color: #888;
}

/* Optional: Add hover/focus style for better UX */
#kanji-search:focus {
  outline: none;
  border-color: #666;
}

/* Search results area */
#search-results {
  margin-top: 20px;
  padding: 10px;
}

/* Mobile responsiveness */
@media screen and (max-width: 480px) {
  .search-box {
    margin-top: 20px;
    margin-bottom: 0px;
  }

  #kanji-search {
    width: 120px;
  }
}

#search-results a:hover img {
  transform: scale(1.05);
  transition: 0.2s ease;
  border-color: #e9d0a5;
}

.search-heading {
  text-align: center;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 1.6em;
  color: #f0f0f0;
  font-weight: 400;
  margin: 0px;  /* tighter top + bottom spacing */
  letter-spacing: 0.02em;
}

/* === Kanji Road Animation (Top Page) === */
.kanji-road {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  align-items: center;
  height: 60px;
  background: #000;
  overflow: hidden;
  position: relative;
  margin-top: 30px;     /* Add or adjust this */
  margin-bottom: 0px;  /* Match the top margin */
}

.kanji-img {
  width: 60px;
  height: 60px;
  opacity: 0;
  transform: translateX(200px);
  animation: slideInLeft 0.8s ease forwards;
}

@keyframes slideInLeft {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.kanji-hint {
  color: antiquewhite;
  text-align: center;
  font-size: 16px;
  opacity: 0;
  transition: opacity 4s ease;
  margin-top: 5px;
}
.kanji-hint.show {
  opacity: 1;
}

.kanji-search-box {
  margin: 30px auto;
  text-align: center;
}

.kw-input {
  font-size: 1.2em;
  padding: 0.4em 0.8em;
  border: none;
  border-radius: 6px;
  background-color: #fff;
  color: #000;
  width: 160px;
  margin-right: 10px;
  outline: none;
}

.search-result {
  margin-top: 20px;
  text-align: center;
  font-size: 1.1em;
  color: #fff;
}

:root {
  --kw-gold: #ca952e;
  --kw-gold-soft: #e5b875;
  --kw-brown: #5a2d0c;
  --kw-dark: #1a0c00;
  --kw-beige: #f4e3c0;
  --kw-bg: #000000;
  --kw-text-light: #eeeeee;
  --kw-subtle: #999999;
  --kw-gradient: linear-gradient(to right, #b77c3c, #5a2d0c);
}

/* Banner */
.kw-header {
  background: var(--kw-gradient);
  color: var(--kw-text-light);
  padding: 1em;
  text-align: center;
}

/* Logo Styling */
.kw-logo {
  font-weight: bold;
}
.kw-logo .kanji {
  color: var(--kw-gold);
}
.kw-logo .world {
  color: #ddd;
}

/* What - Why - How */
.kw-tab-container.kw-tab-home {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;  /* spacing between buttons */
  margin-bottom: 0.6em;
}

.kw-tab {
  flex: 1 1 calc(33.333% - 10px); /* 3 in a row with gap */
  max-width: 300px;
  background: var(--kw-brown);
  color: var(--kw-text-light);
  border: 1px solid #333;
  padding: 0.6em 0.6em;
  border-radius: 6px;
  font-weight: bold;
  text-align: center;
  transition: background 0.3s ease;
  box-sizing: border-box;
}

.kw-tab:hover {
  background: var(--kw-gold);
  color: #000;
}

.tab-label {
  display: block;
  font-size: 1.05em;
}

.tab-sub {
  display: block;
  font-size: 0.8em;
  font-weight: normal;
  opacity: 0.9;
}

/* Search Box */
#kanji-search {
  background: #fff;
  color: #000;
  padding: 0.5em;
  border: none;
  border-radius: 4px;
}
#kanji-search:focus {
  outline: 2px solid var(--kw-gold);
}
.search-button {
  background: var(--kw-gold);
  color: #000;
  border: none;
  padding: 0.5em 1em;
  margin-left: 0.5em;
  border-radius: 4px;
  font-weight: bold;
}

.kanji-tabs {
  display: flex;
  justify-content: space-between;
  gap: 6px; /* slightly tighter gap */
  margin: 1.5em 0 1em;
}

.kanji-tabs a {
  flex: 1;
  text-align: center;
  background-color: #313b12;
  color: antiquewhite;
  border-radius: 16px;
  padding: 0.4em 0.2em; /* less vertical padding */
  font-size: 0.8rem; /* slightly smaller */
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
  border: 1px solid #333;
  white-space: nowrap; /* 💡 prevent line wrap */
}

.kanji-tabs a:hover {
  background-color: darkolivegreen;
  color: #000;
}

.kanji-tabs a:nth-child(1) { flex: 1; }      /* Home */
.kanji-tabs a:nth-child(2) { flex: 1.4; }    /* Listen & Learn */
.kanji-tabs a:nth-child(3) { flex: 1; }      /* Spin 9 */

/* Footer */
.footer {
  color: var(--kw-gold);
  text-align: center;
  padding: 1em;
  font-size: 0.9em;
}
.footer .world {
  color: #aaa;
}

.evoice-btn {
  background-color: #9c6a17; /* matched to the E-voice button */
  border: none;
  border-radius: 6px;
  padding: 0.5em 1.2em;
  color: #fff;
  font-weight: normal;
  cursor: pointer;
}

table.howto {
  width: 100%;
  max-width: 480px;
  border-collapse: collapse;
  margin: 1em auto;
  border: 1px solid #333;
  font-size: 0.9rem;
  color: #999;
}

table.howto td {
  border: 1px solid #333;
  padding: 10px;
  vertical-align: middle;
}

table.howto img {
  display: block;
  margin: 0 auto;
}

.howto td img {
  display: inline-block;
  vertical-align: middle;
}

.kw-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: -1em;
  margin-bottom: 0;
	margin-left: 0.5em;
	margin-right: 0.5em;
}

.kw-title {
  font-size: 1.1em;        /* reduced from 1.2em */
  font-weight: bold;
}

.sitemap a {
  font-size: 0.85em;
  color: #ca952e;
  text-decoration: none;
}

.sitemap a:hover {
  text-decoration: none;
	color: #fff;
}