:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --success-color: #2ecc71;
  --success-light: rgba(46, 204, 113, 0.2);
  --background-color: #f5f7fa;
  --text-color: #2c3e50;
  --light-gray: #ecf0f1;
  --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  --button-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
}

body {
  font-family: 'Open Sans', sans-serif;
  font-size: 1.2em;
  background-color: var(--background-color);
  color: var(--text-color);
  text-align: center;
  margin: 0;
  line-height: 1.6;
}

.blurred {
  -webkit-filter: blur(10px);
  -moz-filter: blur(10px);
  -o-filter: blur(10px);
  -ms-filter: blur(10px);
  filter: blur(10px);
}

h3 {
  padding: 0 30px;
  margin: 0;
  font-weight: 600;
}

.no-scroll {
  overflow: hidden;
}

.first {
  margin-top: 75px;
}

.last {
  margin-bottom: 50px;
}

#header {
  margin-bottom: 30px;
  margin-top: 20px;
  font-size: 1.2em;
}

.inline-block {
  display: inline-block;
}

.section {
  margin-bottom: 40px;
  padding: 0 20px;
}

.section.actions {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  width: 100%;
  margin-top: 15px;
}

span {
  margin: 0 5px;
}

.lightning, .smishmash {
  margin-top: 50px;
}

.modal-footer {
  display: inline-block;
}

#footer-nav {
  margin-top: 15px;
}

input {
  border-radius: 10px;
  font-size: 1em;
  max-width: 350px;
  line-height: 1.5;
  width: auto;
  margin: 15px 0 25px 0;
  border: 1px solid var(--light-gray);
  padding: 12px 15px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-speed) ease;
}

input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
  border-color: var(--secondary-color);
}

textarea {
  text-align: center;
  border-radius: 10px;
  border: 1px solid var(--light-gray);
}

.times-container {
  text-align: center;
  color: var(--text-color);
}

.time.scores {
  margin-top: 25px;
}

.time {
  display: inline-block;
  padding: 0 20px;
  margin: 5px;
  font-weight: 400;
  font-size: 1.3em;
}

.action.start {
  margin: 20px;
}

span#start,
span#end {
  margin: 0;
}

/* Green revealed letter - enhanced */
span#start {
  font-weight: 700;
  color: var(--success-color) !important;
  transition: all 0.3s ease;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

/* Make the hint letter animation more obvious */
span#start.just-revealed {
  animation: pulseHint 0.8s ease;
}

@keyframes pulseHint {
  0% { transform: scale(1); text-shadow: 0 0 0 rgba(0,0,0,0); }
  50% { transform: scale(1.5); text-shadow: 0 0 15px var(--success-light); }
  100% { transform: scale(1); text-shadow: 0 1px 0 rgba(0,0,0,0.05); }
}

.correct {
  border: 2px solid var(--success-color);
  color: var(--success-color);
  font-weight: bold;
  text-align: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  padding: 5px 10px;
  background-color: var(--success-light);
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
  animation: correctPulse 0.8s ease;
}

@keyframes correctPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(46, 204, 113, 0); }
  50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(46, 204, 113, 0.7); }
  100% { transform: scale(1); box-shadow: 0 0 10px rgba(46, 204, 113, 0.5); }
}

.offensive {
  font-size: 1em;
  color: var(--accent-color);
}

.real-word {
  line-height: 2em;
  vertical-align: middle;
  height: 100px;
}

#scrambles-and-answers {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

#scrambles {
  min-height: 75px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 0;
  margin: 0 auto;
}

.leaderboard-container {
  min-width: 35%;
  max-height: 300px;
  overflow: auto;
  box-shadow: var(--card-shadow);
  border-radius: 10px;
  border: none;
}

.card-header {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  padding: 12px 15px;
  border-radius: 10px 10px 0 0;
}

.card-body {
  padding: 15px;
}

.placeholder-text {
  opacity: 0.5;
}

.scramble-unit {
  display: inline-block;
  padding: 25px 15px;
  margin: 5px;
  height: auto;
  min-height: 75px;
  max-height: 150px;
  overflow-y: auto;
  color: #7f8c8d;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
  font-size: 0.95em;
}

.scramble-unit:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Style for correctly answered words */
.scramble-unit > div[answered="true"] {
  color: var(--success-color) !important;
  font-weight: 700;
  font-size: 0.9em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
  animation: correctWord 0.7s ease;
}

@keyframes correctWord {
  0% { transform: scale(1); text-shadow: 0 0 0 rgba(0,0,0,0); }
  50% { transform: scale(1.3); text-shadow: 0 0 20px var(--success-color); }
  100% { transform: scale(1); text-shadow: 0 1px 0 rgba(0,0,0,0.05); }
}

