
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #102d26;
  color: #f4deab;
  font-family: Georgia, serif;
}

.game {
  width: 100%;
  max-width: 540px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px 12px 28px;
  background: #102d26;
}

.game-header {
  text-align: center;
  margin-bottom: 20px;
}

.crown {
  font-size: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: -5px;
}
.crown img {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
}
h1 {
  font-size: clamp(28px, 7vw, 40px);
  letter-spacing: 3px;
  margin: 4px 0;
}

.subtitle {
  font-size: 17px;
  font-style: italic;
  margin: 4px 0;
}

.game-status {
  display: flex;
  justify-content: space-between;
  font: bold 13px Arial, sans-serif;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.court {
  position: relative;
  width: 100%;
  min-height: 350px;
  background: #174437;
  border: none;
  border-radius: 14px;
  box-shadow: inset 0 0 25px #0b2922;
}

.card-area {
  display: flex;
  justify-content: center;
  gap: 42px;
  margin: 22px 0;
}

.draw-pile,
.current-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font: 11px Arial, sans-serif;
  letter-spacing: 1px;
}

.card-back,
.card-face {
  width: 76px;
  height: 105px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
}


.card-back {
  background: #254c44;
  background-image: url("https://01a1b375-f961-7819-a1de-ca24c9b73362.codepenusercontent.com/IMG_7462.png") !important;
  background-size: 100% 100% !important;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid #ddbb74;
  color: #ddbb74;
}


.card-face {
  background: #faf5e8;
  color: #202020;
  border: 1px solid #c8bfae;
}

.controls,
.game-footer {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

button {
  cursor: pointer;
  border-radius: 8px;
  padding: 13px 18px;
  font: bold 12px Arial, sans-serif;
  letter-spacing: 1px;
}

.controls button:first-child {
  background: #ddbb74;
  color: #17352a;
  border: none;
}

.controls button:last-child,
.game-footer button {
  background: transparent;
  color: #f4deab;
  border: 1px solid #ddbb74;
}

.game-footer button {
  padding: 10px 20px;
}

@media (max-width: 390px) {
  .game {
    padding: 12px 8px 20px;
  }
  .court {
    min-height: 300px;
  }
  .card-area {
    margin: 16px 0;
  }
}html {
  height: 100%;
  background: 50% 50% no-repeat
    url('data:image/svg+xml,<svg viewBox="-20 -5 60 40" width="140" xmlns="http://www.w3.org/2000/svg" opacity="0.2"><path d="M1 8l11-7 11 7v8l-11 7-11-7zm0 0l11 8 11-8m0 8L12 8 1 16M12 1v7m0 8v7" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="2"/><text x="-12" y="32" font-size="5" font-family="monospace" fill="currentColor">Built on CodePen</text></svg>');
}
.court-slot {
  position: absolute;
  width: 13%;
  aspect-ratio: 0.72;
  transform: translate(-50%, -50%);
  border: 1.5px solid #c7a66a;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.15);
}

.court-slot {
  position: absolute;
  width: 13%;
  aspect-ratio: 0.72;
  transform: translate(-50%, -50%);
  border: 1.5px solid #c7a66a;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.15);
}

.court {
  min-height: 650px;
}
  min-height: 650px;
}
  position: absolute;
  width: 10%;
  aspect-ratio: 0.72;
  transform: translate(-50%, -50%);
  border: 1.5px solid #c7a66a;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.15);
}

.court {
  min-height: 600px;
}
/* HIERARCHY — Midnight Blue & Silver */

body,
.game {
  background: #15263e;
  color: #dce5ef;
}

h1,
.crown,
.subtitle {
  color: #e5edf5;
}

.game-status {
  color: #c5d5e5;
}

.court {
  background: transparent;
  border: none;
  box-shadow: none;
}

.court-slot {
  border: 1.5px solid #9eb6cd;
  background: rgba(220, 230, 240, 0.035);
  box-shadow: none;
}

.card-back {
  background: #233a55;
  border-color: #9eb6cd;
  color: #dce5ef;
}

.card-face {
  background: #faf7f0;
  border-color: #9eb6cd;
}

.controls button:first-child {
  background: #c5d5e5;
  color: #15263e;
}

.controls button:last-child,
.game-footer button {
  border-color: #9eb6cd;
  color: #dce5ef;
}
.strike-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 14px 0 8px;
}

