#game {
    display: grid;
    grid-template-columns: 15% 35% 50%;
    width: 100%;
    gap: 10px;
    align-items: start;
}

#left {
    width: 100%;
}

#center {
    width: 100%;
    text-align: center;
}

#right {
    width: 100%;
}

#cookie {
    width: 350px;
    max-width: 100%;
    cursor: pointer;
    display: block;
    margin: 15px auto;
}

.section {
    margin-bottom: 15px;
}

.scoreContainer 
{
	background-color : #BDAAA9;
	width : 30%;
	padding : 10px;
	border-radius: 10px;
	font-size: 40px;
    border-radius: 10px;
	border: 2px groove #BF7673;
    margin : 10px 0px 10px 0px;
}
.urgence
{
	float : center;
	position : absolute;
	top : 60%;
	left : 50px;
	height : 150px;
	width : 150px;
}
.urgence:hover
{
	transform : scale(1.1);
}

#clicker
{
	background-size: contain;
	position : relative;
	transition: all .1s ease-in-out;
	height: 485px;
	width: 435px;
	cursor : pointer;
    border-radius: 10px;
	border: 2px groove #BF7673;
    margin : 10px 0px 10px 0px;
}

#clicker:hover
{
	transform : scale(1.02);
}

#clicker:active
{
	transform : scale(0.99);
}

#clicker > .number {
	z-index: 99;
	font-size: 60px;
	color: #9D0052;
	position: absolute;
}

#clicker > .number2 {
	z-index: 99;
	font-size: 30px;
	color: black;
	position: absolute;
    background-color: #D9D9D9;
    width: 200px;
    border: groove 3px;
    border-radius: 15px;
}

.shop 
{
	background-color : #BDAAA1;
	transition: all .2s ease-in-out;
	border-radius: 10px;
	border: 2px groove #BF7673;
	width : 100%;
	margin : 10px 0px 10px 0px;
    
}

.shop:hover 
{
	background-color : #D1C2BF;
	transition: all .2s ease-in-out;
}
	
.shop #image 
{
	width : 25%;
}
	
.shop img 
{
	height : 74px;
	width : 85px;
  	border-radius: 10%;
}
	
.shop #nameandcost p {
	margin : 0px;
	width : 60%;
}
	
.shop #nameandcost p:first-of-type {
	font-size : 30px;
}
	
.shop #amount {
	font-size : 48px;
	color: #595959;
	width : 15%;
}
	
.unselectable {
	-webkit-user-select: none;
	-moze-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

#upgradeContainer
{
	background-color : #BDAAA9;
	width : 95%;
	padding : 10px;
	font-size: 40px;
    border-radius: 10px;
	border: 2px groove #BF7673;
    margin : 10px 0px 10px 0px;
}

#upgradeContainer img {
	border:2px solid #000;
	border-radius: 5px;
	margin : 7px 0px 7px 0px;
	padding : 7px;
	height : 64px;
	width : 90px;
}

.amelio, .construct
{
	font-size: 30px;
}
#phrase
{
	background-color : #ADA8A6;
	width: 100%;
	text-align: center;
	position: absolute;
    top: 0;
    left: 0;
  	font-size: 25px;
	position: fixed;
  	z-index: 98;
    border:3px solid #000;
	border-radius: 6px;
	margin : 7px 2px 7px 0px;
}
.nombreclics
{
	background: ##F090D9;
	width: 100%;
	font-size: 20px;
	margin : 1px 0px 10px 0px;
	border-radius : 5px;
}

#achievementContainer img
{
	border:2px solid #000;
	border-radius: 5px;
	margin : 7px 0px 7px 0px;
	padding : 7px;
	height : 80px;
	width : 85px;
}

.succes
{
	font-size: 30px;
}

.menu {
    position: static;
    margin-bottom: 20px;
}

.connect {
    position: static;
}

#perso {
    position: static;
}

#navigation {
    list-style: none;
    padding: 0;
    margin: 0;
}

#navigation li {
    list-style: none;
}

#navigation a {
    text-decoration:none;
    color:white;
    display:block;
    padding:5px;
}

#navigation a:hover {
    color:white;
}
#navigation a:visited {
    color:white;
}
a:visited {
  color:white;
}

@keyframes rotationBonus {

  from {
    transform:rotate(-20deg);
  }

  to {
    transform:rotate(20deg);
  }

}


@keyframes apparitionBonus {

  0% {
    opacity:0;
    transform:scale(0.1);
  }

  10% {
    opacity:1;
    transform:scale(1);
  }

  85% {
    opacity:1;
    transform:scale(1);
  }

  100% {
    opacity:0;
    transform:scale(0.1);
  }

}
#bonusLayer{
    position:fixed;
    left:0;
    top:0;
    width:100vw;
    height:100vh;
    pointer-events:none;
    z-index:9999;
}

.bonusContainer{
    position:absolute;
    width:70px;
    height:100px;
    animation:rotationBonus 4s linear infinite;
    pointer-events:auto;
    transform-origin:center center;
}