/* Add a subtle highlight to the scramble unit when word is correct */
.scramble-unit.correct-answer {
  animation: correctUnitPulse 1s ease;
}

@keyframes correctUnitPulse {
  0% { background-color: white; }
  50% { background-color: var(--success-light); }
  100% { background-color: white; }
}

/* Style for revealed permutations */
.scramble-unit > div.perms {
  color: var(--success-color);
  font-size: 0.8em;
  opacity: 0.8;
  margin-top: 5px;
  padding: 3px 0;
}

#answers {
  display: none;
}

.final-div {
  margin-top: 50px;
}

.hide {
  visibility: hidden;
}

.remove {
  display: none !important;
}

#tutorial-button {
  --bs-btn-color: var(--primary-color);
  --bs-btn-border-color: var(--primary-color);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--primary-color);
  --bs-btn-hover-border-color: var(--primary-color);
  --bs-btn-focus-shadow-rgb: 44,62,80;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--primary-color);
  --bs-btn-active-border-color: var(--primary-color);
  --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  --bs-btn-disabled-color: var(--primary-color);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--primary-color);
  --bs-gradient: none;
  margin: 15px 0;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.tutorial-gif {
  border: 5px solid white;
  border-radius: 10px;
  padding: 15px;
  width: 100%;
  box-shadow: var(--card-shadow);
}

.tutorial-class {
  background-color: var(--light-gray);
}

.carousel-control-prev,
.carousel-control-next {
  color: white;
}

.carousel-inner {
  width: auto;
}

#champ-streak-info {
  margin: 0;
  padding: 0;
}

.champ-info > .x-button {
  position: absolute;
  top: -3px;
  right: 3px;
}

.btn-gameplay {
  width: 45%;
  padding: 12px 10px;
  font-weight: 600;
  transition: all var(--transition-speed) ease;
  border-radius: 50px;
  border: none;
  box-shadow: var(--button-shadow);
  margin: 0 5px;
  display: inline-block;
  font-size: 0.95em;
}

.btn-gameplay:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-danger {
  background-color: var(--accent-color);
}

.btn-success {
  background-color: var(--success-color);
}

.action-text {
  display: inline-block;
  line-height: normal;
}

.toggle-timer {
  display: inline-block;
}

.toggle-timer > img {
  width: 45px;
}

.faded-out {
  opacity: 0.5;
  cursor: not-allowed;
}

.lets-go {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* justify-content: center; */
  overflow: auto;  
  background-color: var(--background-color);
  color: var(--text-color);
  text-align: center;
}

.lets-go-text-div {
  padding: 1.3em;
  max-width: 800px;
}

.first-lets-go {
  font-size: 1.2em;
}

.lets-go-container {
  position: fixed;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 500px;
  z-index: 20;
}

.share-x {
  position: absolute;
  top: -15px;
  right: -15px;
  background-color: var(--primary-color);
  border-radius: 50%;
  width: 35px;
  height: 35px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 21;
}

.share-content-background {
  background-color: white;
  color: var(--text-color);
  width: 90%;
  max-width: 500px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 15px;
  box-shadow: var(--card-shadow);
  padding: 25px;
  z-index: 20;
}

#logo {
  padding: 20px 0;
  font-size: 2.5em;
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 3;
}

.scoreboard {
  margin-top: 10px;
  min-height: 100px;
}

#logo:before {
  content: "";
  position: absolute;
  left: 15%;
  bottom: 0;
  height: 1px;
  width: 70%;
  border-bottom: 1px solid rgba(44, 62, 80, 0.2);
}

#title span {
  position: relative;
  display: inline-block;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--primary-color);
  animation: flip 1s forwards;
  animation-delay: calc(.08s * var(--i));
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
}

#title-no-animate {
  position: relative;
  display: inline-block;
  text-transform: uppercase;
  font-weight: 700; 
  color: var(--primary-color);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
}

.subtitle {
  margin: 20px 0;
  font-size: 1.2em;
  color: #7f8c8d;
}

.tutorial-footer > p {
  font-size: 0.7em;
}

.modal-dialog {
  top: 25%;
}

.modal-content {
  width: auto;
  border-radius: 15px;
  box-shadow: var(--card-shadow);
  border: none;
}

.modal-header {
  background-color: var(--primary-color);
  color: white;
  border-radius: 15px 15px 0 0;
}

.modal-body {
  padding: 20px;
  font-size: 0.9em;
}

@keyframes flip {
  0% {
    transform: rotateY(360deg);
  }
}