.strike-dot {
  width: 8px;
  height: 8px;
  border: 1.5px solid #c8d5e3;
  border-radius: 50%;
  background: transparent;
}

.strike-dot.used {
  background: #d5a5a5;
  border-color: #d5a5a5;
}
.draw-pile {
  position: relative;
  width: 94px;
  height: 130px;
  margin: 0 auto;
  cursor: pointer;
}

.draw-pile .card-back,
.draw-pile #drawn-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.draw-pile #drawn-card {
  display: none;
}

.draw-pile.is-revealed .card-back {
  display: none;
}

.draw-pile.is-revealed #drawn-card {
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-area {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0 8px;
  transform: translateX(-34px);
}

.draw-pile {
  position: relative;
  width: 68px !important;
  height: 94px !important;
  min-width: 68px;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 !important;
padding-left: 0;
}

#discard-btn {
   transform: none; 
  width: 68px !important;
  height: 94px !important;
  min-width: 68px !important;
  max-width: 68px !important;
  min-height: 94px !important;
  max-height: 94px !important;
  padding: 0 !important;
  font-size: 10px;
  box-sizing: border-box;
}

/* HIERARCHY — Game-ending toast */
.game-toast[hidden] {
  display: none !important;
}

.game-toast {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(5, 12, 25, 0.78);
}

.toast-panel {
  width: 100%;
  max-width: 390px;
  box-sizing: border-box;
  padding: 30px 24px;
  border: 1.5px solid #aabed1;
  border-radius: 16px;
  background: #172a43;
  color: #e7edf5;
  text-align: center;
  box-shadow: 0 18px 55px rgba(0,0,0,0.45);
  animation: toastAppear 0.3s ease-out;
}

.toast-eyebrow {
  color: #b6c9db;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

#toast-title {
  margin: 18px 0 12px;
  font-family: Georgia, serif;
  font-size: 27px;
  color: #f3f5f8;
}

#toast-message {
  font-size: 15px;
  line-height: 1.6;
  color: #d1deeb;
}

.toast-countdown {
  margin: 22px 0;
  font-size: 12px;
  color: #b6c9db;
}

#toast-seconds {
  color: #ffffff;
  font-weight: bold;
}

#toast-play-again {
  padding: 13px 28px;
  border: 1px solid #c2d2e2;
  border-radius: 8px;
  background: #e8eef5;
  color: #172a43;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1.5px;
  cursor: pointer;
}

@keyframes toastAppear {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
#discard-btn {
  color: #000000 !important;
}
.game-footer {
  display: none !important;
}
/* Relocate strike indicators below the court */
.game {
  position: relative;
}

.strike-dots {
  position: absolute;
  top: 575px;
  left: 10.5%;
  transform: translateX(-50%);
  margin: 0;
}

.copyright {
  text-align: center;
  font-size: 10px;
  color: #8190a5;
  margin-top: 24px;
  padding-bottom: 12px;
  letter-spacing: 0.5px;
}

@media (max-width: 480px) {
  .court-slot {
    transform: translate(-50%, -50%) scale(1);
  }
  
.court {
  height: 480px;
  min-height: 480px;
}

}

@media (max-width: 480px) {
  .strike-dots {
    top: 460px;
    left: 12%;
    transform: translateX(-50%) scale(0.7);
  }
}
/* Draw pile and RULES: shared alignment */
.action-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 22px auto;
}

.action-row .card-area,
.action-row .controls {
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

.action-row .draw-pile,
.action-row #discard-btn {
  width: 68px !important;
  height: 94px !important;
  min-width: 68px !important;
  max-width: 68px !important;
  min-height: 94px !important;
  max-height: 94px !important;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .action-row .draw-pile,
  .action-row #discard-btn {
    width: 54px !important;
    height: 76px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    min-height: 76px !important;
    max-height: 76px !important;
  }

  .action-row .card-back,
  .action-row .card-face {
    width: 100% !important;
    height: 100% !important;
  }
}
.court-slot[data-position="9"]::after {
  content: "PSALM 59:9";
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: #c8d5e3;
  font: normal 9px Georgia, serif;
  letter-spacing: 0.5px;
}
@media (max-width: 480px) {
  .court-slot[data-position="9"]::after {
    top: calc(100% + 7px);
font-size: 8px;
  }
}

@keyframes royalPardonPulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(255, 215, 0, 0);
  }
  50% {
    box-shadow: 0 0 18px 5px rgba(255, 215, 0, 0.85);
  }
}

