/* 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;
	color: #b8860b;
}

.spacer-neg10 {
  margin-top: -10px;
}

.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;
}

.kanji-box {
  width: 50px;
  height: 50px;
  float: left;
  margin: 0 12px 8px 0;
  border: 1px solid #444;
  border-radius: 8px;
  background: #000;
  padding: 6px;
}

.kanji-box2 {
  width: 75px;
  height: 50px;
  float: left;
  margin: 0 12px 8px 0;
  border: 1px solid #444;
  border-radius: 8px;
  background: #000;
  padding: 6px;
}

/* 3 x 2 grid */
.kanji-grid-3x2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  row-gap: 6px;
  column-gap: 10px;
  margin: 10px 0;
  padding: 0 10px;
  text-align: center;
}

/* Shared button base styles */
.full-btn,
.pick9-btn {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 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: 38px;
  background: #e9d0a5 !important;
  color: #222;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px 10px 0 0;
  margin-bottom: -4px;
}

/* Bottom button: Pick 9 - rounded bottom only */
.pick9-btn {
  height: 23px;
  background: #b97e35;                /* original warm brown-orange */
  color: #222;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 0 0 10px 10px;
  margin-top: 0px;
  border: none;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  padding: 3px 0;
}

.pick9-subtext {
  font-size: 0.75rem;
  color: #555;
  margin-top: 1px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Hover effect (optional) */
.full-btn:hover,
.pick9-btn:hover {
  filter: brightness(1.05);
}

.pick9-mini {
  height: 32px;
  background: #b97e35;
  color: wheat;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  border-radius: 0 0 10px 10px;
  border: none;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pick9-mini:hover {
  filter: brightness(1.1);
  border: 1px solid #fea701;
}

.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: 38px !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: 600;
  font-size: 0.9rem;
  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: 600;
}

.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: 25px;
  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 12px;
  background-color: #b67c18;
  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: #895602;
  color: antiquewhite;
  padding: 4px 8px 1px 8px;
  border: 1px solid #333;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9em;
  transition: background-color 0.3s ease;
}

.advanced-tab:hover {
  background-color: #573701;
  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: 10px;              /* smaller gap for 7 images */
  align-items: center;
  height: 45px;           /* adjust if needed */
  background: #000;
  overflow: hidden;
  position: relative;
  margin-top: 15px;
  margin-bottom: 0px;
}

.kanji-img {
  width: 35px;
  height: 35px;
  opacity: 0;
  transform: translateX(200px);
  animation: slideInLeft 0.8s ease forwards;
}

@keyframes slideInLeft {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .kanji-road {
    flex-wrap: wrap;
    height: auto;               /* allow it to grow */
    padding: 10px 0;
  }
}

.kanji-hint {
  color: sandybrown;                /* Slightly crisper than antiquewhite */
  text-align: center;
  font-size: 13px;            /* Smaller to match the reduced icon size */
  line-height: 1.4;
  opacity: 0.2;
  transition: opacity 4s ease; /* Slightly faster appearance */
  margin-top: 4px;             /* Tighter vertical spacing */
  font-style: italic;          /* Optional: gives it a softer hint-like tone */
}

.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.8em 0 1em;
}

.kanji-tabs a {
  flex: 1;
  text-align: center;
  background-color: #313b12;
  color: antiquewhite;
  border-radius: 10px;
  padding: 0.2em 0.2em; /* less vertical padding */
  font-size: 1.0rem; /* 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 {
  flex: 1;
  /* ... other styles stay the same */
}

/* 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;
}

.radical-tab {
  background-color: #3a4420;
  color: white;
  font-size: 0.9rem;
  padding: 7px 7px 5px;
  text-decoration: none;
  border-radius: 5px;
	border: 1px solid #555;
  display: inline-block;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
  transition: filter 0.2s ease;
}

.radical-tab:hover {
  background-color: #667f3c; /* slightly brighter olive green */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transform: scale(1.04);
}

.radical-tab ruby rt {
  font-size: 0.65em;
  color: #eee;
}

.kw-tab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 480px;
  margin: 10px auto;
  text-align: center;
}

