@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap");

:root {
  --bg: #0c1117;
  --panel: #111827;
  --muted: #9ca3af;
  --primary: #22d3ee;
  --primary-contrast: #0f172a;
  --border: #1f2937;
  --text: #e5e7eb;
  --danger: #f87171;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% 20%, #0b2239, #0c1117 50%),
    radial-gradient(circle at 80% 0%, rgba(34, 211, 238, 0.06), #0c1117 40%);
  color: var(--text);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem 3rem;
}

.page {
  width: min(960px, 100%);
  display: grid;
  gap: 1.5rem;
}

.page--narrow {
  width: min(760px, 100%);
}

.hero {
  text-align: center;
  padding: 0 1rem;
}

.hero--compact {
  text-align: left;
  padding: 0;
}

.hero__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.6rem);
}

.hero p {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.panel__header--space-between {
  align-items: flex-start;
}

.panel__title {
  margin: 0;
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.room-name-input {
  font: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  outline: none;
  min-width: 0;
  width: auto;
  flex: 1;
}

.room-name-input[readonly] {
  cursor: default;
}

.settings-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.9rem;
  min-width: 0;
}

.room-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.room-code {
  font-weight: 700;
  letter-spacing: 0.05em;
}

.room-visibility {
  color: var(--muted);
  font-weight: 600;
}

.room-info {
  margin: 0.25rem 0 1rem;
  color: var(--muted);
}

.room-rules {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.room-rules__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.room-rules__header h4 {
  margin: 0;
}

.room-rules__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.rule-list__title {
  margin: 0.35rem 0;
  color: #cbd5e1;
  font-weight: 700;
}

.rule-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rule-list--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.35rem 0.75rem;
}

.rule-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  gap: 0.75rem;
}

.rule-item--colored::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rule-dot, var(--primary));
  display: inline-block;
}

.rule-item__label {
  font-weight: 600;
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
}

.rule-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 48px;
  height: 24px;
}

.panel {
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.06), transparent 45%),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}

.public-room-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.public-room-list__empty {
  margin: 0;
  color: var(--muted);
}

.public-room-button {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  text-align: left;
}

.public-room-button__title {
  flex: 1;
  margin-right: 0.5rem;
}

.public-room-button__icons {
  display: inline-flex;
  gap: 0.35rem;
  justify-content: flex-end;
  min-width: 4rem;
}

.public-room-button__icon {
  font-size: 1rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.ghost-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.ghost-link:hover {
  color: var(--text);
}

.badge {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(34, 211, 238, 0.12);
  color: var(--primary);
  font-weight: 700;
}

.badge[data-gender="f"] {
  color: #f472b6;
  background: rgba(244, 114, 182, 0.14);
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.field {
  display: flex;
  gap: 0.35rem;
  flex-direction: column;
}

.field__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.field__counter {
  color: var(--muted);
  font-size: 0.95rem;
}

.field__hint {
  margin: 0;
  color: var(--muted);
}

.field__label {
  margin: 0;
  color: #cbd5e1;
  font-weight: 700;
}

label {
  font-weight: 600;
  color: #cbd5e1;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.input-row--code {
  grid-template-columns: 1fr auto;
}

.input-row--player {
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem 0.75rem;
}

.input-row--tight {
  max-width: 180px;
  grid-template-columns: 1fr;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25);
}

input.room-name-input {
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  width: auto;
}

input.room-name-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

.input-hint {
  color: var(--muted);
  font-size: 0.9rem;
}

button {
  appearance: none;
  border: none;
  background: var(--primary);
  color: var(--primary-contrast);
  font-weight: 700;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.2s ease;
  box-shadow: 0 10px 30px rgba(34, 211, 238, 0.35);
}

button:hover:enabled {
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(34, 211, 238, 0.45);
}

button:active:enabled {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.ready-toggle {
  width: auto;
  min-width: 140px;
}

.ready-toggle--active {
  background: #22c55e;
  color: #052e16;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.35);
}

.room-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.room-actions button {
  min-width: 120px;
}

.room-actions__cta {
  min-width: 140px;
}

.room-actions__leave {
  margin-right: auto;
}

.button-danger {
  background: rgba(248, 113, 113, 0.16);
  color: #fecdd3;
  border: 1px solid rgba(248, 113, 113, 0.45);
  box-shadow: 0 10px 30px rgba(248, 113, 113, 0.35);
}

.button-danger:hover:enabled {
  box-shadow: 0 12px 36px rgba(248, 113, 113, 0.45);
}

.button-danger:active:enabled {
  transform: translateY(0);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form__status {
  margin: 0;
  font-weight: 700;
}

.form__status[data-state="success"] {
  color: #22c55e;
}

.form__status[data-state="error"] {
  color: var(--danger);
}

.helper-box {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.helper-box__title {
  margin: 0 0 0.4rem;
}

.placeholder-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.25rem;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.option-row__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  background: rgba(255, 255, 255, 0.02);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  align-items: flex-start;
}

.field--stacked {
  gap: 0.5rem;
  flex-direction: column;
}

.button-secondary {
  background: #0f172a;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(12, 17, 23, 0.8);
  padding: 1.5rem;
  z-index: 60;
}

.confirm-overlay__box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.45);
  min-width: min(420px, 100%);
}

.confirm-overlay__box p {
  margin: 0 0 1rem;
  line-height: 1.4;
  text-align: center;
}

.confirm-overlay__actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.message-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(12, 17, 23, 0.8);
  padding: 1.5rem;
  z-index: 70;
}

.message-overlay__box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.45);
  min-width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  text-align: center;
}

.message-overlay__box h3 {
  margin: 0;
}

