body {
  user-select: none;
  -webkit-user-select: none;  /* Safari */
}

input, textarea, button {
  user-select: auto; /* allow selecting inside inputs and buttons */
}


:root {
  --primary-color: #bf1a2f;
  --background-color: #390e12;
  --light-background-color: #4d1217;
  --hover-color: #991122;
  --bg-text-color: #f5c7c7;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --game-name: "Dranken";

  --card-sip: #c71c33;
  --card-truth: #2f8dda;
  --card-dare: #e94a19;
  --card-challenge: #9621ab;
  --card-group: #CDDC39;
  --card-wild: #dd1b5b;
  --card-effectStart: #ffae00;
  --card-effectEnd: #ffae00;
  --card-game: #19bd10;
  --card-twoPart: #3800d1;
  --card-spez: #ff43d6;

}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: 'Cooper';
  src: url('fonts/cooper.ttf') format('truetype');
}

/* Font classes */
.cooper-font {
  font-family: 'Cooper', sans-serif;
}

.bigger {
  font-size: 130%;
}

/* Base styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background-color);
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
}

/* Container */
.menu-container {
  text-align: center;
  background-color: var(--light-background-color);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 0 20px var(--shadow-color);
  max-width: 400px;
  width: 100%;
  box-sizing: border-box;
}

/* Headings */
.menu-container h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  word-wrap: break-word;
}

/* Paragraph */
.menu-container p {
  font-size: 115%;
  margin-bottom: 2rem;
  color: var(--bg-text-color);
}

/* Buttons */
.menu-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  margin: 0.5rem auto;
  width: 100%;
  max-width: 400px;
  cursor: pointer;
  display: block;
  transition: background-color 0.3s, transform 0.1s;
  white-space: normal;
  word-break: break-word;
}

@media (hover: hover) and (pointer: fine) {
  .menu-button:hover {
    background-color: var(--hover-color);
  }
}

.menu-button:active {
  transform: scale(0.95);
}


/* Container for checkbox and label */
.custom-checkbox {
  display: flex;
  align-items: center;
  margin: 5px 0;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}

/* Hide the native checkbox */
.custom-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  margin-right: 10px;
  width: 17px;
  height: 17px;
  border: 2px solid #888;
  border-radius: 5px;
  display: inline-block;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

/* Checked state */
.custom-checkbox input[type="checkbox"]:checked {
  background-color: var(--primary-color); /* Use your theme's accent color */
  border-color: var(--hover-color);
}

/* Checkmark */
.custom-checkbox input[type="checkbox"]::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  top: 0.5px;
  left: 3.5px;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.2s;
}

/* Show checkmark when checked */
.custom-checkbox input[type="checkbox"]:checked::after {
  opacity: 1;
}


/* Chrome, Safari, Edge, Opera */
#customRoundInput::-webkit-outer-spin-button,
#customRoundInput::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
#customRoundInput {
  -moz-appearance: textfield;
}

#customRoundInput {
  text-align: center;
  width: 200px;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: 0.2px solid var(--primary-color);
  border-radius: 8px;
  background-color: var(--light-background-color);
  color: white;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 20px var(--shadow-color);
}

#customRoundInput:focus {
  border-color: white;
  box-shadow: 0 0 0 2px var(--hover-color);
}

#customInputContainer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.1rem;
  margin-bottom: 1rem;
}







/* Base style for all range sliders */
input[type="range"] {
  -webkit-appearance: none; /* Remove default Chrome/Safari style */
  width: 100%;
  height: 7px;
  background: #ddd;
  border-radius: 6px;
  outline: none;
  padding: 0;
  margin: 10px 0;
  transition: background 0.3s;
}

/* Track hover */
input[type="range"]:hover {
  background: #ccc;
}

/* Webkit slider thumb */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var( --primary-color);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var( --hover-color);
  transition: background 0.3s, transform 0.2s;
}

@media (hover: hover) and (pointer: fine) {
  input[type="range"]::-webkit-slider-thumb:hover {
    background: var( --hover-color);
    border: 2px solid var( --primary-color);
    transform: scale(1.1);
  }
}

/* Firefox slider thumb */
input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var( --primary-color);
  border-radius: 50%;
  border: 2px solid var( --hover-color);
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

@media (hover: hover) and (pointer: fine) {
  input[type="range"]::-moz-range-thumb:hover {
    background: var(--hover-color);
    border: 2px solid var( --primary-color);
    transform: scale(1.1);
  }
}

