html, body {
    height: 100%;
    overflow: hidden;
    margin: 0;
	font-family: sans-serif;
	background-color: #f4f4f4 !important;
}
#container {
    display: flex;
    height: 100vh;
    /*height: calc(100vh - 5rem);
	margin-top: 5rem;*/
}
#game {
    width: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
}



#image-wrapper {
    position: relative;
		transform-origin: 0 0;
    /*width: 100%;
    max-height: 100%;*/
}


#image-wrapper img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}


.dropzone {
    position:absolute;
	/*background-color: rgba(0,61,204,0.8);*/
	background-color: rgba(0,61,204,0.8);
    width:1%;
    /*height:80px;*/
    /*border:2px dashed rgba(0,61,204,1);*/
    border:2px solid rgba(0,61,204,1);
    border-radius:50%;
	aspect-ratio: 1;
	animation: pulseHotspot 3.5s infinite;
}

.dropzone.hover {
    transform: scale(1.3);
    box-shadow: 0 0 12px rgba(255,255,255,0.9);
}


pulseHotspot animation {
    box-shadow: rgba(0,61,204,0.6) 0px 0px 0px 6px;
}

@keyframes pulseHotspot{
	0% {
	    box-shadow: 0 0 0 6px rgba(255,255,255, .6);
	}
	10% {
	    box-shadow: 0 0 0 10px rgba(255,255,255, 1);
	}
	20% {
	    box-shadow: 0 0 0 6px rgba(255,255,255, .6);
	}
	100% {
	    box-shadow: 0 0 0 6px rgba(255,255,255, .6);
	}
}


.dropzone.correct {
    background:rgba(0,255,0,0.4);
	border:2px solid rgba(0,255,0,1);
	animation: pulseHotspotCorrect 3.5s infinite;
}

pulseHotspotCorrect animation {
    box-shadow: rgba(0,255,0,0.6) 0px 0px 0px 6px;
}

@keyframes pulseHotspotCorrect{
	0% {
	    box-shadow: 0 0 0 6px rgba(0,255,0, .6);
	}
	100% {
	    box-shadow: 0 0 0 6px rgba(0,255,0, .6);
	}
}

.dropzone.wrong {
    background: rgba(255,0,0,0.4);
	border:2px solid rgba(255,0,0,1);
	animation: pulseHotspotWrong 3.5s infinite;
}

pulseHotspotWrong animation {
    box-shadow: rgba(255,0,0,0.6) 0px 0px 0px 6px;
}

@keyframes pulseHotspotWrong{
	0% {
	    box-shadow: 0 0 0 6px rgba(255,0,0, .6);
	}
	10% {
	    box-shadow: 0 0 0 10px rgba(255,0,0, 1);
	}
	20% {
	    box-shadow: 0 0 0 6px rgba(255,0,0, .6);
	}
	100% {
	    box-shadow: 0 0 0 6px rgba(255,0,0, .6);
	}
}

.toolbar{
	position: absolute;
	bottom: 65px;
	left: 16px;
	z-index: 999;
	display:none;
}

.timer {
    background:#000;
    color:#fff;
    padding:10px;
	display: flex;
	flex-direction: row;
}
#timer{
	margin-left: 0.5rem;
}

#resetView{
  /*margin-top: 16px;
  padding: 10px 20px;
  background-color: rgba(0,61,204, 0.4);
  color: #fff;
  
  border: 2px solid rgba(0,61,204, 1);
  cursor: pointer;
  font-weight: bold;
  border-radius: 4px;
  text-shadow: 3px 1px 3px #4d4d4d;*/
}

/* Container */
#items {
    width: 30%;
    /*padding: 20px;*/
    background: #f4f4f4;
    overflow-y: auto;
    overflow-x: hidden;
}
#items-container {
	display: grid;
    padding: 20px;
    overflow-y: hidden;
    overflow-x: hidden;
    gap: 10px;
	grid-template-columns: 32% 32% 32%;
}

/* Individual item */
/*.item {
    background:#4a90e2;
    color:white;
    padding:10px;
    margin-bottom:10px;
    border-radius:8px;
    cursor:grab;
	touch-action: none;
	user-select: none;
}*/
.item {
    display: flex;
    flex-direction: column;
    align-items: center;
	justify-content: center;
    gap: 10px;
    padding: 10px;
    background: #ffffff;
    border: 2px solid #004a8f;
    border-radius: 8px;
    cursor: grab;
	touch-action: none;
    user-select: none;
    transition: transform 0.1s;
	z-index: 10;

	/*aspect-ratio: 1;*/
}

