h1 {
  text-align: center;
  color: #fdf6e3;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85), 0 0 3px rgba(0, 0, 0, 0.6);
}
h5 {
  text-align: center;
  color: #fdf6e3;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85), 0 0 3px rgba(0, 0, 0, 0.6);
}
body {
  background-image: url("images/background.jpeg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
  width: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.skipLink {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1100;
  padding: 10px 14px;
  border: 2px solid #f5d98a;
  border-radius: 4px;
  color: #180f34;
  background: #fdf6e3;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-150%);
}
.skipLink:focus {
  transform: translateY(0);
}
:focus-visible {
  outline: 3px solid #f5d98a;
  outline-offset: 3px;
}
.pageBody {
  flex: 1 0 auto;
}
#game {
  display: flex;
  flex-direction: row;
  justify-content: center;
}
#cardPic {
  border: 2px solid black;
}
.mainCard {
  max-height: 300px;
  max-width: 180px;
  margin: 2%;
  transition: transform 0.3s ease;
}
.card {
  border: 2px solid black;
  margin: 6px;
  transition: transform 0.3s ease;
}
.cardTrigger {
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.cardTrigger:hover:not([aria-disabled="true"]),
.cardTrigger:focus-visible {
  filter: brightness(1.1);
  box-shadow: 0 0 0 3px #f5d98a, 0 8px 20px rgba(24, 15, 52, 0.5);
  outline: none;
}
.cardTrigger[aria-disabled="true"] {
  cursor: default;
}
.card-sm {
  max-height: 150px;
  max-width: 90px;
}
.card-lg {
  max-height: 240px;
  max-width: 144px;
}
.cardMeaning {
  font-size: 0.68rem;
  color: #f0e6d2;
  background: rgba(20, 12, 40, 0.6);
  border-radius: 4px;
  padding: 2px 5px;
  box-sizing: border-box;
  text-align: center;
  max-width: 110px;
  line-height: 1.25;
  margin: 2px auto 6px;
}
.cardResult {
  font-size: 0.66rem;
  font-weight: 700;
  color: #ffe9b3;
  background: rgba(20, 12, 40, 0.6);
  border-radius: 4px;
  padding: 2px 5px;
  box-sizing: border-box;
  text-align: center;
  max-width: 120px;
  line-height: 1.25;
  margin: 0 auto 6px;
  min-height: 1em;
}
.homePage {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 24px;
  box-sizing: border-box;
}
.homeHeader {
  margin-bottom: 34px;
  text-align: center;
}
.homeHeader h1 {
  margin: 0 0 12px;
  font-size: 2.15rem;
}
.homeHeader p {
  margin: 0;
  color: #30204f;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.7;
  text-shadow: 0 1px 2px rgba(253, 246, 227, 0.8);
}
.homeSpreadList {
  display: grid;
  gap: 12px;
}
.homeSpreadOption {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) 20px;
  gap: 22px;
  align-items: center;
  min-height: 160px;
  padding: 18px 22px;
  box-sizing: border-box;
  border: 1px solid rgba(202, 161, 74, 0.68);
  border-radius: 8px;
  color: #fdf6e3;
  background: rgba(15, 9, 35, 0.86);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.homeSpreadOption:hover {
  border-color: #f5d98a;
  background: rgba(35, 23, 62, 0.94);
  transform: translateY(-2px);
}
.homeSpreadOption > img,
.homeSpreadCards {
  width: 116px;
  height: 124px;
}
.homeSpreadOption > img {
  width: 72px;
  height: 120px;
  justify-self: center;
  object-fit: cover;
  border: 1px solid #000;
  border-radius: 4px;
}
.homeSpreadCards {
  position: relative;
  display: block;
}
.homeSpreadCards img {
  position: absolute;
  top: 8px;
  left: 22px;
  width: 62px;
  height: 104px;
  object-fit: cover;
  border: 1px solid #000;
  border-radius: 3px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
}
.homeSpreadCards img:first-child {
  transform: translateX(-17px) rotate(-8deg);
}
.homeSpreadCards img:last-child {
  transform: translateX(17px) rotate(8deg);
}
.homeSpreadCardsCeltic img:first-child {
  transform: translate(-14px, 11px) rotate(-90deg);
}
.homeSpreadText {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.homeSpreadText strong {
  color: #ffe9b3;
  font-size: 1.25rem;
}
.homeSpreadText span {
  color: #f0e6d2;
  font-size: 0.88rem;
  line-height: 1.7;
}
.homeSpreadOption > i,
.homeDictionaryLink > i {
  color: #f5d98a;
}
.homeDictionaryLink {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 20px;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding: 16px 20px;
  border-top: 1px solid rgba(202, 161, 74, 0.55);
  border-bottom: 1px solid rgba(202, 161, 74, 0.55);
  color: #180f34;
  background: rgba(253, 246, 227, 0.72);
  font-weight: 700;
  text-decoration: none;
}
.homeDictionaryLink > i {
  color: #8a6a2a;
}
.homeDictionaryLink:hover {
  color: #ffe9b3;
  background: rgba(202, 161, 74, 0.1);
}
#pageGrid {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(130px, auto);
  justify-content: center;
  justify-items: center;
  column-gap: 4%;
}
#pageGrid > h1 {
  grid-column: 1 / -1;
  grid-row: 1;
}
#pageGrid > h5 {
  grid-column: 1 / -1;
  grid-row: 2;
}
#pageGrid > #buttons {
  grid-column: 1 / -1;
  grid-row: 3;
}
#pageGrid > #shuffleButton {
  grid-column: 1 / -1;
  grid-row: 5;
}
#pageGrid > .spreadQuestionPanel {
  grid-column: 1 / -1;
  grid-row: 4;
}
#pageGrid > #mainBox {
  grid-column: 1;
  grid-row: 6;
  align-self: end;
}
#pageGrid > #rightBox {
  grid-column: 2;
  grid-row: 6;
  align-self: end;
  justify-self: start;
}
@media (max-width: 520px) {
  #pageGrid {
    grid-template-columns: 1fr;
  }
  #pageGrid > #rightBox {
    grid-column: 1;
    grid-row: auto;
    align-self: center;
  }
}
#mainBox {
  display: flex;
  flex-direction: row;
  justify-content: center;
}
#leftBox {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#rightBox {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#topBox {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#centerBox {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}
#threeBox {
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 3%;
}
#bottomBox {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
#buttons a,
#buttons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4em;
  color: #fdf6e3;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(202, 161, 74, 0.7);
  background: rgba(24, 15, 52, 0.55);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease,
    box-shadow 0.2s ease;
}
#buttons a:hover,
#buttons button:hover {
  background: rgba(202, 161, 74, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
#buttons a:active,
#buttons button:active {
  transform: translateY(0) scale(0.96);
}
.homeIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15em;
  height: 1.15em;
}
.homeIcon::before {
  color: currentColor;
  content: "\2302";
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
}
#box {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#mainButton {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 190px;
  min-height: 50px;
  margin: 8px auto 4px;
  padding: 11px 22px;
  overflow: hidden;
  border: 1px solid #fff0bd;
  border-radius: 5px;
  color: #fff8e8;
  background: #30204f;
  box-shadow: inset 0 0 0 3px #30204f, inset 0 0 0 4px rgba(245, 217, 138, 0.72),
    0 5px 14px rgba(24, 15, 52, 0.42);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
