.goshuin-game {
  --gj-ink: var(--color-primary-text, rgba(0, 0, 0, 0.9));
  --gj-ink-soft: var(--color-secondary-text, rgba(0, 0, 0, 0.64));
  --gj-accent: var(--ghost-accent-color);
  --gj-indigo: var(--gj-accent);
  --gj-vermilion: var(--gj-accent);
  --gj-vermilion-dark: color-mix(in srgb, var(--gj-accent) 80%, var(--gj-ink));
  --gj-cream: var(--background-color, #fff);
  --gj-paper: color-mix(in srgb, var(--gj-cream) 97%, var(--gj-ink) 3%);
  --gj-surface: color-mix(in srgb, var(--gj-cream) 94%, var(--gj-ink) 6%);
  --gj-game-background: #fff;
  --gj-game-radius: 28px;
  --gj-line: var(--color-border, rgba(0, 0, 0, 0.16));
  --gj-shadow: 0 18px 52px rgba(0, 0, 0, 0.09);
  border-radius: var(--gj-game-radius);
  background: var(--gj-game-background);
  color: var(--gj-ink);
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif);
  margin-top: 3rem;
}

.goshuin-login-placeholder {
  display: flex;
  min-height: 300px;
  margin-top: 3rem;
  padding: 4rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-lighter-gray);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.goshuin-login-placeholder:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.goshuin-login-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  color: var(--color-secondary-text);
}

.goshuin-login-icon {
  display: flex;
  width: 80px;
  height: 80px;
  align-items: center;
  justify-content: center;
  border: 3px double rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: var(--ghost-accent-color, #a7312a);
  box-shadow: 0 9px 24px rgba(167, 49, 42, 0.22);
  color: #fff;
  font-family: var(--font-serif, Georgia, "Times New Roman", serif);
  font-size: 2.4rem;
  font-weight: 700;
}

.goshuin-login-title {
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
  font-weight: 500;
}

.goshuin-login-subtitle {
  max-width: 400px;
  opacity: 0.7;
  font-size: 1.4rem;
  line-height: 1.5;
}

.goshuin-login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.goshuin-game *,
.goshuin-game *::before,
.goshuin-game *::after {
  box-sizing: border-box;
}

.gj-app {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--gj-line);
  border-radius: var(--gj-game-radius);
  background: var(--gj-game-background);
  box-shadow: var(--gj-shadow);
}

.gj-app::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

.gj-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(390px, 0.8fr);
  gap: 28px;
  align-items: center;
  padding: 30px 34px 24px;
  background: var(--gj-game-background);
  border-bottom: 1px solid var(--gj-line);
}

.gj-brand {
  display: flex;
  min-width: 0;
  gap: 18px;
  align-items: center;
}

.gj-brand img {
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px color-mix(in srgb, var(--gj-accent) 18%, transparent));
}

.gj-brand h2,
.gj-route-intro h3,
.gj-section-heading h3,
.gj-next-card h3,
.gj-dialog h3,
.gj-achievement h4,
.gj-passport-chapter h4,
.gj-stamp-card h5 {
  margin: 0;
  color: var(--gj-ink);
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif);
}

.gj-brand h2 {
  margin-top: 3px;
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.gj-brand p {
  margin: 7px 0 0;
  max-width: 64ch;
  color: var(--gj-ink-soft);
  font-size: 1.35rem;
  line-height: 1.45;
}

.gj-kicker {
  display: block;
  color: var(--gj-vermilion-dark);
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  line-height: 1.35;
  text-transform: uppercase;
}

.gj-player-status {
  display: grid;
  min-width: 0;
  gap: 11px;
}

.gj-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.gj-stats div {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid var(--gj-line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--gj-cream) 88%, transparent);
  text-align: center;
}

.gj-stats span,
.gj-stats strong {
  display: block;
}

.gj-stats span {
  margin-bottom: 2px;
  color: var(--gj-ink-soft);
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}

.gj-stats strong {
  overflow: hidden;
  color: var(--gj-indigo);
  font-size: 1.6rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gj-xp-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
  padding-inline: 3px;
}

.gj-xp-value {
  display: flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 7px;
  color: var(--gj-ink-soft);
  font-size: 1.4rem;
}

.gj-xp-value strong {
  color: var(--gj-indigo);
  font-size: 1.4rem;
}

.gj-level-track {
  flex: 1 1 auto;
  min-width: 80px;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--gj-accent) 10%, transparent);
}

.gj-level-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gj-accent);
  transition: width 300ms ease;
}

.gj-tabs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px 0;
}

.gj-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid var(--gj-line);
  border-radius: 12px;
  color: var(--gj-ink);
  background: var(--gj-cream);
  font: inherit;
  font-size: 1.4rem;
  font-weight: 500;
  opacity: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: box-shadow 200ms ease, transform 200ms ease, background 200ms ease;
}

.gj-tabs button:hover {
  color: var(--gj-ink);
  background: var(--gj-surface);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.gj-tabs button.is-active {
  color: var(--gj-ink);
  border-color: var(--gj-line);
  background: var(--gj-cream);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.gj-tabs .filter-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.gj-tabs .filter-label {
  font-size: 1.4rem;
  font-weight: 500;
}

.gj-main {
  position: relative;
  outline: none;
  padding: 22px 26px 32px;
}

.gj-chapter-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-bottom: 20px;
}

.gj-chapter-picker button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-height: 70px;
  padding: 10px 14px 10px 11px;
  border: 1px solid var(--gj-line);
  border-radius: 17px;
  color: var(--gj-ink);
  background: color-mix(in srgb, var(--gj-paper) 86%, transparent);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.gj-chapter-picker button:not(:disabled):hover {
  border-color: var(--chapter-accent);
}

.gj-chapter-picker button.is-active {
  border-color: var(--chapter-accent);
  background: var(--gj-paper);
  box-shadow: 0 9px 24px rgba(36, 50, 62, 0.08);
}

.gj-chapter-picker button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.56;
}

.gj-chapter-picker button > span:nth-child(2) {
  min-width: 0;
}

.gj-chapter-picker small,
.gj-chapter-picker strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gj-chapter-picker small {
  color: var(--gj-ink-soft);
  font-size: 1.2rem;
}

.gj-chapter-picker strong {
  margin-top: 2px;
  font-size: 1.4rem;
}

