/* Howei Event Shirt Customiser - chrome + Canvas workspace. */

.howei-shirt-designer {
    margin: 20px 0;
}

.hsd-disclaimer {
    margin: 8px 0 20px;
    font-size: 12px;
    color: #8a93a0;
    text-align: center;
}

.hsd-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 24px;
    border: 1px solid #0057A0;
    background: #fff;
    color: #0057A0;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.hsd-expand-btn:hover,
.hsd-expand-btn[aria-expanded="true"] {
    background: #0057A0;
    color: #fff;
}

.hsd-panel {
    margin-top: 14px;
    border: 1px solid #e2e6ea;
    border-radius: 12px;
    padding: 16px;
    background: #fafbfc;
}

.hsd-loading {
    text-align: center;
    padding: 30px 0;
    color: #667;
    font-size: 14px;
}

.hsd-image-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.hsd-image-picker-item {
    border: 2px solid transparent;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    cursor: pointer;
    text-align: center;
    width: 86px;
}

.hsd-image-picker-item img {
    width: 100%;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.hsd-image-picker-item span {
    display: block;
    font-size: 10px;
    color: #556;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hsd-image-picker-item.active {
    border-color: #0057A0;
}

.hsd-color-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e6ea;
}

.hsd-color-label {
    font-size: 13px;
    font-weight: 600;
    color: #445;
    margin-right: 2px;
}

.hsd-color-wheel {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #ccd3da;
    cursor: pointer;
    background: none;
}

.hsd-color-wheel::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 50%;
}

.hsd-color-wheel::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.hsd-color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ccd3da;
    cursor: pointer;
    padding: 0;
}

.hsd-color-swatch:hover,
.hsd-color-swatch.active {
    box-shadow: 0 0 0 2px #0057A0;
}

.hsd-garment-select {
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid #ccd3da;
    background: #fff;
    /* Host pages (e.g. the "Design Your Own Baju" game card) set a white
       page-level text colour for their own blue background - without this,
       the select inherits that and shows white text on its own white
       background, i.e. invisible until opened. */
    color: #222;
    cursor: pointer;
}

.hsd-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.hsd-toolbar button {
    font-size: 13px;
    padding: 7px 14px;
    border-radius: 18px;
    border: 1px solid #ccd3da;
    background: #fff;
    color: #333;
    cursor: pointer;
}

.hsd-toolbar button:hover {
    border-color: #0057A0;
    color: #0057A0;
}

.hsd-canvas-wrap {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    touch-action: none; /* the canvas itself handles drag/pinch; page scroll resumes outside it */
    position: relative;
}

/* Default-template mode (no real shirt image uploaded, or the uploaded one
   failed to load - see HoweiEventShirtDesigner.js's _enterDefaultTemplateMode())
   renders larger: the blank templates are a fixed, known 768x1086 size
   rather than whatever an organiser happened to upload, so there's no risk
   of this looking oversized/cropped the way an arbitrary real photo might. */
.hsd-default-mode .hsd-canvas-wrap {
    max-width: 740px;
}

.hsd-canvas-wrap canvas {
    max-width: 100%;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.hsd-object-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.hsd-object-controls button {
    font-size: 15px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #ccd3da;
    background: #fff;
    cursor: pointer;
}

.hsd-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.hsd-actions button {
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 18px;
    border: 1px solid #ccd3da;
    background: #fff;
    color: #333;
    cursor: pointer;
}

.hsd-btn-primary {
    background: #0057A0 !important;
    border-color: #0057A0 !important;
    color: #fff !important;
}

.hsd-btn-secondary {
    border-color: #0057A0 !important;
    color: #0057A0 !important;
}

.hsd-save-status {
    text-align: center;
    font-size: 12px;
    color: #667;
    margin-top: 8px;
    min-height: 16px;
}

/* Text/colour/opacity property controls for the selected object - appended
   directly into .hsd-toolbar's own flex row (inline with +Text/+Image/
   +Name/+Number) rather than as a separate row below it, so selecting an
   object/changing its colour doesn't shift the rest of the panel down. */
.hsd-toolbar .hsd-props-item {
    font-size: 12px;
    color: #445;
    display: flex;
    align-items: center;
}

.hsd-toolbar input.hsd-props-item[type="text"] {
    font-size: 13px;
    padding: 4px 8px;
    border: 1px solid #ccd3da;
    border-radius: 4px;
    width: 120px;
}

.hsd-toolbar input.hsd-props-item[type="color"] {
    width: 28px;
    height: 24px;
    padding: 0;
    border: 1px solid #ccd3da;
    border-radius: 4px;
}

.hsd-toolbar input.hsd-props-item[type="range"] {
    width: 90px;
}

@media (max-width: 480px) {
    .hsd-panel {
        padding: 10px;
    }

    .hsd-toolbar button {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }

    /* Selected-object property controls (text/colour/opacity) take the
       toolbar's full width on small screens so each one is comfortably
       tappable, instead of competing for space alongside the tool buttons. */
    .hsd-toolbar .hsd-props-item {
        flex: 1 1 100%;
    }

    .hsd-toolbar input.hsd-props-item[type="text"] {
        width: 100%;
    }
}