#mainButton::before,
#mainButton::after {
  position: absolute;
  width: 6px;
  height: 6px;
  border: 1px solid #f5d98a;
  content: "";
  opacity: 0.9;
}
#mainButton::before {
  top: 6px;
  left: 6px;
  border-right: 0;
  border-bottom: 0;
}
#mainButton::after {
  right: 6px;
  bottom: 6px;
  border-top: 0;
  border-left: 0;
}
#mainButton i {
  color: #f5d98a;
  font-size: 0.78rem;
  transition: transform 0.2s ease;
}
#mainButton:hover:not(:disabled) {
  background: #463064;
  box-shadow: inset 0 0 0 3px #463064, inset 0 0 0 4px #ffe9b3,
    0 8px 20px rgba(24, 15, 52, 0.5), 0 0 14px rgba(202, 161, 74, 0.32);
  transform: translateY(-2px);
}
#mainButton:hover:not(:disabled) i:first-child {
  transform: rotate(-18deg) scale(1.18);
}
#mainButton:hover:not(:disabled) i:last-child {
  transform: rotate(18deg) scale(1.18);
}
#mainButton:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}
#mainButton:disabled {
  color: rgba(255, 248, 232, 0.72);
  background: #261b3e;
  box-shadow: inset 0 0 0 3px #261b3e, inset 0 0 0 4px rgba(245, 217, 138, 0.35);
  cursor: default;
}
#mainButton:disabled i {
  color: rgba(245, 217, 138, 0.5);
}
.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.readingQuestionPanel {
  width: min(620px, calc(100% - 32px));
  margin: 28px auto 8px;
  padding: 22px 24px;
  box-sizing: border-box;
  border: 1px solid rgba(202, 161, 74, 0.65);
  border-radius: 8px;
  color: #f0e6d2;
  background: rgba(15, 9, 35, 0.82);
}
.readingQuestionPanel h2 {
  margin: 0 0 8px;
  color: #ffe9b3;
  font-size: 1.15rem;
  text-align: center;
}
.readingQuestionDescription {
  margin: 0 0 18px;
  font-size: 0.88rem;
  line-height: 1.6;
  text-align: center;
}
.readingQuestionOptions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0;
  padding: 0;
  border: 0;
}
.readingQuestionOption {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 5px;
  color: #fdf6e3;
  font-size: 0.84rem;
  line-height: 1.4;
  cursor: pointer;
}
.readingQuestionOption:hover {
  background: rgba(202, 161, 74, 0.14);
}
.readingQuestionOption input {
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: #caa14a;
}
#box .cardResult {
  max-width: min(560px, calc(100vw - 40px));
  padding: 8px 12px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.readingDetail[hidden] {
  display: none;
}
.readingDetail {
  width: min(760px, calc(100% - 32px));
  margin: 28px auto 40px;
  padding: 28px;
  box-sizing: border-box;
  border: 1px solid rgba(202, 161, 74, 0.65);
  border-radius: 8px;
  color: #f0e6d2;
  background: rgba(15, 9, 35, 0.9);
}
.readingDetailHeader {
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(202, 161, 74, 0.4);
  text-align: center;
}
.readingDetailQuestionLabel,
.readingDetailKeywordLabel {
  margin: 0 0 4px;
  color: #d8cdb0;
  font-size: 0.74rem;
  font-weight: 700;
}
.readingDetailQuestion {
  margin: 0 0 18px;
  color: #fdf6e3;
  font-size: 0.95rem;
}
.readingDetailHeader h2 {
  margin: 0 0 16px;
  color: #ffe9b3;
  font-size: 1.45rem;
}
.readingDetailKeywords {
  margin: 0;
  color: #fdf6e3;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.6;
}
.readingDetailSections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: 14px;
}
.readingDetailSection {
  padding: 16px 12px;
  border-bottom: 1px solid rgba(202, 161, 74, 0.2);
}
.readingDetailSection.isHighlighted {
  border-left: 3px solid #f5d98a;
  background: rgba(202, 161, 74, 0.1);
}
.readingDetailSection h3,
.readingDetailAdvice h3 {
  margin: 0 0 8px;
  color: #ffe9b3;
  font-size: 0.95rem;
  text-align: center;
}
.readingDetailSection p,
.readingDetailAdvice p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.75;
}
.readingDetailAdvice {
  margin-top: 22px;
  padding: 18px 20px;
  border-left: 3px solid #f5d98a;
  background: rgba(202, 161, 74, 0.12);
}
.spreadDetail {
  scroll-margin-top: 20px;
}
.spreadDetailProgress {
  margin: 0 0 12px;
  color: #d8cdb0;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
}
.spreadDetailTabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-bottom: 22px;
}
.spreadDetailTab {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid rgba(202, 161, 74, 0.65);
  border-radius: 5px;
  color: #fdf6e3;
  background: rgba(24, 15, 52, 0.6);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.spreadDetailTab:hover,
.spreadDetailTab.isActive {
  color: #180f34;
  background: #f5d98a;
}
.spreadDetailPosition {
  margin: 0 0 14px;
  color: #ffe9b3;
  font-size: 0.9rem;
  font-weight: 700;
}
.spreadDetailMessage,
.spreadDetailSummary {
  padding: 20px 12px;
  border-bottom: 1px solid rgba(202, 161, 74, 0.25);
}
.spreadDetailMessage h3,
.spreadDetailSummary h3 {
  margin: 0 0 8px;
  color: #ffe9b3;
  font-size: 1rem;
  text-align: center;
}
.spreadDetailMessage p,
.spreadDetailSummary p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.8;
}
.spreadDetailSummary {
  margin-top: 22px;
  border: 1px solid rgba(245, 217, 138, 0.5);
  background: rgba(245, 217, 138, 0.08);
}
.spreadBackButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  margin: 22px auto 0;
  padding: 8px 14px;
  border: 1px solid rgba(202, 161, 74, 0.72);
  border-radius: 5px;
  color: #fdf6e3;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.spreadBackButton:hover {
  color: #180f34;
  background: #f5d98a;
}
.spreadDetail .spreadBackButton {
  display: flex;
}
.rotated {
  --card-base-transform: rotate(150deg);
  transform: var(--card-base-transform);
}