.item:active {
    transform: scale(1.05);
}

/* Item image */
.item-img {
    width: 80%;
    object-fit: cover;
    flex-shrink: 0;
	z-index: -10;
}


.item-drag{
    border: none;
    border-right: 15px solid #004a8f;
}


.item-drag .item-img{
	width: 300px;
}



/* Item text */
.item-text {
    display: flex;
    flex-direction: column;
	font-weight: bold;
    color: #4d4d4d;
}

/* Optional: item ID styling */
.item-id {
	font-weight: normal;
    margin-right: 4px;
    /*color: #4a90e2;*/
}

/* Start screen */
#startOverlay {
    position: fixed;
    inset: 0;
	background: url("source/hermi4.jpg") center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}


.start-modal {
    background: white;
    padding: 30px;
	/*min-width: 350px;
    width: min-content;*/
    border-radius: 0.7rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.start-modal h2 {
    margin: 0 0 10px;
    text-align: center;
}

.start-modal label {
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

.start-modal input,
.start-modal select {
    margin-top: 5px;
    padding: 8px;
    font-size: 14px;
}

.start-modal button,
.success-modal button,
.toolbar button{
    margin-top: 10px;
    padding: 10px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.start-modal button:hover,
.success-modal button:hover,
.toolbar button:hover{
    background: #357bd8;
}

#objectGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.object-card {
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    background: #f5f5f5;
}

.object-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    background: #fff;
}

.object-card span {
    display: block;
    margin-top: 6px;
    font-size: 12px;
}

.object-card:hover {
    transform: scale(1.05);
}

.object-card.selected {
    border-color: #4a90e2;
    background: #eaf2ff;
}


/* Modal base */

.modal-score-content {
    width: 100%;
    max-height: 80vh;
    background: #fff;
    border-radius: 0.7rem;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

/* Scoreboard list */
#scoreboardList {
    margin: 15px 0;
}

.score-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 20px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.score-row span {
    font-weight: 600;
}

.object-icon{
	display: inline-block;
    height: 1.5rem;
    margin: 0.25rem 1rem;
	box-shadow: 1px 1px 3px #000;
}
.loading {
    text-align: center;
    padding: 20px;
    opacity: .6;
}


.score-row:nth-child(odd){
	background-color: rgba(77,77,77,0.1);
}

.score-row:nth-child(even){
	background-color: rgba(77,77,77,0.05);
}

.score-row:first-child {
    background-color: rgba(212, 175, 55, 0.7);
	color: #FFF;
	text-shadow: 2px 2px 2px #000;
	padding: 20px;
}

.score-row:nth-child(2) {
    background-color: rgba(188, 198, 204, 0.7);
	color: #FFF;
	text-shadow: 2px 2px 2px #000;
	padding: 20px;
}

.score-row:nth-child(3) {
    background-color: rgba(169, 113, 66, 0.7);
	color: #FFF;
	text-shadow: 2px 2px 2px #000;
	padding: 20px;
}

.successContainer{
	display: none;
	position: fixed;
	align-items: center;
	z-index: 9999;
	justify-content: center;
	inset: 0;
}

.success-modal{
	width: 350px !important;
}


/* Virtual Keyboard */
.keyboard-overlay {
    display: none;
    position: fixed;
	width: 50%;
	min-height: 25%;
	left: 40% !important;
	top: 40% !important;
	aspect-ratio:16 / 9;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
}

.keyboard-overlay.active {
    display: block;
}

.keyboard-frame {
    width: 100%;
    height: 420px; /* adjust to keyboard height */
    border: none;
    background: white;
}
/*
.keyboard-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
}

.keyboard-overlay.active {
    display: flex;
    align-items: flex-end;
}
*/
/* Language selector */
#language-selector {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 9999;
}

#languageSelect {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
}


@media (max-width: 1500px) {
	#items-container {
		gap: 20px;
		grid-template-columns: 48% 48%;
	}

}

#objectGrid {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 480px) {
    #objectGrid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    #objectGrid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 600px) {
	html, body {
	    overflow: unset;
	}
	
	#startOverlay {
		position: unset;
	    align-items: flex-start;
	}
	
	#items-container {
		grid-template-columns: 100%;
		padding: 5px;
		font-size: 0.75rem;
		line-height: 1;
	}
}