.royal-pardon {
  animation: royalPardonPulse 1.5s ease-in-out;
}

#hierarchy-rules {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.hierarchy-rules-box {
  background: #14263f;
  color: #f5f1e8;
  border: 2px solid #c9a34b;
  border-radius: 14px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-sizing: border-box;
  text-align: left;
}

.hierarchy-rules-box h2 {
  color: #e0b75a;
  text-align: center;
  font-size: 21px;
}

.hierarchy-rules-box p {
  font-size: 15px;
  line-height: 1.5;
}

#close-hierarchy-rules {
  display: block;
  margin: 20px auto 0;
  padding: 10px 28px;
  background: #c9a34b;
  color: #14263f;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}


/* HIERARCHY — Royal Rejection button */
#discard-btn.royal-rejection {
  background: #182b46;
  color: #e4ebf4 !important;
  border: 2px solid #91a9bf;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: bold;
}


#discard-btn.royal-rejection::before {
  content: "";
  display: block;
  width: 36px;
  height: 42px;
  background-color: #e4ebf4;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 56'%3E%3Cpath d='M24 3 C17 9 9 11 5 11 V29 C5 39 13 47 24 53 C35 47 43 39 43 29 V11 C39 11 31 9 24 3 Z' fill='none' stroke='black' stroke-width='3.5' stroke-linejoin='round'/%3E%3Cpath d='M17 22 L31 36 M31 22 L17 36' fill='none' stroke='black' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 56'%3E%3Cpath d='M24 3 C17 9 9 11 5 11 V29 C5 39 13 47 24 53 C35 47 43 39 43 29 V11 C39 11 31 9 24 3 Z' fill='none' stroke='black' stroke-width='3.5' stroke-linejoin='round'/%3E%3Cpath d='M17 22 L31 36 M31 22 L17 36' fill='none' stroke='black' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}


#discard-btn.royal-rejection:active {
  background: #294262;
}
/* Creator email link */
.creator-email {
  color: #d6b66e;
  text-decoration: none;
  cursor: pointer;
}

.creator-email:hover,
.creator-email:focus-visible {
  color: #f2d99b;
  text-decoration: underline;
}
.cross-promo {
  margin: 12px auto 20px;
  text-align: center;
  color: #c5cbd4;
  font-size: 13px;
  line-height: 1.7;
}

.canadian-kid-link {
  display: inline-flex;
  width: fit-content;
  margin: 3px auto 0;
  text-decoration: none;
}

.ck-word {
  color: #d9dce0;
  font-family: Arial, sans-serif;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: -0.6px;
}

.ck-leaf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ba2028;
  font-size: 15px;
  vertical-align: middle;
}

.canadian-kid-link:hover .ck-word {
  color: #ffffff;
  }
/* Smaller Canadian Kid promotion */
.cross-promo {
  font-size: 12px;
}

.cross-promo img {
  width: 150px;
  max-width: 100%;
  height: auto;
}
  /* Compact Canadian Kid cross-promotion */
.cross-promo {
  display: block;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
  font-size: clamp(8px, 1.5vw, 12px);
}

.cross-promo .canadian-kid-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.85em;
  margin-left: 2px;
}

.cross-promo .ck-leaf {
  font-size: 0.9em;
}
  /* Keep the entire Canadian Kid promotion on one line */
.cross-promo {
  display: block !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
  white-space: nowrap !important;
  font-size: clamp(8px, 1.2vw, 11px) !important;
}

.cross-promo .canadian-kid-link {
  display: inline-flex !important;
  width: auto !important;
  margin: 0 !important;
  font-size: 1em !important;
  white-space: nowrap !important;
}

.cross-promo .ck-word {
  font-size: 0.75em !important;
  white-space: nowrap !important;
}

.cross-promo .ck-leaf {
  font-size: 0.65em !important;
}
  .cross-promo {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: normal !important;
  text-align: center;
}
  .cross-promo {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  text-align: center !important;
}

.cross-promo .promo-invitation {
  display: block;
  color: #c7d3e1;
  font-size: 12px;
  letter-spacing: 1px;
}

.cross-promo .promo-link {
  display: block;
  color: #c9a44d !important;
  font-size: 12px;
  text-decoration: none !important;
}

.cross-promo .promo-link:hover {
  text-decoration: underline !important;
}