.cardArea {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.cardArea.revealed {
  opacity: 1;
  transform: translateY(0);
}

#shuffleButton {
  display: block;
  width: fit-content;
  margin: 6% auto 4%;
  padding: 14px 32px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #180f34;
  background: linear-gradient(135deg, #f5d98a, #caa14a 60%, #b8863a);
  border: 2px solid #8a6a2a;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.3s ease;
  animation: shuffleGlow 2.4s ease-in-out infinite;
}
#shuffleButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(202, 161, 74, 0.75);
}
#shuffleButton:active {
  transform: translateY(0) scale(0.97);
}
#shuffleButton:disabled {
  opacity: 0.55;
  cursor: default;
  animation: none;
  transform: none;
  box-shadow: none;
}
@keyframes shuffleGlow {
  0%,
  100% {
    box-shadow: 0 4px 14px rgba(202, 161, 74, 0.45);
  }
  50% {
    box-shadow: 0 4px 22px rgba(202, 161, 74, 0.85);
  }
}
.shuffleOverlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 15, 52, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.shuffleOverlay[hidden] {
  display: none;
}
.onboardingDialog {
  width: min(560px, calc(100% - 32px));
  padding: 0;
  border: 1px solid rgba(202, 161, 74, 0.85);
  border-radius: 8px;
  color: #f0e6d2;
  background: #180f34;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
}
.onboardingDialog::backdrop {
  background: rgba(7, 4, 18, 0.78);
}
.onboardingContent {
  padding: 28px;
}
.onboardingEyebrow {
  margin: 0 0 6px;
  color: #ffe9b3;
  font-size: 0.82rem;
  font-weight: 700;
}
.onboardingContent h2 {
  margin: 0 0 20px;
  color: #fdf6e3;
  font-size: 1.45rem;
}
.onboardingSteps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 1.4em;
}
.onboardingSteps li {
  padding-left: 4px;
  line-height: 1.55;
}
.onboardingSteps strong,
.onboardingSteps span {
  display: block;
}
.onboardingSteps span {
  color: #d8cdb0;
  font-size: 0.9rem;
}
.onboardingActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.onboardingActions button {
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid rgba(202, 161, 74, 0.8);
  border-radius: 5px;
  color: #fdf6e3;
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.onboardingActions .onboardingStart {
  color: #180f34;
  background: #f5d98a;
}
.shuffleDeck {
  position: relative;
  width: 260px;
  height: 170px;
}
.shuffleCardEl {
  position: absolute;
  top: 5px;
  left: 50%;
  margin-left: -50px;
  width: 100px;
  height: 160px;
  background-image: url("images/default.jpeg");
  background-size: cover;
  border: 2px solid black;
  border-radius: 4px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55);
  will-change: transform;
}