.gj-chapter-picker b {
  color: var(--chapter-accent);
  font-size: 1.3rem;
}

.gj-chapter-order {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--chapter-accent);
  font-family: var(--font-sans, sans-serif);
  font-size: 1.5rem;
  font-weight: 800;
}

.gj-route-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: 28px;
  align-items: end;
  margin: 2px 4px 16px;
  padding-left: 15px;
  border-left: 4px solid var(--chapter-accent);
}

.gj-route-intro h3,
.gj-section-heading h3 {
  margin-top: 3px;
  font-size: clamp(2rem, 2.5vw, 3rem);
  line-height: 1.1;
}

.gj-route-intro p,
.gj-section-heading > p {
  margin: 0;
  color: var(--gj-ink-soft);
  font-size: 1.2rem;
  line-height: 1.55;
}

.goshuin-game .gj-achievement-heading {
  display: block;
  margin: 5px 5px 20px;
}

.goshuin-game .gj-achievement-heading .section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
  color: var(--gj-ink);
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: left;
}

.goshuin-game .gj-achievement-heading .achievement-summary {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--gj-ink-soft);
  font-family: var(--font-sans, sans-serif);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.3;
  text-align: right;
  white-space: nowrap;
}

.gj-route-intro > p {
  max-width: 44ch;
  justify-self: end;
  text-align: right;
}

.gj-journey-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: stretch;
}

.gj-map-card,
.gj-next-card {
  border: 1px solid var(--gj-line);
  border-radius: 22px;
  background: var(--gj-paper);
  box-shadow: 0 14px 36px rgba(43, 55, 65, 0.09);
}

.gj-map-card {
  min-width: 0;
  overflow: hidden;
  padding: 0;
}

.gj-map-stage {
  position: relative;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  aspect-ratio: 1672 / 941;
  border-radius: 21px;
  background: #f3eadc;
}

.gj-map-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gj-map-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(19, 49, 63, 0.02) 60%, rgba(20, 38, 48, 0.28));
}

.gj-map-caption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 7px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  color: var(--gj-indigo);
  background: color-mix(in srgb, var(--gj-paper) 92%, transparent);
  box-shadow: 0 7px 20px rgba(20, 35, 44, 0.18);
  font-size: 1rem;
  font-weight: 750;
}

.gj-map-caption span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--gj-vermilion);
  font-family: "Noto Sans JP", var(--font-sans, sans-serif);
}

.gj-map-marker {
  position: absolute;
  z-index: 4;
  left: var(--x);
  top: var(--y);
  display: grid;
  justify-items: center;
  border: 0;
  color: var(--gj-ink);
  background: transparent;
  font: inherit;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.gj-map-marker > span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 4px solid #fff;
  border-radius: 50% 50% 50% 12%;
  color: #fff;
  background: var(--gj-indigo);
  box-shadow: 0 6px 16px rgba(20, 32, 43, 0.35);
  font-size: 1.3rem;
  font-weight: 850;
  transform: none;
  transition: transform 180ms ease;
}

.gj-map-marker small {
  max-width: 150px;
  margin-top: 7px;
  padding: 4px 8px;
  overflow: hidden;
  border-radius: 7px;
  color: var(--gj-ink);
  background: color-mix(in srgb, var(--gj-paper) 94%, transparent);
  box-shadow: 0 4px 14px rgba(19, 32, 42, 0.2);
  font-size: 0.92rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gj-map-marker:hover > span {
  transform: scale(1.12);
}

.gj-map-marker.is-collected > span {
  background: var(--gj-vermilion);
  font-family: "Noto Sans JP", var(--font-sans, sans-serif);
}

.gj-map-marker.is-unlocked > span {
  animation: gj-pulse 2.2s ease-in-out infinite;
}

.gj-map-marker.is-locked {
  cursor: not-allowed;
  opacity: 0.68;
}

.gj-map-marker.is-locked > span {
  background: #6f7d83;
  filter: grayscale(1);
}

.gj-player {
  position: absolute;
  z-index: 5;
  left: var(--x);
  top: var(--y);
  width: clamp(24px, 2.2vw, 34px);
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 6px 6px rgba(28, 41, 48, 0.26));
}

.gj-player img {
  display: block;
  width: 100%;
  height: auto;
}

.gj-next-card {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  padding: 23px;
}

.gj-next-card::before {
  position: absolute;
  right: -35px;
  top: -50px;
  width: 145px;
  height: 145px;
  border: 24px solid color-mix(in srgb, var(--chapter-accent) 16%, transparent);
  border-radius: 50%;
  content: "";
}

.gj-next-number {
  margin: 10px 0 2px;
  color: color-mix(in srgb, var(--chapter-accent) 22%, transparent);
  font-family: var(--font-sans, sans-serif);
  font-size: 6.4rem;
  font-weight: 900;
  line-height: 0.92;
}

.gj-next-card .gj-japanese {
  margin: 10px 0 4px;
  color: var(--gj-vermilion-dark);
  font-size: 1.15rem;
}

.gj-next-card h3 {
  font-size: 2.25rem;
  line-height: 1.08;
}

.gj-next-card > p:not(.gj-japanese) {
  margin: 5px 0 15px;
  color: var(--gj-ink-soft);
}

.gj-event-chip {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--chapter-accent) 32%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--chapter-accent) 7%, white);
}

.gj-event-chip > span,
.gj-event-note > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--gj-vermilion);
  font-family: "Noto Sans JP", var(--font-sans, sans-serif);
  font-size: 1.4rem;
  font-weight: 850;
}

.gj-event-chip small,
.gj-event-chip strong {
  display: block;
}

.gj-event-chip small {
  color: var(--gj-ink-soft);
  font-size: 1.1rem;
}

.gj-event-chip strong {
  margin-top: 1px;
  font-size: 1.3rem;
}

.gj-button {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: var(--font-sans, sans-serif);
  font-size: 1.6rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.gj-button:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.gj-button-primary {
  border-color: var(--gj-accent);
  color: #fff;
  background: var(--gj-accent);
}

.gj-button-primary:hover {
  color: #fff;
  background: var(--gj-accent);
}

.gj-button-secondary {
  border-color: var(--gj-line);
  color: var(--gj-ink);
  background: var(--gj-paper);
  font-weight: 500;
}

.gj-route-progress {
  margin-top: auto;
  padding-top: 19px;
}

.gj-route-progress > div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--gj-ink-soft);
  font-size: 1.4rem;
}

