/* ========================================
* Project: Twenty-One Dice Game
* File: twentyOne.css
* Author: Bretscher Jan
* Date: 20.02.25
* Version: 1.0
* Description: Stylesheet for the Twenty-One dice game interface,
*              handling layout, styling, and responsive design
======================================== */

* {
    font-family: sans-serif;
}

/* General styles for the body element */
body {
    margin: 0;
    padding: 10px;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: left;
    height: 60vh;
    position: relative;
}

/* Background image positioning */
#backgroundImage {
    position: absolute;
    top: 20px;
    left: 50;
    z-index: -1;
    object-fit: none;
  }

/* Grid layout for the game board */
.grid {
    position: absolute;
    top: 20px;
    left: 50;
    display: grid;
    grid-template-columns: repeat(6, 70px); /* 6 columns of 70px each */
    grid-template-rows: repeat(5, 70px);    /* 5 rows of 70px each */
    column-gap: 40px;
    row-gap: 20px;
    z-index: 2;
}

/* Individual cell styling */
.cell {
    background-color: #ffffff2d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    border-radius: 10px;
    z-index: 3;
}

/* Highlighted cell when dragging over */
.cell.dragover {
    background-color: rgba(0, 0, 0, 0.566);
    border-radius: 10px;
}

/* Styling for draggable elements */
.draggable {
    width: 72px;
    height: 72px;
    cursor: grab;
    z-index: 4;
    position: relative;
    overflow: hidden; /* Prevents lines from extending beyond the container */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0; /* Makes the text ("0") invisible */
}

/* Styling for the X cross lines */
.cross-line {
    background-color: #000000;
    position: absolute;
    width: 102px; /* Length of diagonal */
    height: 10px; /* Line thickness */
    border-radius: 5px; /* Rounded corners */
    top: 50%; /* Centering */
    left: 50%; /* Centering */
}

/* First diagonal line (top-left to bottom-right) */
.diagonal-1 {
    transform: translate(-50%, -50%) rotate(45deg); /* 45 degree rotation */
}

/* Second diagonal line (top-right to bottom-left) */
.diagonal-2 {
    transform: translate(-50%, -50%) rotate(-45deg); /* -45 degree rotation */
}

/* Clone of draggable element */
#draggableClone {
    width: 72px;
    height: 72px;
    background-color: #000000;
    border-radius: 10px;
    cursor: grab;
    z-index: 4;
}

/* Dice container styling */
#wuefel {
    margin-top: 20px;
    margin-left: 2.5%;
    text-align: center;
    position: relative;
    z-index: 3;
}

/* Container for the dice elements */
.dice-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

/* Base styling for all dice */
.dice {
    width: 55px;
    height: 55px;
    background-color: #fff;
    border: 2px solid #000;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

/* Specific styling for each colored dice */
.diceRed { background-color: rgb(249, 215, 213); color: rgb(0, 0, 0); }
.diceYellow { background-color: rgb(255, 234, 213); color: rgb(0, 0, 0); }
.diceGreen { background-color: rgb(220, 236, 220); color: rgb(0, 0, 0); }
.diceBlue { background-color: rgb(225, 236, 253); color: rgb(0, 0, 0); }
.diceWhite { background-color: rgb(247, 247, 247); color: rgb(0, 0, 0); }
.diceBlack { background-color: rgb(112, 112, 112); color: rgb(0, 0, 0); }

/* Button styling */
.btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 5px;
}

/* Styling for score display */
.auswertung {
    background-color: #6f6f6f90;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    text-align: center;
    margin: 5px;
}

/* Disabled button styling */
.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Button hover effect */
.btn:hover {
    background-color: #0056b3;
}

/* Session container styling */
.session {
    margin-top: 20px;
    text-align: center;
    position: relative;
    z-index: 3;
}

/* Input fields within session container */
.session input {
    padding: 10px;
    margin: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

/* Buttons within session container */
.session button {
    margin: 5px;
}

/* Home button positioning */
#home {
    position: relative;
    top: 20px;
    left: 20px;
    z-index: 3;
}

/* Paragraph text styling */
p {
    margin-top: 20px;
    text-align: center;
    color: #333;
    position: relative;
    z-index: 3;
}

/* Menu styling */
#menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 5;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    width: 100%;
    right: 0;
}

/* Responsive design adjustments for tablets */
@media (max-width: 768px) {

    .dice {
        width: 40px; /* Reduces dice size */
        height: 40px; /* Reduces dice size */
        font-size: 16px; /* Reduces font size */
    }

    .btn {
        padding: 8px 16px; /* Reduces button padding */
        font-size: 14px; /* Reduces button font size */
    }

    p {
        font-size: 14px; /* Reduces hint text font size */
    }
}

/* Responsive design adjustments for mobile phones */
@media (max-width: 480px) {

    .dice {
        width: 30px; /* Further reduces dice size */
        height: 30px; /* Further reduces dice size */
        font-size: 14px; /* Further reduces font size */
    }

    .btn {
        padding: 6px 12px; /* Further reduces button padding */
        font-size: 12px; /* Further reduces button font size */
    }

    p {
        font-size: 12px; /* Further reduces hint text font size */
    }
}