#dictSearchWrap {
  display: flex;
  justify-content: center;
  margin: 3% auto;
}
#dictSearch {
  width: min(320px, 80%);
  padding: 9px 16px;
  border-radius: 999px;
  border: 2px solid #8a6a2a;
  background: rgba(253, 246, 227, 0.92);
  color: #180f34;
  font-size: 0.95rem;
  text-align: center;
}
#dictSearch:focus {
  outline: 2px solid #caa14a;
}
.dictSearchStatus,
.dictNoResults {
  color: #ffe9b3;
  font-size: 0.82rem;
  font-weight: 700;
  margin: -1.5% auto 3%;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}
.dictNoResults {
  margin-top: 2%;
}
#dictionary {
  max-width: 900px;
  margin: 0 auto 6%;
  padding: 0 4%;
}
.dictSection {
  margin-bottom: 7%;
}
.dictSection h2 {
  text-align: center;
  color: #fdf6e3;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85), 0 0 3px rgba(0, 0, 0, 0.6);
  border-bottom: 2px solid rgba(202, 161, 74, 0.6);
  padding-bottom: 6px;
  margin: 0 0 4%;
}
.dictGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 14px;
}
.dictCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(15, 9, 35, 0.85);
  border: 1px solid rgba(202, 161, 74, 0.5);
  border-radius: 8px;
  padding: 8px;
}
.dictSection[hidden],
.dictCard[hidden],
.dictNoResults[hidden] {
  display: none !important;
}
.dictCardImg {
  width: 90px;
  height: 150px;
  object-fit: cover;
  border: 2px solid black;
  border-radius: 4px;
  margin-bottom: 6px;
}
.dictCardName {
  font-weight: 700;
  color: #ffe9b3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  font-size: 0.8rem;
  text-align: center;
  margin: 0 0 4px;
}
.dictCardMeaning {
  font-size: 0.66rem;
  text-align: center;
  color: #f0e6d2;
  line-height: 1.3;
  margin: 0 0 2px;
}
.dictReversed {
  color: #f0b8d0;
}
.dictFilters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
  margin: 0 auto 16px;
}
.dictFilterGroup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.dictFilterGroup legend {
  width: auto;
  margin: 0 auto 6px;
  padding: 2px 10px;
  border: 1px solid rgba(202, 161, 74, 0.78);
  border-radius: 999px;
  color: #302345;
  background: rgba(253, 246, 227, 0.96);
  box-shadow: 0 2px 6px rgba(24, 15, 52, 0.2);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
}
.dictFilterButton {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(202, 161, 74, 0.7);
  border-radius: 5px;
  color: #fdf6e3;
  background: rgba(24, 15, 52, 0.7);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.dictFilterButton.isSelected {
  color: #180f34;
  background: #f5d98a;
  border-color: #f5d98a;
}
.dictCard {
  width: 100%;
  border: 1px solid rgba(202, 161, 74, 0.5);
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}
.dictCard:hover {
  border-color: #f5d98a;
  transform: translateY(-2px);
}
.dictCard:focus-visible,
.dictFilterButton:focus-visible,
.dictDetailClose:focus-visible {
  outline: 3px solid #f5d98a;
  outline-offset: 3px;
}
#dictionary[data-orientation="upright"] .dictReversed,
#dictionary[data-orientation="reversed"] .dictUpright {
  display: none;
}
.dictDetailDialog {
  width: min(620px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 28px;
  border: 1px solid rgba(202, 161, 74, 0.8);
  border-radius: 8px;
  color: #f0e6d2;
  background: #180f34;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
}
.dictDetailDialog::backdrop {
  background: rgba(7, 4, 18, 0.78);
}
.dictDetailClose {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  color: #fdf6e3;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.dictDetailContent {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}
.dictDetailImage {
  width: 180px;
  height: 300px;
  object-fit: cover;
  border: 2px solid #000;
  border-radius: 4px;
}
.dictDetailText h2 {
  margin: 0 0 16px;
  color: #ffe9b3;
  font-size: 1.45rem;
}
.dictDetailMeaning {
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.7;
}

@media (max-width: 600px) {
  body {
    margin: 0;
    overflow-x: hidden;
    background-attachment: scroll;
  }
  .pageBody {
    box-sizing: border-box;
    padding: 20px 12px 0;
  }
  .homePage {
    width: 100%;
    padding-top: 24px;
  }
  .homeHeader {
    margin-bottom: 24px;
  }
  .homeHeader h1 {
    font-size: 1.75rem;
  }
  .homeSpreadOption {
    grid-template-columns: 82px minmax(0, 1fr) 14px;
    gap: 12px;
    min-height: 138px;
    padding: 14px 12px;
  }
  .homeSpreadOption > img,
  .homeSpreadCards {
    width: 82px;
    height: 108px;
  }
  .homeSpreadOption > img {
    width: 60px;
    height: 100px;
  }
  .homeSpreadCards img {
    top: 9px;
    left: 16px;
    width: 51px;
    height: 86px;
  }
  .homeSpreadCards img:first-child {
    transform: translateX(-12px) rotate(-7deg);
  }
  .homeSpreadCards img:last-child {
    transform: translateX(12px) rotate(7deg);
  }
  .homeSpreadCardsCeltic img:first-child {
    transform: translate(-11px, 9px) rotate(-90deg);
  }
  .homeSpreadText strong {
    font-size: 1.05rem;
  }
  .homeSpreadText span {
    font-size: 0.76rem;
    line-height: 1.55;
  }
  #pageGrid {
    align-content: start;
  }
  #pageGrid > #shuffleButton {
    align-self: center;
  }
  h1 {
    margin: 0 0 18px;
    padding: 0 4px;
    font-size: 1.6rem;
    line-height: 1.25;
  }
  h5 {
    margin: 0 0 18px;
    padding: 0 8px;
    font-size: 0.86rem;
    line-height: 1.55;
  }
  #buttons {
    gap: 8px;
  }
  #buttons a,
  #buttons button {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 0.82rem;
    box-sizing: border-box;
  }
  #shuffleButton {
    width: min(100%, 320px);
    min-height: 52px;
    margin: 26px auto 18px;
    padding: 12px 18px;
    font-size: 1rem;
  }
  #box button,
  #threeBox button,
  #leftBox button,
  #rightBox button {
    min-height: 38px;
    max-width: 140px;
    padding: 6px 8px;
    color: #180f34;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
  }
  #box #mainButton {
    min-width: 184px;
    min-height: 48px;
    padding: 10px 18px;
    font-size: 0.92rem;
  }
  .readingQuestionPanel {
    width: 100%;
    margin: 20px auto 4px;
    padding: 18px 14px;
  }
  .readingQuestionOptions {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .readingQuestionOption {
    min-height: 42px;
    box-sizing: border-box;
  }
  .readingDetail {
    width: 100%;
    margin: 22px auto 32px;
    padding: 22px 16px;
  }
  .readingDetailHeader h2 {
    font-size: 1.25rem;
  }
  .readingDetailSections {
    grid-template-columns: 1fr;
    gap: 0;
  }
  #mainBox,
  #threeBox {
    margin-top: 18px;
  }
  #threeBox {
    gap: 18px;
  }
  #threeBox > div {
    width: min(100%, 180px);
    text-align: center;
  }
  #centerBox {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 8px;
    justify-items: center;
  }
  #centerBox > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
  }
  body[data-page="reading"] #centerBox {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 4px;
    align-items: start;
  }
  body[data-page="reading"] #centerBox > div {
    width: 100%;
  }
  body[data-page="reading"] #centerBox .card-sm {
    width: min(58px, calc(100% - 4px));
    height: auto;
    max-width: 58px;
    max-height: 98px;
    margin: 4px auto;
  }
  body[data-page="reading"] #centerBox #card2 {
    --card-base-transform: translateX(clamp(8px, 2.6vw, 11px)) rotate(150deg) scale(0.78);
    position: relative;
    z-index: 2;
  }
  body[data-page="reading"] #centerBox button {
    width: 100%;
    max-width: 68px;
    min-height: 42px;
    padding: 5px 2px;
    font-size: 0.58rem;
  }
  body[data-page="reading"] #centerBox .cardMeaning,
  body[data-page="reading"] #centerBox .cardResult {
    width: 100%;
    max-width: 68px;
    padding-right: 2px;
    padding-left: 2px;
    font-size: 0.56rem;
  }
  .card-sm {
    max-height: 135px;
    max-width: 81px;
    margin: 4px;
  }
  .cardMeaning {
    max-width: 124px;
    font-size: 0.7rem;
  }
  .cardResult {
    max-width: 132px;
    font-size: 0.68rem;
  }
  body[data-page="reading"] #pageGrid {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 76px;
    column-gap: 6px;
  }
  body[data-page="reading"] #pageGrid > h1,
  body[data-page="reading"] #pageGrid > h5,
  body[data-page="reading"] #pageGrid > #buttons,
  body[data-page="reading"] #pageGrid > .spreadQuestionPanel,
  body[data-page="reading"] #pageGrid > #shuffleButton {
    grid-column: 1 / -1;
  }
  body[data-page="reading"] #pageGrid > .spreadQuestionPanel {
    grid-row: 4;
  }
  body[data-page="reading"] #pageGrid > #shuffleButton {
    grid-row: 5;
  }
  body[data-page="reading"] #pageGrid > #mainBox {
    grid-column: 1;
    grid-row: 6;
    width: 100%;
    min-width: 0;
    justify-self: stretch;
    align-self: end;
  }
  body[data-page="reading"] #pageGrid > #rightBox {
    grid-column: 2;
    grid-row: 6;
    align-self: end;
    justify-self: center;
    gap: 12px;
  }
  body[data-page="reading"] #leftBox {
    width: 100%;
    min-width: 0;
  }
  body[data-page="reading"] #rightBox > div {
    width: 76px;
    min-width: 0;
    text-align: center;
  }
  body[data-page="reading"] #rightBox .card-sm {
    max-width: 60px;
    max-height: 100px;
    margin: 3px;
  }
  body[data-page="reading"] #rightBox button {
    width: 76px;
    max-width: 76px;
    min-height: 34px;
    padding: 4px 2px;
    font-size: 0.58rem;
  }
  body[data-page="reading"] #rightBox .cardMeaning,
  body[data-page="reading"] #rightBox .cardResult {
    width: 76px;
    max-width: 76px;
    font-size: 0.56rem;
  }
  .spreadDetailTabs {
    justify-content: flex-start;
  }
  .spreadDetailTab {
    flex: 1 1 calc(50% - 7px);
    min-width: 0;
  }
  .spreadDetailMessage,
  .spreadDetailSummary {
    padding: 18px 8px;
  }
  #dictSearchWrap {
    margin: 20px auto 12px;
  }
  #dictSearch {
    box-sizing: border-box;
    width: min(100%, 360px);
    min-height: 44px;
    font-size: 1rem;
  }
  .dictSearchStatus,
  .dictNoResults {
    margin: 0 auto 20px;
  }
  #dictionary {
    padding: 0;
    margin-bottom: 32px;
  }
  .dictSection {
    margin-bottom: 32px;
  }
  .dictSection h2 {
    margin-bottom: 16px;
    font-size: 1.25rem;
  }
  .dictGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .dictCard {
    min-width: 0;
    padding: 8px 5px;
  }
  .dictCardImg {
    width: 84px;
    height: 140px;
  }
  .dictCardMeaning {
    font-size: 0.7rem;
    line-height: 1.4;
  }
  .dictFilters {
    gap: 12px;
    margin-bottom: 14px;
  }
  .dictFilterGroup {
    gap: 5px;
  }
  .dictFilterButton {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 0.74rem;
  }
  .dictDetailDialog {
    width: min(100% - 24px, 420px);
    padding: 44px 18px 20px;
  }
  .dictDetailContent {
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: center;
  }
  .dictDetailImage {
    width: 144px;
    height: 240px;
    margin: 0 auto;
  }
  .dictDetailText h2 {
    font-size: 1.3rem;
  }
  .dictDetailMeaning {
    font-size: 0.92rem;
    line-height: 1.6;
  }
  .siteFooter {
    padding: 24px 12px 28px;
    margin-top: 24px;
  }
  .onboardingContent {
    padding: 24px 20px;
  }
  .onboardingContent h2 {
    font-size: 1.25rem;
  }
  .onboardingActions {
    flex-direction: column-reverse;
  }
  .onboardingActions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.policyPanel {
  max-width: 720px;
  margin: 4% auto 6%;
  padding: 6%;
  background: rgba(15, 9, 35, 0.85);
  border: 1px solid rgba(202, 161, 74, 0.5);
  border-radius: 12px;
  color: #f0e6d2;
  line-height: 1.8;
}
.policyPanel h2 {
  color: #ffe9b3;
  border-bottom: 1px solid rgba(202, 161, 74, 0.4);
  padding-bottom: 6px;
  margin-top: 1.6em;
  font-size: 1.05rem;
}
.policyPanel p,
.policyPanel li {
  font-size: 0.92rem;
}
.policyPanel ul {
  padding-left: 1.4em;
}
.policyPanel a {
  color: #ffe9b3;
}
.policyMeta {
  font-size: 0.8rem;
  color: #d8cdb0;
  text-align: right;
}
.contactPage {
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 20px;
  box-sizing: border-box;
}
.contactPage h1,
.contactLead {
  text-align: center;
}
.contactLead {
  margin: 0 auto 26px;
  color: #302345;
  line-height: 1.7;
}
.contactPage #buttons {
  margin-bottom: 28px;
}
.contactPanel {
  display: grid;
  gap: 28px;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid rgba(202, 161, 74, 0.58);
  border-radius: 8px;
  color: #f0e6d2;
  background: rgba(15, 9, 35, 0.86);
  box-shadow: 0 10px 26px rgba(7, 4, 18, 0.28);
}
.contactPanel h2 {
  margin: 0 0 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(202, 161, 74, 0.42);
  color: #ffe9b3;
  font-size: 1.08rem;
}
.contactPanel ul {
  margin: 0;
  padding-left: 1.35em;
  line-height: 1.8;
}
.contactForm {
  display: grid;
  gap: 16px;
}
.contactForm label {
  display: grid;
  gap: 7px;
  color: #fdf6e3;
  font-size: 0.92rem;
  font-weight: 700;
}
.contactForm input,
.contactForm textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid rgba(202, 161, 74, 0.68);
  border-radius: 4px;
  color: #180f34;
  background: #fdf6e3;
  font: inherit;
}
.contactForm textarea {
  min-height: 176px;
  resize: vertical;
}
.contactForm button {
  justify-self: start;
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid #caa14a;
  border-radius: 4px;
  color: #180f34;
  background: #f5d98a;
  box-shadow: 0 3px 0 #8a6a2a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.contactForm button:hover:not(:disabled) {
  background: #ffe9b3;
  transform: translateY(-1px);
}
.contactForm button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}
.contactForm input:focus-visible,
.contactForm textarea:focus-visible,
.contactForm button:focus-visible {
  outline: 3px solid #ffe9b3;
  outline-offset: 3px;
}
.contactNotice {
  padding: 12px 14px;
  border: 1px solid rgba(245, 217, 138, 0.72);
  color: #ffe9b3;
  background: rgba(202, 161, 74, 0.18);
  line-height: 1.7;
}
.contactNotice--success {
  border-color: rgba(151, 211, 168, 0.82);
  color: #e7f8e9;
  background: rgba(48, 120, 70, 0.3);
}
.contactNotice--error {
  border-color: rgba(244, 154, 154, 0.82);
  color: #ffe5e5;
  background: rgba(145, 45, 54, 0.3);
}
.contactHoneypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.contactNote {
  margin: 16px 0 0;
  color: #d8cdb0;
  font-size: 0.84rem;
  line-height: 1.7;
}
.contactNote a {
  color: #ffe9b3;
}
.siteFooter {
  text-align: center;
  padding: 4% 0 6%;
  margin-top: 4%;
  border-top: 1px solid rgba(202, 161, 74, 0.35);
  font-size: 0.78rem;
  color: #f0e6d2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}
.siteFooter a {
  color: #ffe9b3;
  text-decoration: underline;
}

.dictGuideLink {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: -8px auto 24px;
  color: #302345;
  text-align: center;
}
.dictGuideLink a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid #8a6a2a;
  border-radius: 4px;
  color: #180f34;
  background: #f5d98a;
  box-shadow: 0 2px 0 #8a6a2a;
  font-weight: 700;
  text-decoration: none;
}
.dictGuideLink a:hover {
  background: #ffe9b3;
  transform: translateY(-1px);
}
.dictGuideLink span {
  display: none;
}
.dictDetailGuideLink {
  color: #ffe9b3;
  font-weight: 700;
}
.dictDetailGuideLink {
  display: inline-block;
  margin-top: 8px;
}
.guideIndexPage,
.guideArticle {
  width: min(940px, calc(100% - 32px));
  margin: 0 auto;
  box-sizing: border-box;
}
.guideIndexPage {
  padding: 48px 0 40px;
}
.guideIndexPage h1 {
  margin: 0 0 12px;
  color: #180f34;
  text-shadow: 0 1px 2px rgba(253, 246, 227, 0.9);
}
.guideIndexLead {
  margin: 0 auto 28px;
  color: #302345;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.guideIndexPage #buttons {
  margin-bottom: 34px;
}
.guideIndexGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 16px;
}
.guideIndexCard {
  display: grid;
  grid-template-rows: auto auto auto;
  align-items: start;
  min-height: 250px;
  padding: 10px;
  border: 1px solid rgba(202, 161, 74, 0.55);
  border-radius: 8px;
  color: #fdf6e3;
  background: rgba(24, 15, 52, 0.82);
  box-shadow: 0 5px 14px rgba(7, 4, 18, 0.32);
  text-align: center;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease,
    transform 0.18s ease;
}
.guideIndexCard:hover {
  border-color: #f5d98a;
  background: #33244c;
  transform: translateY(-2px);
}
.guideIndexCard img {
  width: 100%;
  height: 190px;
  border: 2px solid #000;
  border-radius: 4px;
  object-fit: cover;
}
.guideIndexCard span {
  margin-top: 8px;
  color: #d8cdb0;
  font-size: 0.74rem;
}
.guideIndexCard strong {
  margin-top: 3px;
  color: #ffe9b3;
  font-size: 0.9rem;
}
.guideArticle {
  padding: 46px 0 42px;
  color: #180f34;
}
.guideHero {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 0 0 30px;
}
.guideCardImage {
  width: 180px;
  height: 300px;
  margin: 0 auto;
  border: 2px solid #000;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  object-fit: cover;
}
.guideEyebrow {
  margin: 0 0 10px;
  color: #76551c;
  font-size: 0.82rem;
  font-weight: 700;
}
.guideHero h1 {
  margin: 0 0 16px;
  color: #180f34;
  text-align: left;
  text-shadow: 0 1px 2px rgba(253, 246, 227, 0.9);
}
.guideLead {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.85;
}
.guideSection {
  padding: 24px 0;
  border-top: 1px solid rgba(202, 161, 74, 0.48);
}
.guideSection h2 {
  margin: 0 0 10px;
  color: #302345;
  font-size: 1.2rem;
}
.guideSection p {
  margin: 0;
  line-height: 1.85;
}
.guideSection.guideTip {
  padding: 22px;
  border: 1px solid rgba(202, 161, 74, 0.55);
  color: #fdf6e3;
  background: rgba(24, 15, 52, 0.68);
}
.guideSection.guideTip h2 {
  color: #ffe9b3;
}
.guideActions,
.guideRelated {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.guideActions {
  padding: 28px 0;
}
.guideIntroLinks {
  padding: 0 0 28px;
}
.basicsArticle {
  padding-top: 22px;
}
.basicsHero {
  display: block;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.basicsList {
  margin: 0;
  padding-left: 1.35em;
  line-height: 1.85;
}
.basicsList li + li {
  margin-top: 10px;
}
.suitIndexGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.suitIndexCard {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 136px;
  padding: 14px;
  border: 1px solid rgba(202, 161, 74, 0.62);
  border-radius: 6px;
  color: #180f34;
  background: rgba(253, 246, 227, 0.93);
  text-decoration: none;
  box-shadow: 0 7px 17px rgba(24, 15, 52, 0.15);
}
.suitIndexCard:hover {
  border-color: #76551c;
  transform: translateY(-2px);
}
.suitIndexCard img {
  width: 88px;
  height: 112px;
  object-fit: cover;
  border: 1px solid #76551c;
  border-radius: 3px;
}
.suitIndexCard h2,
.suitIndexCard p {
  margin: 0;
}
.suitIndexCard h2 {
  font-size: 1.1rem;
}
.suitIndexCard p {
  margin-top: 7px;
  color: #4b3b61;
  font-size: 0.88rem;
  line-height: 1.6;
}
.minorSuitCards h2 {
  text-align: center;
}
.minorSuitGrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}
.minorSuitGrid a {
  display: grid;
  gap: 7px;
  color: #302345;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.minorSuitGrid img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 1px solid rgba(118, 85, 28, 0.72);
  border-radius: 3px;
  background: #fdf6e3;
}
.minorSuitGrid a:hover {
  color: #76551c;
  transform: translateY(-2px);
}
@media (max-width: 600px) {
  .suitIndexGrid {
    grid-template-columns: 1fr;
  }
  .minorSuitGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.guideActions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 9px 18px;
  border: 1px solid #caa14a;
  border-radius: 4px;
  color: #180f34;
  background: #f5d98a;
  box-shadow: 0 3px 0 #8a6a2a;
  font-weight: 700;
  text-decoration: none;
}
.guideActions a:hover {
  background: #ffe9b3;
  transform: translateY(-1px);
}
.guideRelated {
  padding-top: 22px;
  border-top: 1px solid rgba(202, 161, 74, 0.48);
}
.guideRelated a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid #caa14a;
  border-radius: 4px;
  color: #fdf6e3;
  background: #302345;
  box-shadow: 0 3px 0 #120b28;
  font-weight: 700;
  text-decoration: none;
}
.guideRelated a:hover {
  border-color: #ffe9b3;
  background: #49345f;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .guideIndexPage,
  .guideArticle {
    width: 100%;
    padding-top: 24px;
  }
  .guideIndexGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .guideIndexCard {
    min-height: 226px;
    padding: 7px;
  }
  .guideIndexCard img {
    height: 170px;
  }
  .guideHero {
    grid-template-columns: 1fr;
    gap: 18px;
    text-align: center;
  }
  .guideHero h1 {
    text-align: center;
    font-size: 1.45rem;
  }
  .guideLead {
    font-size: 0.96rem;
    line-height: 1.75;
  }
  .guideSection {
    padding: 20px 0;
  }
  .guideSection h2 {
    font-size: 1.08rem;
  }
  .guideSection p {
    font-size: 0.92rem;
    line-height: 1.75;
  }
  .guideSection.guideTip {
    padding: 18px 14px;
  }
  .guideActions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .guideActions a {
    width: 100%;
    box-sizing: border-box;
  }
}

