/* ==========================================================================
   Recreation additions — rules modal, colors & theme studio, sound toggle,
   timer warning animations, time's-up banner, list row transitions.
   Loaded after style.css so these rules win over the originals where needed.
   ========================================================================== */

.hidden { display: none !important; }

/* ---------- generic modal behavior (about / rules / colors) --------------- */
.about-modal {
  visibility: hidden;
  transition: transform .6s cubic-bezier(.16,1.08,.38,.98), visibility 0s .6s;
}
.about-modal.open {
  visibility: visible;
  transform: translateY(0);
  transition: transform .6s cubic-bezier(.16,1.08,.38,.98), visibility 0s 0s;
}
.about-modal.open .about-modal-close-wrap {
  animation: modal-rise .6s .2s cubic-bezier(.2,1,.2,1) both;
}
.about-modal.open .about-modal-content .content-p {
  animation: modal-rise .8s cubic-bezier(.2,1,.2,1) both;
}
.about-modal.open .about-modal-content .content-p:nth-child(1) { animation-delay: .15s; }
.about-modal.open .about-modal-content .content-p:nth-child(3) { animation-delay: .2s; }
.about-modal.open .about-modal-content .content-p:nth-child(5) { animation-delay: .25s; }
.about-modal.open .about-modal-content .content-p:nth-child(7) { animation-delay: .3s; }
@keyframes modal-rise {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.about-modal .about-modal-content {
  max-height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  padding-bottom: 2rem;
}

/* ---------- rules modal --------------------------------------------------- */
.rules-content {
  display: flex;
  flex-direction: row;
  gap: 2.5rem;
  width: 100%;
  max-width: 1200px;
  text-align: left;
  align-self: flex-start;
  margin-top: 1rem;
  box-sizing: border-box;
  padding: 0 2rem;
}
.rules-col {
  flex: 1 1 0;
  min-width: 0;
  animation: modal-rise .7s cubic-bezier(.2,1,.2,1) both;
}
.rules-col:nth-child(1) { animation-delay: .15s; }
.rules-col:nth-child(2) { animation-delay: .25s; }
.rules-lang {
  font-family: Mono, monospace;
  font-size: .8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: .65;
  margin-bottom: .3rem;
}
.rules-col h2 {
  font-size: 1.6rem;
  margin: 0 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 3px solid currentColor;
}
.rules-col ol { margin: 0; padding-left: 1.4rem; }
.rules-col li {
  font-size: 1.1rem;
  line-height: 1.55;
  margin-bottom: .9rem;
}
.rules-col li b { font-weight: 700; }
.rules-note {
  font-size: .95rem;
  font-style: italic;
  opacity: .65;
  margin-top: 1.2rem;
  border-top: 1px solid currentColor;
  padding-top: .7rem;
}
@media screen and (max-width: 760px) {
  .rules-content { flex-direction: column; gap: 2rem; }
}

/* ---------- colors & themes modal ---------------------------------------- */
.colors-modal { background: var(--secondary, #fff); }
.about-modal.colors-modal .about-modal-content { color: var(--primary, #000); }
.colors-title {
  font-size: 1.8rem;
  margin: .5rem 0 1.2rem;
  text-align: center;
}
.about-modal .about-modal-content.colors-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 900px;
  text-align: center;
}

.theme-slots { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.slot {
  font-family: Didactic, sans-serif;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem 1.1rem;
  border: 3px solid var(--primary, #000);
  background: transparent;
  color: var(--primary, #000);
  cursor: pointer;
  transition: all .12s linear;
}
.slot .chip {
  display: inline-block;
  width: 1.4rem;
  height: 1.4rem;
  border: 2px solid currentColor;
  background: #222;
}
.slot.active { background: var(--primary, #000); color: var(--secondary, #fff); }
.slot:hover { transform: scale(1.03); }

.wheel-area {
  display: flex;
  gap: 1.8rem;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}
#color-wheel {
  width: 280px;
  height: 280px;
  border: 3px solid var(--primary, #000);
  background: #fff;
  cursor: crosshair;
  touch-action: none;
  flex: 0 0 auto;
}
.wheel-panel {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  align-items: center;
  min-width: 240px;
}
.hex-row { display: flex; gap: .6rem; align-items: center; justify-content: center; }
.hex-row label {
  font-family: Mono, monospace;
  font-size: .85rem;
  letter-spacing: 2px;
  opacity: .7;
}
#hex-input {
  font-family: Mono, monospace;
  font-size: 1.25rem;
  width: 7.5rem;
  padding: .45rem .5rem;
  border: 3px solid var(--primary, #000);
  background: transparent;
  color: var(--primary, #000);
  text-align: center;
  text-transform: lowercase;
  outline: none;
}
#hex-input:focus { background: rgba(var(--primary-rgb), .06); }
#native-color {
  width: 3.2rem;
  height: 2.7rem;
  padding: 0;
  border: 3px solid var(--primary, #000);
  background: transparent;
  cursor: pointer;
}
.wheel-hint { font-size: .95rem; line-height: 1.5; opacity: .7; }
.wheel-actions { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; }

.btn {
  font-family: Didactic, sans-serif;
  font-size: 1rem;
  padding: .5rem 1rem;
  border: 3px solid var(--primary, #000);
  background: transparent;
  color: var(--primary, #000);
  cursor: pointer;
  transition: all .12s linear;
}
.btn:hover { background: var(--primary, #000); color: var(--secondary, #fff); }
.btn:active { transform: scale(1.02); }
.btn-solid { background: var(--primary, #000); color: var(--secondary, #fff); }
.btn-solid:hover { opacity: .85; }

.theme-save-row { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
#theme-name {
  font-family: Didactic, sans-serif;
  font-size: 1rem;
  padding: .5rem .7rem;
  border: 3px solid var(--primary, #000);
  background: transparent;
  color: var(--primary, #000);
  width: 12rem;
  outline: none;
}
#theme-name::placeholder { color: rgba(var(--primary-rgb), .45); }

.theme-list-wrap {
  width: 100%;
  margin-top: 1.4rem;
  border-top: 3px solid var(--primary, #000);
  padding-top: .8rem;
}
.theme-list-title {
  font-family: Mono, monospace;
  font-size: .8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: .7;
  margin-bottom: .5rem;
}
.theme-list {
  max-height: 190px;
  overflow-y: auto;
  text-align: left;
}
.no-themes { opacity: .5; font-size: 1rem; padding: .4rem 0; }
.theme-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .45rem .2rem;
  border-bottom: 1px solid rgba(var(--primary-rgb), .15);
}
.theme-row .tname { flex: 1 1 auto; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-row .swatches i {
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid var(--primary, #000);
  margin-right: .3rem;
  vertical-align: middle;
}
.theme-row .tbtn {
  font-family: Didactic, sans-serif;
  font-size: .9rem;
  padding: .3rem .7rem;
  border: 2px solid var(--primary, #000);
  background: transparent;
  color: var(--primary, #000);
  cursor: pointer;
}
.theme-row .tbtn:hover { background: var(--primary, #000); color: var(--secondary, #fff); }
.theme-row .tbtn.del:hover { background: #c0392b; border-color: #c0392b; color: #fff; }

/* ---------- time's up banner --------------------------------------------- */
.time-up-banner {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--primary-rgb), .93);
  z-index: 1000002;
  opacity: 0;
  pointer-events: none;
}
.time-up-banner.show { animation: banner-show 1.9s ease forwards; }
.time-up-banner span {
  font-size: 6rem;
  line-height: 1;
  color: var(--secondary, #fff);
  text-align: center;
  letter-spacing: .05em;
}
@keyframes banner-show {
  0%   { opacity: 0; transform: scale(.5); }
  12%  { opacity: 1; transform: scale(1); }
  14%  { transform: scale(1.06) rotate(-1.5deg); }
  18%  { transform: scale(1) rotate(0); }
  80%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.1); }
}
@media screen and (max-width: 700px) {
  .time-up-banner span { font-size: 3rem; }
}

/* ---------- timer warning animations -------------------------------------- */
.time {
  transform-origin: center center;
  will-change: transform;
}
.time.bump {
  animation:
    time-bump .9s cubic-bezier(.175,.885,.32,1.275),
    time-flash .9s linear;
}
@keyframes time-bump {
  0%   { transform: scale(1) rotate(0deg); }
  18%  { transform: scale(1.38) rotate(-5deg); }
  40%  { transform: scale(.94) rotate(3deg); }
  62%  { transform: scale(1.18) rotate(-2deg); }
  80%  { transform: scale(1.02) rotate(1deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes time-flash {
  0%, 100% { background: transparent; color: inherit; }
  30%, 62% { background: var(--primary, #000); color: var(--secondary, #fff); }
}
.time.pulse { animation: time-pulse .35s ease-out; }
@keyframes time-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.14); }
  100% { transform: scale(1); }
}

/* ---------- save / URL bar slide (override hardcoded white) --------------- */
.save-button-wrap {
  background: var(--secondary, #fff);
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: all .2s ease;
}
.save-button-wrap.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ---------- wordlist row enter / leave ------------------------------------ */
.wordlist-word.row-enter { animation: row-in .4s ease both; }
@keyframes row-in {
  from { opacity: 0; transform: translateX(4px); }
  to   { opacity: 1; transform: translateX(0); }
}
.wordlist-word.row-leave { animation: row-out .4s ease both; }
@keyframes row-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(4px); }
}

/* ---------- sound toggle button ------------------------------------------- */
#sound-btn svg {
  height: 1.4rem;
  width: 1.4rem;
  vertical-align: middle;
  display: inline-block;
}
.bottom-button { display: inline-flex; align-items: center; justify-content: center; }

/* ---------- play/pause icon morph ----------------------------------------- */
.controls .animate-svg-path path {
  transition: d .35s cubic-bezier(.16,1.08,.38,.98);
}

/* ---------- modal scrollbars (keep the site's minimal look) --------------- */
.about-modal-content::-webkit-scrollbar,
.theme-list::-webkit-scrollbar { width: 6px; }
.about-modal-content::-webkit-scrollbar-thumb,
.theme-list::-webkit-scrollbar-thumb { background: rgba(var(--primary-rgb), .3); }
