/* ---------------------------------------------------------
   GLOBAL LAYOUT
---------------------------------------------------------- */
body.dark {
    margin: 0;
    padding: 0;
    font-family: "Inter", Arial, sans-serif;
    background-color: #1f2023;
    color: #e5e7eb;

    min-height: 0;
    box-sizing: border-box;
}

/* ---------------------------------------------------------
   CARD (Login + Dashboard)
---------------------------------------------------------- */
.card {
    background: #2c2f33;
    padding: 2rem 3rem;
    border-radius: 18px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.35);
    text-align: center;
    width: clamp(300px, 95%, 600px);
    box-sizing: border-box;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    opacity: 0;
    animation: blendIn 1s ease-out forwards;
    position: relative;
    /*background-color: transparent;*/
}

.card:hover {
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.45);
}

/* ---------------------------------------------------------
   PAGE WRAPPERS
---------------------------------------------------------- */

.dashboard {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
min-height: 100vh;
}


.login-page {
    display: flex;
    justify-content: center;  /* nur horizontal zentrieren */
    width: 100%;
    min-height: auto;   /* WICHTIG!!! verhindert Scroll-problem */
    z-index: 2;
}

.login-page { background: #1f2023; }
.login-page .card { max-width: 420px; padding: 2.5rem 3rem; }

/* ---------------------------------------------------------
   ANIMATIONS
---------------------------------------------------------- */
@keyframes floatUp {
    0% { transform: translateY(35px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes blendIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ---------------------------------------------------------
   HEADERS + TEXT
---------------------------------------------------------- */
h1 {
    font-size: 1.9rem;
    color: #e5e7eb;
    margin-bottom: 1rem;
}

.login-page h1 { margin-bottom: 1.5rem; }

.username { color: #4f9aff; }

/* ---------------------------------------------------------
   FLASH MESSAGES
---------------------------------------------------------- */
.flash-messages { list-style: none; padding: 0; margin: 1rem 0; }

.flash {
    padding: 0.9rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
}

.flash.success {
    background-color: rgba(52, 211, 153, 0.2);
    color: #22c55e;
    border: 1px solid #065f46;
}

.flash.error {
    background-color: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid #7f1d1d;
}

/* ---------------------------------------------------------
   BUTTONS
---------------------------------------------------------- */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.btn {
    display: inline-block;
    width: 100%;
    border: none;
    padding: 0.85rem;
    font-size: 1rem;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}

.btn:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.btn-blue { background-color: #4f9aff; }
.btn-blue:hover { background-color: #3b82f6; }


/* top-right admin/logout */
.control {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.control-buttons {
    display: inline-block;
    margin-top: 0.5rem;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}
.control-buttons:hover { color: #ffffff; }

/* ---------------------------------------------------------
   FORMS
---------------------------------------------------------- */
.login-form { display: flex; flex-direction: column; gap: 1.2rem; }

.form-group { text-align: left; }

.form-label {
    display: block;
    color: #cbd5e1;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid #3a3d41;
    background-color: #242629;
    color: #e5e7eb;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: #4f9aff;
    box-shadow: 0 0 0 3px rgba(79, 154, 255, 0.25);
}

/* Autofill fix */
input:-webkit-autofill {
    -webkit-text-fill-color: #e5e7eb !important;
    box-shadow: 0 0 0 30px #242629 inset !important;
    background-color: #242629 !important;
    border: 1px solid #3a3d41 !important;
    transition: background-color 9999s;
    caret-color: #e5e7eb !important;
}

/* ---------------------------------------------------------
   DARTBOARD OVERLAY (NEU + FIXED)
---------------------------------------------------------- */

.board-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 0;          /* WICHTIG!! */
    overflow: visible;  /* Elemente dürfen trotzdem rausgucken */
    pointer-events: none;
}

.board-overlay .container {
    position: relative;
    width: 100%;
    height: 0;          /* darf NICHT das Board halten! */
}

/* DARTBOARD wird Positionierungsbasis */
.board-overlay .board-wrapper {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 350px;
    height: 350px;
}

/* Dartboard */
.board-overlay .dartboard {
    width: 100%;
    height: 100%;
    display: block;
}

/* ARROWS – bleiben jetzt stabil */
.board-overlay .arrow-wrapper {
    position: absolute;
    opacity: 0;
    transform-origin: center center;
    pointer-events: none;
    z-index: 999999; /* völlig egal, Hauptsache > 3 */

}

.board-overlay .arrow-img {
    width: 150px;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none; /* Safari + alte Chrome Builds */
    -webkit-touch-callout: none;
    transform-origin: bottom center;
    
}

.board-space {
        height: min(500px, 50vh);
}


/* ---------------------------------------------------------
   ANIMATION TIMINGS
---------------------------------------------------------- */
.arrow1 { animation: fly1 0.3s linear forwards; animation-delay: 0s; }
.arrow1 .arrow-img { animation: rotateLate 0.4s linear forwards; animation-delay: 0s; }

.arrow2 { animation: fly2 0.3s linear forwards; animation-delay: 0.3s; }
.arrow2 .arrow-img { animation: rotateLate 0.4s linear forwards; animation-delay: 0.4s; }

.arrow3 { animation: fly3 0.3s linear forwards; animation-delay: 0.6s; }
.arrow3 .arrow-img { animation: rotateLate 0.4s linear forwards; animation-delay: 0.7s; }

/* ---------------------------------------------------------
   FIXED END POSITIONS (RELATIV ZUR SCHEIBE)
---------------------------------------------------------- */

@keyframes fly1 {
    0% { top: 40vh; left: -100vw; transform: scale(3.5); opacity: 1; }
    100% {
        top: 38%;
        left: 48%;
        transform: translate(-51%, -78%) scale(0.17);
        opacity: 1;
    }
}

@keyframes fly2 {
    0% { top: 120vh; left: 140vw; transform: scale(3.5); opacity: 1; }
    100% {
        top: 54%;
        left: 57%;
        transform: translate(-59%, -65%) scale(0.17);
        opacity: 1;
    }
}

@keyframes fly3 {
    0% { top: 80vh; left: -100vw; transform: scale(3.5); opacity: 1; }
    100% {
        top: 60%;
        left: 44%;
        transform: translate(-58%, -26%) scale(0.17);
        opacity: 1;
    }
}

/* Rotation */
@keyframes rotateLate {
    from { transform: rotateX(-50deg); }
    to   { transform: rotateX(0deg); }
}


/* HANDY ///*/
@media (hover: none) and (pointer: coarse) {
    .board-space {
      height: calc(min(360px, 60vw, 40vh) + 70px);
    }

    .board-overlay .board-wrapper {
      position: absolute;
      top: 40px;
      left: 50%;
      transform: translateX(-50%);
      width: min(360px, 60vw, 40vh);
      height: min(360px, 60vw, 40vh);
    }
}


/* Bestätigungs Modal und Buttons
/* Hintergrund */
.modal {
  display: none; 
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Box */
.modal-content {
  background: #1e1e1e;
  color: #eee;
  padding: 20px 30px;
  border-radius: 12px;
  width: 350px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Buttons */
.modal-buttons {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 20px;        /* Abstand zwischen den Buttons */
}

.modal-buttons button {
  padding: 10px 20px;
}

.btn-red {
  background-color: #d9534f;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-red:hover {
  background-color: #c9302c;
}