.gj-route-progress > div strong {
  font-size: 1.6rem;
}

.gj-route-progress > span {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--gj-accent) 10%, transparent);
}

.gj-route-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gj-accent);
}

.gj-stop-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.gj-stop-list button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--gj-line);
  border-radius: 14px;
  color: var(--gj-ink);
  background: color-mix(in srgb, var(--gj-paper) 88%, transparent);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gj-stop-list button:not(:disabled):hover {
  border-color: color-mix(in srgb, var(--gj-accent) 48%, transparent);
  background: var(--gj-paper);
}

.gj-stop-list button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.gj-stop-list button.is-collected {
  border-color: color-mix(in srgb, var(--gj-accent) 30%, transparent);
}

.gj-stop-order {
  color: var(--gj-vermilion);
  font-family: var(--font-sans, sans-serif);
  font-size: 2rem;
  font-weight: 800;
}

.gj-stop-list small,
.gj-stop-list strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gj-stop-list small {
  color: var(--gj-ink-soft);
  font-size: 1.2rem;
}

.gj-stop-list strong {
  font-size: 1.4rem;
}

.gj-stop-list strong {
  font-size: 1.08rem;
}

.gj-stop-list b {
  color: var(--gj-vermilion);
  font-family: "Noto Sans JP", var(--font-sans, sans-serif);
  font-size: 1.55rem;
}

.gj-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 25px;
  align-items: end;
  margin: 5px 5px 20px;
}

.gj-passport-book {
  display: grid;
  gap: 18px;
}

.gj-passport-chapter {
  overflow: hidden;
  border: 1px solid var(--gj-line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--gj-paper) 90%, transparent);
  box-shadow: 0 12px 32px rgba(43, 55, 65, 0.07);
}

.gj-passport-chapter > header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px dashed color-mix(in srgb, var(--chapter-accent) 35%, transparent);
  background: color-mix(in srgb, var(--chapter-accent) 8%, var(--gj-paper));
}

.gj-passport-chapter > header > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--chapter-accent);
  font-family: "Noto Sans JP", var(--font-sans, sans-serif);
  font-size: 1.45rem;
  font-weight: 800;
}

.gj-passport-chapter header small {
  color: var(--gj-ink-soft);
}

.gj-passport-chapter header h4 {
  margin-top: 1px;
  font-size: 1.55rem;
}

.gj-passport-chapter header b {
  color: var(--chapter-accent);
  font-size: 1.3rem;
}

.gj-stamp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gj-stamp-card {
  position: relative;
  min-height: 270px;
  padding: 19px;
  border-right: 1px dashed var(--gj-line);
  text-align: center;
}

.gj-stamp-card:last-child {
  border-right: 0;
}

.gj-stamp-card::before {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(41, 53, 63, 0.08);
  border-radius: 10px;
  content: "";
  pointer-events: none;
}

.gj-stamp-card > small {
  position: relative;
  color: var(--gj-ink-soft);
  letter-spacing: 0.12em;
}

.gj-stamp-mark {
  position: relative;
  display: grid;
  width: 112px;
  height: 112px;
  margin: 9px auto 5px;
  place-items: center;
}

.gj-stamp-mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.88;
  transform: rotate(var(--seal-rotation, -6deg));
}

.gj-stamp-mark b {
  position: relative;
  z-index: 1;
  color: rgba(143, 37, 32, 0.82);
  font-family: "Noto Sans JP", var(--font-sans, sans-serif);
  font-size: 2.5rem;
  transform: rotate(var(--seal-rotation, -6deg));
}

.gj-stamp-mark > span {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border: 1px dashed rgba(35, 63, 99, 0.22);
  border-radius: 50%;
  color: rgba(35, 63, 99, 0.3);
  font-family: "Noto Sans JP", var(--font-sans, sans-serif);
  font-size: 2rem;
}

.gj-stamp-card .gj-japanese {
  position: relative;
  margin: 0;
  color: var(--gj-vermilion-dark);
  font-size: 1rem;
}

.gj-stamp-card h5 {
  position: relative;
  margin-top: 3px;
  font-size: 1.3rem;
}

.gj-stamp-card > span:last-child {
  position: relative;
  color: var(--gj-ink-soft);
  font-size: 0.95rem;
}

.gj-stamp-card:not(.is-collected) {
  filter: grayscale(0.55);
  opacity: 0.68;
}

.achievement-stats-overview {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.goshuin-game .stats-card-achievement {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 3rem;
  border: 1px solid var(--gj-accent);
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gj-accent) 8%, var(--gj-paper)), color-mix(in srgb, #ff8c00 5%, var(--gj-paper)));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.goshuin-game .stats-card-achievement:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--gj-accent) 16%, transparent);
}

.goshuin-game .stats-card-icon {
  font-size: 3.6rem;
  line-height: 1;
}

.goshuin-game .stats-card-content {
  flex: 1;
  min-width: 0;
}

.goshuin-game .stats-card-value {
  color: var(--gj-ink);
  font-size: 3.2rem;
  font-weight: 750;
  line-height: 1;
}

.goshuin-game .stats-card-label {
  margin-top: 6px;
  color: var(--gj-ink-soft);
  font-size: 1.4rem;
  line-height: 1.2;
}

.goshuin-game .achievement-date {
  color: var(--gj-ink-soft);
}

.achievement-rarity-section {
  min-width: 0;
}

.rarity-section-title {
  display: none;
}

.achievement-rarity-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1.5rem;
}

