*, ::before, ::after {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}

::backdrop {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}/*
! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com
*//*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/

*,
::before,
::after {
  box-sizing: border-box; /* 1 */
  border-width: 0; /* 2 */
  border-style: solid; /* 2 */
  border-color: #e5e7eb; /* 2 */
}

::before,
::after {
  --tw-content: '';
}

/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
6. Use the user's configured `sans` font-variation-settings by default.
7. Disable tap highlights on iOS
*/

html,
:host {
  line-height: 1.5; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
  -moz-tab-size: 4; /* 3 */
  -o-tab-size: 4;
     tab-size: 4; /* 3 */
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
  font-feature-settings: normal; /* 5 */
  font-variation-settings: normal; /* 6 */
  -webkit-tap-highlight-color: transparent; /* 7 */
}

/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/

body {
  margin: 0; /* 1 */
  line-height: inherit; /* 2 */
}

/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/

hr {
  height: 0; /* 1 */
  color: inherit; /* 2 */
  border-top-width: 1px; /* 3 */
}

/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
          text-decoration: underline dotted;
}

/*
Remove the default font size and weight for headings.
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/*
Reset links to optimize for opt-in styling instead of opt-out.
*/

a {
  color: inherit;
  text-decoration: inherit;
}

/*
Add the correct font weight in Edge and Safari.
*/

b,
strong {
  font-weight: bolder;
}

/*
1. Use the user's configured `mono` font-family by default.
2. Use the user's configured `mono` font-feature-settings by default.
3. Use the user's configured `mono` font-variation-settings by default.
4. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */
  font-feature-settings: normal; /* 2 */
  font-variation-settings: normal; /* 3 */
  font-size: 1em; /* 4 */
}

/*
Add the correct font size in all browsers.
*/

small {
  font-size: 80%;
}

/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/

table {
  text-indent: 0; /* 1 */
  border-color: inherit; /* 2 */
  border-collapse: collapse; /* 3 */
}

/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-feature-settings: inherit; /* 1 */
  font-variation-settings: inherit; /* 1 */
  font-size: 100%; /* 1 */
  font-weight: inherit; /* 1 */
  line-height: inherit; /* 1 */
  letter-spacing: inherit; /* 1 */
  color: inherit; /* 1 */
  margin: 0; /* 2 */
  padding: 0; /* 3 */
}

/*
Remove the inheritance of text transform in Edge and Firefox.
*/

button,
select {
  text-transform: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/

button,
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}

/*
Use the modern Firefox focus style for all focusable elements.
*/

:-moz-focusring {
  outline: auto;
}

/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/

:-moz-ui-invalid {
  box-shadow: none;
}

/*
Add the correct vertical alignment in Chrome and Firefox.
*/

progress {
  vertical-align: baseline;
}

/*
Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/

[type='search'] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/*
Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/*
Add the correct display in Chrome and Safari.
*/

summary {
  display: list-item;
}

/*
Removes the default spacing and border for appropriate elements.
*/

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

ol,
ul,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/*
Reset default styling for dialogs.
*/
dialog {
  padding: 0;
}

/*
Prevent resizing textareas horizontally by default.
*/

textarea {
  resize: vertical;
}

/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/

input::-moz-placeholder, textarea::-moz-placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

input::placeholder,
textarea::placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

/*
Set the default cursor for buttons.
*/

button,
[role="button"] {
  cursor: pointer;
}

/*
Make sure disabled buttons don't get the pointer cursor.
*/
:disabled {
  cursor: default;
}

/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
   This can trigger a poorly considered lint error in some tools but is included by design.
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block; /* 1 */
  vertical-align: middle; /* 2 */
}

/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/

img,
video {
  max-width: 100%;
  height: auto;
}

/* Make elements with the HTML hidden attribute stay hidden by default */
[hidden]:where(:not([hidden="until-found"])) {
  display: none;
}
  body {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    overflow-y: auto; /* Restore vertical scrollbar */
    background: #000000;
    color: #ffffff;
  }
  
  * {
    box-sizing: border-box;
  }
.container {
  width: 100%;
}
@media (min-width: 640px) {

  .container {
    max-width: 640px;
  }
}
@media (min-width: 768px) {

  .container {
    max-width: 768px;
  }
}
@media (min-width: 1024px) {

  .container {
    max-width: 1024px;
  }
}
@media (min-width: 1280px) {

  .container {
    max-width: 1280px;
  }
}
@media (min-width: 1536px) {

  .container {
    max-width: 1536px;
  }
}
.pixel-font {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
  }