.message-overlay__box p {
  margin: 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.helper {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.player-status {
  justify-self: start;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}

.player-status--ready {
  background: rgba(34, 197, 94, 0.2);
  color: #bbf7d0;
}

.player-status--not-ready {
  background: rgba(248, 113, 113, 0.15);
  color: #fecdd3;
}

.player-status--host {
  background: rgba(34, 211, 238, 0.12);
  color: var(--primary);
}

.greeting {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 10px;
  font-weight: 600;
}

.error {
  color: var(--danger);
}

.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.arrow {
  display: inline-block;
  transform: translateY(1px);
  font-size: 1.1rem;
}

.center
{
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#input-gender
{
	width: 44px;
	height: 44px;
	background-size: cover;
}

#input-gender[data-value="m"]
{
	background-image: url("/img/male.png");
}

#input-gender[data-value="f"]
{
  background-image: url("/img/female.png");
}

#save-name
{
	width: 120px;
	align-self: center;
}

.rejoin-dialog {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(12, 17, 23, 0.8);
  padding: 1.5rem;
  z-index: 20;
}

.rejoin-dialog__box {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.45);
  min-width: min(420px, 100%);
}

.rejoin-dialog p {
  white-space: pre-line;
  margin: 0 0 1rem;
  text-align: center;
  line-height: 1.5;
}

.rejoin-dialog__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(12, 17, 23, 0.82);
  backdrop-filter: blur(2px);
  z-index: 50;
}

.settings-modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  width: min(520px, 100%);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.settings-modal__close {
  background: #0f172a;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
  min-width: 0;
  padding: 0.5rem 0.9rem;
}

.settings-modal__description {
  margin: 0;
  color: var(--muted);
}

.report-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 17, 23, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 40;
}

.report-overlay__box {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  width: min(520px, 100%);
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.45);
}

.report-overlay__description {
  margin: 0.25rem 0 1rem;
  color: var(--muted);
}

.report-overlay__options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.report-overlay__option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.report-overlay__option input[type="radio"] {
  width: 18px;
  height: 18px;
}

.report-overlay__option span {
  font-weight: 600;
}

.report-overlay__feedback {
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.report-overlay__feedback[data-state="error"] {
  color: #fca5a5;
}

.report-overlay__feedback[data-state="success"] {
  color: #34d399;
}

.report-overlay__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.fullscreen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.12), #0c1117 50%),
    radial-gradient(circle at 70% 0%, rgba(34, 211, 238, 0.08), #0c1117 50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 10;
  text-align: center;
  padding: 2rem;
}

.fullscreen__label {
  margin: 0;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.fullscreen__name {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  color: var(--primary);
  text-shadow: 0 10px 45px rgba(34, 211, 238, 0.35);
}

.fullscreen.is-final .fullscreen__name {
  color: #f9fafb;
}

.fullscreen__action {
  margin-top: 1rem;
  padding-inline: 1.5rem;
}

.fullscreen__info {
  margin: 0 0 0.5rem;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 1rem;
  width: 100%;
  height: 100%;
}

.card-tile {
  --card-color: var(--panel);
  --card-text: var(--text);
  width: 100%;
  display: block;
  padding: 1.25rem;
  border-radius: 14px;
  background: var(--card-color);
  color: var(--card-text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  position: relative;
  min-height: 120px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.2s ease;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

.card-tile:hover:enabled {
  transform: translateY(-2px);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.4);
}

.card-tile:active:enabled {
  transform: translateY(0);
}

.card-tile.card-tile--disabled {
  cursor: default;
  opacity: 0.5;
}

.card-tile__text {
  display: block;
  font-size: 1.05rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  font-weight: 700;
  text-align: center;
  font-size: max(3vw, 2vh);
}

.card-tile--large {
    height: 100vh;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
	position: relative;
}

.card-tile--large .card-tile__text
{
	font-size: max(6vw, 6vh);
}

.fullscreen--selected-card {
  gap: 2rem;
}

.card-actions {
  position: fixed;
  left: 50%;
  bottom: 43px;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  z-index: 25;
}

.card-action-button {
  min-width: 180px;
  padding-inline: 1.4rem;
  font-size: 1rem;
}

.card-timer {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--primary);
  border-radius: 14px;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(34, 211, 238, 0.14);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  z-index: 30;
}

.card-timer__label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.card-timer__value {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
}

#btn_report
{
	position: absolute;
    top: 5px;
    right: 5px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0px;
    margin: 0px;
    border-radius: 18px;
    background-color: rgba(255,255,255,0.2);
    color: lightgray;
    box-shadow: none;
	border: 2px solid lightgray;
	outline: none !important;
	font-weight: 900;
    line-height: 32px;
    font-size: 26px;
}

#suggest-category
{
  color: light-dark(rgb(118, 118, 118), rgb(133, 133, 133));
}

.closing {
    overflow-y: hidden;
    height: 43px;
}

.closing[data-open="true"]
{
    height: fit-content;
}


[hidden]
{
	display: none !important;
}

#placeholder-helper::after
{
    content: "?";
    margin-left: 1rem;
    border: 1px solid white;
    width: 24px;
    height: 24px;
    display: inline-flex;
    border-radius: 12px;
    align-content: center;
    justify-content: center;
    cursor: pointer;
}

@media (max-width: 640px) {
  body {
    padding: 1.5rem 1rem 2rem;
  }

  .panel {
    padding: 1.25rem;
  }
  
  .fullscreen
  {
	  padding: 0.5rem;
  }
  
  .card-grid
  {
	  gap: 0.5rem;
  }

  #gender-options
  {
	flex-direction: column;
  }

  .card-action-button
  {
    min-width: 80vw;
    font-size: 0.75rem;
  }

  .card-actions
  {
    flex-direction: column;
  }

}
