* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Malgun Gothic", -apple-system, sans-serif;
    background: #1e1e1e;
    color: #eee;
    -webkit-tap-highlight-color: transparent;
}
header {
    padding: 14px 16px;
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
header h1 { font-size: 18px; margin: 0; }
header button {
    background: #333; color: #eee; border: 1px solid #555; border-radius: 6px;
    padding: 6px 12px; font-size: 13px;
}
main { padding: 16px; max-width: 720px; margin: 0 auto; }

.panel { background: #262626; border: 1px solid #444; border-radius: 10px; padding: 16px; margin-bottom: 16px; }

.preview-wrap { position: relative; display: none; margin-bottom: 12px; }
.preview-wrap.show { display: inline-block; max-width: 100%; }
.preview {
    display: block; width: 100%; max-height: 320px; object-fit: contain; background: #111;
    border-radius: 8px;
}
.crop-canvas {
    position: absolute; left: 0; top: 0; touch-action: none;
    border-radius: 8px;
}

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

button.primary {
    background: #2d6cdf; color: #fff; border: none; border-radius: 8px;
    padding: 12px 20px; font-size: 15px; font-weight: bold; cursor: pointer; flex: 1;
}
button.primary:disabled { background: #555; }
button.secondary {
    background: #333; color: #eee; border: 1px solid #666; border-radius: 8px;
    padding: 12px 16px; font-size: 14px; cursor: pointer;
}
label.toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #ccc; }

.status { margin-top: 10px; font-size: 13px; color: #9cf; min-height: 18px; }
.status.error { color: #f88; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.card {
    background: #262626; border: 1px solid #444; border-radius: 8px; padding: 8px;
    text-align: center; font-size: 12px; text-decoration: none; color: inherit; display: block;
}
.card img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #111; border-radius: 4px; }
.card .rank { color: #888; }
.card .sim { color: #9cf; font-weight: bold; }
.card .no { color: #fc9; font-weight: bold; text-decoration: underline; }
.card .name { color: #eee; margin: 2px 0; word-break: keep-all; text-decoration: underline; }

.more-row { text-align: center; margin-top: 18px; }
#moreBtn { font-size: 14px; padding: 10px 24px; border-radius: 8px; border: 1px solid #666; background: #333; color: #eee; }
.hidden { display: none !important; }

.camera-modal {
    position: fixed; inset: 0; background: #000; z-index: 1000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.camera-modal video {
    width: 100%; height: 100%; object-fit: cover;
}
.camera-modal-controls {
    position: absolute; bottom: 24px; left: 0; right: 0;
    display: flex; justify-content: center; gap: 16px; padding: 0 16px;
}
.camera-modal-controls button { padding: 14px 28px; font-size: 16px; }

.login-box { max-width: 340px; margin: 60px auto; }
.login-box input {
    width: 100%; padding: 12px; margin-bottom: 10px; border-radius: 6px; border: 1px solid #555;
    background: #111; color: #eee; font-size: 15px;
}

.detail-photos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 14px; }
.detail-photos img {
    height: 160px; width: auto; max-width: 220px; object-fit: contain; background: #111;
    border-radius: 6px; border: 1px solid #444; flex-shrink: 0;
}
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table th, .detail-table td {
    text-align: left; padding: 8px 6px; border-bottom: 1px solid #383838; vertical-align: top;
}
.detail-table th { color: #9cf; width: 110px; font-weight: normal; white-space: nowrap; }
.detail-table td { color: #ddd; line-height: 1.5; }
