combat testing and polishing in the dev console, many bug fixes

This commit is contained in:
2025-11-27 20:37:53 -06:00
parent 94c4ca9e95
commit dd92cf5991
45 changed files with 8157 additions and 1106 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,722 @@
/**
* Code of Conquest - Inventory UI Stylesheet
* Inventory modal, item grid, and combat items sheet
*/
/* ===== INVENTORY VARIABLES ===== */
:root {
/* Rarity colors */
--rarity-common: #9ca3af;
--rarity-uncommon: #22c55e;
--rarity-rare: #3b82f6;
--rarity-epic: #a855f7;
--rarity-legendary: #f59e0b;
/* Item card */
--item-bg: var(--bg-input, #1e1e24);
--item-border: var(--border-primary, #3a3a45);
--item-hover-bg: rgba(255, 255, 255, 0.05);
/* Touch targets - WCAG compliant */
--touch-target-min: 48px;
--touch-target-primary: 56px;
--touch-spacing: 8px;
}
/* ===== INVENTORY MODAL ===== */
.inventory-modal {
max-width: 800px;
width: 95%;
max-height: 85vh;
}
.inventory-modal .modal-body {
display: flex;
flex-direction: row;
gap: 1rem;
padding: 1rem;
overflow: hidden;
}
/* ===== TAB FILTER BAR ===== */
.inventory-tabs {
display: flex;
gap: 0.25rem;
padding: 0 1rem;
background: var(--bg-tertiary, #16161a);
border-bottom: 1px solid var(--play-border, #3a3a45);
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.inventory-tabs .tab {
min-height: var(--touch-target-min);
padding: 0.75rem 1rem;
background: transparent;
border: none;
border-bottom: 2px solid transparent;
color: var(--text-secondary, #a0a0a8);
font-size: var(--text-sm, 0.875rem);
cursor: pointer;
white-space: nowrap;
transition: all 0.2s ease;
}
.inventory-tabs .tab:hover {
color: var(--text-primary, #e5e5e5);
background: var(--item-hover-bg);
}
.inventory-tabs .tab.active {
color: var(--accent-gold, #f3a61a);
border-bottom-color: var(--accent-gold, #f3a61a);
}
/* ===== INVENTORY CONTENT LAYOUT ===== */
.inventory-body {
flex: 1;
display: flex;
gap: 1rem;
overflow: hidden;
}
.inventory-grid-container {
flex: 1;
overflow-y: auto;
padding-right: 0.5rem;
}
/* ===== ITEM GRID ===== */
.inventory-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--touch-spacing);
}
/* Responsive grid columns */
@media (max-width: 900px) {
.inventory-grid {
grid-template-columns: repeat(3, 1fr);
}
}
@media (max-width: 600px) {
.inventory-grid {
grid-template-columns: repeat(2, 1fr);
}
}
/* ===== INVENTORY ITEM CARD ===== */
.inventory-item {
display: flex;
flex-direction: column;
align-items: center;
padding: 0.75rem 0.5rem;
min-height: 96px;
min-width: 80px;
background: var(--item-bg);
border: 2px solid var(--item-border);
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
position: relative;
}
.inventory-item:hover,
.inventory-item:focus {
background: var(--item-hover-bg);
transform: translateY(-2px);
}
.inventory-item:focus {
outline: 2px solid var(--accent-gold, #f3a61a);
outline-offset: 2px;
}
.inventory-item.selected {
border-color: var(--accent-gold, #f3a61a);
box-shadow: 0 0 12px rgba(243, 166, 26, 0.3);
}
/* Rarity border colors */
.inventory-item.rarity-common { border-color: var(--rarity-common); }
.inventory-item.rarity-uncommon { border-color: var(--rarity-uncommon); }
.inventory-item.rarity-rare { border-color: var(--rarity-rare); }
.inventory-item.rarity-epic { border-color: var(--rarity-epic); }
.inventory-item.rarity-legendary {
border-color: var(--rarity-legendary);
box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}
/* Item icon */
.inventory-item img {
width: 40px;
height: 40px;
object-fit: contain;
margin-bottom: 0.5rem;
opacity: 0.9;
}
/* Item name */
.inventory-item .item-name {
font-size: var(--text-xs, 0.75rem);
color: var(--text-primary, #e5e5e5);
text-align: center;
line-height: 1.2;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
/* Item quantity badge */
.inventory-item .item-quantity {
position: absolute;
top: 4px;
right: 4px;
min-width: 20px;
height: 20px;
padding: 0 6px;
background: var(--bg-tertiary, #16161a);
border: 1px solid var(--item-border);
border-radius: 10px;
font-size: 0.7rem;
font-weight: 600;
color: var(--text-primary, #e5e5e5);
display: flex;
align-items: center;
justify-content: center;
}
/* Empty state */
.inventory-empty {
grid-column: 1 / -1;
text-align: center;
padding: 2rem;
color: var(--text-muted, #707078);
font-style: italic;
}
/* ===== ITEM DETAIL PANEL ===== */
.item-detail {
width: 280px;
min-width: 280px;
background: var(--bg-tertiary, #16161a);
border: 1px solid var(--play-border, #3a3a45);
border-radius: 8px;
padding: 1rem;
display: flex;
flex-direction: column;
}
.item-detail-empty {
color: var(--text-muted, #707078);
text-align: center;
padding: 2rem 1rem;
font-style: italic;
}
.item-detail-content {
display: flex;
flex-direction: column;
height: 100%;
}
.item-detail-header {
display: flex;
align-items: flex-start;
gap: 0.75rem;
margin-bottom: 1rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--play-border, #3a3a45);
}
.item-detail-icon {
width: 48px;
height: 48px;
object-fit: contain;
}
.item-detail-title h3 {
font-family: var(--font-heading);
font-size: var(--text-lg, 1.125rem);
margin: 0 0 0.25rem 0;
}
.item-detail-title .item-type {
font-size: var(--text-xs, 0.75rem);
color: var(--text-muted, #707078);
text-transform: uppercase;
letter-spacing: 0.5px;
}
/* Rarity text colors */
.rarity-text-common { color: var(--rarity-common); }
.rarity-text-uncommon { color: var(--rarity-uncommon); }
.rarity-text-rare { color: var(--rarity-rare); }
.rarity-text-epic { color: var(--rarity-epic); }
.rarity-text-legendary { color: var(--rarity-legendary); }
.item-description {
font-size: var(--text-sm, 0.875rem);
color: var(--text-secondary, #a0a0a8);
line-height: 1.5;
margin-bottom: 1rem;
}
/* Item stats */
.item-stats {
background: var(--item-bg);
border-radius: 6px;
padding: 0.75rem;
margin-bottom: 1rem;
}
.item-stats div {
display: flex;
justify-content: space-between;
padding: 0.25rem 0;
font-size: var(--text-sm, 0.875rem);
}
.item-stats div:not(:last-child) {
border-bottom: 1px solid var(--item-border);
}
/* Item action buttons */
.item-actions {
margin-top: auto;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.item-actions .action-btn {
min-height: var(--touch-target-primary);
padding: 0.75rem 1rem;
border: none;
border-radius: 6px;
font-size: var(--text-sm, 0.875rem);
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
}
.item-actions .action-btn--primary {
background: var(--accent-gold, #f3a61a);
color: var(--bg-primary, #0a0a0c);
}
.item-actions .action-btn--primary:hover {
background: var(--accent-gold-hover, #e69500);
}
.item-actions .action-btn--secondary {
background: var(--bg-input, #1e1e24);
border: 1px solid var(--play-border, #3a3a45);
color: var(--text-primary, #e5e5e5);
}
.item-actions .action-btn--secondary:hover {
background: var(--item-hover-bg);
border-color: var(--text-muted, #707078);
}
.item-actions .action-btn--danger {
background: transparent;
border: 1px solid #ef4444;
color: #ef4444;
}
.item-actions .action-btn--danger:hover {
background: rgba(239, 68, 68, 0.1);
}
/* ===== MODAL FOOTER ===== */
.inventory-modal .modal-footer {
display: flex;
justify-content: space-between;
align-items: center;
}
.gold-display {
font-size: var(--text-sm, 0.875rem);
color: var(--accent-gold, #f3a61a);
font-weight: 600;
}
.gold-display::before {
content: "coins ";
font-size: 1.1em;
}
/* ===== COMBAT ITEMS BOTTOM SHEET ===== */
.combat-items-sheet {
position: fixed;
bottom: 0;
left: 0;
right: 0;
max-height: 70vh;
background: var(--bg-secondary, #12121a);
border: 2px solid var(--border-ornate, #f3a61a);
border-bottom: none;
border-radius: 16px 16px 0 0;
z-index: 1001;
display: flex;
flex-direction: column;
transform: translateY(100%);
transition: transform 0.3s ease-out;
}
.combat-items-sheet.open {
transform: translateY(0);
}
/* Sheet backdrop */
.sheet-backdrop {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 1000;
animation: fadeIn 0.2s ease;
}
/* Drag handle */
.sheet-handle {
width: 40px;
height: 4px;
background: var(--text-muted, #707078);
border-radius: 2px;
margin: 8px auto;
}
/* Sheet header */
.sheet-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.75rem 1rem;
border-bottom: 1px solid var(--play-border, #3a3a45);
}
.sheet-header h3 {
font-family: var(--font-heading);
font-size: var(--text-lg, 1.125rem);
color: var(--accent-gold, #f3a61a);
margin: 0;
}
.sheet-close {
width: var(--touch-target-min);
height: var(--touch-target-min);
background: none;
border: none;
color: var(--text-muted, #707078);
font-size: 1.5rem;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.sheet-close:hover {
color: var(--text-primary, #e5e5e5);
}
/* Sheet body */
.sheet-body {
flex: 1;
padding: 1rem;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 1rem;
}
/* Combat items grid - larger items for combat */
.combat-items-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
gap: var(--touch-spacing);
}
.combat-item {
display: flex;
flex-direction: column;
align-items: center;
padding: 1rem;
min-height: 120px;
background: var(--item-bg);
border: 2px solid var(--rarity-common);
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
}
.combat-item:hover,
.combat-item:focus {
background: var(--item-hover-bg);
border-color: var(--accent-gold, #f3a61a);
}
.combat-item:focus {
outline: 2px solid var(--accent-gold, #f3a61a);
outline-offset: 2px;
}
.combat-item.selected {
border-color: var(--accent-gold, #f3a61a);
box-shadow: 0 0 12px rgba(243, 166, 26, 0.3);
}
.combat-item img {
width: 48px;
height: 48px;
margin-bottom: 0.5rem;
}
.combat-item .item-name {
font-size: var(--text-sm, 0.875rem);
color: var(--text-primary, #e5e5e5);
font-weight: 500;
text-align: center;
margin-bottom: 0.25rem;
}
.combat-item .item-effect {
font-size: var(--text-xs, 0.75rem);
color: var(--text-muted, #707078);
text-align: center;
}
/* Combat item detail section */
.combat-item-detail {
background: var(--bg-tertiary, #16161a);
border: 1px solid var(--play-border, #3a3a45);
border-radius: 8px;
padding: 1rem;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
}
.combat-item-detail .detail-info {
flex: 1;
}
.combat-item-detail .detail-name {
font-weight: 600;
color: var(--text-primary, #e5e5e5);
margin-bottom: 0.25rem;
}
.combat-item-detail .detail-effect {
font-size: var(--text-sm, 0.875rem);
color: var(--text-secondary, #a0a0a8);
}
.combat-item-detail .use-btn {
min-width: 100px;
min-height: var(--touch-target-primary);
padding: 0.75rem 1.5rem;
background: var(--hp-bar-fill, #ef4444);
border: none;
border-radius: 6px;
color: white;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
}
.combat-item-detail .use-btn:hover {
background: #dc2626;
}
/* No consumables message */
.no-consumables {
text-align: center;
padding: 2rem;
color: var(--text-muted, #707078);
font-style: italic;
}
/* ===== MOBILE RESPONSIVENESS ===== */
/* Full-screen modal on mobile */
@media (max-width: 768px) {
.inventory-modal {
width: 100vw;
height: 100vh;
max-width: 100vw;
max-height: 100vh;
border-radius: 0;
border: none;
}
.inventory-modal .modal-body {
flex-direction: column;
padding: 0.75rem;
}
/* Item detail slides in from right on mobile */
.item-detail {
position: fixed;
top: 0;
right: 0;
bottom: 0;
width: 100%;
max-width: 320px;
min-width: unset;
z-index: 1002;
border-radius: 0;
border-left: 2px solid var(--border-ornate, #f3a61a);
transform: translateX(100%);
transition: transform 0.3s ease;
}
.item-detail.visible {
transform: translateX(0);
}
.item-detail-backdrop {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 1001;
}
/* Back button for mobile detail view */
.item-detail-back {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.75rem;
margin: -1rem -1rem 1rem -1rem;
background: var(--bg-secondary, #12121a);
border: none;
border-bottom: 1px solid var(--play-border, #3a3a45);
color: var(--accent-gold, #f3a61a);
font-size: var(--text-sm, 0.875rem);
cursor: pointer;
width: calc(100% + 2rem);
}
.item-detail-back:hover {
background: var(--item-hover-bg);
}
/* Action buttons fixed at bottom on mobile */
.item-actions {
position: sticky;
bottom: 0;
background: var(--bg-tertiary, #16161a);
padding: 1rem;
margin: auto -1rem -1rem -1rem;
border-top: 1px solid var(--play-border, #3a3a45);
}
/* Larger touch targets on mobile */
.inventory-item {
min-height: 88px;
padding: 0.5rem;
}
/* Tabs scroll horizontally on mobile */
.inventory-tabs {
padding: 0 0.5rem;
}
.inventory-tabs .tab {
min-height: 44px;
padding: 0.5rem 0.75rem;
font-size: 0.8rem;
}
/* Combat sheet takes more space on mobile */
.combat-items-sheet {
max-height: 80vh;
}
.combat-items-grid {
grid-template-columns: repeat(2, 1fr);
}
.combat-item {
min-height: 100px;
padding: 0.75rem;
}
}
/* Extra small screens */
@media (max-width: 400px) {
.inventory-grid {
grid-template-columns: repeat(2, 1fr);
}
.inventory-item {
min-height: 80px;
}
.inventory-item img {
width: 32px;
height: 32px;
}
}
/* ===== LOADING STATE ===== */
.inventory-loading {
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
color: var(--text-muted, #707078);
}
.inventory-loading::after {
content: "";
width: 24px;
height: 24px;
margin-left: 0.75rem;
border: 2px solid var(--text-muted, #707078);
border-top-color: var(--accent-gold, #f3a61a);
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* ===== ACCESSIBILITY ===== */
/* Focus visible for keyboard navigation */
.inventory-item:focus-visible,
.combat-item:focus-visible,
.inventory-tabs .tab:focus-visible,
.action-btn:focus-visible {
outline: 2px solid var(--accent-gold, #f3a61a);
outline-offset: 2px;
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
.inventory-item,
.combat-item,
.combat-items-sheet,
.item-detail {
transition: none;
}
.inventory-loading::after {
animation: none;
}
}

View File

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<!-- Shield shape -->
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
<!-- Shield decoration -->
<path d="M12 8v6"/>
<path d="M9 11h6"/>
</svg>

After

Width:  |  Height:  |  Size: 321 B

View File

@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<!-- Potion bottle body -->
<path d="M10 2v4"/>
<path d="M14 2v4"/>
<!-- Bottle neck -->
<path d="M8 6h8"/>
<!-- Bottle shape -->
<path d="M8 6l-2 4v10a2 2 0 002 2h8a2 2 0 002-2V10l-2-4"/>
<!-- Liquid level -->
<path d="M6 14h12"/>
<!-- Bubbles -->
<circle cx="10" cy="17" r="1"/>
<circle cx="14" cy="16" r="0.5"/>
</svg>

After

Width:  |  Height:  |  Size: 505 B

View File

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<!-- Box/crate shape -->
<path d="M21 8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16V8z"/>
<!-- Box edges -->
<path d="M3.27 6.96L12 12.01l8.73-5.05"/>
<path d="M12 22.08V12"/>
</svg>

After

Width:  |  Height:  |  Size: 410 B

View File

@@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<!-- Scroll body -->
<path d="M4 4a2 2 0 012-2h12a2 2 0 012 2v16a2 2 0 01-2 2H6a2 2 0 01-2-2V4z"/>
<!-- Scroll roll top -->
<path d="M4 4h16"/>
<ellipse cx="4" cy="4" rx="1" ry="2"/>
<ellipse cx="20" cy="4" rx="1" ry="2"/>
<!-- Text lines -->
<path d="M8 9h8"/>
<path d="M8 13h6"/>
<path d="M8 17h4"/>
</svg>

After

Width:  |  Height:  |  Size: 488 B

View File

@@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<!-- Sword blade -->
<path d="M14.5 17.5L3 6V3h3l11.5 11.5"/>
<!-- Sword guard -->
<path d="M13 19l6-6"/>
<!-- Sword handle -->
<path d="M16 16l4 4"/>
<!-- Blade tip detail -->
<path d="M19 21l2-2"/>
</svg>

After

Width:  |  Height:  |  Size: 382 B