/* --- Modal & Iframe Styling --- */
#game-modal .modal-content {
    width: 95vw;
    max-width: none;
    background: #a7b600;
    border: 18px solid #ffffff;
    border-radius: 76px;
    margin-top: -50px;
    box-shadow:
        0 -4px 0 0 #efe5d8,
        0 -5px 7px 0 rgba(132, 153, 6, 0.30),
        inset 0 6px 10px rgba(181, 160, 120, 0.12),
        inset 0 -4px 4px rgba(255, 255, 255, 0.9);
}

#game-frame {
    width: 100%;
    border: none;
}

.modal-background {
    background-color: rgba(132, 153, 6, .86);
    box-shadow:
        0 -4px 0 0 #efe5d8,
        0 -5px 7px 0 rgba(181, 160, 120, 0.30),
        inset 0 6px 10px rgba(181, 160, 120, 0.12),
        inset 0 -4px 4px rgba(255, 255, 255, 0.9);
}

/* --- Konfetti-Effekt --- */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 999;
}

.confetti-piece {
    position: absolute;
    width: 12px;
    height: 12px;
    top: -20px;
    border-radius: 3px;
    animation: fall linear forwards;
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* --- Zertifikats-Generator Struktur --- */
#certificateContent {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    background-position: top center;
    background-repeat: no-repeat;
    background-size: 100% auto;
}

.certificate-generator {
    width: 100%;
    min-height: 700px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.certificate-preview {
    flex: 1;
}

.certificate-controls {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-top: 20px;
  background-color: #a7b500;
  padding: 20px;
  border-radius: 20px;
}
.certificate-name-input {
  flex: 1;
  height: 70px;
  padding: 0 25px;
  font-size: 32px;
  border: 3px solid #89a523;
  border-radius: 16px;
  outline: none;
  box-sizing: border-box;
  background: #fff;
}

.certificate-name-input:focus {
    border-color: #89a423;
}

.certificate-button {
  height: 70px;
  padding: 0 35px;
  border: none;
  border-radius: 16px;
  background: #89a523;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: .2s;
}

.certificate-button:hover {
    background: #a7b500;
}

/* --- Lade-Animation (Spinner) --- */
.certificate-loading {
    text-align: center;
    padding: 120px 20px;
}

.spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px auto;
    border: 8px solid #e5e5e5;
    border-top: 8px solid #78b300;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 28px;
    font-weight: 700;
    color: #444;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Social-Media Share-Buttons --- */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 1000px;
    margin: 25px auto;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 25px;
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: bold;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    flex: 1 1 auto;
    min-width: 140px;
    max-width: 200px;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
    filter: brightness(1.05);
}

.share-btn:active {
    transform: translateY(1px);
}

/* Candytopia Bonbon-Farben */
.viber { background-color: #9253c2; }
.whatsapp { background-color: #74a80c; }
.facebook { background-color: #f25c84; }
.messenger { background-color: #f58220; }
.telegram { background-color: #2ea3dc; }
.download { 
    background-color: #ffc212; 
    color: #4a3300; 
}

/* --- Responsive Layout --- */
@media(max-width:768px) {
    #certificateContent {
        padding: 15px;
    }
    .certificate-generator {
        min-height: 450px;
    }
    .certificate-controls {
        flex-direction: column;
    }
    .certificate-name-input,
    .certificate-button {
        width: 100%;
    }
    .certificate-name-input {
        font-size: 24px;
    }
    .certificate-button {
        font-size: 22px;
    }
    .loading-text {
        font-size: 22px;
    }
}

@media (max-width: 600px) {
    .share-buttons {
        padding: 0 15px;
    }
    .share-btn {
        max-width: none;
        flex: 1 1 100%;
    }
}