/*
 * Floor 8: a small Tibia 8.60 client. Frame in the client's grooved grey, the game window shows the
 * floor itself, and vocations attack the Cyclops while hovered (.tg.act-* runs the animations).
 */
.f8 .ground { position: absolute; left: 0; right: 0; top: 350px; }
.client {
  position: absolute; top: 0; left: calc(50% - 496px); /* centred: 12 + 768 + 200 + 12 px */
  border: 12px solid transparent; border-top-width: 0; border-image: var(--tex-stone) 24 round;
  box-shadow: 0 0 0 1px #000, 0 24px 48px #000c;
}
.cap {
  height: 34px; margin: 0 -12px; padding: 0 10px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #000;
  background: #2a2a2a var(--tex-panel) 0 0 / 240px 240px; background-blend-mode: multiply;
  font: 700 12px var(--font-game); color: #d7d7d7; text-shadow: 1px 1px 0 #000;
}
.cap img { width: 20px; height: 20px; image-rendering: pixelated; }
.cap .wb { margin-left: auto; display: flex; gap: 3px; }
.cap .wb i, .mwb i { display: grid; place-items: center; background: #555; color: #ddd; border: 1px solid; border-color: #8a8a8a #222 #222 #8a8a8a; }
.cap .wb i { width: 16px; height: 16px; }
.cbody { display: flex; align-items: stretch; }
.gcol { display: flex; flex-direction: column; flex: none; width: 768px; min-width: 0; }

/* game window: tile-aligned 12 x 6 tiles at 2x */
.tg { position: relative; flex: none; width: 768px; height: 384px; box-shadow: inset 0 0 0 1px #000, inset 0 0 30px #0007; }
.vc2, .foe { position: absolute; width: 128px; height: 128px; padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.foe { cursor: default; }
.vc2 .bd, .foe .bd { position: absolute; inset: 0; }
.vc2 img, .foe img { position: absolute; left: 0; top: 0; width: 128px; height: 128px; image-rendering: pixelated; }
.vc2 .walk, .vc2 .walkw { opacity: 0; }
.np2 { position: absolute; left: 92px; top: 40px; z-index: 2; display: flex; flex-direction: column; align-items: center; white-space: nowrap; transform: translate(-50%, -100%); }
.foe .np2 { left: 62px; }
.np2 .gt { font-size: 12.5px; }
.sq { position: absolute; left: 64px; top: 64px; width: 64px; height: 64px; border: 2px solid transparent; pointer-events: none; }
.vc2.on .sq, .vc2:hover .sq, .vc2:focus-visible .sq { border-color: #fff; }
.vc2:focus-visible { outline: none; }
.fx2 { position: absolute; z-index: 4; opacity: 0; pointer-events: none; image-rendering: pixelated; }
.dm { position: absolute; z-index: 5; opacity: 0; pointer-events: none; transform: translateX(-50%); font-size: 15px; }

/* console */
.console { flex: 1; width: 100%; min-width: 0; min-height: 140px; display: flex; flex-direction: column; border: 0 solid transparent; border-top-width: 12px; border-image: var(--tex-stone) 24 round; background: #3f3f3f var(--tex-panel) 0 0 / 240px 240px; }
.ctab { position: relative; z-index: 1; align-self: flex-start; margin: 3px 0 -1px 4px; padding: 2px 12px; background: #3d3d3d; border: 1px solid; border-color: #777 #111 #262626 #777; font: 700 11px var(--font-game); color: #dfdfdf; }
.clog { flex: 1; margin: 0 4px 4px; padding: 6px 8px; font: 11px/1.5 var(--font-game); background: #2b2b2b var(--tex-panel) 0 0 / 240px 240px; background-blend-mode: multiply; border: 1px solid; border-color: #1c1c1c #7d7d7d #7d7d7d #1c1c1c; }
.clog p { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.clog .y { color: #ffff00; }
.clog .w { color: #f0f0f0; }
.clog .g { color: var(--life); }
.clog .b { color: #9ab4ff; }

/* side panel: equipment and backpack */
.cside { width: 200px; padding: 6px 6px 6px 18px; display: flex; flex-direction: column; gap: 4px; background: #3f3f3f var(--tex-panel) 0 0 / 240px 240px; box-shadow: inset 1px 0 0 #000; }
.invp { display: flex; justify-content: center; padding: 6px 0; background: #454545 var(--tex-panel) 0 0 / 240px 240px; border: 1px solid; border-color: #7d7d7d #1c1c1c #1c1c1c #7d7d7d; box-shadow: 0 0 0 1px #000; }
.inv2 { position: relative; width: 111px; height: 141px; }
.inv2 .s { position: absolute; }
.box2 { position: absolute; width: 37px; height: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #1c1c1c; border: 1px solid; border-color: #0d0d0d #6a6a6a #6a6a6a #0d0d0d; font: 9px/1.15 var(--font-game); color: #c8c8c8; }
.box2 b { font-size: 10px; color: #fff; }
.mw { position: relative; flex: 1; margin-top: 4px; border-style: solid; border-width: 22px 4px 5px 4px; border-image: var(--tex-miniwindow) 22 4 5 4 fill stretch; }
.mw-t { position: absolute; top: -19px; left: 2px; right: 2px; height: 16px; display: flex; align-items: center; gap: 5px; font: 700 11px var(--font-game); color: #c0c0c0; text-shadow: 1px 1px 0 #000; }
.mw-t i[data-bag-icon] { width: 16px; height: 16px; background-size: auto 16px; image-rendering: pixelated; }
.mwb { margin-left: auto; display: flex; gap: 2px; }
.mwb i { width: 12px; height: 12px; }
.bpgrid { display: grid; grid-template-columns: repeat(4, 34px); gap: 2px; padding: 4px 4px 4px 5px; }
.s { position: relative; width: 34px; height: 34px; padding: 1px; border: 0; background: var(--tex-slot) 0 0 / 34px 34px; image-rendering: pixelated; cursor: pointer; }
.s .ic, .s .it { display: block; width: 32px; height: 32px; image-rendering: pixelated; }
.s .it { background-size: auto 32px; }
.s .ic { background-size: 320px 32px; opacity: .85; }
.bpgrid .s .ic { background: none; }
.s .n { position: absolute; right: 1px; bottom: 0; font: 700 10px/1 var(--font-game); color: #fff; text-shadow: var(--outline); }
.s:hover, .s:focus-visible { outline: 1px solid #fff; outline-offset: -1px; }

/* ---- attacks (one cycle per vocation, looped while hovered) ---- */
.act-knight .v-knight .bd { animation: kw 3s linear infinite; }
.act-knight .v-knight .idle { animation: kidle 3s steps(1) infinite; }
.act-knight .v-knight .walk { animation: kwalkimg 3s steps(1) infinite; }
.act-knight .v-knight .walkw { animation: kwalkw 3s steps(1) infinite; }
.act-knight .k-blood { animation: hit1 3s steps(1) infinite; }
.act-knight .k-dmg { animation: dm1 3s infinite; }
.act-knight .k-say { animation: sy1 3s infinite; }
.act-paladin .p-arrow { animation: ar 2.2s linear infinite; }
.act-paladin .p-blood { animation: hit2 2.2s steps(1) infinite; }
.act-paladin .p-dmg { animation: dm2 2.2s infinite; }
.act-sorc .s-ue { animation: ue2 3s steps(1) infinite; }
.act-sorc .s-say { animation: sy2 3s infinite; }
.act-sorc .s-dmg { animation: dm3 3s infinite; }
.act-druid .d-heal { animation: hl 2.6s steps(1) infinite; }
.act-druid .d-say { animation: sy2 2.6s infinite; }
.act-druid .v-knight .hp i { animation: hb 2.6s infinite; }
.act-knight .foe .hp i, .act-paladin .foe .hp i { width: 72% !important; }
.act-sorc .foe .hp i { width: 28% !important; background: #c03000; }

@keyframes kw { 0% { transform: translateX(0); } 30% { transform: translateX(256px); } 62% { transform: translateX(256px); } 92%, 100% { transform: translateX(0); } }
@keyframes kidle { 0% { opacity: 0; } 30% { opacity: 1; } 62% { opacity: 0; } 92% { opacity: 1; } }
@keyframes kwalkimg { 0% { opacity: 1; } 30% { opacity: 0; } }
@keyframes kwalkw { 0% { opacity: 0; } 62% { opacity: 1; } 92% { opacity: 0; } }
@keyframes hit1 { 0%, 33% { opacity: 0; } 34% { opacity: 1; } 44% { opacity: 0; } 46% { opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes dm1 { 0%, 33% { opacity: 0; transform: translate(-50%, 0); } 36% { opacity: 1; } 60% { opacity: 1; transform: translate(-50%, -24px); } 66%, 100% { opacity: 0; } }
@keyframes sy1 { 0%, 30% { opacity: 0; } 32% { opacity: 1; } 58% { opacity: 1; } 62%, 100% { opacity: 0; } }
@keyframes ar { 0% { opacity: 1; transform: translate(0, 0) rotate(18deg); } 32% { opacity: 1; transform: translate(384px, 128px) rotate(18deg); } 33%, 100% { opacity: 0; transform: translate(384px, 128px) rotate(18deg); } }
@keyframes hit2 { 0%, 32% { opacity: 0; } 33% { opacity: 1; } 52%, 100% { opacity: 0; } }
@keyframes dm2 { 0%, 32% { opacity: 0; transform: translate(-50%, 0); } 35% { opacity: 1; } 62% { opacity: 1; transform: translate(-50%, -24px); } 70%, 100% { opacity: 0; } }
@keyframes ue2 { 0%, 9% { opacity: 0; } 10% { opacity: 1; } 64%, 100% { opacity: 0; } }
@keyframes sy2 { 0% { opacity: 0; } 4% { opacity: 1; } 50% { opacity: 1; } 58%, 100% { opacity: 0; } }
@keyframes dm3 { 0%, 14% { opacity: 0; transform: translate(-50%, 0); } 18% { opacity: 1; } 60% { opacity: 1; transform: translate(-50%, -26px); } 68%, 100% { opacity: 0; } }
@keyframes hl { 0%, 9% { opacity: 0; } 10% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes hb { 0%, 12% { width: 45%; } 26%, 100% { width: 100%; } }

@media (max-width: 1240px) {
  .f8 { height: auto; padding-bottom: 120px; background-position: center top; }
  .f8 .ground { position: relative; top: auto; margin-top: 110px; display: flex; justify-content: center; }
  .client { position: relative; left: auto; zoom: .8; }
}
@media (max-width: 960px) { .client { zoom: .55; } }
@media (max-width: 600px) { .client { zoom: .4; } .cbody { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { .tg * { animation: none !important; } }