#start-name {
  opacity: 1;
  width: 150px;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  transition: all var(--transition-speed) ease;
  border-radius: 50px;
  font-weight: 600;
  margin-left: 10px;
}

#start-name:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
}

.attribution {
  margin-top: 30px;
  font-size: 0.8em;
  color: #7f8c8d;
}

.attr-link {
  font-size: 12px;
  display: block;
  text-decoration: none;
  color: var(--secondary-color);
  transition: color var(--transition-speed) ease;
}

.attr-link:hover {
  color: #2980b9;
}

p.name-input-p {
  margin: 0;
}

input.user-name {
  margin: 0;
  text-align: center;
  border-radius: 50px;
}

.slideopen-now {
  animation: slideopen 1s forwards;
}

.username-container {
  margin-bottom: 2em;
}

@keyframes slideopen {
  from {
    width: 0;
    padding: 0;
  }
  to {
    width: 100%;
    padding: .375rem .75rem;
  }
}

.username-required,
.offensive {
  color: var(--accent-color);
  font-size: 0.8em;
  margin-top: 5px;
}

.btn-primary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  padding: 8px 16px;
  border-radius: 50px;
  transition: all var(--transition-speed) ease;
}

.btn-primary:hover {
  background-color: #2980b9;
  border-color: #2980b9;
  transform: translateY(-2px);
}

/* Responsive styles */
@media screen and (min-width: 1px) {
  body {
    font-size: 1em;
    height: 100vh;
  }
  
  .lets-go {
    height: 100%;
    width: 100%;
  }
  
  .section.actions {
    width: 100%;
    margin-top: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }
  
  .btn-gameplay {
    width: 45%;
    margin: 0 5px;
  }
  
  #scrambles {
    padding: 5px 0;
    margin-bottom: 15px;
    width: 100%;
  }
  
  #logo {
    font-size: 2em;
  }
  
  .first {
    margin: 0;
    padding: 0;
  }
  
  #header {
    font-size: unset;
    margin-bottom: 15px;
  }
  
  .time {
    font-size: unset;
  }
  
  .time.average {
    padding: 0;
    display: block;
  }
  
  input {
    margin: 15px 0 25px 0;
    max-width: 170px;
  }
  
  .section {
    margin-bottom: 0;
  }
  
  .scramble-unit {
    height: 75px;
    padding: 25px 15px;
    margin: 5px 2px;
  }
  
  #main {
    height: 100%;
  }
  
  .action-text {
    display: unset;
    line-height: unset;
  }
  
  .share-x {
    top: -15px;
    right: -15px;
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
}

@media screen and (min-width: 280px) {
  #tutorial-button {
    width: 30%;
  }
}

@media screen and (min-width: 360px) {
  #tutorial-button {
    width: auto;
  }
}

@media screen and (min-width: 900px) {
  body {
    font-size: 1.1em;
  }
  
  .tutorial-gif {
    width: 80%;
  }

  .real-word {
    height: 3.4em;
  }
  
  .lets-go-text-div {
    margin: 0 100px;
  }
  
  #logo {
    font-size: 3em;
  }
  
  .time {
    font-size: 1.2em;
  }
  
  .first {
    margin-top: 25px;
  }
  
  #header {
    margin: 0;
  }
  
  .section {
    margin-bottom: 25px;
  }
  
  .section.actions {
    margin-top: 20px;
    margin-bottom: 30px;
  }
  
  input {
    margin: 15px 0 25px 0;
  }
  
  .scramble-unit {
    height: 75px;
    padding: 25px 25px;
    font-size: 1em;
  }
  
  .share-content-background {
    width: 45%;
  }
  
  p.name-input-p {
    margin: 30px;
  }
  
  .btn-gameplay {
    width: 30%;
    margin: 0 10px;
    padding: 12px 20px;
    font-size: 1em;
  }
}

@media screen and (min-width: 1008px) {
  body {
    font-size: 1.2em;
  }

  #logo {
    font-size: 3.5em;
  }

  #header {
    margin: 15px;
  }

  .first {
    margin-top: 0;
  }

  .section {
    margin-bottom: 20px;
  }

  .time {
    font-size: 1.2em;
  }

  .toggle-timer > img {
    width: 20px;
  }
  
  input {
    margin: 0;
  }
  
  .scramble-unit {
    height: 75px;
  }
  
  .lets-go-text-div {
    margin: 0 200px;
  }
  
  .first-lets-go {
    padding-top: 0;
  }
  
  .action.start {
    margin-top: 0;
  }
  
  .share-content-background {
    top: 55%;
  }
}