/* Track for Firefox */
input[type="range"]::-moz-range-track {
  background: #ddd;
  height: 12px;
  border-radius: 6px;
}

/* Track for IE */
input[type="range"]::-ms-track {
  background: transparent;
  border-color: transparent;
  color: transparent;
  height: 12px;
  border-radius: 6px;
}

input[type="range"]::-ms-fill-lower {
  background: #ddd;
  border-radius: 6px;
}

input[type="range"]::-ms-fill-upper {
  background: #ddd;
  border-radius: 6px;
}









.truth-dare-container {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.truth-column, .dare-column {
  width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.truth-and-dare-button {
  width: 100%;
  margin-bottom: 10px;
}

.category-filters {
  margin-top: 0.rem;
  display: flex;
  flex-direction: column;
  gap: 0px;
}


/* Dropdown details */
details {
  max-width: 90vw;
  margin-bottom: 1rem;
}

summary {
  font-weight: bold;
  cursor: pointer;
  white-space: normal;
  word-wrap: break-word;
}

.output-box {
  margin-top: -1.3rem;
  background-color: var(--light-background-color);
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 1.1rem;
  color: var(--bg-text-color);
  box-shadow: 0 2px 5px var(--shadow-color);
}

.back-button {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000; /* stays above other elements */
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
}

.has-back-button {
  position: relative;
}


.x-btn {
  background: transparent;
  color: rgba(255, 255, 255, 0.6); /* light grey */
  border: none;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s, transform 0.1s;
  position: fixed;
  top: 1.5rem;
  left: 1.7rem;
  z-index: 1000; /* stays above other elements */
  text-shadow: 0 2px 5px var(--shadow-color);
}

.x-btn:hover {
  color: rgba(255, 255, 255, 0.9); /* brighter on hover */
  transform: scale(1.1);
}

.x-btn:focus {
  outline: none;
}


#playerList {
  margin-top: 1rem;
  padding-left: 0;
  list-style: none;
  text-align: center; 
  color: var(--bg-text-color);
}

#playerList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--light-background-color);
  color: var(--bg-text-color);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.player-name {
  flex: 1;
  text-align: center;
  font-weight: bold;
}

.remove-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

input[type="text"] {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem;
  margin: 1rem auto;
  display: block;
  font-size: 1rem;
  border: none;
  border-radius: 0.5rem;
  background-color: var(--light-background-color);
  color: #fff;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}

input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.remove-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #ff6b6b;
  transition: transform 0.1s;
}

.remove-btn:hover {
  transform: scale(1.2);
}


#game-screen, #game-screen * {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;

  touch-action: manipulation;
  -ms-touch-action: manipulation;
}

/* Fullscreen prompt screen */
#game-screen {
  height: 100vh;
  width: 100vw;
  background-color: var(--background-color); /* default background */
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
  cursor: pointer;
  box-sizing: border-box;
  position: relative;
  border-radius: 1rem;
  box-shadow: 0 0 20px var(--shadow-color);
  transition: background-color 0.3s ease; /* smooth color changes */
  color: white; /* default text color */
  user-select: none;
}


/* Prompt text centered and styled */
.prompt-text {
  font-size: 1.7rem;
  font-weight: normal;
  color: inherit;
  max-width: 100%;
  font-family: 'Cooper', sans-serif;
  animation: fadeIn 0.2s ease-in-out;
  line-height: 1.4;
  text-align: center;
}



/* Optional animation for prompt changes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#game-screen.card-sip    { background-color: var(--card-sip); }
#game-screen.card-truth  { background-color: var(--card-truth); }
#game-screen.card-dare   { background-color: var(--card-dare); }
#game-screen.card-group  { background-color: var(--card-group); color: black; }
#game-screen.card-wild   { background-color: var(--card-wild); }
#game-screen.card-challenge { background-color: var(--card-challenge); }
#game-screen.card-effectStart { background-color: var(--card-effectStart); color: black; }
#game-screen.card-effectEnd { background-color: var(--card-effectEnd); color: black; }
#game-screen.card-game { background-color: var(--card-game); }
#game-screen.card-twoPart { background-color: var(--card-twoPart); }
#game-screen.card-spez { background-color: var(--card-spez); color: rgb(255, 255, 0); }




#difficulty-buttons {
  display: flex;
  justify-content: center; /* centers buttons horizontally */
  gap: 0.4rem;
  margin-bottom: 1.3rem;
  margin-top: 0.5rem;
}