.bonus{
    width:70px;
    height:100px;
    display:block;
    cursor:pointer;
    opacity:0;
    animation:apparitionBonus 10s forwards;
}
.item{
    position:relative;
}
.item img {
    filter: drop-shadow(0 0 5px white);
}

.tooltip{
    position:absolute;

    right:calc(100% + 20px);   /* à gauche de la construction */
    top:50%;
    transform:translateY(-50%);

    width:300px;
    padding:15px;

    background:#222;
    color:#fff;
    border:2px solid #636363;
    border-radius:10px;
    box-shadow:0 0 15px rgba(0,0,0,.7);

    opacity:0;
    visibility:hidden;
    transition:.2s;

    pointer-events:none;
    z-index:9999;
}

.item:hover .tooltip{
    opacity:1;
    visibility:visible;
}
#rainLayer{
    position:fixed;
    left:0;
    top:0;
    width:100%;
    height:100%;
    overflow:hidden;
    z-index:9999;
    pointer-events:none;
}

.rainBoob{
    position:absolute;
    cursor:pointer;
    pointer-events:auto;
    user-select:none;

    padding:10px;
    box-sizing:border-box;
}


@keyframes fall {
    from {
        top: -80px;
        transform: rotate(0deg);
    }

    to {
        top: 100vh;
        transform: rotate(720deg);
    }
}

input[type="radio"] {
    display: none;
}

.bonnasse-image {
    cursor: pointer;
    border: 4px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.bonnasse-image:hover {
    transform: scale(1.05);
}

input[type="radio"]:checked + label .bonnasse-image {
    border-color: red;
}
/* ===== NOUVELLE ORGANISATION DU JEU ===== */

#game {
    display: grid !important;
    grid-template-columns: 15fr 35fr 50fr !important;
    width: 100% !important;
    gap: 10px;
    box-sizing: border-box;
    align-items: start;
}

#left {
    width: auto !important;
    min-width: 0;
}

#center {
    width: auto !important;
    min-width: 0;
    text-align: center;
}

#right {
    width: auto !important;
    min-width: 0;
}
#classement {
    width: 100%;
    max-width: 350px;
    margin: 20px auto;
    padding: 15px;
    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    color: white;
}

#classement h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
}

.classementLigne {
    display: flex;
    align-items: center;
    padding: 8px 5px;
    margin-bottom: 5px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.classementPosition {
    width: 35px;
    font-weight: bold;
}

.classementNom {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.classementScore {
    font-weight: bold;
    margin-left: 10px;
}

.bonusClick {
    filter:
        drop-shadow(0 0 10px rgba(0, 180, 255, 1))
        drop-shadow(0 0 25px rgba(0, 180, 255, 0.8))
        drop-shadow(0 0 50px rgba(0, 180, 255, 0.6))
        drop-shadow(0 0 80px rgba(0, 180, 255, 0.4));
}
.popImage {
    position: absolute;
    width: 35px;
    height: 35px;
    object-fit: contain;
    pointer-events: none;
    z-index: 9999;

    animation: popImageAnim 1s ease-out forwards;
}

@keyframes popImageAnim {
    0% {
        opacity: 1;
        transform: scale(0.5);
    }

    30% {
        opacity: 1;
        transform: scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0.8);
    }
}
/* ============================= */
/* AFFICHAGE MOBILE              */
/* ============================= */

@media (max-width: 600px) {

    #game {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px;
        box-sizing: border-box;
    }

    #left,
    #center,
    #right {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    /* Zone de clic */
    #clicker {
        width: min(435px, calc(100vw - 20px));
        height: auto;
        aspect-ratio: 435 / 485;
        margin: 10px auto;
        box-sizing: border-box;
    }

    #cookie {
        width: 100%;
        max-width: 350px;
        height: auto;
    }

    /* Score */
    .scoreContainer {
        width: calc(100% - 20px);
        max-width: none;
        box-sizing: border-box;
        font-size: 30px;
        margin: 10px auto;
    }

    /* Constructions */
    .shop {
        width: 100%;
        box-sizing: border-box;
    }

    /* Améliorations */
    #upgradeContainer {
        width: 100%;
        box-sizing: border-box;
    }

    /* Succès */
    #achievementContainer {
        width: 100%;
        box-sizing: border-box;
    }

    /* Phrase en haut */
    #phrase {
        width: 100%;
        box-sizing: border-box;
        font-size: 20px;
        margin: 0;
        padding: 3px;
    }

    /* Évite les textes trop larges */
    .shop #nameandcost p {
        max-width: 100%;
        overflow-wrap: break-word;
    }

    /* Menu / connexion */
    .menu,
    .connect,
    #perso {
        width: 100%;
        box-sizing: border-box;
    }

    input {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Urgence */
    .urgence {
        position: static;
        width: 120px;
        height: auto;
        display: block;
        margin: 10px auto;
    }

    /* Classement */
    #classement {
        width: calc(100% - 20px);
        max-width: none;
    }

    /* Les infobulles ne doivent pas sortir de l'écran */
    .tooltip {
        right: auto;
        left: 0;
        top: 100%;
        transform: none;
        width: calc(100vw - 30px);
        max-width: 300px;
    }
}