.goshuin-game .rarity-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 1.5rem;
  border: 1px solid var(--gj-line);
  border-radius: 10px;
  background: var(--gj-paper);
  text-align: center;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.goshuin-game .rarity-card.common { --rarity-color: #718096; }
.goshuin-game .rarity-card.uncommon { --rarity-color: #48bb78; }
.goshuin-game .rarity-card.rare { --rarity-color: #4299e1; }
.goshuin-game .rarity-card.epic { --rarity-color: #9f7aea; }
.goshuin-game .rarity-card.legendary { --rarity-color: #f6ad55; }

.goshuin-game .rarity-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  content: "";
  background: var(--rarity-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: height 300ms ease;
}

.goshuin-game .rarity-card.legendary::before {
  background: linear-gradient(135deg, #f6ad55, #ed8936);
}

.goshuin-game .rarity-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.goshuin-game .rarity-card:hover::before {
  height: 8px;
}

.goshuin-game .rarity-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.goshuin-game .rarity-name {
  color: var(--gj-ink);
  font-size: 1.1rem;
  font-weight: 600;
}

.goshuin-game .rarity-progress-circle {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.goshuin-game .circular-chart {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0 auto;
}

.goshuin-game .circle-bg {
  fill: none;
  stroke: color-mix(in srgb, var(--gj-line) 55%, transparent);
  stroke-width: 2.8;
}

.goshuin-game .circle {
  fill: none;
  stroke: var(--rarity-color);
  stroke-width: 2.8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  animation: gj-progress 1s ease-out forwards;
}

.goshuin-game .percentage {
  fill: var(--gj-ink);
  font-size: 0.5em;
  font-weight: 700;
  text-anchor: middle;
}

.next-achievements-section {
  margin-bottom: 3rem;
}

.goshuin-game .subsection-title {
  margin: 0 0 1.5rem;
  color: var(--gj-ink);
  font-family: var(--font-sans, sans-serif);
  font-size: 1.8rem;
  font-weight: 600;
  text-align: center;
}

.next-achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.goshuin-game .achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.goshuin-game .next-achievement-card {
  overflow: hidden;
  border: 1px solid var(--gj-line);
  border-radius: 12px;
  background: var(--gj-paper);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.goshuin-game .next-achievement-card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.goshuin-game .achievement-progress-bar {
  position: relative;
  height: 4px;
  background: var(--gj-surface);
}

.goshuin-game .achievement-progress-fill {
  height: 100%;
  background: var(--gj-accent);
  transition: width 300ms ease;
}

.goshuin-game .next-achievement-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
}

.goshuin-game .next-achievement-content .achievement-icon {
  font-size: 3.2rem;
}

.goshuin-game .next-achievement-content .achievement-title {
  font-size: 1.6rem;
}

.goshuin-game .next-achievement-content .achievement-description {
  font-size: 1.3rem;
}

.goshuin-game .next-achievement-content .achievement-points {
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
}

.goshuin-game .achievement-info,
.goshuin-game .achievement-content {
  min-width: 0;
  flex: 1;
}

.goshuin-game .achievement-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  border: 1px solid var(--gj-line);
  border-radius: 12px;
  background: var(--gj-paper);
  transition: box-shadow 200ms ease;
}

.goshuin-game .achievement-card.unlocked {
  background: linear-gradient(135deg, color-mix(in srgb, #ffd700 10%, var(--gj-cream)), color-mix(in srgb, #ff8c00 10%, var(--gj-cream)));
}

.goshuin-game .achievement-card.locked {
  opacity: 0.5;
  filter: grayscale(1);
}

.goshuin-game .achievement-card.rarity-common {
  border-color: #718096;
  border-left: 4px solid #718096;
  --achievement-rarity: #718096;
}

.goshuin-game .achievement-card.rarity-uncommon {
  border-color: #48bb78;
  border-left: 4px solid #48bb78;
  --achievement-rarity: #48bb78;
}

.goshuin-game .achievement-card.rarity-rare {
  border-color: #4299e1;
  border-left: 4px solid #4299e1;
  --achievement-rarity: #4299e1;
}

.goshuin-game .achievement-card.rarity-epic {
  border-color: #9f7aea;
  border-left: 4px solid #9f7aea;
  --achievement-rarity: #9f7aea;
}

.goshuin-game .achievement-card.rarity-legendary {
  border-color: #f6ad55;
  border-left: 4px solid #f6ad55;
  background: linear-gradient(135deg, color-mix(in srgb, #f6ad55 7%, var(--gj-cream)), color-mix(in srgb, #ed8936 7%, var(--gj-cream)));
  --achievement-rarity: #f6ad55;
}

.achievements-tabs {
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid var(--gj-line);
  border-radius: 12px;
  background: var(--gj-paper);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.achievements-tabs:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.goshuin-game .tabs-header {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--gj-line);
  -webkit-overflow-scrolling: touch;
}

.goshuin-game .tab-button {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  min-height: 56px;
  padding: 1.5rem 2rem;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--gj-ink-soft);
  background: transparent;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.goshuin-game .tab-button:hover {
  background: var(--gj-surface);
}

.goshuin-game .tab-button.active {
  color: var(--gj-accent);
  border-bottom-color: var(--gj-accent);
  background: color-mix(in srgb, var(--gj-accent) 8%, transparent);
}

.goshuin-game .tab-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  color: var(--gj-ink-soft);
  background: var(--gj-surface);
  font-size: 1.2rem;
}

.goshuin-game .tab-button.active .tab-badge {
  color: #fff;
  background: var(--gj-accent);
}

.goshuin-game .tab-content {
  display: none;
  padding: 2rem;
}

.goshuin-game .tab-content.active {
  display: block;
}

.goshuin-game .achievement-card.unlocked:hover {
  box-shadow: 0 6px 16px color-mix(in srgb, var(--achievement-rarity) 30%, transparent);
}

.goshuin-game .achievement-icon {
  flex: 0 0 auto;
  font-size: 3.2rem;
  line-height: 1;
}

.goshuin-game .achievement-title {
  margin: 0 0 5px;
  color: var(--gj-ink);
  font-family: var(--font-sans, sans-serif);
  font-size: 1.6rem;
  font-weight: 600;
}

.goshuin-game .achievement-description {
  margin: 0;
  color: var(--gj-ink-soft);
  font-size: 1.3rem;
  line-height: 1.4;
}

.goshuin-game .achievement-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 5px 12px;
  margin-top: 0.8rem;
  padding: 0;
  color: var(--gj-ink-soft);
  font-size: 1.2rem;
}

.goshuin-game .achievement-points {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--gj-accent);
  background: color-mix(in srgb, var(--gj-accent) 10%, transparent);
  font-size: 1.2rem;
  font-weight: 600;
  white-space: nowrap;
}

.gj-dialog {
  width: min(860px, calc(100vw - 26px));
  max-height: min(880px, calc(100vh - 28px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--gj-line);
  border-radius: 24px;
  color: var(--gj-ink);
  background: #fff;
  box-shadow: 0 30px 90px rgba(20, 32, 44, 0.35);
}

html.gj-dialog-open,
body.gj-dialog-open {
  overflow: hidden;
}

.gj-dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.gj-dialog > div {
  padding: 28px;
}

.gj-dialog-close {
  position: sticky;
  z-index: 5;
  top: 13px;
  display: flex;
  width: 32px;
  height: 32px;
  margin-top: -49px;
  margin-right: 13px;
  margin-bottom: 0;
  margin-left: auto;
  padding: 8px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  color: var(--gj-ink-soft);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.gj-dialog-close:hover {
  color: var(--gj-ink);
  background: var(--color-lighter-gray);
}

[data-theme="dark"] .gj-dialog {
  background: var(--dark-surface-elevated);
}

[data-theme="dark"] .gj-dialog::backdrop {
  background: rgba(0, 0, 0, 0.9);
}

[data-theme="dark"] .gj-dialog-close {
  color: var(--color-secondary-text);
}

[data-theme="dark"] .gj-dialog-close:hover {
  color: var(--color-primary-text);
  background: var(--dark-surface);
}

.gj-dialog-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-right: 32px;
}

.gj-guide-avatar {
  display: grid;
  width: 66px;
  height: 66px;
  flex: 0 0 auto;
  overflow: hidden;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--gj-accent) 18%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--gj-accent) 7%, var(--gj-paper));
}

.gj-guide-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.gj-dialog-hero h3 {
  margin-top: 3px;
  font-size: 2.1rem;
  line-height: 1.1;
}

.gj-dialog-hero p {
  margin: 4px 0 0;
  color: var(--gj-ink-soft);
}

.gj-event-note {
  display: flex;
  gap: 11px;
  align-items: center;
  margin: 19px 0 12px;
  padding: 10px 13px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--gj-accent) 8%, var(--gj-paper));
}

.gj-event-note p {
  margin: 0;
  color: var(--gj-ink-soft);
  line-height: 1.45;
}

.gj-dialogue-card {
  padding: 18px;
  border: 1px solid var(--gj-line);
  border-left: 4px solid var(--gj-vermilion);
  border-radius: 4px 15px 15px 4px;
  background: var(--gj-surface);
}

.gj-dialog-hero + .gj-dialogue-card {
  margin-top: 18px;
}

.gj-dialogue-card small {
  color: var(--gj-vermilion-dark);
  font-weight: 750;
}

.gj-dialogue-card .gj-japanese {
  margin: 4px 0 8px;
  color: var(--gj-indigo);
  font-family: "Noto Sans JP", var(--font-sans, sans-serif);
  font-size: 1.8rem;
  font-weight: 650;
  line-height: 1.55;
}

.gj-dialogue-card > p:not(.gj-japanese) {
  margin: 0 0 12px;
  color: var(--gj-ink-soft);
  line-height: 1.55;
}

.gj-scene-progress {
  margin: 18px 0 12px;
}

.gj-scene-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 7px;
  color: var(--gj-ink-soft);
  font-size: 1.4rem;
}

.gj-scene-progress > div strong {
  color: var(--gj-indigo);
  font-size: 1.4rem;
  font-weight: 600;
}

.gj-scene-progress > span {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--gj-accent) 10%, transparent);
}

