/*general stuff*/
*
{
    box-sizing: border-box;
    /*border: 1px solid red; */
    user-select: none;
}

html, body
{
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    font-family: 'UnifrakturCook', fantasy;
    background-color: #1a1111;
    color: white;
    margin: 0;
    overflow: hidden;
}
img
{
    max-width: 100%;
    height: auto;
    display: block;
}
.hidden 
{
    display: none !important;
}
/*main layout*/
#screen
{
  display: flex;
  flex-direction: column;
  height: 100vh;
}
#top
{
    display: grid;
    grid-template-columns: 10% 1fr auto; /* left, middle, right */
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 10px;
    background-color: #222;
    color: white;
    border: 1px solid rgb(29, 7, 7);
}

#bottom
{
    flex:0 0 40px;
    background-color: #222;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgb(29, 7, 7);
}
#middle
{
    display:flex;
    flex-direction:row;
    flex:1;
}
#center
{
    position: relative;   
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    aspect-ratio: 1.5 / 1;
    overflow: visible;
}
#ticker-wrapper 
{
    width: 100%;
}
#ticker 
{
    background-color: rgba(30,0,0,0.9);
    color: #ff5555;
    width: 100%;
    height: 30px;
    line-height: 30px;
    font-weight: bold;
    font-family: 'MedievalSharp', sans-serif;
    overflow: hidden;
    white-space: nowrap;
    z-index: 10000;
    border-bottom: 2px solid #880000;
    padding-left: 5px;
}

#ticker-content 
{
    display: inline-block;
    will-change: transform,opacity;
    transform: translateX(0); 
    font-size: 20px;
    opacity: 0;
}



.game-screen 
{
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/img/ui/gameframe.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    z-index: 10;
}
#middle #left, #right
{
    flex:1;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    border: 1px solid rgb(29, 7, 7);
}
/* game canvas */
canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
}
.modal
{
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    backdrop-filter: blur(1px);
}


