/* KW-dynamic.css – for Kanji World */
@charset "UTF-8";

body {
  background: #000 !important;
  color: #fff;
  font-family: sans-serif;
  text-align: center;
  padding: 20px;
}

/* heading */
h1 {
  font-size: 1.6em;
  margin: 0.4em 0 0.6em 0;
  color: burlywood;
  text-align: center;
}

.kanji-page-label {
  text-align: center;
  font-size: 0.9rem;
  color: burlywood; /* warm tone to match "Kanji" logo */
  margin: 0.5rem 0 0.8rem;
  font-weight: 500;
}

.kanji-subtitle {
  font-size: 0.95em;
  color: #7b8b4a;
  font-style: italic;
  margin-top: -1em;
  margin-bottom: 0.8em;
}

/* grid: 3 x 3 Kanji */
.kanji-random09 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  justify-content: center;
  max-width: 360px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.kanji-box {
  background-color: #000 !important;
  padding: 1.2rem;
  border-radius: 10px;
  border: 2px solid #333;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s;
}

.kanji-box:hover {
  transform: scale(1.05);
  border-color: #d4a017;
}

/* image style inside box (if used) */
.kanji-box img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #000;
  border-radius: 6px;
  transition: transform 0.2s;
  cursor: pointer;
}

.kanji-box img:hover {
  transform: scale(1.08);
}

/* Random 4 */
.kanji-random04 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  justify-content: center;
  max-width: 320px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.kanji-box:hover {
  transform: scale(1.05);
  border-color: #d4a017;
}

/* bottom New 9 */
.kanji-square-refresh {
  margin: 2em auto;
  display: block;               /* centers the button */
	width: 80%;
  max-width: 300px; /* optional cap for large screens */
  padding: 0.7em 1.5em;
  font-size: 1.1em;
  font-weight: bold;
  background-color: darkgoldenrod;
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease, transform 0.2s;
}

.kanji-square-refresh:hover {
  background-color: #b8860b;
  transform: scale(1.05);
}

.kanji-search-form {
  display: flex;
  flex: 2;
  gap: 0.5rem;
}

.kanji-search-form input[type="text"] {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.9em;
  border-radius: 4px;
  border: none;
}

.kanji-search-form button {
  padding: 0.5rem 0.8rem;
  background: #333;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}

.kanji-search-form button:hover {
  background: #555;
}

.kanji-square-refresh {
  padding: 0.6rem;
  font-size: 1.1em;
  font-weight: bold;
  background-color: darkgoldenrod;
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}

.kanji-square-refresh:hover {
  background-color: #a6761d;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .kanji-random09 {
    gap: 1rem;
    padding: 0 0.5rem;
  }

  .kanji-box {
    padding: 1rem;
  }

  .kanji-bottom-bar {
    flex-direction: column;
    gap: 0.8rem;
    padding: 0 1rem;
  }

  .kanji-search-form {
    flex-direction: column;
    gap: 0.5rem;
  }

  .kanji-search-form input,
  .kanji-search-form button,
  .kanji-square-refresh {
    width: 100%;
  }
}

.kanji-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding: 0 4px;
}

.kanji-grid a {
  display: block;
  width: 12%;           /* about 8 per row on large screens */
  max-width: 50px;
  min-width: 40px;
}

.kanji-grid img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 600px) {
  .kanji-grid a {
    width: 16.6%;        /* 6 per row on small screens */
    max-width: 43px;
  }
}

.kw-tab-container {
  display: flex;
  justify-content: center;
  gap: 1.2rem; /* space between buttons */
  margin-top: 1.5rem; /* optional: adds vertical space */
  flex-wrap: wrap; /* allows wrapping on small screens */
}

.kanji-related {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 2em;
  margin-bottom: 2em;
}

/* Related Kanji */
.related-kanji-img {
  width: 80px;
  height: 80px;
  border: 1px solid #444;
  border-radius: 6px;
  transition: transform 0.2s ease;
}

.related-kanji-img:hover {
  transform: scale(1.08);
}

#kana-grid {
  width: 80%;
  margin: 0 auto;
}

.kana-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0px;
  flex-wrap: wrap;
}

.kana-card {
  width: 16%;
  text-align: center;
  font-family: sans-serif;
}

.kana-img {
  width: 30px;
  max-width: 40px;  /* adjust as needed */
  height: auto;
  margin-bottom: 0;
}

.kana-label {
  width: 4%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8em;
  font-weight: bold;
  color: #c88a2c;
  font-family: sans-serif;
  margin-right: 7%;    /* horizontal spacing */
  margin-bottom: 7px;     /* vertical spacing between rows */
}

.kana-caption {
  font-size: 1em;
  line-height: 1.2em;
}

.level-label {
  color: #b8860b;
  font-size: 1.4em;
  text-align: center;
  margin: 1em auto 0.3em;  /* reduced vertical spacing */
}

.map-grid {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  margin: 1em auto 1.5em;
}

.map-grid a {
  display: inline-block;
  padding: 0.2em 0.6em;
  font-size: 0.8em;
  border: 1px solid #777;
  color: #eee;
  background: #000;
  border-radius: 2px;
  text-decoration: none;
  text-align: center;
  min-width: 70px;
  box-sizing: border-box;
  transition: background 0.2s, transform 0.2s;
}

.map-grid a:hover {
  background: #b8860b;
  transform: scale(1.03);
}

.level-label a {
  color: olive;
  text-decoration: none;
}

.level-label a:hover {
  text-decoration: none;
  color: orange;
}

.radical-two-col {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  margin: 30px 0;
}

.radical-left {
  flex: 0 0 auto;
  text-align: center;
}

.radical-meaning {
  margin-top: 1rem;
  font-size: 1rem;
  color: #fff;
}

.radical-right {
  max-width: 420px;
  font-size: 1rem;
  line-height: 1.5;
  color: #fff;
}

.radical-right p {
  margin: 0;
}