.gj-scene-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gj-accent);
  transition: width 260ms ease;
}

.gj-npc-turn {
  position: relative;
  margin-top: 0;
}

.gj-audio-button {
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--gj-accent) 24%, transparent);
  border-radius: 9px;
  color: var(--gj-indigo);
  background: var(--gj-paper);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.gj-dialog-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 18px;
}

.gj-dialog-actions .gj-button {
  flex: 1;
  min-width: 190px;
}

.gj-dialog-loading,
.gj-dialog-error {
  display: grid;
  min-height: 280px;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
}

.gj-dialog-loading span {
  width: 45px;
  height: 45px;
  border: 4px solid rgba(35, 63, 99, 0.14);
  border-top-color: var(--gj-vermilion);
  border-radius: 50%;
  animation: gj-spin 0.8s linear infinite;
}

.gj-challenge {
  margin-top: 18px;
  padding-top: 17px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-top: 1px dashed var(--gj-line);
}

.gj-challenge-ja {
  margin: 9px 0 3px;
  color: var(--gj-indigo);
  font-family: "Noto Sans JP", var(--font-sans, sans-serif);
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 750;
  line-height: 1.25;
}

.gj-challenge h4 {
  margin: 0 0 18px;
  font-size: 1.8rem;
  line-height: 1.4;
}

.gj-options {
  display: grid;
  gap: 12px;
}

.gj-options button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 60px;
  padding: 12px 14px;
  border: 1px solid var(--gj-line);
  border-radius: 12px;
  color: var(--gj-ink);
  background: var(--gj-paper);
  font: inherit;
  font-size: 1.8rem;
  font-weight: 630;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.gj-options button:not(:disabled):hover,
.gj-options button.is-selected {
  border-color: var(--gj-indigo);
  background: color-mix(in srgb, var(--gj-accent) 8%, var(--gj-paper));
}

.gj-options button > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: var(--gj-indigo);
  background: color-mix(in srgb, var(--gj-accent) 8%, transparent);
  font-weight: 850;
}

.gj-options button.is-correct {
  border-color: #28a745;
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.gj-options button.is-wrong {
  border-color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.gj-listening-note {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 13px;
  border: 1px solid color-mix(in srgb, var(--gj-accent) 20%, var(--gj-line));
  border-radius: 12px;
  color: var(--gj-ink-soft);
  background: color-mix(in srgb, var(--gj-accent) 6%, var(--gj-paper));
}

.gj-listening-note span {
  font-size: 1.6rem;
}

.gj-listening-note p {
  margin: 0;
}

.gj-sentence-exercise {
  display: grid;
  gap: 1.6rem;
}

.gj-word-bank,
.gj-sentence-builder {
  padding: 2rem;
  border: 1px solid var(--gj-line);
  border-radius: 12px;
}

.gj-word-bank {
  background: #f7fafc;
}

.gj-sentence-builder {
  background: white;
}

.gj-word-bank > span,
.gj-sentence-builder > span {
  display: block;
  margin-bottom: 1.5rem;
  color: var(--gj-ink);
  font-size: 1.6rem;
  font-weight: 600;
}

.gj-word-bank > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gj-word-token {
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--gj-line);
  border-radius: 12px;
  color: var(--gj-ink);
  background: var(--gj-paper);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
  font: inherit;
  font-family: "Noto Sans JP", var(--font-sans, sans-serif);
  font-size: 1.8rem;
  font-weight: 500;
  cursor: grab;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.gj-word-token:not(:disabled):hover {
  border-color: var(--gj-accent);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--gj-accent) 12%, transparent);
  transform: translateY(-1px);
}