.kw-tab {
  background: linear-gradient(to bottom, #0e1c0a, #263a0f);
  color: #f1e2c5 !important; /* beige top label */
  border-radius: 8px;
  padding: 10px 8px;
  cursor: pointer;
  border: 1px solid #2e3f1a;
  font-family: inherit;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.kw-tab:hover {
  background: linear-gradient(to bottom, #1a3015, #345c1f);
  transform: scale(1.04);
}

.kw-tab .tab-label {
  font-size: 1.1em;
  font-weight: bold;
  display: block;
  line-height: 1.0; /* reduce default spacing */
  margin-top: 8px;  /* was 4px or 2px */
  margin-bottom: 1px; /* explicitly collapse space if needed */
}

.kw-tab .tab-sub {
  font-size: 0.95em;
  color: #ca952e;
  margin-top: 8px;  /* was 4px or 2px */
  margin-bottom: 2px; /* explicitly collapse space if needed */
  display: block;
  line-height: 1.2;
}

.kw-tab a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.search-bar-container input[type="text"] {
  width: 140px!important;
  padding: 8px 10px;
  font-size: 1rem;
  border-radius: 6px;
  border: none;
  margin-right: 8px;
  box-sizing: border-box;
}

.search-bar-container input[type="submit"] {
  padding: 8px 12px;
  font-size: 1rem;
  font-weight: 500;
  background-color: #ca952e;
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  box-sizing: border-box;
}

/* Radical Exp tab */
.radex-tab {
  background-color: #40576f;   /* flat blue for consistency */
  color: #fff !important;
  padding: 8px 0;
  border-radius: 6px;
  flex: 1 1 0;                 /* equal width with others */
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radex-tab:hover {
  background-color: #506a87;
}

.kanji-tabs a.radex-tab {
  background-color: #40576f !important;
  color: #fff !important;
}
.kanji-tabs a.radex-tab:hover {
  background-color: #506a87 !important;
}

/* Simple bottom nav, all white, spread across */
.footer-icons {
  display: flex;
  justify-content: space-around;  /* spreads icons wider */
  margin: 30px 0 5px;  /* reduce bottom margin */
}

.footer-icons a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: white;
}

.footer-icons i {
  font-size: 1.8rem;   /* ~20% larger */
  margin-bottom: 3px;
  color: #9da93a;      /* Spin 9 orange */
}

.footer-icons span {
  font-size: 0.75rem; 
  color: #f4e3c1;      /* Level tab beige */
}

.radical-tabs a[href="../find.html"] {
  background-color: #ca952e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.radical-tabs a[href="../find.html"]:hover {
  background-color: #e0a84c;
}

.search-status {
  margin: 10px auto 16px;
  text-align: center;
  font-size: .95rem;
  color: #c9d1a7;
  min-height: 1.2em;
}
.search-status.is-loading { color: #e0c27a; }
.search-status .dot {
  display:inline-block; width:.6em; height:.6em; border-radius:50%;
  background: currentColor; opacity:.7; margin-right:.4em;
  animation: sr-pulse 1s ease-in-out infinite;
}
@keyframes sr-pulse { 0%{transform:scale(.6);opacity:.4} 50%{transform:scale(1);opacity:1} 100%{transform:scale(.6);opacity:.4} }

/* Base tab style */
.kanji-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  margin: 0 4px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  color: black;
}

/* Radical Exp (blue) */
.kanji-tabs a.radex-tab {
  background-color: #446688;
  color: #fff;
}
.kanji-tabs a.radex-tab:hover {
  background-color: #5a7ca1;
}

/* E-voice (orange) */
.kanji-tabs a.evoice-tab {
  background-color: #ca952e;
  color: black;
}
.kanji-tabs a.evoice-tab:hover {
  background-color: #e0aa40;
}

/* Search (green) */
.kanji-tabs a.search-tab {
  background-color: #7b8b4a;
  color: #fff;
}
.kanji-tabs a.search-tab:hover {
  background-color: #90a65a;
}

/* Default tab style */
.kanji-tabs a,
.kana-tab {
  color: goldenrod;   /* font */
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
}

/* Hover state */
.kanji-tabs a:hover,
.kana-tab:hover {
  color: #ca952e;   /* kakishibu orange on hover */
}

a[href="../find.html"] i.fa-magnifying-glass {
  color: black !important;
}

/* Tagline Block */
.tagline {
  text-align: center;
  margin: 0 0 25px;
  line-height: 1.6;
}

/* Japanese tagline */
.tagline-jp {
  font-size: 1.2em;
  font-weight: 600;
  color: #7b8b4a;   /* olive green */
  margin: 0;
  letter-spacing: 0.05em;
}

/* English tagline */
.tagline-en {
  font-size: 0.85em;       /* slightly smaller for small screens */
  font-weight: 300;
  font-style: italic;
  color: #d2e4b6;          /* lighter gray for balance */
  margin: 2px 10px 0;      /* add side padding + small gap above */
  letter-spacing: 0.02em;
  line-height: 1.4;        /* improve readability on 2-line wrap */
}

.center-tab.kfr-tab {
  background: #6a5a8c;  /* purple example */
  color: #fff;
}
.center-tab.kfr-tab:hover {
  background: #7c6ca1;
}