.pixel-art {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: nearest-neighbor;
  }
/* Layout Containers */
.portrait-layout {
    flex-direction: column;
  }
.landscape-layout {
    flex-direction: row;
  }
.portrait-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 16px;
  }
.landscape-map-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
.landscape-sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
  }
/* Full Area Fade Transition - Covers entire game interface */
.full-area-fade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }
.full-area-fade-content {
    width: 100%;
    height: 100%;
    background: #000000;
    animation: fadeInOut 1s ease-in-out;
  }
/* Map-specific fade transition - only covers the game map area (legacy support) */
.map-fade-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
  }
.map-fade-content {
    width: 100%;
    height: 100%;
    background: #000000;
    animation: fadeInOut 1s ease-in-out;
    border-radius: inherit;
  }
@keyframes fadeInOut {
    0% {
      opacity: 0;
    }
    50% {
      opacity: 1;
    }
    100% {
      opacity: 0;
    }
  }
/* Hit Overlay Styles */
.hit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: hitOverlayPulse 0.5s ease-out;
  }
.hit-overlay-sprite {
    width: 100%;
    height: 100%;
    -o-object-fit: contain;
       object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: nearest-neighbor;
  }
@keyframes hitOverlayPulse {
    0% {
      opacity: 0;
      transform: scale(0.8);
    }
    50% {
      opacity: 1;
      transform: scale(1.2);
    }
    100% {
      opacity: 0.8;
      transform: scale(1);
    }
  }
/* Modal Overlay Base - Centered over game map area */
.modal-overlay-base {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
  }
/* Confirmation Modal Styles */
.confirmation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
  }
.confirmation-modal-content {
    min-width: 300px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
  }
.confirmation-modal-header {
    margin: -12px -12px 16px -12px;
  }
.confirmation-modal-body {
    padding: 0 12px 12px 12px;
  }
.confirmation-modal-button {
    min-width: 80px;
    transition: all 0.2s ease;
  }
.confirmation-modal-button:focus {
    box-shadow: 0 0 0 2px #ffffff;
  }