.gj-word-token:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.gj-sentence-dropzone {
  display: flex;
  min-height: 80px;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  padding: 1.5rem;
  border: 2px dashed var(--gj-line);
  border-radius: 12px;
  background: #f7fafc;
  transition: border-color 160ms ease, background 160ms ease;
}

.gj-sentence-dropzone.is-dragging {
  border-color: var(--gj-accent);
  background: color-mix(in srgb, var(--gj-accent) 8%, var(--gj-surface));
}

.gj-sentence-dropzone > p {
  width: 100%;
  margin: 0;
  color: var(--gj-ink-soft);
  font-size: 1.4rem;
  font-style: italic;
  line-height: 1.45;
  text-align: center;
  padding: 1rem;
}

.gj-listening-transcript {
  color: var(--gj-ink-soft);
  font-style: italic;
}

.gj-sentence-word {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--gj-accent);
  font: inherit;
  font-family: "Noto Sans JP", var(--font-sans, sans-serif);
  font-size: 1.4rem;
  font-weight: 500;
  cursor: pointer;
}

.gj-sentence-word span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 1.4rem;
  font-weight: bold;
}

.gj-sentence-actions {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
}

.gj-sentence-actions .gj-clear-btn,
.gj-sentence-actions .gj-submit-btn,
.gj-hint .gj-hint-btn {
  position: relative;
  display: inline-flex;
  min-width: 190px;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 2rem;
  border: 1px solid var(--gj-line);
  border-radius: 12px;
  color: var(--gj-ink);
  background: var(--gj-paper);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
  font-family: var(--font-sans, sans-serif);
  font-size: 1.6rem;
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow 0.2s ease, opacity 0.2s ease;
}

.gj-sentence-actions .gj-clear-btn:hover:not(:disabled),
.gj-sentence-actions .gj-submit-btn:hover:not(:disabled),
.gj-hint .gj-hint-btn:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.gj-sentence-actions .gj-submit-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.gj-sentence-actions .gj-clear-btn:disabled,
.gj-sentence-actions .gj-submit-btn:disabled,
.gj-hint .gj-hint-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gj-hint .gj-hint-btn:disabled {
  border-color: var(--color-border);
  color: var(--color-secondary-text);
  background: var(--color-lighter-gray);
  box-shadow: none;
  pointer-events: none;
}

.gj-correct-answer {
  margin-top: 9px !important;
  color: var(--gj-ink) !important;
}

.gj-hint {
  color: var(--gj-ink-soft);
  text-align: center;
  margin-bottom: 1.25rem;
}

.gj-hint.gj-hints {
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
}

.gj-hint .gj-hint-btn.used {
  background: linear-gradient(135deg, rgba(255, 87, 0, 0.1), rgba(255, 140, 0, 0.1));
}

[data-theme="dark"] .gj-hint .gj-hint-btn.used {
  border-color: var(--gj-accent);
}

.gj-hint .gj-hint-btn:not(.penalty-applied):hover::after,
.gj-hint .gj-hint-btn.penalty-applied::after {
  position: absolute;
  top: -8px;
  right: -8px;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: #fff;
  background: #c05621;
  content: attr(data-hover-penalty);
  font-size: 1rem;
  font-weight: 600;
  pointer-events: none;
  animation: gj-penalty-pop 200ms ease-out;
}

.gj-hint .gj-hint-btn.penalty-applied::after {
  content: attr(data-penalty);
}

.gj-hint.is-disabled {
  opacity: 0.7;
}

.gj-hint.is-disabled .gj-hint-btn {
  box-shadow: none;
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.gj-hint.is-disabled .gj-hint-btn::after {
  display: none;
}

.gj-hint > .gj-hint-content {
  overflow: hidden;
  max-height: 200px;
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--gj-accent) 22%, var(--gj-line));
  border-radius: 12px;
  opacity: 1;
  color: var(--gj-accent);
  background: color-mix(in srgb, var(--gj-accent) 6%, var(--gj-paper));
  box-shadow: 0 4px 12px rgba(255, 87, 0, 0.03), 0 1px 3px rgba(255, 87, 0, 0.05);
  font-size: 1.6rem;
  font-style: italic;
  line-height: 1.5;
  text-align: left;
  transition: box-shadow 0.2s ease, transform 0.2s ease, opacity 0.25s ease, max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}

.gj-hint > .gj-hint-content:hover {
  box-shadow: 0 6px 16px rgba(255, 87, 0, 0.08), 0 2px 6px rgba(255, 87, 0, 0.1);
}

.gj-hint > .gj-hint-content.is-hiding {
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
}

.gj-hint > .gj-hint-content[hidden] {
  display: none;
}

@keyframes gj-hint-in {
  from {
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    max-height: 200px;
    margin-bottom: 2rem;
    padding: 1rem;
    opacity: 1;
    transform: translateY(0);
  }
}

.gj-answer-result {
  margin: 2rem 0;
}

.gj-answer {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 2rem;
  padding: 2rem;
  border: 2px solid rgba(40, 167, 69, 0.2);
  border-radius: 13px;
  background: rgba(40, 167, 69, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
}

.gj-answer.is-wrong {
  border-color: rgba(220, 53, 69, 0.2);
  background: rgba(220, 53, 69, 0.05);
}

.gj-answer-icon {
  flex: 0 0 auto;
  font-size: 3rem;
  line-height: 1;
}

.gj-answer-content {
  min-width: 0;
  flex: 1;
}

.gj-answer-content h4 {
  margin: 0 0 1rem;
  color: var(--gj-ink);
  font-family: var(--font-sans, sans-serif);
  font-size: 2rem;
  font-weight: 700;
}

.gj-answer p {
  margin: 0;
  color: var(--gj-ink-soft);
  font-size: 1.6rem;
  line-height: 1.6;
}

.gj-answer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
}

.gj-xp-reward {
  color: #267255;
  font-weight: 850;
}

.gj-hint-penalty {
  color: #c05621;
  font-weight: 700;
}

.gj-answer-result > .gj-button {
  display: flex;
  margin: 1rem auto 0;
}