#threeBox > div > button,
#leftBox button,
#rightBox button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  max-width: 160px;
  padding: 7px 12px;
  border: 1px solid #caa14a;
  border-radius: 4px;
  color: #fdf6e3;
  background: #302345;
  box-shadow: inset 0 0 0 1px rgba(245, 217, 138, 0.16),
    0 3px 0 #120b28, 0 6px 12px rgba(18, 11, 40, 0.34);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease,
    border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
#threeBox > div > button::before,
#leftBox button::before,
#rightBox button::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  background: #f5d98a;
  content: "";
  transform: rotate(45deg);
}
#threeBox > div > button:hover:not(:disabled),
#leftBox button:hover:not(:disabled),
#rightBox button:hover:not(:disabled) {
  border-color: #ffe9b3;
  background: #49345f;
  box-shadow: inset 0 0 0 1px rgba(255, 233, 179, 0.26),
    0 4px 0 #120b28, 0 8px 16px rgba(18, 11, 40, 0.42);
  transform: translateY(-1px);
}
#threeBox > div > button:active:not(:disabled),
#leftBox button:active:not(:disabled),
#rightBox button:active:not(:disabled) {
  box-shadow: inset 0 0 0 1px rgba(255, 233, 179, 0.22),
    0 1px 0 #120b28, 0 3px 8px rgba(18, 11, 40, 0.35);
  transform: translateY(1px);
}
#threeBox > div > button:disabled,
#leftBox button:disabled,
#rightBox button:disabled {
  border-color: #8a6a2a;
  color: #180f34;
  background: #f5d98a;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 232, 0.62),
    0 2px 0 #8a6a2a;
  cursor: default;
  opacity: 1;
}
#threeBox > div > button:disabled::before,
#leftBox button:disabled::before,
#rightBox button:disabled::before {
  width: auto;
  height: auto;
  color: #180f34;
  background: transparent;
  content: "\2713";
  transform: none;
}