@keyframes modalSlideIn {
    from {
      opacity: 0;
      transform: translateY(-20px) scale(0.95);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
/* Help Modal Styles */
.help-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
  }
.help-modal-content {
    min-width: 400px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.help-modal-header {
    margin: -12px -12px 16px -12px;
  }
.help-modal-body {
    padding: 0 12px 12px 12px;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.help-modal-close-button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
  }
.help-modal-close-button:focus {
    box-shadow: 0 0 0 2px #ffffff;
  }
/* History Modal Styles */
.history-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
  }
.history-modal-content {
    min-width: 400px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.history-modal-header {
    margin: -12px -12px 16px -12px;
  }
.history-modal-body {
    padding: 0 12px 12px 12px;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.history-modal-close-button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
  }
.history-modal-close-button:focus {
    box-shadow: 0 0 0 2px #ffffff;
  }
.history-log-entry {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.history-log-number {
    flex-shrink: 0;
    min-width: 24px;
    font-size: 10px;
  }
.history-log-text {
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
/* Item Details Modal Styles */
.item-details-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
  }
.item-details-modal-content {
    min-width: 400px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.item-details-modal-header {
    margin: -12px -12px 16px -12px;
  }
.item-details-modal-body {
    padding: 0 12px 12px 12px;
    position: relative;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.item-details-modal-close-button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
  }
.item-details-modal-close-button:focus {
    box-shadow: 0 0 0 2px #ffffff;
  }
.item-details-display {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-start;
  }
.item-details-sprite-container {
    width: 80px;
    height: 80px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
.item-details-sprite {
    width: 56px;
    height: 56px;
    -o-object-fit: contain;
       object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: nearest-neighbor;
  }
.item-details-info {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.item-details-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.item-equipped-indicator {
    color: #32cd32;
  }
.item-details-description {
    font-size: 11px;
    margin-bottom: 6px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.item-details-stats {
    font-size: 10px;
    font-style: italic;
  }
.item-details-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }
.item-details-action-button {
    padding: 8px 16px;
    font-size: 11px;
    min-width: 80px;
    flex: 1;
    max-width: 120px;
    transition: all 0.2s ease;
  }
.item-details-action-button:hover:not(:disabled) {
    transform: scale(1.05);
  }
.item-details-action-button:active:not(:disabled) {
    transform: scale(0.95);
  }
.item-details-empty {
    text-align: center;
    font-size: 11px;
    padding: 40px 20px;
    line-height: 1.4;
  }
.item-details-disabled-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    text-align: center;
    padding: 8px;
  }
/* Container Modal Styles */
.container-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
  }
.container-modal-content {
    min-width: 400px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.container-modal-header {
    margin: -12px -12px 16px -12px;
  }
.container-modal-body {
    padding: 0 12px 12px 12px;
    position: relative;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-height: 70vh;
    overflow-y: auto;
  }
.container-modal-close-button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
  }
.container-modal-close-button:focus {
    box-shadow: 0 0 0 2px #ffffff;
  }
.container-empty {
    text-align: center;
    font-size: 12px;
    padding: 40px 20px;
    line-height: 1.4;
  }
.container-items-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
.container-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333333;
    border-radius: 4px;
  }
.container-item-sprite-container {
    width: 48px;
    height: 48px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
.container-item-sprite {
    width: 32px;
    height: 32px;
    -o-object-fit: contain;
       object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: nearest-neighbor;
  }
.container-item-info {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.container-item-name {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.container-item-description {
    font-size: 10px;
    margin-bottom: 4px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.container-item-stats {
    font-size: 9px;
    font-style: italic;
    margin-bottom: 2px;
  }
.container-item-take-button {
    padding: 6px 12px;
    font-size: 10px;
    min-width: 60px;
    flex-shrink: 0;
    transition: all 0.2s ease;
  }
.container-item-take-button:hover:not(:disabled) {
    transform: scale(1.05);
  }
.container-item-take-button:active:not(:disabled) {
    transform: scale(0.95);
  }
.container-disabled-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    text-align: center;
    padding: 8px;
  }
/* Dungeon Map Modal Styles */
.dungeon-map-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
  }
.dungeon-map-modal-content {
    min-width: 400px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
.dungeon-map-modal-header {
    margin: -12px -12px 16px -12px;
  }
.dungeon-map-modal-body {
    padding: 0 12px 12px 12px;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-height: 70vh;
    overflow-y: auto;
  }
.dungeon-map-modal-close-button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
  }
.dungeon-map-modal-close-button:focus {
    box-shadow: 0 0 0 2px #ffffff;
  }
.dungeon-map-container {
    border: 2px solid #333333;
    background: #0d0d0d;
    padding: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
.dungeon-map-grid {
    background: #000000;
    border: 1px solid #333333;
  }
.dungeon-map-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    text-align: center;
    border: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
.dungeon-map-void {
    background: #000000;
  }
.dungeon-map-wall {
    background: #333333;
  }
.dungeon-map-floor {
    background: #666666;
  }
.dungeon-map-door {
    background: #888888;
  }
.dungeon-map-player {
    background: #00ff00 !important;
    color: #000000;
  }
.dungeon-map-enemy {
    background: #ff0000 !important;
    color: #ffffff;
  }
.dungeon-map-stairway {
    background: #0088ff !important;
    color: #ffffff;
  }
.dungeon-map-container {
    background: #ffff00 !important;
    color: #000000;
  }
.dungeon-map-item {
    background: #ff8800 !important;
    color: #ffffff;
  }
.dungeon-map-legend {
    border-top: 1px solid #333333;
    padding-top: 12px;
  }
.dungeon-map-legend-player {
    width: 16px;
    height: 16px;
    background: #00ff00;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid #333333;
  }
.dungeon-map-legend-enemy {
    width: 16px;
    height: 16px;
    background: #ff0000;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid #333333;
  }
.dungeon-map-legend-stairway {
    width: 16px;
    height: 16px;
    background: #0088ff;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid #333333;
  }
.dungeon-map-legend-container {
    width: 16px;
    height: 16px;
    background: #ffff00;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid #333333;
  }
.dungeon-map-legend-item {
    width: 16px;
    height: 16px;
    background: #ff8800;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid #333333;
  }
/* Status Area Styles */
.status-area-container {
    width: 100%;
    margin-bottom: 16px;
  }
/* History Button Styles */
.history-button {
    transition: all 0.2s ease;
  }
.history-button:hover:not(:disabled) {
    transform: scale(1.05);
  }
.history-button:active:not(:disabled) {
    transform: scale(0.95);
  }
/* Help Button Styles - Original bottom button */
.help-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
  }
.help-button:hover:not(:disabled) {
    transform: scale(1.05);
  }
.help-button:active:not(:disabled) {
    transform: scale(0.95);
  }
/* Help Button in Player Stats - Smaller, positioned in top right */
.help-button-stats {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
  }
.help-button-stats:hover:not(:disabled) {
    transform: scale(1.05);
  }
.help-button-stats:active:not(:disabled) {
    transform: scale(0.95);
  }
/* Map Button in Player Stats - Similar to help button */
.map-button-stats {
    height: 32px;
    padding: 0 8px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    min-width: 48px;
  }
.map-button-stats:hover:not(:disabled) {
    transform: scale(1.05);
  }
.map-button-stats:active:not(:disabled) {
    transform: scale(0.95);
  }
/* Map Icon Styles */
.map-icon {
    width: 16px;
    height: 16px;
    display: block;
  }
/* Hotbar Styles */
.hotbar-container {
    width: 100%;
    display: flex;
    justify-content: center;
  }
.hotbar {
    padding: 12px;
    width: 100%;
    position: relative;
  }
.hotbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }
.hotbar-title {
    font-size: 14px;
    font-weight: bold;
  }
.hotbar-count {
    font-size: 10px;
  }
.hotbar-slots {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
  }
.hotbar-slot {
    width: 48px;
    height: 48px;
    background: #1a1a1a;
    border: 2px solid #333333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.1s ease;
  }
.hotbar-slot:hover:not(.hotbar-slot-disabled) {
    background: #2a2a2a;
    border-color: #555555;
  }
.hotbar-slot-selected {
    background: #333333 !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6) !important;
  }
.hotbar-slot-equipped {
    background: #1a3d1a !important;
    border-color: #32cd32 !important;
    box-shadow: 0 0 6px rgba(50, 205, 50, 0.5) !important;
  }
.hotbar-slot-disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
.hotbar-item {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
.hotbar-item-sprite {
    width: 32px;
    height: 32px;
    -o-object-fit: contain;
       object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: nearest-neighbor;
  }
.hotbar-empty-slot {
    width: 100%;
    height: 100%;
    background: transparent;
  }
.hotbar-disabled-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    text-align: center;
    padding: 4px;
  }
/* Simplified pathfinding cell highlight */
.black-theme-pathfinding-cell {
    background: #333333 !important;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6) !important;
  }
/* Responsive adjustments for modals and layout */
@media (max-width: 767px) and (orientation: portrait) {
    /* Mobile portrait mode - keep existing portrait layout */
    .landscape-layout {
      flex-direction: column;
    }

    .landscape-map-container {
      width: 100%;
    }

    .landscape-sidebar {
      width: 100%;
      flex-direction: column;
    }

    .item-details-modal-content {
      min-width: 300px;
    }

    .item-details-display {
      flex-direction: column;
      align-items: center;
      gap: 12px;
    }

    .item-details-sprite-container {
      width: 64px;
      height: 64px;
      padding: 8px;
    }

    .item-details-sprite {
      width: 48px;
      height: 48px;
    }

    .item-details-name {
      font-size: 12px;
      text-align: center;
    }

    .item-details-description {
      font-size: 10px;
      text-align: center;
    }

    .item-details-stats {
      font-size: 9px;
      text-align: center;
    }

    .item-details-action-button {
      padding: 6px 12px;
      font-size: 10px;
      min-width: 70px;
      max-width: 100px;
    }

    .container-modal-content {
      min-width: 300px;
    }

    .container-item {
      flex-direction: column;
      text-align: center;
      gap: 8px;
    }

    .container-item-sprite-container {
      width: 40px;
      height: 40px;
      padding: 6px;
    }

    .container-item-sprite {
      width: 28px;
      height: 28px;
    }

    .container-item-name {
      font-size: 11px;
    }

    .container-item-description {
      font-size: 9px;
    }

    .container-item-stats {
      font-size: 8px;
    }

    .container-item-take-button {
      padding: 4px 8px;
      font-size: 9px;
      min-width: 50px;
    }

    .dungeon-map-modal-content {
      min-width: 300px;
    }

    .hotbar-slot {
      width: 40px;
      height: 40px;
    }

    .hotbar-item-sprite {
      width: 24px;
      height: 24px;
    }

    .hotbar-title {
      font-size: 12px;
    }

    .hotbar-count {
      font-size: 8px;
    }

    .help-modal-content {
      min-width: 300px;
    }

    .history-modal-content {
      min-width: 300px;
    }

    .help-button {
      width: 40px;
      height: 40px;
      font-size: 16px;
    }

    .help-button-stats {
      width: 28px;
      height: 28px;
      font-size: 12px;
    }

    .map-button-stats {
      height: 28px;
      padding: 0 6px;
      font-size: 8px;
      min-width: 40px;
    }

    .map-icon {
      width: 12px;
      height: 12px;
    }

    .history-button {
      padding: 2px 6px;
      font-size: 8px;
    }

    /* Mobile portrait mode - further reduce UI space reservation for even larger map */
    .status-area-container {
      margin-bottom: 6px; /* Reduced from 8px */
    }

    .status-area-container .p-4 {
      padding: 6px; /* Reduced from 8px */
    }

    .portrait-container {
      gap: 6px; /* Reduced from 8px */
    }
  }
/* Mobile landscape and desktop landscape - both use landscape layout */
@media (min-width: 768px), (orientation: landscape) {
    .landscape-sidebar .hotbar-slots {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 4px;
      justify-items: center;
    }

    .landscape-sidebar .hotbar-slot {
      width: 44px;
      height: 44px;
    }

    .landscape-sidebar .hotbar-item-sprite {
      width: 28px;
      height: 28px;
    }
  }
/* Mobile landscape specific adjustments - ENHANCED for more immersive gameplay */
@media (max-width: 1024px) and (orientation: landscape) {
    .landscape-sidebar {
      width: 300px; /* Reduced sidebar width to give more space to map */
    }

    /* Enhanced map container for mobile landscape */
    .landscape-map-container {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
      /* Maximize available space for map */
      margin-right: 8px; /* Small gap between map and sidebar */
    }

    /* Reduce UI element sizes to maximize map space */
    .hotbar-slot {
      width: 36px;
      height: 36px;
    }

    .hotbar-item-sprite {
      width: 22px;
      height: 22px;
    }

    .hotbar-title {
      font-size: 12px;
    }

    .hotbar-count {
      font-size: 9px;
    }

    .help-button-stats {
      width: 28px;
      height: 28px;
      font-size: 12px;
    }

    .map-button-stats {
      height: 28px;
      padding: 0 6px;
      font-size: 9px;
      min-width: 44px;
    }

    .map-icon {
      width: 14px;
      height: 14px;
    }

    .history-button {
      padding: 2px 6px;
      font-size: 9px;
    }

    /* Reduce status area padding for mobile landscape */
    .status-area-container {
      margin-bottom: 8px;
    }

    .status-area-container .p-4 {
      padding: 8px;
    }

    /* Optimize sidebar spacing for mobile landscape */
    .landscape-sidebar {
      gap: 12px; /* Reduced gap between sidebar elements */
    }

    /* Reduce player stats panel padding */
    .landscape-sidebar .black-theme-panel {
      padding: 12px; /* Reduced from default padding */
    }

    /* Optimize hotbar for mobile landscape */
    .landscape-sidebar .hotbar {
      padding: 8px; /* Reduced hotbar padding */
    }
  }
.static {
  position: static;
}
.fixed {
  position: fixed;
}
.absolute {
  position: absolute;
}
.relative {
  position: relative;
}
.right-2 {
  right: 0.5rem;
}
.top-2 {
  top: 0.5rem;
}
.mx-4 {
  margin-left: 1rem;
  margin-right: 1rem;
}
.mb-1 {
  margin-bottom: 0.25rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-3 {
  margin-bottom: 0.75rem;
}
.mb-4 {
  margin-bottom: 1rem;
}
.mb-6 {
  margin-bottom: 1.5rem;
}
.ml-2 {
  margin-left: 0.5rem;
}
.ml-4 {
  margin-left: 1rem;
}
.mr-3 {
  margin-right: 0.75rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-4 {
  margin-top: 1rem;
}
.block {
  display: block;
}
.flex {
  display: flex;
}
.grid {
  display: grid;
}
.contents {
  display: contents;
}
.hidden {
  display: none;
}
.h-12 {
  height: 3rem;
}
.h-4 {
  height: 1rem;
}
.h-6 {
  height: 1.5rem;
}
.h-full {
  height: 100%;
}
.max-h-96 {
  max-height: 24rem;
}
.min-h-\[1\.5rem\] {
  min-height: 1.5rem;
}
.min-h-screen {
  min-height: 100vh;
}
.w-12 {
  width: 3rem;
}
.w-6 {
  width: 1.5rem;
}
.w-full {
  width: 100%;
}
.flex-1 {
  flex: 1 1 0%;
}
.flex-shrink {
  flex-shrink: 1;
}
.flex-grow {
  flex-grow: 1;
}
.transform {
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.cursor-not-allowed {
  cursor: not-allowed;
}
.resize {
  resize: both;
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.flex-col {
  flex-direction: column;
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-4 {
  gap: 1rem;
}
.space-x-2 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 0;
  margin-right: calc(0.5rem * var(--tw-space-x-reverse));
  margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}
.space-x-4 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 0;
  margin-right: calc(1rem * var(--tw-space-x-reverse));
  margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
}
.space-y-1 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
}
.space-y-2 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));
}
.space-y-3 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.75rem * var(--tw-space-y-reverse));
}
.space-y-4 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(1rem * var(--tw-space-y-reverse));
}
.overflow-y-auto {
  overflow-y: auto;
}
.rounded-none {
  border-radius: 0px;
}
.border {
  border-width: 1px;
}
.border-t {
  border-top-width: 1px;
}
.border-gray-600 {
  --tw-border-opacity: 1;
  border-color: rgb(75 85 99 / var(--tw-border-opacity, 1));
}
.object-contain {
  -o-object-fit: contain;
     object-fit: contain;
}
.p-1 {
  padding: 0.25rem;
}
.p-3 {
  padding: 0.75rem;
}
.p-4 {
  padding: 1rem;
}
.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.pt-2 {
  padding-top: 0.5rem;
}
.pt-3 {
  padding-top: 0.75rem;
}
.text-center {
  text-align: center;
}
.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}
.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}
.font-bold {
  font-weight: 700;
}
.font-medium {
  font-weight: 500;
}
.italic {
  font-style: italic;
}
.text-red-400 {
  --tw-text-opacity: 1;
  color: rgb(248 113 113 / var(--tw-text-opacity, 1));
}
.opacity-50 {
  opacity: 0.5;
}
.outline {
  outline-style: solid;
}
.ring {
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}
.filter {
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.transition {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
/* Import pixel font */
/* Ensure buttons don't have default focus styles that interfere with game */
button:focus {
  outline: none;
}
/* Game map specific styles - Full width spanning with responsive scaling */
.game-map-full-width {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}
.game-map-container-full-width {
  overflow: hidden; /* Prevent scrolling */
  width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}
.game-map-grid {
  display: grid;
  gap: 0;
  width: -moz-fit-content;
  width: fit-content;
  background: transparent;
  line-height: 0;
  contain: layout style; /* CSS containment for better performance */
  /* Center the grid */
  margin: 0 auto;
}
/* Optimized cell rendering - ensures single consistent block per cell with no gaps */
.game-map-cell {
  border: none; /* Remove border to eliminate gaps */
  outline: none;
  padding: 0;
  margin: 0;
  background: #1a1a1a;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  flex-grow: 0;
  box-sizing: border-box;
  contain: layout style; /* CSS containment for better performance */
}
.black-theme-cell {
  box-shadow: inset 1px 1px 0px rgba(255, 255, 255, 0.1);
}
.black-theme-cell-hover:hover:not(:disabled):not(.pathfinding-disabled) {
  background: #2a2a2a !important;
  box-shadow: inset 1px 1px 0px rgba(255, 255, 255, 0.3) !important;
}
.black-theme-player-cell {
  background: #2a2a2a !important;
  box-shadow: inset 1px 1px 0px rgba(255, 255, 255, 0.3) !important;
}
.black-theme-enemy-cell {
  background: #2a2a2a !important;
  box-shadow: inset 1px 1px 0px rgba(255, 255, 255, 0.3) !important;
}
.black-theme-item-cell {
  background: #2a2a2a !important;
  box-shadow: inset 1px 1px 0px rgba(255, 255, 255, 0.3) !important;
}
/* Out of bounds cell styling */
.out-of-bounds-cell {
  background: #000000 !important;
  box-shadow: none !important;
  cursor: not-allowed;
}
.out-of-bounds-cell:hover {
  background: #000000 !important;
  box-shadow: none !important;
}
.game-map-cell:active:not(:disabled):not(.pathfinding-disabled):not(.out-of-bounds-cell) {
  background: #0d0d0d !important;
  box-shadow: inset -1px -1px 0px rgba(255, 255, 255, 0.5) !important;
}
.pathfinding-disabled {
  cursor: not-allowed;
  opacity: 0.7;
}
.pathfinding-disabled:hover {
  background: #1a1a1a !important;
  box-shadow: inset 1px 1px 0px rgba(255, 255, 255, 0.1) !important;
}
/* Cell content container - layered rendering system */
.cell-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  contain: layout style; /* CSS containment for better performance */
}
/* Terrain Layer - Base layer (z-index: 1) */
.terrain-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Overlay Layer - Middle layer for doors, staircases, boulders, etc. (z-index: 5) */
.overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none; /* Allow clicks to pass through to terrain */
}
/* Entity Layer - Top layer (z-index: 10) */
.entity-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none; /* Allow clicks to pass through to terrain */
}
/* Optimized sprite rendering - consistent sizing and positioning */
.cell-sprite {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
  display: block;
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  -ms-interpolation-mode: nearest-neighbor;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
/* Overlay sprites - rendered on middle layer with transparency support */
.overlay-sprite {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
  display: block;
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  -ms-interpolation-mode: nearest-neighbor;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  /* Ensure transparent backgrounds are preserved */
  background: transparent;
}
/* Entity sprites - rendered on top with transparency support */
.entity-sprite {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
  display: block;
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  -ms-interpolation-mode: nearest-neighbor;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  /* Ensure transparent backgrounds are preserved */
  background: transparent;
}
/* Fallback rendering - consistent with sprite sizing */
.cell-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  line-height: 1;
  box-sizing: border-box;
  box-shadow: inset 1px 1px 0px rgba(255,255,255,0.1);
}
/* Overlay fallback - rendered on middle layer */
.overlay-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  line-height: 1;
  box-sizing: border-box;
  background: transparent;
  /* Add subtle outline to distinguish from terrain */
  text-shadow: 
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}
/* Entity fallback - rendered on top layer */
.entity-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  line-height: 1;
  box-sizing: border-box;
  background: transparent;
  /* Add subtle outline to distinguish from terrain */
  text-shadow: 
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}
/* Performance optimizations - prevent sub-pixel rendering issues */
.game-map-cell *,
.cell-content *,
.terrain-layer *,
.overlay-layer *,
.entity-layer *,
.cell-sprite,
.overlay-sprite,
.entity-sprite,
.cell-fallback,
.overlay-fallback,
.entity-fallback {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: auto;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
/* Ensure clean grid rendering - no gaps or overlaps */
.game-map-grid > * {
  box-sizing: border-box;
  flex-shrink: 0;
  position: relative;
}
/* Additional pixel art optimizations */
.pixel-art,
.cell-sprite,
.overlay-sprite,
.entity-sprite {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  -ms-interpolation-mode: nearest-neighbor;
}
/* Remove mobile scroll restrictions to allow vertical scrolling */
@media (max-width: 1024px) {
  .game-map-container-full-width {
    touch-action: pan-y; /* Allow vertical scrolling */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: none; /* Prevent horizontal overscroll */
  }
  
  body {
    overflow-y: auto; /* Allow vertical scrolling */
    position: static;
    width: auto;
    height: auto;
  }
}
/* Allow scrolling on desktop */
@media (min-width: 1025px) {
  .game-map-container-full-width {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
  }
}
/* Black Theme Background */
.black-theme-bg {
  background: #000000;
}
/* Black Theme Text Colors */
.black-theme-text {
  color: #ffffff;
}
.black-theme-title-text {
  color: #ffffff;
}
.black-theme-accent-text {
  color: #ffffff;
}
.black-theme-muted-text {
  color: #cccccc;
}
.black-theme-link {
  color: #ffffff;
}
.black-theme-link:hover {
  color: #cccccc;
}
/* Black Theme Panel Styles */
.black-theme-panel {
  background: #1a1a1a;
  border: 2px solid #333333;
  border-radius: 0;
}
.black-theme-panel-inset {
  background: #0d0d0d;
  border: 2px solid #333333;
  border-radius: 0;
}
/* Black Theme Button */
.black-theme-button {
  background: #1a1a1a;
  border: 2px solid #333333;
  color: #ffffff;
  transition: none;
}
.black-theme-button:hover:not(:disabled) {
  background: #2a2a2a;
  border-color: #555555;
}
.black-theme-button:active:not(:disabled) {
  background: #0d0d0d;
  border-color: #ffffff;
}
.black-theme-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* Health Bar */
.black-theme-health-bar {
  background: #ff0000;
  border: 1px solid #ffffff;
  transition: width 0.2s ease;
}
/* Separator */
.black-theme-separator {
  border-top: 2px solid #333333;
  border-bottom: 1px solid #555555;
}
/* Cell Background Colors */
.black-theme-player-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.black-theme-enemy-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.black-theme-item-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.black-theme-floor-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.black-theme-wall-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.black-theme-dungeon-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.black-theme-exit-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.black-theme-staircase-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.black-theme-door-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.black-theme-golden-door-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.black-theme-void-bg {
  background: #000000;
  color: #ffffff;
}
.black-theme-default-bg {
  background: #1a1a1a;
  color: #ffffff;
}
/* Out of bounds background - solid black */
.out-of-bounds-bg {
  background: #000000;
  color: #000000;
}
/* Terrain-specific backgrounds */
.black-theme-grass-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.black-theme-flowered-grass-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.black-theme-boulder-bg {
  background: #1a1a1a;
  color: #ffffff;
}
/* Retro fallback colors for sprites */
.retro-bg {
  background: #000000;
}
.retro-text {
  color: #ffffff;
}
.retro-panel {
  background: #1a1a1a;
  border: 2px solid #333333;
}
.retro-panel-inset {
  background: #0d0d0d;
  border: 2px solid #333333;
}
/* Retro sprite fallback colors */
.retro-player-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.retro-enemy-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.retro-goblin-bg {
  background: #1a1a1a;
  color: #32cd32;
}
.retro-orc-bg {
  background: #1a1a1a;
  color: #8b4513;
}
.retro-skeleton-bg {
  background: #1a1a1a;
  color: #f5f5dc;
}
.retro-troll-bg {
  background: #1a1a1a;
  color: #696969;
}
.retro-item-bg {
  background: #1a1a1a;
  color: #ffffff;
}
.retro-potion-bg {
  background: #1a1a1a;
  color: #ff69b4;
}
.retro-sword-bg {
  background: #1a1a1a;
  color: #c0c0c0;
}
.retro-dagger-bg {
  background: #1a1a1a;
  color: #c0c0c0;
}
.retro-coin-bg {
  background: #1a1a1a;
  color: #ffd700;
}
.retro-key-bg {
  background: #1a1a1a;
  color: #ffd700;
}
.retro-shield-bg {
  background: #1a1a1a;
  color: #8b4513;
}
.retro-ring-bg {
  background: #1a1a1a;
  color: #ffd700;
}
.retro-armor-bg {
  background: #1a1a1a;
  color: #8b4513;
}
.retro-apple-bg {
  background: #1a1a1a;
  color: #ff0000;
}
.retro-grass-bg {
  background: #1a1a1a;
  color: #32cd32;
}
.retro-flowered-grass-bg {
  background: #1a1a1a;
  color: #ff69b4;
}
.retro-boulder-bg {
  background: #1a1a1a;
  color: #696969;
}
.retro-floor-bg {
  background: #1a1a1a;
  color: #d2b48c;
}
.retro-wall-bg {
  background: #1a1a1a;
  color: #696969;
}
.retro-door-bg {
  background: #1a1a1a;
  color: #8b4513;
}
.retro-golden-door-bg {
  background: #1a1a1a;
  color: #ffd700;
}
.retro-staircase-bg {
  background: #1a1a1a;
  color: #d2b48c;
}
.retro-dungeon-bg {
  background: #1a1a1a;
  color: #8b4513;
}