.gj-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  min-height: 230px;
  padding: 30px;
  border: 1px solid var(--gj-line);
  border-radius: 28px;
  color: var(--gj-ink);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--gj-cream) 98%, var(--gj-accent) 2%), var(--gj-cream));
  box-shadow: var(--gj-shadow);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gj-loading::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

.gj-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 30px;
  border: 1px solid var(--gj-line);
  border-radius: 28px;
  color: var(--gj-ink);
  background: var(--gj-cream);
  box-shadow: var(--gj-shadow);
  text-align: left;
}

.gj-loading-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border: 3px double rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: var(--gj-vermilion);
  color: #fff;
  font-family: "Noto Sans JP", var(--font-sans, sans-serif);
  font-size: 2.4rem;
  font-weight: 700;
  box-shadow: 0 9px 24px rgba(167, 49, 42, 0.22);
}

.gj-loading strong {
  font-size: 1.8rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.gj-loading > span:last-child,
.gj-error p {
  margin: 0;
  font-size: 1.4rem;
  opacity: 0.7;
  max-width: 400px;
  line-height: 1.5;
  color: var(--gj-ink-soft);
}

.gj-error > span:first-child {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--gj-vermilion);
  font-size: 2rem;
  font-weight: 800;
}

.gj-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.gj-toasts {
  position: fixed;
  z-index: 10000;
  right: 20px;
  top: 20px;
  display: grid;
  gap: 8px;
}

.gj-dialog > .gj-toasts-dialog {
  position: fixed;
  padding: 0;
}

