body {
  background: linear-gradient(135deg, #131313 0%, #ff6347 100%);
  min-height: 100vh;
  margin: 0;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#app {
  width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
}

.card {
  width: 96vw;
  max-width: 420px;
  min-height: 260px;
  height: auto;
  max-height: none;
  background: #fff;
  color: #181818;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 0 transparent;
  position: relative;
  overflow: hidden;
  z-index: 1;
  padding: 0 !important;
}

.card__rainbow-border {
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: 0; 
  z-index: 2;
  box-sizing: border-box;
  border: 3px solid transparent;
  --angle: 0deg;
  border-image: linear-gradient(var(--angle),
    #ff0040,
    #ff8000,
    #fff700,
    #00ff00,
    #00cfff,
    #002bff,
    #7a00ff,
    #ff00c8,
    #ff0040
  ) 1;
  animation: rainbowBorderLinear 8s linear infinite;
}

@keyframes rainbowBorderLinear {
  0% {
    --angle: 0deg;
  }
  100% {
    --angle: 360deg;
  }
}

.card .card-front,
.card .card-back {
  background: none !important;
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  backface-visibility: hidden;
  transition: transform 0.5s;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  border-radius: 20px;
  padding: 32px 18px 54px 18px;
  box-sizing: border-box;
  padding-bottom: 48px !important;
}

.card .card-front {
  transform: rotateY(0deg);
  z-index: 2;
}

.card .card-back {
  transform: rotateY(180deg);
  z-index: 1;
}

.card.flipped .card-front {
  transform: rotateY(180deg);
  z-index: 1;
}
.card.flipped .card-back {
  transform: rotateY(0deg);
  z-index: 2;
}

.card.flipped .card-front {
  display: none;
}
.card:not(.flipped) .card-back {
  display: none;
}

.card-front .instructionText,
.card-back .instructionText {
  font-size: 1.18em;
  font-weight: 600;
  margin-bottom: 18px;
  text-align: center;
  width: 100%;
  word-break: break-word;
  color: #181818;
  line-height: 1.4;
}
.card-front .categoryText,
.card-back .categoryText {
  font-size: 1.1em;
  margin-top: 18px;
  text-align: center;
  font-weight: bold;
  text-decoration: underline;
  width: 100%;
}

#speakCardBtn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 0;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  max-width: 28px;
  max-height: 28px;
  font-size: 1.1em;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #222;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: background 0.2s;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#speakCardBtn span,
#speakCardBtn svg {
  font-size: 1em !important;
  line-height: 1;
  pointer-events: none;
}
#speakCardBtn:active,
#speakCardBtn:focus {
  background: #e0e0e0;
  outline: 2px solid #0078d7;
}

#muteButton {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 3000;
  padding: 10px;
  font-size: 1.5em;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #222;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0,0,0,0.13);
  transition: background 0.2s;
}
#muteButton:active,
#muteButton:focus {
  background: #e0e0e0;
  outline: 2.5px solid #0078d7;
}

#activeEffectsContainer {
  max-width: 420px;
  width: 96vw;
  margin: 0 auto 16px auto;
  background: #f9f9f9;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  padding: 10px 14px;
  color: #222;
  font-size: 1.1em;
  text-align: center;
  border: 1.5px solid #e0e0e0;
}

#activeEffectsContainer .activeEffectsTitle {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 1.08em;
}
#activeEffectsContainer .activeEffectItem {
  margin-bottom: 2px;
  font-size: 1em;
}

.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none; 
  align-items: center;
  justify-content: center;
  z-index: 2000;
  background: rgba(0,0,0,0.18);
}
.modal[style*="flex"] {
  display: flex !important;
}
.modal-content {
  background-color: #e3e3e3;
  padding: 16px;
  border-radius: 10px;
  border: 2px solid #ccc;
  max-width: 98vw;
  width: 98vw;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-content input[type="text"], 
.modal-content input[type="number"] {
  width: 98%;
  padding: 10px 14px;
  margin: 8px 0;
  border: 2px solid #ccc;
  border-radius: 8px;
  font-size: 1.1em;
  background: #f7f7f7;
  color: #222;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.modal-content input[type="text"]:focus, 
.modal-content input[type="number"]:focus {
  border-color: #ff6347;
  outline: none;
  background: #fff;
}

.modal-content button {
  margin: 8px 6px 0 0;
  padding: 10px 18px;
  font-size: 1.1em;
  border-radius: 6px;
  border: none;
  background: #ff6347;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-block;
}
.modal-content button:last-child {
  margin-right: 0;
}

#footer {
  flex-shrink: 0;
  position: static;
  margin-top: 24px;
  font-size: 0.95em;
  color: #535353;
  width: 100%;
  text-align: center;
}

#rulesButtonContainer {
  position: static;
  width: 100%;
  text-align: center;
  padding: 18px 0 0 0;
}

#showRulesLink {
  color: #535353;
  font-size: 1.1em;
  text-decoration: none;
  cursor: pointer;
}
#showRulesLink:hover {
  text-decoration: underline;
}

/* Gör allt extra mobilvänligt på små skärmar */
@media (max-width: 600px) {
  .card {
    max-width: 98vw;
    min-height: 220px;
    height: auto;
    max-height: auto;
    padding: 0;
  }
  #speakCardBtn {
    top: 16px;
    right: 16px;
    font-size: 1.3em;
    padding: 10px;
  }
  #activeEffectsContainer {
    max-width: 98vw;
    padding: 8px 6px 6px 8px;
    font-size: 0.98em;
  }
  .modal-content {
    max-width: 420px;
    width: 90vw;
  }
  #footer {
    font-size: 0.9em;
    margin-top: 12px;
  }
}

@media (max-width: 500px) {
  .card, #activeEffectsContainer {
    max-width: 99vw;
    font-size: 1em;
  }
  .card-front .instructionText,
  .card-back .instructionText {
    font-size: 1.08em;
    padding: 0 4vw;
  }
  #speakCardBtn {
    bottom: 8px;
    right: 8px;
    font-size: 1.1em;
    padding: 6px;
  }
  #muteButton {
    top: 8px;
    right: 8px;
    font-size: 1.2em;
    padding: 7px;
  }
}