/*###############################
###
###     base.component.scss
###     Produktion App
###     BASED ON: Angular  21.02.0, SCSS,
###     AUTHOR: Benjamin Bennewitz
###
###
###       ██████╗  ▀█
###       ██╔══██╗ █▄
###       ██████╦╝
###       ██╔══██╗
###       ██████╦╝
###       ╚═════╝
###
###
#################################*/

/* ==========================================================================
   INHALTSVERZEICHNIS

   01   Viewport
   02   Hotspots
   03   Spielsteuerung
   04   Direkte Touchflächen
   05   Responsive
   ========================================================================== */

/* ==========================================================================
   01   Viewport
   ========================================================================== */

#viewport { position: absolute; inset: 0; touch-action: none; }
#viewport canvas { width: 100%; height: 100%; display: block; }
.screen-action { position: absolute; background: transparent; border: 0; z-index: 2; padding: 0; }
.screen-action:hover { background: transparent !important; }

/* ==========================================================================
   02   Hotspots
   ========================================================================== */

.hotspot { position: absolute; top: 0; left: 0; width: 52px; height: 52px; min-height: 52px; margin: -26px 0 0 -26px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; touch-action: none; cursor: grab; z-index: 3; }
.hotspot:hover:not(:disabled), .hotspot:focus-visible { border-color: #d9eca180; background: #c2dd7d12; }
.hotspot:active { cursor: grabbing; }
.hotspot span { opacity: 0; pointer-events: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: #1a1d15ee; padding: 8px; border-radius: 3px; font-size: 11px; }
.hotspot:hover span, .hotspot:focus-visible span { opacity: 1; }
.cartridge-hotspot { border-radius: 8px; cursor: pointer; }

/* ==========================================================================
   03   Spielsteuerung
   ========================================================================== */

#game-controls { position: absolute; left: 12px; bottom: 82px; display: flex; flex-direction: column; align-items: start; gap: 12px; z-index: 4; }
.direction-pad { display: grid; grid-template-columns: repeat(3, 44px); gap: 3px; }
.direction-pad button:first-child { grid-column: 2; }
.direction-pad button:nth-child(2) { grid-column: 1; grid-row: 2; }
.direction-pad button:nth-child(3) { grid-column: 2; grid-row: 2; }
.direction-pad button:nth-child(4) { grid-column: 3; grid-row: 2; }
.direction-pad button { touch-action: none; user-select: none; }
.game-actions button { min-width: 44px; padding-inline: 5px; }

.game-actions { display: grid; grid-template-columns: repeat(2, 66px); gap: 5px; width: 137px; font-size: 12px; }

/* ==========================================================================
   04   Direkte Touchflächen
   ========================================================================== */

.model-controls, .device-discovery { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.touch-key, .touch-guide { position: absolute; width: 44px; height: 44px; min-height: 44px; margin: -22px 0 0 -22px; padding: 0; pointer-events: auto; touch-action: none; user-select: none; border: 0; border-radius: 50%; background: transparent; }
.touch-direction { width: 34px; height: 34px; min-height: 34px; margin: -17px 0 0 -17px; }
.touch-key:hover:not(:disabled), .touch-key:active:not(:disabled), .touch-guide:hover:not(:disabled) { background: transparent; }
.touch-key span, .touch-guide span { position: absolute; top: calc(100% - 4px); left: 50%; transform: translateX(-50%); padding: 2px 4px; background: #182115e8; color: #d3ea92; font-size: 10px; line-height: 1.3; white-space: nowrap; opacity: 0; pointer-events: none; }
.touch-key::after, .touch-guide::after { content: ''; position: absolute; inset: 16px; border: 1px solid #e3f4ad; border-radius: 50%; background: #c5e880a6; box-shadow: 0 0 0 5px #15251070; opacity: 0; pointer-events: none; }
.touch-direction::after { inset: 12px; }
[data-touch-guides="true"] .touch-key::after, [data-touch-guides="true"] .touch-guide::after, [data-touch-guides="true"] .touch-guide span, .touch-key:focus-visible span { opacity: 1; }
.touch-key:active::after { opacity: .7; background: #f0ffd2; }
.touch-guide[data-device-view="left"] span { left: 0; transform: none; }
.touch-guide[data-device-view="right"] span { right: 0; left: auto; transform: none; }
.hotspot[data-guide="true"] { border-color: #d3ea92; background: #c5e88022; }
.hotspot[data-guide="true"] span { opacity: 1; }

/* ==========================================================================
   05   Responsive
   ========================================================================== */

@media (min-width: 601px) and (pointer: fine) { #viewport { left: 164px; } }
@media (max-width: 600px), (pointer: coarse) {
  #viewport { inset: 8px 0 64px; }
  #game-controls { left: 8px; bottom: 72px; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  #game-controls:focus-within { width: auto; height: auto; margin: 0; padding: 8px; overflow: visible; clip-path: none; background: var(--surface); border-radius: 4px; }
}
@media (max-height: 500px) { #game-controls { bottom: 66px; } }