.gj-toast {
  display: flex;
  width: min(340px, calc(100vw - 40px));
  min-width: 300px;
  gap: 11px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid var(--toast-rarity, #718096);
  border-left: 4px solid var(--toast-rarity, #718096);
  border-radius: 14px;
  color: var(--gj-ink);
  background: #fff;
  box-shadow: 0 16px 36px rgba(20, 32, 44, 0.16);
  animation: gj-toast-in 240ms ease both;
}

.gj-toast.rarity-common { --toast-rarity: #718096; }
.gj-toast.rarity-uncommon { --toast-rarity: #48bb78; }
.gj-toast.rarity-rare { --toast-rarity: #4299e1; }
.gj-toast.rarity-epic { --toast-rarity: #9f7aea; }
.gj-toast.rarity-legendary { --toast-rarity: #f6ad55; }

.gj-toast > span {
  font-size: 2rem;
}

.gj-toast small,
.gj-toast strong {
  display: block;
}

.gj-toast small {
  color: var(--gj-ink-soft);
}

.gj-button:focus-visible,
.gj-tabs button:focus-visible,
.gj-chapter-picker button:focus-visible,
.gj-stop-list button:focus-visible,
.gj-map-marker:focus-visible,
.gj-options button:focus-visible,
.gj-word-token:focus-visible,
.gj-sentence-word:focus-visible,
.gj-audio-button:focus-visible,
.gj-hint .gj-hint-btn:focus-visible,
.gj-dialog-close:focus-visible {
  outline: 3px solid #efae3a;
  outline-offset: 3px;
}

[data-theme="dark"] .gj-map-caption {
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  background: rgba(18, 22, 28, 0.88);
}

[data-theme="dark"] .goshuin-game {
  --gj-game-background: var(--dark-surface);
}

[data-theme="dark"] .gj-event-chip {
  border-color: var(--gj-line);
  background: var(--gj-surface);
}

[data-theme="dark"] .gj-event-chip small {
  color: var(--gj-ink-soft);
}

[data-theme="dark"] .gj-event-chip strong {
  color: var(--gj-ink);
}

[data-theme="dark"] .gj-event-note {
  border: 1px solid var(--color-border);
  background: var(--dark-surface);
}

[data-theme="dark"] .goshuin-game .next-achievement-card,
[data-theme="dark"] .goshuin-game .rarity-card,
[data-theme="dark"] .goshuin-game .achievements-tabs {
  background: var(--gj-paper);
}

[data-theme="dark"] .goshuin-game .stats-card-achievement {
  border-color: var(--gj-accent);
  background: linear-gradient(135deg, rgba(255, 87, 0, 0.15), rgba(255, 140, 0, 0.15));
}

[data-theme="dark"] .goshuin-game .achievement-card.unlocked {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 140, 0, 0.1));
}

[data-theme="dark"] .goshuin-game .achievement-card.locked {
  background: var(--gj-surface);
}

[data-theme="dark"] .goshuin-game .achievement-progress-bar {
  background: var(--gj-surface);
}

[data-theme="dark"] .goshuin-game .circle-bg {
  stroke: color-mix(in srgb, var(--gj-line) 85%, transparent);
}

[data-theme="dark"] .goshuin-game .percentage {
  fill: var(--gj-ink);
}

[data-theme="dark"] .gj-stamp-mark > span {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

[data-theme="dark"] .goshuin-game .gj-options button.is-correct {
  border-color: #28a745;
  color: #28a745;
  background: rgba(40, 167, 69, 0.2);
}

[data-theme="dark"] .goshuin-game .gj-options button.is-wrong {
  border-color: #dc3545;
  color: #dc3545;
  background: rgba(220, 53, 69, 0.2);
}

@keyframes gj-spin {
  to { transform: rotate(360deg); }
}

@keyframes gj-pulse {
  0%, 100% { box-shadow: 0 6px 16px rgba(20, 32, 43, 0.35), 0 0 0 0 rgba(255, 255, 255, 0.72); }
  50% { box-shadow: 0 6px 16px rgba(20, 32, 43, 0.35), 0 0 0 10px rgba(255, 255, 255, 0); }
}

@keyframes gj-progress {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes gj-toast-in {
  from { opacity: 0; transform: translateY(10px); }
}

@keyframes gj-penalty-pop {
  0% { opacity: 0; transform: scale(0.7); }
  100% { opacity: 1; transform: scale(1); }
}

@media (max-width: 1050px) {
  .gj-header {
    grid-template-columns: 1fr;
  }

  .gj-level-track {
    flex: 1 1 auto;
  }

  .gj-journey-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
  }

  .gj-next-number {
    font-size: 5rem;
  }
}

@media (max-width: 820px) {
  .gj-chapter-picker {
    grid-template-columns: 1fr;
  }

  .gj-route-intro,
  .gj-section-heading {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .achievement-stats-overview {
    grid-template-columns: 1fr;
  }

  .goshuin-game .gj-achievement-heading .section-title {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .goshuin-game .gj-achievement-heading .achievement-summary {
    margin-left: 0;
    text-align: left;
  }

  .gj-journey-layout {
    grid-template-columns: 1fr;
  }

  .goshuin-game .achievements-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gj-next-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 15px;
  }

  .gj-next-card > * {
    grid-column: 1;
  }

  .gj-next-card .gj-button,
  .gj-next-card .gj-route-progress {
    grid-column: 2;
  }

  .gj-next-card .gj-button {
    grid-row: 3 / 5;
    align-self: center;
  }

  .gj-next-card .gj-route-progress {
    grid-row: 5 / 7;
    min-width: 210px;
    align-self: end;
  }

  .gj-next-number {
    display: none;
  }
}

@media (max-width: 640px) {
  .goshuin-game {
    --gj-game-radius: 18px;
  }

  .gj-app {
    margin-inline: -12px;
  }

  .gj-header {
    gap: 18px;
    padding: 22px 17px 20px;
  }

  .gj-brand {
    align-items: flex-start;
    gap: 12px;
  }

  .gj-brand img {
    width: 57px;
    height: 57px;
  }

  .gj-brand h2 {
    font-size: 2rem;
  }

  .gj-brand p {
    font-size: 1.08rem;
  }

  .gj-kicker {
    font-size: 0.9rem;
  }

  .gj-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .gj-tabs {
    justify-content: stretch;
    padding-inline: 10px;
  }

  .gj-tabs button {
    flex: 1;
    justify-content: center;
    padding-inline: 7px;
    font-size: 1rem;
  }

  .goshuin-game .tabs-header {
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .goshuin-game .tabs-header::-webkit-scrollbar {
    display: none;
  }

  .goshuin-game .tab-button {
    flex: 0 0 auto;
    min-width: 120px;
    padding: 1.2rem 1rem;
    font-size: 1.3rem;
  }

  .goshuin-game .tabs-content {
    padding: 1.3rem;
  }

  .gj-main {
    padding: 17px 10px 23px;
  }

  .gj-chapter-picker button {
    min-height: 62px;
  }

  .gj-route-intro {
    margin-inline: 2px;
  }

  .gj-route-intro > p {
    justify-self: start;
    text-align: left;
  }

  .gj-map-card {
    padding: 0;
    border-radius: 15px;
  }

  .gj-map-stage {
    min-height: 310px;
    aspect-ratio: auto;
  }

  .gj-map-art {
    object-position: center;
  }

  .gj-map-marker > span {
    width: 39px;
    height: 39px;
    border-width: 3px;
    font-size: 1.05rem;
  }

  .gj-map-marker small {
    max-width: 104px;
    font-size: 0.75rem;
  }

  .gj-player {
    width: 31px;
  }

  .gj-map-caption {
    display: none;
  }

  .gj-next-card {
    display: flex;
    padding: 18px;
  }

  .gj-next-card .gj-button,
  .gj-next-card .gj-route-progress {
    width: 100%;
  }

  .gj-stop-list,
  .next-achievements-grid,
  .gj-stamp-grid {
    grid-template-columns: 1fr;
  }

  .goshuin-game .achievements-grid {
    grid-template-columns: 1fr;
  }

  .achievement-rarity-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .goshuin-game .stats-card-achievement {
    min-height: 0;
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .goshuin-game .stats-card-icon {
    font-size: 2.5rem;
  }

  .goshuin-game .stats-card-value {
    font-size: 2.4rem;
  }

  .goshuin-game .stats-card-label {
    font-size: 1.1rem;
  }

  .rarity-section-title {
    display: block;
    margin: 0 0 1rem;
    font-size: 1.1rem;
  }

  .achievement-rarity-section {
    margin-top: 1.5rem;
  }

  .goshuin-game .rarity-card {
    padding: 1.2rem;
  }

  .goshuin-game .rarity-card.legendary {
    grid-column: 1 / -1;
  }

  .goshuin-game .rarity-progress-circle {
    width: 60px;
    height: 60px;
  }

  .goshuin-game .percentage {
    font-size: 0.4em;
  }

  .goshuin-game .next-achievement-content {
    align-items: flex-start;
    gap: 11px;
    padding: 13px;
  }

  .goshuin-game .next-achievement-content .achievement-icon {
    font-size: 3.2rem;
  }

  .goshuin-game .next-achievement-content .achievement-title {
    font-size: 1.6rem;
  }

  .goshuin-game .next-achievement-content .achievement-description {
    font-size: 1.3rem;
  }

  .goshuin-game .achievement-points {
    padding-inline: 7px;
  }

  .gj-stamp-card {
    min-height: 245px;
    border-right: 0;
    border-bottom: 1px dashed var(--gj-line);
  }

  .gj-stamp-card:last-child {
    border-bottom: 0;
  }

  .gj-section-heading {
    margin-inline: 3px;
  }

  .gj-dialog > div {
    padding: 21px 17px;
  }

  .gj-dialog-hero h3 {
    font-size: 1.65rem;
  }

  .gj-dialog-actions {
    flex-direction: column-reverse;
  }

  .gj-dialog-actions .gj-button {
    width: 100%;
  }

  .gj-sentence-actions {
    flex-direction: column-reverse;
  }

  .gj-sentence-actions .gj-clear-btn,
  .gj-sentence-actions .gj-submit-btn {
    width: 100%;
  }

  .goshuin-login-actions {
    flex-direction: column;
    width: 100%;
    margin-left: 0;
  }

  .gj-toasts {
    right: 10px;
    top: 10px;
    bottom: auto;
    left: 10px;
  }

  .gj-toast {
    width: auto;
    min-width: 0;
  }

  .gj-answer {
    gap: 12px;
    padding: 16px;
  }

  .gj-answer-icon {
    font-size: 2.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gj-map-marker.is-unlocked > span,
  .gj-dialog-loading span,
  .gj-toast {
    animation: none;
  }

  .gj-button,
  .gj-chapter-picker button,
  .gj-map-marker > span {
    transition: none;
  }
}

/* ============================================
   HOMOGENIZACIÓN DE LAYOUT
   ============================================ */

.goshuin-game-template .gh-section {
  padding: 2rem 0;
}

.goshuin-game-template .gh-section:first-child {
  padding-top: 0;
}