.difficulty-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--primary-color);
  background-color: transparent;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .difficulty-btn:hover {
    background-color: #af5353;
  }
}

.difficulty-btn.selected {
  background-color: var(--primary-color);
  color: white;
}

#roundOptions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  margin-top: 0.4rem;
}

.round-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--primary-color);
  background-color: transparent;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}

.round-btn:hover {
  background-color: #913939;
}

.round-btn.selected {
  background-color: var(--primary-color);
  color: white;
}

#customRoundInput::placeholder {
  color: #ff7f7f; /* Light gray, change as needed */
  opacity: 1;  /* Ensures the color isn't faded in some browsers */
}

.active-effects-container {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  z-index: 1000;
}

.effect-tag {
  background-color: rgba(164, 154, 154, 0.536);
  color: white;
  border: 1px solid white;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.effect-emoji {
  font-size: 2em;
  margin-bottom: 2px;
}

.effect-tag:hover {
  background-color: rgba(255, 255, 255, 0.2);
}


.tooltip-bubble {
  position: absolute;
  background: #333;
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  width: 240px;
  z-index: 1000;
  pointer-events: auto;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: translate(-95%, -10%);
  display: none; /* Only toggle this */
}

.tooltip-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

/* Language selector */
.language-selector {
  appearance: none; /* Remove native styling */
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--light-background-color);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  padding: 4px 25px 4px 16px;
  font-size: 16px;
  color: #fff;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon fill='%23666' points='70,100 100,50 40,50'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: absolute;
  top: 20px; right: 18px;
}

.language-selector:focus {
  outline: none;
  border-color: rgb(255, 66, 66);
  box-shadow: 0 0 0 3px rgba(185, 0, 0, 0.2);
}



/* Games */

#games-container {
  display: flex;
  height: 80vh;
  width: 90vw;
  max-width: 1200px;
  background-color: var(--light-background-color);
  border-radius: 1rem;
  box-shadow: 0 0 20px var(--shadow-color);
  overflow: hidden;
}

#sidebar {
  width: 30%;
  border-right: 1px solid #ccc;
  overflow-y: scroll;
}

.game {
  padding: 0.5rem;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.game:hover {
  background: #f0f0f0;
}

#filters {
  margin-bottom: 1rem;
}

/* ---------- Modal Base Styles ---------- */
.modal {
  display: none; /* hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
}

/* Modal content box */
.modal-content {
  background: var(--light-background-color);
  margin: 4% auto;
  padding: 20px;
  border-radius: 12px;
  width: 80%;
  max-width: 500px;
  text-align: left; /* rules left-aligned */
  max-height: 85vh; /* scrollable if content too tall */
  overflow-y: auto;
}

/* Modal title */
#modalTitle {
  text-align: center;   /* center the title */
  font-size: 2em;       /* make it bigger */
  font-weight: bold;     /* bold for emphasis */
  margin-bottom: 15px;  /* spacing below title */
}

/* Close button */
.close-button {
  float: right;
  font-size: 28px;
  cursor: pointer;
}
.close-button:hover {
  color: red;
}

/* Rule section formatting */
.rule-section-title {
  margin-top: 15px;
  font-weight: bold;
  font-size: 1.2em;
}

.rule-section-content {
  margin-bottom: 10px;
  line-height: 1.4;
}

/* Adjust modal content on small screens */
@media (max-width: 600px) {
  .modal-content {
    width: 90%;
    margin-top: 15%;
  }
}



/* Right-side panel with flap */
.side-panel {
  position: fixed;
  top: 0;
  right: -250px;
  width: 250px;
  height: 100%;
  background: var(--light-background-color);
  box-shadow: -2px 0 6px rgba(0,0,0,0.3);
  transition: right 0.3s ease;
  z-index: 1050;
  display: flex;
  border-style: solid;
  border-color: var(--bg-text-color);
  border-width: 0 0 0 2px;
}

.side-panel.open {
  right: 0;
}

.panel-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

/* Flap button: sits on the left edge of the panel */
.flap-button {
  position: absolute;
  left: -25px;  /* sticks out when closed */
  top: 50%;
  transform: translateY(-50%);
  width: 25px;
  height: 80px;
  background: var(--light-background-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 10px 0 0 10px;
  font-size: 20px;
  border-style: solid;
  border-color: var(--bg-text-color);
  border-width: 2px 0 2px 2px;
}