@media (max-width: 600px) {
  .contactPage {
    width: 100%;
    padding-top: 26px;
  }
  .contactForm button {
    width: 100%;
  }
  #threeBox > div > button,
  #leftBox button {
    width: min(100%, 150px);
    max-width: 150px;
    min-height: 40px;
    padding: 7px 9px;
    font-size: 0.72rem;
  }
  body[data-page="reading"] #rightBox button {
    width: 76px;
    max-width: 76px;
    min-height: 38px;
    padding: 4px 3px;
    gap: 4px;
    font-size: 0.58rem;
  }
  body[data-page="reading"] #rightBox button::before {
    width: 4px;
    height: 4px;
  }
  body[data-page="reading"] #rightBox button:disabled::before {
    width: auto;
    height: auto;
  }
}

@media (max-width: 1024px) {
  body[data-page="three"] #threeBox {
    display: grid;
    width: min(100%, 680px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(8px, 2vw, 18px);
    align-items: start;
    margin: 18px auto 0;
  }
  body[data-page="three"] #threeBox > div {
    width: 100%;
    min-width: 0;
    text-align: center;
  }
  body[data-page="three"] #threeBox .card-lg {
    display: block;
    width: min(144px, calc(100% - 8px));
    height: auto;
    margin: 6px auto;
  }
  body[data-page="three"] #threeBox > div > button,
  body[data-page="three"] #threeBox .cardMeaning,
  body[data-page="three"] #threeBox .cardResult {
    width: 100%;
    max-width: 160px;
  }
}

@media (max-width: 600px) {
  body[data-page="three"] #threeBox {
    gap: 4px;
  }
  body[data-page="three"] #threeBox .card-lg {
    width: min(96px, calc(100% - 4px));
  }
  body[data-page="three"] #threeBox > div > button {
    width: 100%;
    max-width: 110px;
    min-height: 40px;
    padding: 6px 2px;
    gap: 4px;
    font-size: 0.66rem;
  }
  body[data-page="three"] #threeBox .cardMeaning,
  body[data-page="three"] #threeBox .cardResult {
    max-width: 110px;
    padding-right: 2px;
    padding-left: 2px;
    font-size: 0.6rem;
  }
}