.login-content 
{
    background: #2a1d1d;
    font-family: 'Old English Text MT', fantasy;
    color: #e0c097;
    padding: 25px;
    border-radius: 12px;
    width: 350px;
    text-align: center;
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px rgb(151 8 8 / 50%);
    border: 2px solid #21090d;
}
#loginModal
{
    background-color: black;
    background-image: url('../assets/img/ui/bg.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}
.form-group {
    margin-bottom: 15px;
    text-align: left;
}
input {
    width: 100%;
    padding: 8px;
    border: 2px solid #21090d;
    background: #3e2c1e;
    color: white;
    border-radius: 5px;
    font-size: 16px;
    font-family: 'Old English Text MT', fantasy;
}

input::placeholder {
    color: #d4af37; /* Gold hint text to match the theme */
    font-family: 'Old English Text MT', fantasy;
    font-size: 16px;
}

input:focus {
    outline: none;
    border-color: #d4af37; /* Adds a gold glow effect on focus */
}
.btn {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(90deg, #8b5a2b, #d4af37);
    color: black;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.3);
}

.btn:hover {
    background: linear-gradient(90deg, #d4af37, #8b5a2b);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.6);
}

.btn.alt {
    background: linear-gradient(90deg, #444, #777);
    color: white;
}
.btn.logout {
    width:auto;
}

.btn.alt:hover {
    background: linear-gradient(90deg, #777, #aaa);
}
#hud 
{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* allows gameplay clicks to pass through */
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 25; /* just above the game canvas */
}

#hud #messagebox
{
    position: absolute;
    top: 23vh;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    max-height: 200px;
    background: radial-gradient(ellipse at center, rgba(250, 240, 220, 0.95) 0%, rgba(210, 180, 140, 0.9) 100%);
    border: 4px solid rgba(120, 80, 40, 0.8);
    border-radius: 15px;
    padding: 16px 24px;
    font-family: 'UnifrakturCook', fantasy;
    font-size: 18px;
    color: #4b2e0f;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 25px rgba(120, 80, 40, 0.7),
                inset 0 0 8px rgba(255, 255, 240, 0.5);
    text-align: center;
    overflow-y: auto;
    pointer-events: auto;
    transition: opacity 0.3s;
}

#hud #messagebox.hidden 
{
    pointer-events: none;
    opacity: 0;
} 
@keyframes bloodgodFade {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}


.inventory 
{
    position: absolute;
    top: 50%;
    left: 75%;
    width: 374px;
    height: 345px;
    transform: translate(-50%, -50%);
    background-image: url('../assets/img/ui/bgframe1.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    flex-direction: column;
    z-index: 20;
}

.inventory-grid, .chest-grid, .known-grid
{
    display: grid;
    grid-template-columns: repeat(4, 80px);
    grid-gap: 3px;
    justify-self: center;
}

.item-slot 
{
    position: relative;
    width: 80px;
    height: 80px;
    border: 1px solid #444;
    border-radius: 6px;
    background: rgb(10 12 37 / 0%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.item-title 
{
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    color: #6b421df0;
    text-shadow: 0 0 5px black;
}

.item-slot:hover 
{
    transform: scale(1.05);
    box-shadow: inset 0px 0px 9px 6px rgb(73 43 6 / 90%);
    cursor: pointer;
}

.item-slot.selected 
{
    outline: 2px solid #97623a;
}

.item-icon 
{
    background-size: auto; /* show one tile area */
    background-repeat: no-repeat;
    background-position: 0px 0px;
    width: 64px;
    height: 64px;
}

.item-amount 
{
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #2b0c0c;
    color: #89861a;
    font-size: 12px;
    border-radius: 50%;
    padding: 4px 6px;
    box-shadow: 0 0 5px black;
}
#inventoryActionMenu
{
    height: 68px;
    border: 2px solid rgba(255, 255, 255, 0.15);

}
.action-grid
{
    height: 100%;
}
.action-grid button
{
    height: 100%;

}

.header
{
    font-size: 20px;
    margin-bottom: 12px;
    text-align: center;
    color: #7d1515;
    text-shadow: 0 0 5px black;
}
#actionbar,#castbar 
{
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-image: url('../assets/img/ui/bgframe1.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    padding: 9px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    z-index: 1000;
}


#actionbar .action-grid,#castbar .action-grid
{
    display: grid;
    grid-template-columns: repeat(6, 64px);
    grid-gap: 2px;
}
.action-icon
{
    background-color: transparent;
}
/* basechest */
#basechest
{
	position: fixed;
  	top: 50%;
 	left: 50%;
 	width: 45%;
 	height: 55%;
  	background: rgba(30, 30, 30, 0.9);
  	color: white;
  	z-index: 20;
  	padding:3%;
  	transform: translate(-50%, -50%);
	background-image: url('../assets/img/ui/bgframe1.png');
	background-size: 100% 100%;
	background-repeat: no-repeat;
}
#innerframe
{
	position:relative;
	display:flex;
	flex-direction:row;
	justify-content:space-between;
	background: rgb(00 00 00 / 0%);

}
#inventoryframe, #chestframe, #knownframe,#bloodframe
{
	flex:1;
	height: 100%;
    padding:3%;
	background-image: url('../assets/img/ui/bgframe4.png');
	background-size: 100% 100%;
	background-repeat: no-repeat;
}

/* basework */
#basework,#baseblood
{
	position: fixed;
  	top: 50%;
 	left: 50%;
 	width: 70%;
 	height: 55%;
  	background: rgba(30, 30, 30, 0.9);
  	border: 2px solid #555;
  	padding: 20px;
  	color: white;
  	z-index: 20;
  	padding:3%;
  	transform: translate(-50%, -50%);
	background-image: url('../assets/img/ui/bgframe1.png');
	background-size: 100% 100%;
	background-repeat: no-repeat;
}

#basework #innerframe
{
	position:relative;
	display:flex;
	flex-direction:row;
	justify-content:space-between;
	width:100%;
	height:100%;
	background: rgb(00 00 00 / 0%);
}
.construct-details
{
    top:50%;
    position: relative;
    width: 80px;
    height: 80px;
    border: 1px solid #444;
    border-radius: 6px;
    background: rgb(10 12 37 / 0%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
}
.construct-icon 
{
    background-size: auto; /* show one tile area */
    background-repeat: no-repeat;
    background-position: 0px 0px;
    width: 64px;
    height: 64px;
}
.construct-details .btn {
    width: 80%;
    padding: 0px;
    margin-top: 0px;
    font-size: 13px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(90deg, #8b5a2b, #d4af37);
    color: black;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.3);
}

.construct-details .btn:hover {
    background: linear-gradient(90deg, #d4af37, #8b5a2b);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.6);
}
/*blood work*/
#baseblood
{
	position: fixed;
  	top: 50%;
 	left: 50%;
 	width: 50%;
 	height: 45%;
  	background: rgba(30, 30, 30, 0.9);
  	border: 2px solid #555;
  	padding: 20px;
  	color: white;
  	z-index: 20;
  	padding:3%;
  	transform: translate(-50%, -50%);
	background-image: url('../assets/img/ui/bgframe1.png');
	background-size: 100% 100%;
	background-repeat: no-repeat;
}
.blood-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.tank {
    position: relative;
    width: 60px;
    height: 200px;
    border: 2px solid #550000;
    border-radius: 6px;
    background-color: #220000;
    overflow: hidden;
    margin: 0 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Blood fill */
.tank-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0%; /* updated by JS */
    background: linear-gradient(to top, #8b0000 0%, #ff0000 60%, #ff6666 100%);
    box-shadow: inset 0 0 15px rgba(255,0,0,0.6);
    transition: height 0.4s ease; /* smooth fill animation */
}

/* Optional animated shine */
.tank-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(268deg, rgba(255, 255, 255, 0.1) 0%, rgb(12 0 0 / 30%) 50%, rgb(113 23 23 / 10%) 100%);
}


/* Label below tank */
.tank-label {
    margin-top: 5px;
    text-align: center;
    font-size: 14px;
    color: #ffcccc;
}

/* overlay */
#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(6px);
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
  opacity: 1;
  transition: opacity 0.4s ease-in-out;
  pointer-events: all;
}

#overlay.hidden 
{
  opacity: 0;
  pointer-events: none;
}

.overlay-content 
{
    background: #2a1d1da1;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 40px 60px;
    border-radius: 16px;
    text-align: center;
    color: #e0c097;
    max-width: 600px;
    width: 90%;
    max-height: 615px;
    overflow-y: auto;
    font-family: 'Cinzel', serif;
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
}

.overlay-content h1 {
  margin-bottom: 20px;
  font-size: 2em;
  color: #fff;
  letter-spacing: 1px;
}

.overlay-content p {
  margin-bottom: 20px;
  color: #ccc;
}

.overlay-content ul {
  text-align: left;
  margin: 0 auto 30px auto;
  max-width: 400px;
}

#overlay-close {
  background: #8b0000;
  border: none;
  color: #fff;
  font-weight: bold;
  font-size: 1.1em;
  padding: 10px 30px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

#overlay-close:hover {
  background: #a10000;
}



                
                

